Berkeley DB Java Edition
version 3.3.62

com.sleepycat.je
Class EnvironmentConfig

java.lang.Object
  extended by com.sleepycat.je.EnvironmentMutableConfig
      extended by com.sleepycat.je.EnvironmentConfig
All Implemented Interfaces:
Cloneable

public class EnvironmentConfig
extends EnvironmentMutableConfig

Specifies the attributes of an environment.

To change the default settings for a database environment, an application creates a configuration object, customizes settings and uses it for environment construction. The set methods of this class validate the configuration values when the method is invoked. An IllegalArgumentException is thrown if the value is not valid for that attribute.

All commonly used environment attributes have convenience setter/getter methods defined in this class. For example, to change the default transaction timeout setting for an environment, the application should do the following:

     // customize an environment configuration
     EnvironmentConfig envConfig = new EnvironmentConfig();
 envConfig.setTxnTimeout(10000);  // will throw if timeout value is
 invalid
     // Open the environment.
     Environment myEnvironment = new Environment(home, envConfig);
 

Additional parameters are described by the parameter name String constants in this class. These additional parameters will not be needed by most applications. This category of properties can be specified for the EnvironmentConfig object through a Properties object read by EnvironmentConfig(Properties), or individually through EnvironmentConfig.setConfigParam().

For example, an application can change the default btree node size with:

     envConfig.setConfigParam("je.nodeMaxEntries", "256");
 

Environment configuration follows this order of precedence:

  1. Configuration parameters specified in <environment home>/je.properties take first precedence.
  2. Configuration parameters set in the EnvironmentConfig object used at Environment construction are next.
  3. Any configuration parameters not set by the application are set to system defaults, described along with the parameter name String constants in this class.

An EnvironmentConfig can be used to specify both mutable and immutable environment properties. Immutable properties may be specified when the first Environment handle (instance) is opened for a given physical environment. When more handles are opened for the same environment, the following rules apply:

  1. Immutable properties must equal the original values specified when constructing an Environment handle for an already open environment. When a mismatch occurs, an exception is thrown.
  2. Mutable properties are ignored when constructing an Environment handle for an already open environment.

After an Environment has been constructed, its mutable properties may be changed using Environment.setMutableConfig(com.sleepycat.je.EnvironmentMutableConfig). See EnvironmentMutableConfig for a list of mutable properties; all other properties are immutable. Whether a property is mutable or immutable is also described along with the parameter name String constants in this class.

Getting the Current Environment Properties

To get the current "live" properties of an environment after constructing it or changing its properties, you must call Environment.getConfig() or Environment.getMutableConfig(). The original EnvironmentConfig or EnvironmentMutableConfig object used to set the properties is not kept up to date as properties are changed, and does not reflect property validation or properties that are computed.


Field Summary
static String ADLER32_CHUNK_SIZE
          By default, JE passes an entire log record to the Adler32 class for checksumming.
static String CHECKPOINTER_BYTES_INTERVAL
          Ask the checkpointer to run every time we write this many bytes to the log.
static String CHECKPOINTER_DEADLOCK_RETRY
          The number of times to retry a checkpoint if it runs into a deadlock.
static String CHECKPOINTER_HIGH_PRIORITY
          If true, the checkpointer uses more resources in order to complete the checkpoint in a shorter time interval.
static String CHECKPOINTER_WAKEUP_INTERVAL
          The checkpointer wakeup interval in microseconds.
static String CLEANER_BYTES_INTERVAL
          The cleaner checks disk utilization every time we write this many bytes to the log.
static String CLEANER_DEADLOCK_RETRY
          The number of times to retry cleaning if a deadlock occurs.
static String CLEANER_DETAIL_MAX_MEMORY_PERCENTAGE
          Tracking of detailed cleaning information will use no more than this percentage of the cache.
static String CLEANER_EXPUNGE
          If true, the cleaner deletes log files after successful cleaning.
static String CLEANER_FETCH_OBSOLETE_SIZE
          If true, the cleaner will fetch records to determine their size to more accurately calculate log utilization.
static String CLEANER_FORCE_CLEAN_FILES
          Specifies a list of files or file ranges to be cleaned at a time when no other log cleaning is necessary.
static String CLEANER_LOCK_TIMEOUT
          The lock timeout for cleaner transactions in microseconds.
static String CLEANER_LOOK_AHEAD_CACHE_SIZE
          The look ahead cache size for cleaning in bytes.
static String CLEANER_MAX_BATCH_FILES
          The maximum number of log files in the cleaner's backlog, or zero if there is no limit.
static String CLEANER_MIN_AGE
          The minimum age of a file (number of files between it and the active file) to qualify it for cleaning under any conditions.
static String CLEANER_MIN_FILE_UTILIZATION
          A log file will be cleaned if its utilization percentage is below this value, irrespective of total utilization.
static String CLEANER_MIN_UTILIZATION
          The cleaner will keep the total disk space utilization percentage above this value.
static String CLEANER_READ_SIZE
          The read buffer size for cleaning.
static String CLEANER_THREADS
          The number of threads allocated by the cleaner for log file processing.
static String CLEANER_UPGRADE_TO_LOG_VERSION
          All log files having a log version prior to the specified version will be cleaned at a time when no other log cleaning is necessary.
static String COMPRESSOR_DEADLOCK_RETRY
          The number of times to retry a compression run if a deadlock occurs.
static String COMPRESSOR_LOCK_TIMEOUT
          The lock timeout for compressor transactions in microseconds.
static String COMPRESSOR_PURGE_ROOT
          If true, when the compressor encounters an empty tree, the root node of the tree is deleted.
static String COMPRESSOR_WAKEUP_INTERVAL
          The compressor thread wakeup interval in microseconds.
static String ENV_BACKGROUND_READ_LIMIT
          The maximum number of read operations performed by JE background activities (e.g., cleaning) before sleeping to ensure that application threads can perform I/O.
static String ENV_BACKGROUND_SLEEP_INTERVAL
          The number of microseconds that JE background activities will sleep when the ENV_BACKGROUND_WRITE_LIMIT or ENV_BACKGROUND_WRITE_LIMIT is reached.
