com.bigdata.journal
Class TemporaryStoreFactory

java.lang.Object
  extended by com.bigdata.journal.TemporaryStoreFactory

public class TemporaryStoreFactory
extends Object

Helper class for IIndexStore.getTempStore(). This class is very light weight.

Version:
$Id: TemporaryStoreFactory.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Nested Class Summary
static interface TemporaryStoreFactory.Options
          Configuration options for the TemporaryStoreFactory.
 
Field Summary
protected static org.apache.log4j.Logger log
           
 
Constructor Summary
TemporaryStoreFactory()
          Constructor uses the Java system properties to configure the factory.
TemporaryStoreFactory(File tmpDir, int offsetBits, long maxExtent)
          Constructor uses the caller's values to configure the factory.
TemporaryStoreFactory(Properties properties)
          Constructor uses the caller's properties object to configure the factory.
 
Method Summary
 void closeAll()
          Close all open temporary stores allocated by this factory.
 TemporaryStore getTempStore()
          Return a TemporaryStore.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final transient org.apache.log4j.Logger log
Constructor Detail

TemporaryStoreFactory

public TemporaryStoreFactory()
Constructor uses the Java system properties to configure the factory. The TemporaryStoreFactory.Options may be used to override the defaults if specified in the environment or on the JVM command line.


TemporaryStoreFactory

public TemporaryStoreFactory(Properties properties)
Constructor uses the caller's properties object to configure the factory.

Parameters:
properties - Properties used to configure the factory.

TemporaryStoreFactory

public TemporaryStoreFactory(File tmpDir,
                             int offsetBits,
                             long maxExtent)
Constructor uses the caller's values to configure the factory.

Parameters:
tmpDir - The directory within which the TemporaryStore files will be created.
offsetBits - This value governs how many records can exist within the TemporaryStore and the maximum size of those records. A good default value is WormAddressManager.SCALE_UP_OFFSET_BITS.
maxExtent - The maximum extent of the current TemporaryStore before getTempStore() will return a new TemporaryStore.
Throws:
IllegalArgumentException - if maxExtent is negative (zero is allowed and will cause each request to return a distinct TemporaryStore).
Method Detail

getTempStore

public TemporaryStore getTempStore()
Return a TemporaryStore. If there is no existing TemporaryStore then a new instance is returned. If there is an existing TemporaryStore and its extent is greater then the configured maximum extent then a new TemporaryStore will be created and returned. Otherwise the existing instance is returned.


closeAll

public void closeAll()
Close all open temporary stores allocated by this factory.



Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.