static String ENV_BACKGROUND_WRITE_LIMIT
          The maximum number of write operations performed by JE background activities (e.g., checkpointing and eviction) before sleeping to ensure that application threads can perform I/O.
static String ENV_CHECK_LEAKS
          Debugging support: check leaked locks and txns at env close.
static String ENV_DB_EVICTION
          If true, enable eviction of metadata for closed databases.
static String ENV_FAIR_LATCHES
          If true, use latches instead of synchronized blocks to implement the lock table and log write mutexes.
static String ENV_FORCED_YIELD
          Debugging support: call Thread.yield() at strategic points.
static String ENV_IS_LOCKING
          If true, create the environment with record locking.
static String ENV_IS_TRANSACTIONAL
          If true, create an environment that is capable of performing transactions.
static String ENV_LOCKOUT_TIMEOUT
          The maximum time in milliseconds to wait for an API call to start executing when the API is locked.
static String ENV_READ_ONLY
          If true, open the environment read-only.
static String ENV_RECOVERY_FORCE_CHECKPOINT
          If true, a checkpoint is forced following recovery, even if the log ends with a checkpoint.
static String ENV_RUN_CHECKPOINTER
          If true, starts up the checkpointer thread.
static String ENV_RUN_CLEANER
          If true, starts up the cleaner thread.
static String ENV_RUN_IN_COMPRESSOR
          If true, starts up the INCompressor thread.
static String EVICTOR_DEADLOCK_RETRY
          The number of times to retry the evictor if it runs into a deadlock.
static String EVICTOR_EVICT_BYTES
          When eviction occurs, the evictor will push memory usage to this number of bytes below MAX_MEMORY.
static String EVICTOR_FORCED_YIELD
          Call Thread.yield() at each check for cache overflow.
static String EVICTOR_LRU_ONLY
          If true (the default), use an LRU-only policy to select nodes for eviction.
static String EVICTOR_NODES_PER_SCAN
          The number of nodes in one evictor scan.
static String LOCK_N_LOCK_TABLES
          Number of Lock Tables.
static String LOCK_TIMEOUT
          The LockTimeout property.
static String LOG_BUFFER_SIZE
          The maximum starting size of a JE log buffer.
static String LOG_CHECKSUM_READ
          If true, perform a checksum check when reading entries from log.
static String LOG_CHUNKED_NIO
          If non-0 (default is 0) break all IO into chunks of this size.
static String LOG_DIRECT_NIO
          If true (default is false) direct NIO buffers are used.
static String LOG_FAULT_READ_SIZE
          The buffer size for faulting in objects from disk, in bytes.
static String LOG_FILE_CACHE_SIZE
          The size of the file handle cache.
static String LOG_FILE_MAX
          The maximum size of each individual JE log file, in bytes.
static String LOG_FSYNC_TIMEOUT
          The timeout limit for group file sync, in microseconds.
static String LOG_ITERATOR_MAX_SIZE
          The maximum read buffer size for log iterators, which are used when scanning the log during activities like log cleaning and environment open, in bytes.
static String LOG_ITERATOR_READ_SIZE
          The read buffer size for log iterators, which are used when scanning the log during activities like log cleaning and environment open, in bytes.
static String LOG_MEM_ONLY
          If true, operates in an in-memory test mode without flushing the log to disk.
static String LOG_NUM_BUFFERS
          The number of JE log buffers.
static String LOG_TOTAL_BUFFER_BYTES
          The total memory taken by log buffers, in bytes.
static String LOG_USE_NIO
          If true (default is false) NIO is used for all file I/O.
static String LOG_USE_ODSYNC
          If true (default is false) O_DSYNC is used to open JE log files.
static String LOG_VERIFY_CHECKSUMS
          If true, perform a checksum verification just before and after writing to the log.
static String MAX_MEMORY
          The CacheSize property.
static String MAX_MEMORY_PERCENT
          The CachePercent property.
static String NODE_DUP_TREE_MAX_ENTRIES
          The maximum number of entries in an internal dup btree node.
static String NODE_MAX_ENTRIES
          The maximum number of entries in an internal btree node.
static String SHARED_CACHE
          The SharedCache property.
static String TRACE_CONSOLE
          Use ConsoleHandler in logging system.
static String TRACE_DB
          Use DbLogHandler in logging system.
static String TRACE_FILE
          Use FileHandler in logging system.
static String TRACE_FILE_COUNT
          Log file count for FileHandler.
static String TRACE_FILE_LIMIT
          Log file limit for FileHandler.
static String TRACE_LEVEL
          Trace messages equal and above this level will be logged.
static String TRACE_LEVEL_CLEANER
          Cleaner specific detailed trace messages will be issued at this level.
static String TRACE_LEVEL_EVICTOR
          Evictor specific trace messages will be issued at this level.
static String TRACE_LEVEL_LOCK_MANAGER
          Lock manager specific trace messages will be issued at this level.
static String TRACE_LEVEL_RECOVERY
          Recovery specific trace messages will be issued at this level.
static String TREE_BIN_DELTA
          If less than this percentage of entries are changed on a BIN, log a delta instead of a full version.
static String TREE_MAX_DELTA
          After this many deltas, log a full version.
static String TREE_MIN_MEMORY
          The minimum bytes allocated out of the memory cache to hold Btree data including internal nodes and record keys and data.
static String TXN_DEADLOCK_STACK_TRACE
          Set this parameter to true to add stacktrace information to deadlock (lock timeout) exception messages.
static String TXN_DUMP_LOCKS
          Dump the lock table when a lock timeout is encountered, for debugging assistance.
static String TXN_SERIALIZABLE_ISOLATION
          The TxnSerializableIsolation property.
static String TXN_TIMEOUT
          The TxnTimeout property.
 
Constructor Summary
EnvironmentConfig()
          Creates an EnvironmentConfig initialized with the system default settings.
EnvironmentConfig(Properties properties)
          Creates an EnvironmentConfig which includes the properties specified in the properties parameter.
 
Method Summary
 boolean getAllowCreate()
          Returns a flag that specifies if we may create this environment.
 boolean getLocking()
          Returns true if the database environment is configured for locking.
 long getLockTimeout()
          Returns the lock timeout setting, in microseconds.
 boolean getReadOnly()
          Returns true if the database environment is configured to be read only.
 boolean getSharedCache()
          Returns true if the shared cache is used by this environment.
 boolean getTransactional()
          Returns true if the database environment is configured for transactions.
 boolean getTxnSerializableIsolation()
          Returns true if all transactions for this environment has been configured to have Serializable (Degree 3) isolation.
 long getTxnTimeout()
          Returns the transaction timeout, in microseconds.
 void setAllowCreate(boolean allowCreate)
          If true, creates the database environment if it doesn't already exist.
 void setConfigParam(String paramName, String value)
          Validates the value prescribed for the configuration parameter; if it is valid, the value is set in the configuration.
 void setLocking(boolean locking)
          Configures the database environment for no locking.
 void setLockTimeout(long timeout)
          Configures the lock timeout, in microseconds.
 void setReadOnly(boolean readOnly)
          Configures the database environment to be read only, and any attempt to modify a database will fail.
 void setSharedCache(boolean sharedCache)
          If true, the shared cache is used by this environment.
 void setTransactional(boolean transactional)
          Configures the database environment for transactions.
 void setTxnSerializableIsolation(boolean txnSerializableIsolation)
          Configures all transactions for this environment to have Serializable (Degree 3) isolation.
 void setTxnTimeout(long timeout)
          Configures the transaction timeout, in microseconds.
 String toString()
          Display configuration values.
 
Methods inherited from class com.sleepycat.je.EnvironmentMutableConfig
getCachePercent, getCacheSize, getConfigParam, getExceptionListener, getNumExplicitlySetParams, getTxnNoSync, getTxnWriteNoSync, setCachePercent, setCacheSize, setExceptionListener, setTxnNoSync, setTxnWriteNoSync
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_MEMORY

public static final String MAX_MEMORY
The CacheSize property.

NameTypeMutable DefaultMinimumMaximum
"je.maxMemory" Long Yes 0 -none- -none-

See Also:
EnvironmentMutableConfig.setCacheSize(long), Constant Field Values

MAX_MEMORY_PERCENT

public static final String MAX_MEMORY_PERCENT
The CachePercent property.

NameTypeMutable DefaultMinimumMaximum
"je.maxMemoryPercent" Integer Yes 60 1 90

See Also:
EnvironmentMutableConfig.setCachePercent(int), Constant Field Values

SHARED_CACHE

public static final String SHARED_CACHE
The SharedCache property.

NameTypeMutableDefault
"je.sharedCache" Boolean No false

See Also:
Constant Field Values

ENV_RECOVERY_FORCE_CHECKPOINT

public static final String ENV_RECOVERY_FORCE_CHECKPOINT
If true, a checkpoint is forced following recovery, even if the log ends with a checkpoint.

NameTypeMutableDefault
"je.env.recoveryForceCheckpoint" Boolean No false

See Also:
Constant Field Values

ENV_RUN_IN_COMPRESSOR

public static final String ENV_RUN_IN_COMPRESSOR
If true, starts up the INCompressor thread.

NameTypeMutableDefault
"je.env.runINCompressor" Boolean Yes true

See Also:
Constant Field Values

ENV_RUN_CHECKPOINTER

public static final String ENV_RUN_CHECKPOINTER
If true, starts up the checkpointer thread.

NameTypeMutableDefault
"je.env.runCheckpointer" Boolean Yes true

See Also:
Constant Field Values

ENV_RUN_CLEANER

public static final String ENV_RUN_CLEANER
If true, starts up the cleaner thread.

NameTypeMutableDefault
"je.env.runCleaner" Boolean Yes true

See Also:
Constant Field Values

ENV_BACKGROUND_READ_LIMIT

public static final String ENV_BACKGROUND_READ_LIMIT
The maximum number of read operations performed by JE background activities (e.g., cleaning) before sleeping to ensure that application threads can perform I/O. If zero (the default) then no limitation on I/O is enforced.

NameTypeMutable DefaultMinimumMaximum
"je.env.backgroundReadLimit" Integer Yes 0 0 -none-

See Also:
ENV_BACKGROUND_SLEEP_INTERVAL, Constant Field Values

ENV_BACKGROUND_WRITE_LIMIT

public static final String ENV_BACKGROUND_WRITE_LIMIT
The maximum number of write operations performed by JE background activities (e.g., checkpointing and eviction) before sleeping to ensure that application threads can perform I/O. If zero (the default) then no limitation on I/O is enforced.

NameTypeMutable DefaultMinimumMaximum
"je.env.backgroundWriteLimit" Integer Yes 0 0 -none-

See Also:
ENV_BACKGROUND_SLEEP_INTERVAL, Constant Field Values

ENV_LOCKOUT_TIMEOUT

public static final String ENV_LOCKOUT_TIMEOUT
The maximum time in milliseconds to wait for an API call to start executing when the API is locked. The default timeout is indefinite.

NameTypeMutable DefaultMinimumMaximum
"je.env.lockoutTimeout" Integer Yes 2147483647 0 -none

See Also:
Constant Field Values

ENV_BACKGROUND_SLEEP_INTERVAL

public static final String ENV_BACKGROUND_SLEEP_INTERVAL
The number of microseconds that JE background activities will sleep when the ENV_BACKGROUND_WRITE_LIMIT or ENV_BACKGROUND_WRITE_LIMIT is reached. If ENV_BACKGROUND_WRITE_LIMIT and ENV_BACKGROUND_WRITE_LIMIT are zero, this setting is not used.

NameTypeMutable DefaultMinimumMaximum
"je.env.backgroundSleepInterval" Long Yes 1000 1000 9223372036854775807L

See Also:
Constant Field Values

ENV_CHECK_LEAKS

public static final String ENV_CHECK_LEAKS
Debugging support: check leaked locks and txns at env close.

NameTypeMutableDefault
"je.env.checkLeaks" Boolean No true

See Also:
Constant Field Values

ENV_FORCED_YIELD

public static final String ENV_FORCED_YIELD
Debugging support: call Thread.yield() at strategic points.

NameTypeMutableDefault
"je.env.forcedYield" Boolean No false

See Also:
Constant Field Values

ENV_IS_TRANSACTIONAL

public static final String ENV_IS_TRANSACTIONAL
If true, create an environment that is capable of performing transactions. If true is not passed, transactions may not be used. For licensing purposes, the use of this method distinguishes the use of the Transactional product. Note that if transactions are not used, specifying true does not create additional overhead in the environment.

NameTypeMutableDefault
"je.env.isTransactional" Boolean No false

See Also:
Constant Field Values

ENV_IS_LOCKING

public static final String ENV_IS_LOCKING
If true, create the environment with record locking. This property should be set to false only in special circumstances when it is safe to run without record locking.

NameTypeMutableDefault
"je.env.isLocking" Boolean No true

See Also:
Constant Field Values

ENV_READ_ONLY

public static final String ENV_READ_ONLY
If true, open the environment read-only.

NameTypeMutableDefault
"je.env.isReadOnly" Boolean No false

See Also:
Constant Field Values

ENV_FAIR_LATCHES

public static final String ENV_FAIR_LATCHES
If true, use latches instead of synchronized blocks to implement the lock table and log write mutexes. Latches require that threads queue to obtain the mutex in question and therefore guarantee that there will be no mutex starvation, but do incur a performance penalty. Latches should not be necessary in most cases, so synchronized blocks are the default. An application that puts heavy load on JE with threads with different thread priorities might find it useful to use latches. In a Java 5 JVM, where java.util.concurrent.locks.ReentrantLock is used for the latch implementation, this parameter will determine whether they are 'fair' or not. This parameter is 'static' across all environments.

NameTypeMutableDefault
"je.env.fairLatches" Boolean No false

See Also:
Constant Field Values

ENV_DB_EVICTION

public static final String ENV_DB_EVICTION
If true, enable eviction of metadata for closed databases.

NameTypeMutableDefault
"je.env.dbEviction" Boolean No true

See Also:
Constant Field Values

ADLER32_CHUNK_SIZE

public static final String ADLER32_CHUNK_SIZE
By default, JE passes an entire log record to the Adler32 class for checksumming. This can cause problems with the GC in some cases if the records are large and there is concurrency. Setting this parameter will cause JE to pass chunks of the log record to the checksumming class so that the GC does not block. 0 means do not chunk.

NameTypeMutable DefaultMinimumMaximum
"je.adler32.chunkSize" Integer Yes 0 0 1048576 (1M)

See Also:
Constant Field Values

LOG_TOTAL_BUFFER_BYTES

public static final String LOG_TOTAL_BUFFER_BYTES
The total memory taken by log buffers, in bytes. If 0, use 7% of je.maxMemory. If 0 and je.sharedCache=true, use 7% divided by N where N is the number of environments sharing the global cache.

NameTypeMutable DefaultMinimumMaximum
"je.log.totalBufferBytes" Long No 0 6144L -none-

See Also:
Constant Field Values

LOG_NUM_BUFFERS

public static final String LOG_NUM_BUFFERS
The number of JE log buffers.

NameTypeMutable DefaultMinimumMaximum
"je.log.numBuffers" Integer No 3 2 -none-

See Also:
Constant Field Values

LOG_BUFFER_SIZE

public static final String LOG_BUFFER_SIZE
The maximum starting size of a JE log buffer.

NameTypeMutable DefaultMinimumMaximum
"je.log.bufferSize" Integer No 1048576 (1M) 1024 (1K) -none-

See Also:
Constant Field Values

LOG_FAULT_READ_SIZE

public static final String LOG_FAULT_READ_SIZE
The buffer size for faulting in objects from disk, in bytes.

NameTypeMutable DefaultMinimumMaximum
"je.log.faultReadSize" Integer No 2048 (2K) 32 -none-

See Also:
Constant Field Values

LOG_ITERATOR_READ_SIZE

public static final String LOG_ITERATOR_READ_SIZE
The read buffer size for log iterators, which are used when scanning the log during activities like log cleaning and environment open, in bytes. This may grow as the system encounters larger log entries.

NameTypeMutable DefaultMinimumMaximum
"je.log.iteratorReadSize" Integer No 8192 (8K) 128 -none-

See Also:
Constant Field Values

LOG_ITERATOR_MAX_SIZE

public static final String LOG_ITERATOR_MAX_SIZE
The maximum read buffer size for log iterators, which are used when scanning the log during activities like log cleaning and environment open, in bytes.

NameTypeMutable DefaultMinimumMaximum
"je.log.iteratorMaxSize" Integer No 16777216 (16M) 128 -none-

See Also:
Constant Field Values

LOG_FILE_MAX

public static final String LOG_FILE_MAX
The maximum size of each individual JE log file, in bytes.

NameTypeMutable DefaultMinimumMaximumJVM
"je.log.fileMax" Long No 10000000 (10M) 1000000 (1M) 4294967296 (4G) Conventional JVM
"je.log.fileMax" Long No 100000 (100K) 10000 (10K) 4294967296 (4G) Dalvik JVM

See Also:
Constant Field Values

LOG_CHECKSUM_READ

public static final String LOG_CHECKSUM_READ
If true, perform a checksum check when reading entries from log.

NameTypeMutableDefault
"je.log.checksumRead" Boolean No true

See Also:
Constant Field Values

LOG_VERIFY_CHECKSUMS

public static final String LOG_VERIFY_CHECKSUMS
If true, perform a checksum verification just before and after writing to the log. This is primarily used for debugging.

NameTypeMutableDefault
"je.log.verifyChecksums" Boolean No false

See Also:
Constant Field Values

LOG_MEM_ONLY

public static final String LOG_MEM_ONLY
If true, operates in an in-memory test mode without flushing the log to disk. An environment directory must be specified, but it need not exist and no files are written. The system operates until it runs out of memory, at which time an OutOfMemoryError is thrown. Because the entire log is kept in memory, this mode is normally useful only for testing.

NameTypeMutableDefault
"je.log.memOnly" Boolean No false

See Also:
Constant Field Values

LOG_FILE_CACHE_SIZE

public static final String LOG_FILE_CACHE_SIZE
The size of the file handle cache.

NameTypeMutable DefaultMinimumMaximum
"je.log.fileCacheSize" Integer No 100 3 -none-

See Also:
Constant Field Values

LOG_FSYNC_TIMEOUT

public static final String LOG_FSYNC_TIMEOUT
The timeout limit for group file sync, in microseconds.

NameTypeMutable DefaultMinimumMaximum
"je.log.fsyncTimeout" Long No 500000 (0.5 sec) 10000< (0.01 sec)/td> -none-

See Also:
Constant Field Values

LOG_USE_ODSYNC

public static final String LOG_USE_ODSYNC
If true (default is false) O_DSYNC is used to open JE log files.

NameTypeMutableDefault
"je.log.useODSYNC" Boolean No false

See Also:
Constant Field Values

LOG_USE_NIO

public static final String LOG_USE_NIO
If true (default is false) NIO is used for all file I/O.

NameTypeMutableDefault
"je.log.useNIO" Boolean No false

See Also:
Constant Field Values

LOG_DIRECT_NIO

public static final String LOG_DIRECT_NIO
If true (default is false) direct NIO buffers are used. This setting is only used if LOG_USE_NIO is true.

NameTypeMutableDefault
"je.log.directNIO" Boolean No false

See Also:
Constant Field Values

LOG_CHUNKED_NIO

public static final String LOG_CHUNKED_NIO
If non-0 (default is 0) break all IO into chunks of this size. This setting is only used if LOG_USE_NIO is true.

NameTypeMutable DefaultMinimumMaximum
"je.log.chunkedNIO" Long No 0 0 67108864 (64M)

See Also:
Constant Field Values

NODE_MAX_ENTRIES

public static final String NODE_MAX_ENTRIES
The maximum number of entries in an internal btree node. This can be set per-database using the DatabaseConfig object.

NameTypeMutable DefaultMinimumMaximum
"je.nodeMaxEntries" Integer No 128 4 32767 (32K)

See Also:
Constant Field Values

NODE_DUP_TREE_MAX_ENTRIES

public static final String NODE_DUP_TREE_MAX_ENTRIES
The maximum number of entries in an internal dup btree node. This can be set per-database using the DatabaseConfig object.

NameTypeMutable DefaultMinimumMaximum
"je.nodeDupTreeMaxEntries" Integer No 128 4 32767 (32K)

See Also:
Constant Field Values

TREE_MAX_DELTA

public static final String TREE_MAX_DELTA
After this many deltas, log a full version.

NameTypeMutable DefaultMinimumMaximum
"je.tree.maxDelta" Integer No 10 0 100

See Also:
Constant Field Values

TREE_BIN_DELTA

public static final String TREE_BIN_DELTA
If less than this percentage of entries are changed on a BIN, log a delta instead of a full version.

NameTypeMutable DefaultMinimumMaximum
"je.tree.binDelta" Integer No 25 0 75

See Also:
Constant Field Values

TREE_MIN_MEMORY

public static final String TREE_MIN_MEMORY
The minimum bytes allocated out of the memory cache to hold Btree data including internal nodes and record keys and data. If the specified value is larger than the size initially available in the cache, it will be truncated to the amount available.

TREE_MIN_MEMORY is the minimum for a single environment. By default, 500 KB or the size initially available in the cache is used, whichever is smaller.

NameTypeMutable DefaultMinimumMaximum
"je.tree.minMemory" Long Yes 512000 (500K) 51200 (50K) -none-

See Also:
Constant Field Values

COMPRESSOR_WAKEUP_INTERVAL

public static final String COMPRESSOR_WAKEUP_INTERVAL
The compressor thread wakeup interval in microseconds.

NameTypeMutable DefaultMinimumMaximum
"je.compressor.wakeupInterval" Long No 5000000 (5 sec) 1000000 (1 sec) 4294967296 (71.6 min)

See Also:
Constant Field Values

COMPRESSOR_DEADLOCK_RETRY

public static final String COMPRESSOR_DEADLOCK_RETRY
The number of times to retry a compression run if a deadlock occurs.

NameTypeMutable DefaultMinimumMaximum
"je.compressor.deadlockRetry" Integer No 3 0 -none-

See Also:
Constant Field Values

COMPRESSOR_LOCK_TIMEOUT

public static final String COMPRESSOR_LOCK_TIMEOUT
The lock timeout for compressor transactions in microseconds.

NameTypeMutable DefaultMinimumMaximum
"je.compressor.lockTimeout" Long No 500000 (0.5 sec) 0 4294967296 (71.6 min)

See Also:
Constant Field Values

COMPRESSOR_PURGE_ROOT

public static final String COMPRESSOR_PURGE_ROOT
If true, when the compressor encounters an empty tree, the root node of the tree is deleted.

NameTypeMutableDefault
"je.compressor.purgeRoot" Boolean No false

See Also:
Constant Field Values

EVICTOR_EVICT_BYTES

public static final String EVICTOR_EVICT_BYTES
When eviction occurs, the evictor will push memory usage to this number of bytes below MAX_MEMORY. No more than 50% of je.maxMemory will be evicted per eviction cycle, regardless of this setting.

NameTypeMutable DefaultMinimumMaximum
"je.evictor.evictBytes" Long No 524288 (512K) 1024 (1K) -none-

See Also:
Constant Field Values

EVICTOR_NODES_PER_SCAN

public static final String EVICTOR_NODES_PER_SCAN
The number of nodes in one evictor scan.

NameTypeMutable DefaultMinimumMaximum
"je.evictor.nodesPerScan" Integer No 10 1 1000

See Also:
Constant Field Values

EVICTOR_DEADLOCK_RETRY

public static final String EVICTOR_DEADLOCK_RETRY
The number of times to retry the evictor if it runs into a deadlock.

NameTypeMutable DefaultMinimumMaximum
"je.evictor.deadlockRetry" Integer No 3 0 -none-

See Also:
Constant Field Values

EVICTOR_LRU_ONLY

public static final String EVICTOR_LRU_ONLY
If true (the default), use an LRU-only policy to select nodes for eviction. If false, select by Btree level first, and then by LRU.

NameTypeMutableDefault
"je.evictor.lruOnly" Boolean No true

See Also:
Constant Field Values

EVICTOR_FORCED_YIELD

public static final String EVICTOR_FORCED_YIELD
Call Thread.yield() at each check for cache overflow. This improves GC performance on some systems.

NameTypeMutableDefault
"je.evictor.forcedYield" Boolean No false

See Also:
Constant Field Values

CHECKPOINTER_BYTES_INTERVAL

public static final String CHECKPOINTER_BYTES_INTERVAL
Ask the checkpointer to run every time we write this many bytes to the log. If set, supercedes CHECKPOINTER_WAKEUP_INTERVAL. To use time based checkpointing, set this to 0.

NameTypeMutable DefaultMinimumMaximumJVM
"je.checkpointer.bytesInterval" Long No 20000000 (20M) 0 -none- Conventional JVM
"je.checkpointer.bytesInterval" Long No 200000 (200K) 0 -none- Dalvik JVM

See Also:
Constant Field Values

CHECKPOINTER_WAKEUP_INTERVAL

public static final String CHECKPOINTER_WAKEUP_INTERVAL
The checkpointer wakeup interval in microseconds. By default, this is inactive and we wakeup the checkpointer as a function of the number of bytes written to the log (CHECKPOINTER_BYTES_INTERVAL).

NameTypeMutable DefaultMinimumMaximum
"je.checkpointer.wakeupInterval" Long No 0 1000000 (1 sec) 4294967296 (71.6 min)

See Also:
Constant Field Values

CHECKPOINTER_DEADLOCK_RETRY

public static final String CHECKPOINTER_DEADLOCK_RETRY
The number of times to retry a checkpoint if it runs into a deadlock.

NameTypeMutable DefaultMinimumMaximum
"je.checkpointer.deadlockRetry" Integer No 3 0 -none-

See Also:
Constant Field Values

CHECKPOINTER_HIGH_PRIORITY

public static final String CHECKPOINTER_HIGH_PRIORITY
If true, the checkpointer uses more resources in order to complete the checkpoint in a shorter time interval. Btree latches are held and other threads are blocked for a longer period. Log cleaner record migration is performed by cleaner threads instead of during checkpoints. When set to true, application response time may be longer during a checkpoint, and more cleaner threads may be required to maintain the configured log utilization.

NameTypeMutableDefault
"je.checkpointer.highPriority" Boolean Yes false

See Also:
Constant Field Values

CLEANER_MIN_UTILIZATION

public static final String CLEANER_MIN_UTILIZATION
The cleaner will keep the total disk space utilization percentage above this value.

NameTypeMutable DefaultMinimumMaximum
"je.cleaner.minUtilization" Integer Yes 50 0 90

See Also:
Constant Field Values

CLEANER_MIN_FILE_UTILIZATION

public static final String CLEANER_MIN_FILE_UTILIZATION
A log file will be cleaned if its utilization percentage is below this value, irrespective of total utilization.

NameTypeMutable DefaultMinimumMaximum
"je.cleaner.minFileUtilization" Integer Yes 5 0 50

See Also:
Constant Field Values

CLEANER_BYTES_INTERVAL

public static final String CLEANER_BYTES_INTERVAL
The cleaner checks disk utilization every time we write this many bytes to the log. If zero (and by default) it is set to the LOG_FILE_MAX value divided by four.

NameTypeMutable DefaultMinimumMaximum
"je.cleaner.bytesInterval" Long Yes 0 0 -none-

See Also:
Constant Field Values

CLEANER_FETCH_OBSOLETE_SIZE

public static final String CLEANER_FETCH_OBSOLETE_SIZE
If true, the cleaner will fetch records to determine their size to more accurately calculate log utilization. This setting is used during DB truncation/removal and during recovery, and will cause more I/O during those operations when set to true.

NameTypeMutableDefault
"je.cleaner.fetchObsoleteSize" Boolean Yes false

See Also:
Constant Field Values

CLEANER_DEADLOCK_RETRY

public static final String CLEANER_DEADLOCK_RETRY
The number of times to retry cleaning if a deadlock occurs.

NameTypeMutable DefaultMinimumMaximum
"je.cleaner.deadlockRetry" Integer Yes 3 0 -none-

See Also:
Constant Field Values

CLEANER_LOCK_TIMEOUT

public static final String CLEANER_LOCK_TIMEOUT
The lock timeout for cleaner transactions in microseconds.

NameTypeMutable DefaultMinimumMaximum
"je.cleaner.lockTimeout" Long Yes 500000 (0.5 sec) 0 4294967296 (71.6 min)

See Also:
Constant Field Values

CLEANER_EXPUNGE

public static final String CLEANER_EXPUNGE
If true, the cleaner deletes log files after successful cleaning. If false, the cleaner changes log file extensions to .DEL instead of deleting them. The latter is useful for diagnosing log cleaning problems.

NameTypeMutableDefault
"je.cleaner.expunge" Boolean Yes true

See Also:
Constant Field Values

CLEANER_MIN_AGE

public static final String CLEANER_MIN_AGE
The minimum age of a file (number of files between it and the active file) to qualify it for cleaning under any conditions.

NameTypeMutable DefaultMinimumMaximum
"je.cleaner.minAge" Integer Yes 2 1 1000

See Also:
Constant Field Values

CLEANER_MAX_BATCH_FILES

public static final String CLEANER_MAX_BATCH_FILES
The maximum number of log files in the cleaner's backlog, or zero if there is no limit. Changing this property can impact the performance of some out-of-memory applications.

NameTypeMutable DefaultMinimumMaximum
"je.cleaner.maxBatchFiles" Integer Yes 0 0 100000

See Also:
Constant Field Values

CLEANER_READ_SIZE

public static final String CLEANER_READ_SIZE
The read buffer size for cleaning. If zero (the default), then LOG_ITERATOR_READ_SIZE value is used.

NameTypeMutable DefaultMinimumMaximum
"je.cleaner.readSize" Integer Yes 0 128 -none-

See Also:
Constant Field Values

CLEANER_DETAIL_MAX_MEMORY_PERCENTAGE

public static final String CLEANER_DETAIL_MAX_MEMORY_PERCENTAGE
Tracking of detailed cleaning information will use no more than this percentage of the cache. The default value is 2% of MAX_MEMORY. If 0 and SHARED_CACHE is true, use 2% divided by N where N is the number of environments sharing the global cache.

NameTypeMutable DefaultMinimumMaximum
"je.cleaner.detailMaxMemoryPercentage" Integer Yes 2 1 90

See Also:
Constant Field Values

CLEANER_FORCE_CLEAN_FILES

public static final String CLEANER_FORCE_CLEAN_FILES
Specifies a list of files or file ranges to be cleaned at a time when no other log cleaning is necessary. This parameter is intended for use in forcing the cleaning of a large number of log files. File numbers are in hex and are comma separated or hyphen separated to specify ranges, e.g.: '9,a,b-d' will clean 5 files.

NameTypeMutableDefault
"je.cleaner.forceCleanFiles" String No ""

See Also:
Constant Field Values

CLEANER_UPGRADE_TO_LOG_VERSION

public static final String CLEANER_UPGRADE_TO_LOG_VERSION
All log files having a log version prior to the specified version will be cleaned at a time when no other log cleaning is necessary. Intended for use in upgrading old format log files forward to the current log format version, e.g., to take advantage of format improvements; note that log upgrading is optional. The default value zero (0) specifies that no upgrading will occur. The value negative one (-1) specifies upgrading to the current log version.

NameTypeMutable DefaultMinimumMaximum
"je.cleaner.upgradeToLogVersion" Integer No 0 -1 -none-

See Also:
Constant Field Values

CLEANER_THREADS

public static final String CLEANER_THREADS
The number of threads allocated by the cleaner for log file processing. If the cleaner backlog becomes large, try increasing this value.

NameTypeMutable DefaultMinimumMaximum
"je.cleaner.threads" Integer Yes 1 1 -none-

See Also:
Constant Field Values

CLEANER_LOOK_AHEAD_CACHE_SIZE

public static final String CLEANER_LOOK_AHEAD_CACHE_SIZE
The look ahead cache size for cleaning in bytes. Increasing this value can reduce the number of Btree lookups.

NameTypeMutable DefaultMinimumMaximum
"je.cleaner.lookAheadCacheSize" Integer Yes 8192 (8K) 0 -none-

See Also:
Constant Field Values

LOCK_N_LOCK_TABLES

public static final String LOCK_N_LOCK_TABLES
Number of Lock Tables. Set this to a value other than 1 when an application has multiple threads performing concurrent JE operations. It should be set to a prime number, and in general not higher than the number of application threads performing JE operations.

NameTypeMutable DefaultMinimumMaximum
"je.lock.nLockTables" Integer No 1 1 32767 (32K)

See Also:
Constant Field Values

LOCK_TIMEOUT

public static final String LOCK_TIMEOUT
The LockTimeout property.

NameTypeMutable DefaultMinimumMaximum
"je.lock.timeout" Long No 500000 (0.5 sec) 0 4294967296 (71.6 min)

See Also:
setLockTimeout(long), Constant Field Values

TXN_TIMEOUT

public static final String TXN_TIMEOUT
The TxnTimeout property.

NameTypeMutable DefaultMinimumMaximum
"je.txn.timeout" Long No 0 0 4294967296 (71.6 min)

See Also:
setTxnTimeout(long), Constant Field Values

TXN_SERIALIZABLE_ISOLATION

public static final String TXN_SERIALIZABLE_ISOLATION
The TxnSerializableIsolation property.

NameTypeMutableDefault
"je.txn.serializableIsolation" Boolean No false

See Also:
setTxnSerializableIsolation(boolean), Constant Field Values

TXN_DEADLOCK_STACK_TRACE

public static final String TXN_DEADLOCK_STACK_TRACE
Set this parameter to true to add stacktrace information to deadlock (lock timeout) exception messages. The stack trace will show where each lock was taken. The default is false, and true should only be used during debugging because of the added memory/processing cost. This parameter is 'static' across all environments.

NameTypeMutableDefault
"je.txn.deadlockStackTrace" Boolean Yes false

See Also:
Constant Field Values

TXN_DUMP_LOCKS

public static final String TXN_DUMP_LOCKS
Dump the lock table when a lock timeout is encountered, for debugging assistance.

NameTypeMutableDefault
"je.txn.dumpLocks" Boolean Yes false

See Also:
Constant Field Values

TRACE_FILE

public static final String TRACE_FILE
Use FileHandler in logging system.

NameTypeMutableDefault
"java.util.logging.FileHandler.on" Boolean No false

See Also:
Constant Field Values

TRACE_CONSOLE

public static final String TRACE_CONSOLE
Use ConsoleHandler in logging system.

NameTypeMutableDefault
"java.util.logging.ConsoleHandler.on" Boolean No false

See Also:
Constant Field Values

TRACE_DB

public static final String TRACE_DB
Use DbLogHandler in logging system.

NameTypeMutableDefault
"java.util.logging.DbLogHandler.on" Boolean No true

See Also:
Constant Field Values

TRACE_FILE_LIMIT

public static final String TRACE_FILE_LIMIT
Log file limit for FileHandler.

NameTypeMutable DefaultMinimumMaximum
"java.util.logging.FileHandler.limit" Integer No 10000000 (10M) 1000 1000000000 (1G)

See Also:
Constant Field Values

TRACE_FILE_COUNT

public static final String TRACE_FILE_COUNT
Log file count for FileHandler.

NameTypeMutable DefaultMinimumMaximum
"java.util.logging.FileHandler.count" Integer No 10 1 -none-

See Also:
Constant Field Values

TRACE_LEVEL

public static final String TRACE_LEVEL
Trace messages equal and above this level will be logged. Value should be one of the predefined java.util.logging.Level values.

NameTypeMutableDefault
"java.util.logging.level" String No "INFO"

See Also:
Constant Field Values

TRACE_LEVEL_LOCK_MANAGER

public static final String TRACE_LEVEL_LOCK_MANAGER
Lock manager specific trace messages will be issued at this level. Value should be one of the predefined java.util.logging.Level values.

NameTypeMutableDefault
"java.util.logging.level.lockMgr" String No "FINE"

See Also:
Constant Field Values

TRACE_LEVEL_RECOVERY

public static final String TRACE_LEVEL_RECOVERY
Recovery specific trace messages will be issued at this level. Value should be one of the predefined java.util.logging.Level values.

NameTypeMutableDefault
"java.util.logging.level.recovery" String No "FINE"

See Also:
Constant Field Values

TRACE_LEVEL_EVICTOR

public static final String TRACE_LEVEL_EVICTOR
Evictor specific trace messages will be issued at this level. Value should be one of the predefined java.util.logging.Level values.

NameTypeMutableDefault
"java.util.logging.level.evictor" String No "FINE"

See Also:
Constant Field Values

TRACE_LEVEL_CLEANER

public static final String TRACE_LEVEL_CLEANER
Cleaner specific detailed trace messages will be issued at this level. Value should be one of the predefined java.util.logging.Level values.

NameTypeMutableDefault
"java.util.logging.level.cleaner" String Yes "FINE"

See Also:
Constant Field Values
Constructor Detail

EnvironmentConfig

public EnvironmentConfig()
Creates an EnvironmentConfig initialized with the system default settings.


EnvironmentConfig

public EnvironmentConfig(Properties properties)
                  throws IllegalArgumentException
Creates an EnvironmentConfig which includes the properties specified in the properties parameter.

Parameters:
properties - Supported properties are described in the sample property file.
Throws:
IllegalArgumentException - If any properties read from the properties param are invalid.
Method Detail

setAllowCreate

public void setAllowCreate(boolean allowCreate)
If true, creates the database environment if it doesn't already exist.

Parameters:
allowCreate - If true, the database environment is created if it doesn't already exist.

getAllowCreate

public boolean getAllowCreate()
Returns a flag that specifies if we may create this environment.

Returns:
true if we may create this environment.

setLockTimeout

public void setLockTimeout(long timeout)
                    throws IllegalArgumentException
Configures the lock timeout, in microseconds.

Equivalent to setting the je.lock.timeout parameter in the je.properties file.

Parameters:
timeout - The lock timeout, in microseconds. A value of 0 turns off lock timeouts.
Throws:
IllegalArgumentException - If the value of timeout is negative
See Also:
Transaction.setLockTimeout(long)

getLockTimeout

public long getLockTimeout()
Returns the lock timeout setting, in microseconds. A value of 0 means no timeout is set.


setReadOnly

public void setReadOnly(boolean readOnly)
Configures the database environment to be read only, and any attempt to modify a database will fail.

Parameters:
readOnly - If true, configure the database environment to be read only, and any attempt to modify a database will fail.

getReadOnly

public boolean getReadOnly()
Returns true if the database environment is configured to be read only.

This method may be called at any time during the life of the application.

Returns:
True if the database environment is configured to be read only.

setTransactional

public void setTransactional(boolean transactional)
Configures the database environment for transactions.

This configuration option should be used when transactional guarantees such as atomicity of multiple operations and durability are important.

Parameters:
transactional - If true, configure the database environment for transactions.

getTransactional

public boolean getTransactional()
Returns true if the database environment is configured for transactions.

This method may be called at any time during the life of the application.

Returns:
True if the database environment is configured for transactions.

setLocking

public void setLocking(boolean locking)
Configures the database environment for no locking.

This configuration option should be used when locking guarantees such as consistency and isolation are not important. If locking mode is disabled (it is enabled by default), the cleaner is automatically disabled. The user is responsible for invoking the cleaner and ensuring that there are no concurrent operations while the cleaner is running.

Parameters:
locking - If false, configure the database environment for no locking. The default is true.

getLocking

public boolean getLocking()
Returns true if the database environment is configured for locking.

This method may be called at any time during the life of the application.

Returns:
True if the database environment is configured for locking.

setTxnTimeout

public void setTxnTimeout(long timeout)
                   throws IllegalArgumentException
Configures the transaction timeout, in microseconds.

Equivalent to setting the je.txn.timeout parameter in the je.properties file.

Parameters:
timeout - The transaction timeout, in microseconds. A value of 0 turns off transaction timeouts.
Throws:
IllegalArgumentException - If the value of timeout is negative
See Also:
Transaction.setTxnTimeout(long)

getTxnTimeout

public long getTxnTimeout()
Returns the transaction timeout, in microseconds.

A value of 0 means transaction timeouts are not configured.

Returns:
The transaction timeout, in microseconds.

setTxnSerializableIsolation

public void setTxnSerializableIsolation(boolean txnSerializableIsolation)
Configures all transactions for this environment to have Serializable (Degree 3) isolation. By setting Serializable isolation, phantoms will be prevented. By default transactions provide Repeatable Read isolation. The default is false for the database environment.

See Also:
LockMode

getTxnSerializableIsolation

public boolean getTxnSerializableIsolation()
Returns true if all transactions for this environment has been configured to have Serializable (Degree 3) isolation.

Returns:
true if the environment has been configured to have repeatable read isolation.
See Also:
LockMode

setSharedCache

public void setSharedCache(boolean sharedCache)
If true, the shared cache is used by this environment.

By default this parameter is false and this environment uses a private cache. If this parameter is set to true, this environment will use a cache that is shared with all other open environments in this process that also set this parameter to true. There is a single shared cache per process.

By using the shared cache, multiple open environments will make better use of memory because the cache LRU algorithm is applied across all information in all environments sharing the cache. For example, if one environment is open but not recently used, then it will only use a small portion of the cache, leaving the rest of the cache for environments that have been recently used.

Parameters:
sharedCache - If true, the shared cache is used by this environment.

getSharedCache

public boolean getSharedCache()
Returns true if the shared cache is used by this environment.

Returns:
true if the shared cache is used by this environment. @see #setSharedCache

setConfigParam

public void setConfigParam(String paramName,
                           String value)
                    throws IllegalArgumentException
Description copied from class: EnvironmentMutableConfig
Validates the value prescribed for the configuration parameter; if it is valid, the value is set in the configuration.

Overrides:
setConfigParam in class EnvironmentMutableConfig
Parameters:
paramName - The name of the configuration parameter. See the sample je.properties file for descriptions of all parameters.
value - The value for this configuration parameter.
Throws:
IllegalArgumentException - if an invalid parameter was specified.

toString

public String toString()
Display configuration values.

Overrides:
toString in class EnvironmentMutableConfig

Berkeley DB Java Edition
version 3.3.62

Copyright (c) 2004,2008 Oracle. All rights reserved.