|
Berkeley DB Java Edition version 5.0.34 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.EnvironmentMutableConfig
com.sleepycat.je.EnvironmentConfig
public class EnvironmentConfig
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(); // will throw if timeout value is invalid envConfig.setLockTimeout(250, TimeUnit.MILLISECONDS); // Open the environment using this configuration. 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(EnvironmentConfig.NODE_MAX_ENTRIES, "256");
Environment configuration follows this order of precedence:
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:
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.
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.
Several environment and transaction configuration properties are time durations. For these properties, a time unit is specified along with an integer duration value.
When specific setter and getter methods exist for a time duration
property, these methods have a TimeUnit
argument. Examples are
setLockTimeout(long,TimeUnit)
and getLockTimeout(TimeUnit)
. Note that the TimeUnit
argument may
be null only when the duration value is zero; there is no default unit that
is used when null is specified.
When a time duration is specified as a string value, the following format is used.
<value> [ <whitespace> <unit> ]
The <value>
is an integer. The <unit>
name, if present,
must be preceded by one or more spaces or tabs.
The following <unit>
names are allowed. Both TimeUnit
names and IEEE standard abbreviations are allowed. Unit names are case
insensitive.
IEEE abbreviation | TimeUnit name | Definition |
---|---|---|
ns |
NANOSECONDS |
one billionth (10-9) of a second |
us |
MICROSECONDS |
one millionth (10-6) of a second |
ms |
MILLISECONDS |
one thousandth (10-3) of a second |
s |
SECONDS |
1 second |
min |
60 seconds | |
h |
3600 seconds |
Examples are:
3 seconds 3 s 500 ms 1000000 (microseconds is implied)
Note that when the <unit>
is omitted, microseconds is implied.
This default is supported for compatibility with JE 3.3 and earlier. In JE
3.3 and earlier, explicit time units were not used and durations were always
implicitly specified in microseconds. The older methods that do not have a
TimeUnit
argument, such as setLockTimeout(long)
and getLockTimeout()
, use microsecond durations and have been deprecated.
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_BACKGROUND_PROACTIVE_MIGRATION
If true, the cleaner will fetch log entries (incurring the cost of random I/O) during checkpoints and other JE background thread activities, in order to migrate log entries and reduce the cleaner backlog. |
||||||||||||
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_FOREGROUND_PROACTIVE_MIGRATION
If true, the cleaner will fetch log entries (incurring the cost of random I/O) during eviction, Btree splits, and other application foreground thread activities, in order to migrate log entries and reduce the cleaner backlog. |
||||||||||||
static String |
CLEANER_LAZY_MIGRATION
Controls whether log cleaner threads perform LN (leaf node or record) migration immediately when processing a log file, or lazily during eviction and checkpointing. |
||||||||||||
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
Deprecated. as of 3.3.87. Compression of the root node no longer has any benefit and this feature has been removed. This parameter has no effect. |
||||||||||||
static String |
COMPRESSOR_WAKEUP_INTERVAL
The compressor thread wakeup interval in microseconds. |
||||||||||||
static String |
CONSOLE_LOGGING_LEVEL
Trace messages equal and above this level will be logged to the console. |
||||||||||||
static String |
DOS_PRODUCER_QUEUE_TIMEOUT
The timeout for Disk Ordered Scan producer thread queue offers in milliseconds. |
||||||||||||
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 duration 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_DUP_CONVERT_PRELOAD_ALL
If true (the default) preload all duplicates databases at once when upgrading from JE 4.1 and earlier. |
||||||||||||
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_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_EVICTOR
If true, eviction is also done by a pool of evictor threads, as well as being done inline by application threads. |
||||||||||||
static String |
ENV_RUN_IN_COMPRESSOR
If true, starts up the INCompressor thread. |
||||||||||||
static String |
EVICTOR_ALLOW_BIN_DELTAS
Allow Bottom Internal Nodes (BINs) to be written in a delta format during eviction. |
||||||||||||
static String |
EVICTOR_CORE_THREADS
The minimum number of threads in the eviction thread pool. |
||||||||||||
static String |
EVICTOR_DEADLOCK_RETRY
Deprecated. as of JE 4.1, since the single evictor thread has been replaced be a more robust thread pool. The number of times to retry the evictor if it runs into a deadlock. When using the shared cache feature, the value of this property is applied the first time the cache is set up. New environments that join the cache do not alter the cache setting.
|
||||||||||||
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_KEEP_ALIVE
The duration that excess threads in the eviction thread pool will stay idle. |
||||||||||||
static String |
EVICTOR_LRU_ONLY
If true (the default), use an LRU-only policy to select nodes for eviction. |
||||||||||||
static String |
EVICTOR_MAX_THREADS
The maximum number of threads in the eviction thread pool. |
||||||||||||
static String |
EVICTOR_NODES_PER_SCAN
The number of nodes in one evictor scan. |
||||||||||||
static String |
FILE_LOGGING_LEVEL
Trace messages equal and above this level will be logged to the je.info file, which is in the Environment home directory. |
||||||||||||
static String |
HALT_ON_COMMIT_AFTER_CHECKSUMEXCEPTION
By default, if a checksum exception is found at the end of the log during Environment startup, JE will assume the checksum is due to previously interrupted I/O and will quietly truncate the log and restart. |
||||||||||||
static String |
LOCK_N_LOCK_TABLES
Number of Lock Tables. |
||||||||||||
static String |
LOCK_OLD_LOCK_EXCEPTIONS
Whether to throw old-style lock exceptions for compatibility with older JE releases. |
||||||||||||
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
Deprecated. NIO is no longer used by JE and this parameter has no effect. |
||||||||||||
static String |
LOG_DIRECT_NIO
Deprecated. NIO is no longer used by JE and this parameter has no effect. |
||||||||||||
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_N_DATA_DIRECTORIES
The JE environment can be spread across multiple subdirectories. |
||||||||||||
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
Deprecated. NIO is no longer used by JE and this parameter has no effect. |
||||||||||||
static String |
LOG_USE_ODSYNC
If true (default is false) O_DSYNC is used to open JE log files. |
||||||||||||
static String |
LOG_USE_WRITE_QUEUE
If true (default is true) the Write Queue is used for file I/O operations which are blocked by concurrent I/O operations. |
||||||||||||
static String |
LOG_VERIFY_CHECKSUMS
If true, perform a checksum verification just before and after writing to the log. |
||||||||||||
static String |
LOG_WRITE_QUEUE_SIZE
The size of the Write Queue. |
||||||||||||
static String |
MAX_MEMORY
The CacheSize property. |
||||||||||||
static String |
MAX_MEMORY_PERCENT
The CachePercent property. |
||||||||||||
static String |
NODE_DUP_TREE_MAX_ENTRIES
Deprecated. this property no longer has any effect; DatabaseConfig.setNodeMaxEntries(int) should be used instead. |
||||||||||||
static String |
NODE_MAX_ENTRIES
The maximum number of entries in an internal btree node. |
||||||||||||
static String |
SHARED_CACHE
The SharedCache property. |
||||||||||||
static String |
STARTUP_DUMP_THRESHOLD
If environment startup exceeds this duration, startup statistics are logged and can be found in the je.info file. |
||||||||||||
static String |
TRACE_CONSOLE
Deprecated. in favor of CONSOLE_LOGGING_LEVEL As of JE
4.0, use the standard java.util.logging configuration
methodologies. To enable console output, set
com.sleepycat.je.util.ConsoleHandler.level = <LEVEL> through
the java.util.logging configuration file, or through the
java.util.logging.LogManager. To set the handler level programmatically,
set "com.sleepycat.je.util.ConsoleHandler.level" in the
EnvironmentConfig object. |
||||||||||||
static String |
TRACE_DB
Deprecated. As of JE 4.0, event tracing to the .jdb files has been separated from the java.util.logging mechanism. This parameter has no effect. |
||||||||||||
static String |
TRACE_FILE
Deprecated. in favor of FILE_LOGGING_LEVEL As of JE 4.0,
use the standard java.util.logging configuration methodologies. To
enable logging output to the je.info files, set
com.sleepycat.je.util.FileHandler.level = <LEVEL> through the
java.util.logging configuration file, or through the
java.util.logging.LogManager. To set the handler level programmatically,
set "com.sleepycat.je.util.FileHandler.level" in the EnvironmentConfig
object. |
||||||||||||
static String |
TRACE_FILE_COUNT
Deprecated. As of JE 4.0, use the standard java.util.logging configuration methodologies. To set the FileHandler output file count, set com.sleepycat.je.util.FileHandler.count = <NUMBER> through the java.util.logging configuration file, or through the java.util.logging.LogManager. |
||||||||||||
static String |
TRACE_FILE_LIMIT
Deprecated. As of JE 4.0, use the standard java.util.logging configuration methodologies. To set the FileHandler output file size, set com.sleepycat.je.util.FileHandler.limit = <NUMBER> through the java.util.logging configuration file, or through the java.util.logging.LogManager. |
||||||||||||
static String |
TRACE_LEVEL
Deprecated. As of JE 4.0, use the standard java.util.logging configuration methodologies. Set logging levels using class names through the java.util.logging configuration file, or through the java.util.logging.LogManager. |
||||||||||||
static String |
TRACE_LEVEL_CLEANER
Deprecated. As of JE 4.0, use the standard java.util.logging configuration methodologies. To see cleaner logging, set com.sleepycat.je.cleaner.level = <LEVEL> through the java.util.logging configuration file, or through the java.util.logging.LogManager. |
||||||||||||
static String |
TRACE_LEVEL_EVICTOR
Deprecated. As of JE 4.0, use the standard java.util.logging configuration methodologies. To see evictor logging, set com.sleepycat.je.evictor.level = <LEVEL> through the java.util.logging configuration file, or through the java.util.logging.LogManager. |
||||||||||||
static String |
TRACE_LEVEL_LOCK_MANAGER
Deprecated. As of JE 4.0, use the standard java.util.logging configuration methodologies. To see locking logging, set com.sleepycat.je.txn.level = <LEVEL> through the java.util.logging configuration file, or through the java.util.logging.LogManager. |
||||||||||||
static String |
TRACE_LEVEL_RECOVERY
Deprecated. As of JE 4.0, use the standard java.util.logging configuration methodologies. To see recovery logging, set com.sleepycat.je.recovery.level = <LEVEL> through the java.util.logging configuration file, or through the java.util.logging.LogManager. |
||||||||||||
static String |
TREE_BIN_DELTA
If more than this percentage of entries are changed on a BIN, log a a full version instead of a delta. |
||||||||||||
static String |
TREE_COMPACT_MAX_KEY_LENGTH
Specifies the maximum unprefixed key length for use in the compact in-memory key representation. |
||||||||||||
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 | |
---|---|
EnvironmentConfig |
clone()
Returns a copy of this configuration object. |
boolean |
getAllowCreate()
Returns a flag that specifies if we may create this environment. |
ClassLoader |
getClassLoader()
Returns the ClassLoader for loading user-supplied classes by name, or null if no specified ClassLoader is configured. |
boolean |
getLocking()
Returns true if the database environment is configured for locking. |
long |
getLockTimeout()
Deprecated. as of 4.0, replaced by getLockTimeout(TimeUnit) . |
long |
getLockTimeout(TimeUnit unit)
Returns the lock timeout setting. |
Handler |
getLoggingHandler()
Returns the custom java.util.logging.Handler specified by the application. |
String |
getNodeName()
Returns the user defined nodeName for the Environment. |
boolean |
getReadOnly()
Returns true if the database environment is configured to be read only. |
ProgressListener<RecoveryProgress> |
getRecoveryProgressListener()
Return the ProgressListener to be used at this environment startup. |
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()
Deprecated. as of 4.0, replaced by getTxnTimeout(TimeUnit) . |
long |
getTxnTimeout(TimeUnit unit)
Returns the transaction timeout. |
EnvironmentConfig |
setAllowCreate(boolean allowCreate)
If true, creates the database environment if it doesn't already exist. |
EnvironmentConfig |
setClassLoader(ClassLoader classLoader)
Configure the environment to use a specified ClassLoader for loading user-supplied classes by name. |
EnvironmentConfig |
setConfigParam(String paramName,
String value)
Set this configuration parameter. |
EnvironmentConfig |
setLocking(boolean locking)
Configures the database environment for no locking. |
EnvironmentConfig |
setLockTimeout(long timeout)
Deprecated. as of 4.0, replaced by setLockTimeout(long,
TimeUnit) . |
EnvironmentConfig |
setLockTimeout(long timeout,
TimeUnit unit)
Configures the lock timeout. |
EnvironmentConfig |
setLoggingHandler(Handler handler)
Set a java.util.logging.Handler which will be used by all java.util.logging.Loggers instantiated by this Environment. |
EnvironmentConfig |
setNodeName(String nodeName)
Sets the user defined nodeName for the Environment. |
EnvironmentConfig |
setReadOnly(boolean readOnly)
Configures the database environment to be read-only, and any attempt to modify a database will fail. |
EnvironmentConfig |
setRecoveryProgressListener(ProgressListener<RecoveryProgress> progressListener)
Configure the environment to make periodic calls to a ProgressListener to provide feedback on environment startup (recovery). |
EnvironmentConfig |
setSharedCache(boolean sharedCache)
If true, the shared cache is used by this environment. |
EnvironmentConfig |
setTransactional(boolean transactional)
Configures the database environment for transactions. |
EnvironmentConfig |
setTxnSerializableIsolation(boolean txnSerializableIsolation)
Configures all transactions for this environment to have Serializable (Degree 3) isolation. |
EnvironmentConfig |
setTxnTimeout(long timeout)
Deprecated. as of 4.0, replaced by setTxnTimeout(long,
TimeUnit) . |
EnvironmentConfig |
setTxnTimeout(long timeout,
TimeUnit unit)
Configures the transaction timeout. |
String |
toString()
Display configuration values. |
Methods inherited from class com.sleepycat.je.EnvironmentMutableConfig |
---|
getCacheMode, getCachePercent, getCacheSize, getConfigParam, getDurability, getExceptionListener, getTxnNoSync, getTxnWriteNoSync, setCacheMode, setCachePercent, setCacheSize, setDurability, setExceptionListener, setTxnNoSync, setTxnWriteNoSync |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final transient String MAX_MEMORY
CacheSize
property.
To take full advantage of JE cache memory, it is strongly recommended
that
compressed oops
(-XX:+UseCompressedOops
) is specified when a 64-bit JVM is
used and the maximum heap size is less than 32 GB. As described in the
referenced documentation, compressed oops is sometimes the default JVM
mode even when it is not explicitly specified in the Java command.
However, if compressed oops is desired then it must be
explicitly specified in the Java command when running DbCacheSize or a
JE application. If it is not explicitly specified then JE will not
aware of it, even if it is the JVM default setting, and will not take it
into account when calculating cache memory sizes.
When using the shared cache feature, new environments that join the cache may alter the cache size setting if their configuration is set to a different value.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.maxMemory" | Long | Yes | 0 | -none- | -none- |
EnvironmentMutableConfig.setCacheSize(long)
,
Constant Field Valuespublic static final transient String MAX_MEMORY_PERCENT
CachePercent
property.
When using the shared cache feature, new environments that join the cache may alter the cache percent setting if their configuration is set to a different value.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.maxMemoryPercent" | Integer | Yes | 60 | 1 | 90 |
EnvironmentMutableConfig.setCachePercent(int)
,
Constant Field Valuespublic static final transient String SHARED_CACHE
SharedCache
property.
Name | Type | Mutable | Default |
"je.sharedCache" | Boolean | No | false |
public static final transient String ENV_RECOVERY_FORCE_CHECKPOINT
Name | Type | Mutable | Default |
"je.env.recoveryForceCheckpoint" | Boolean | No | false |
public static final transient String HALT_ON_COMMIT_AFTER_CHECKSUMEXCEPTION
Name | Type | Mutable | Default |
"je.haltOnCommitAfterChecksumException" | Boolean | No | false |
public static final transient String ENV_RUN_IN_COMPRESSOR
Name | Type | Mutable | Default |
"je.env.runINCompressor" | Boolean | Yes | true |
public static final transient String ENV_RUN_CHECKPOINTER
Name | Type | Mutable | Default |
"je.env.runCheckpointer" | Boolean | Yes | true |
public static final transient String ENV_RUN_CLEANER
Name | Type | Mutable | Default |
"je.env.runCleaner" | Boolean | Yes | true |
public static final transient String ENV_RUN_EVICTOR
Name | Type | Mutable | Default |
"je.env.runEvictor" | Boolean | Yes | true |
public static final transient String ENV_BACKGROUND_READ_LIMIT
Name | Type | Mutable | Default | Minimum | Maximum |
"je.env.backgroundReadLimit" | Integer | Yes | 0 | 0 | -none- |
ENV_BACKGROUND_SLEEP_INTERVAL
,
Constant Field Valuespublic static final transient String ENV_BACKGROUND_WRITE_LIMIT
Name | Type | Mutable | Default | Minimum | Maximum |
"je.env.backgroundWriteLimit" | Integer | Yes | 0 | 0 | -none- |
ENV_BACKGROUND_SLEEP_INTERVAL
,
Constant Field Valuespublic static final transient String ENV_BACKGROUND_SLEEP_INTERVAL
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.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.env.backgroundSleepInterval" | Duration | Yes | 1 ms | 1 ms | 24 d |
public static final transient String ENV_CHECK_LEAKS
Name | Type | Mutable | Default |
"je.env.checkLeaks" | Boolean | No | true |
public static final transient String ENV_FORCED_YIELD
Name | Type | Mutable | Default |
"je.env.forcedYield" | Boolean | No | false |
public static final transient String ENV_IS_TRANSACTIONAL
Name | Type | Mutable | Default |
"je.env.isTransactional" | Boolean | No | false |
public static final transient String ENV_IS_LOCKING
Name | Type | Mutable | Default |
"je.env.isLocking" | Boolean | No | true |
public static final transient String ENV_READ_ONLY
Name | Type | Mutable | Default |
"je.env.isReadOnly" | Boolean | No | false |
public static final transient String ENV_FAIR_LATCHES
Name | Type | Mutable | Default |
"je.env.fairLatches" | Boolean | No | false |
public static final transient String ENV_DB_EVICTION
Name | Type | Mutable | Default |
"je.env.dbEviction" | Boolean | No | true |
public static final transient String ENV_DUP_CONVERT_PRELOAD_ALL
Name | Type | Mutable | Default |
"je.env.dupConvertPreloadAll" | Boolean | No | true |
public static final transient String ADLER32_CHUNK_SIZE
Name | Type | Mutable | Default | Minimum | Maximum |
"je.adler32.chunkSize" | Integer | Yes | 0 | 0 | 1048576 (1M) |
public static final transient String LOG_TOTAL_BUFFER_BYTES
Name | Type | Mutable | Default | Minimum | Maximum |
"je.log.totalBufferBytes" | Long | No | 0 | 6144L | -none- |
public static final transient String LOG_NUM_BUFFERS
Name | Type | Mutable | Default | Minimum | Maximum |
"je.log.numBuffers" | Integer | No | 3 | 2 | -none- |
public static final transient String LOG_BUFFER_SIZE
Name | Type | Mutable | Default | Minimum | Maximum |
"je.log.bufferSize" | Integer | No | 1048576 (1M) | 1024 (1K) | -none- |
public static final transient String LOG_FAULT_READ_SIZE
Name | Type | Mutable | Default | Minimum | Maximum |
"je.log.faultReadSize" | Integer | No | 2048 (2K) | 32 | -none- |
public static final transient String LOG_ITERATOR_READ_SIZE
Name | Type | Mutable | Default | Minimum | Maximum |
"je.log.iteratorReadSize" | Integer | No | 8192 (8K) | 128 | -none- |
public static final transient String LOG_ITERATOR_MAX_SIZE
Name | Type | Mutable | Default | Minimum | Maximum |
"je.log.iteratorMaxSize" | Integer | No | 16777216 (16M) | 128 | -none- |
public static final transient String LOG_FILE_MAX
Name | Type | Mutable | Default | Minimum | Maximum | JVM |
"je.log.fileMax" | Long | No | 10000000 (10M) | 1000000 (1M) | 1073741824 (1G) | Conventional JVM |
"je.log.fileMax" | Long | No | 100000 (100K) | 10000 (10K) | 1048576 (1M) | Dalvik JVM |
public static final transient String LOG_N_DATA_DIRECTORIES
If 0, all log files (*.jdb) will reside in the environment home directory passed to the Environment constructor. A non-zero value indicates the number of environment subdirectories to use for holding the environment log files.
If data subdirectories are used (i.e. je.log.nDataDirectories > 0), this parameter must be set when the environment is initially created. Like the environment home directory, each and every one of the dataNNN/ subdirectories must also be present and writable. This parameter must be set to the same value for all subsequent openings of the environment or an exception will be thrown.
If the set of existing dataNNN/ subdirectories is not equivalent to the set { 1 ... je.log.nDataDirectories } when the environment is opened, an EnvironmentFailureException will be thrown, and the Environment will fail to be opened.
This parameter should be set using the je.properties file rather than the EnvironmentConfig. If not, JE command line utilities that open the Environment will throw an exception because they will not know of the non-zero value of this parameter.
Name | Type | Mutable | Default | Minimum | Maximum | JVM |
"je.log.nDataDirectories" | Integer | No | 0 | 0 | 256 |
public static final transient String LOG_CHECKSUM_READ
Name | Type | Mutable | Default |
"je.log.checksumRead" | Boolean | No | true |
public static final transient String LOG_VERIFY_CHECKSUMS
Name | Type | Mutable | Default |
"je.log.verifyChecksums" | Boolean | No | false |
public static final transient String LOG_MEM_ONLY
Name | Type | Mutable | Default |
"je.log.memOnly" | Boolean | No | false |
public static final transient String LOG_FILE_CACHE_SIZE
Name | Type | Mutable | Default | Minimum | Maximum |
"je.log.fileCacheSize" | Integer | No | 100 | 3 | -none- |
public static final transient String LOG_FSYNC_TIMEOUT
Name | Type | Mutable | Default | Minimum | Maximum |
"je.log.fsyncTimeout" | Duration | No | 500 ms | 10 ms | 24 d |
public static final transient String LOG_USE_ODSYNC
Name | Type | Mutable | Default |
"je.log.useODSYNC" | Boolean | No | false |
public static final transient String LOG_USE_NIO
Name | Type | Mutable | Default |
"je.log.useNIO" | Boolean | No | false |
public static final transient String LOG_USE_WRITE_QUEUE
Name | Type | Mutable | Default |
"je.log.useWriteQueue" | Boolean | No | true |
public static final transient String LOG_WRITE_QUEUE_SIZE
Name | Type | Mutable | Default | Minimum | Maximum |
"je.log.writeQueueSize" | Integer | No | 1MB | 4KB | 32MB- |
public static final transient String LOG_DIRECT_NIO
LOG_USE_NIO
is true.
Name | Type | Mutable | Default |
"je.log.directNIO" | Boolean | No | false |
public static final transient String LOG_CHUNKED_NIO
LOG_USE_NIO
is true.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.log.chunkedNIO" | Long | No | 0 | 0 | 67108864 (64M) |
public static final transient String NODE_MAX_ENTRIES
Name | Type | Mutable | Default | Minimum | Maximum |
"je.nodeMaxEntries" | Integer | No | 128 | 4 | 32767 (32K) |
public static final transient String NODE_DUP_TREE_MAX_ENTRIES
DatabaseConfig.setNodeMaxEntries(int)
should be used instead.public static final transient String TREE_MAX_DELTA
Both the TREE_MAX_DELTA
and TREE_BIN_DELTA
conditions
for logging a delta must be met; otherwise a full version will be
logged. For example, using the default parameter settings, a delta will
be logged only if less than 10 deltas have previously been logged (since
the last full version) and no more than 25% of the BIN entries
have changed.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.tree.maxDelta" | Integer | No | 10 | 0 | 100 |
public static final transient String TREE_BIN_DELTA
Both the TREE_MAX_DELTA
and TREE_BIN_DELTA
conditions
for logging a delta must be met; otherwise a full version will be
logged. For example, using the default parameter settings, a delta will
be logged only if less than 10 deltas have previously been logged (since
the last full version) and no more than 25% of the BIN entries
have changed.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.tree.binDelta" | Integer | No | 25 | 0 | 75 |
public static final transient String TREE_MIN_MEMORY
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.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.tree.minMemory" | Long | Yes | 512000 (500K) | 51200 (50K) | -none- |
public static final transient String TREE_COMPACT_MAX_KEY_LENGTH
In the Btree, the JE in-memory cache, the default representation for keys uses a byte array object per key. The per-key object overhead of this approach ranges from 20 to 32 bytes, depending on the JVM platform.
To reduce memory overhead, a compact representation can instead be used where keys will be represented inside a single byte array instead of having one byte array per key. Within the single array, all keys are assigned a storage size equal to that taken up by the largest key, plus one byte to hold the actual key length. The use of the fixed size array reduces Java GC activity as well as memory overhead.
In order for the compact representation to reduce memory usage, all keys in a database, or in a Btree internal node, must be roughly the same size. The more fully populated the internal node, the more the savings with this representation since the single byte array is sized to hold the maximum number of keys in the internal node, regardless of the actual number of keys that are present.
It's worth noting that the storage savings of the compact
representation are realized in addition to the storage benefits of key
prefixing (if it is configured), since the keys stored in the key array
are the smaller key values after the prefix has been stripped, reducing
the length of the key and making it more likely that it's small enough
for this specialized representation. This configuration parameter
(TREE_COMPACT_MAX_KEY_LENGTH
) is the maximum key length, not
including the common prefix, for the keys in a Btree internal node
stored using the compact representation. See DatabaseConfig.setKeyPrefixing(boolean)
.
The compact representation is used automatically when both of the following conditions hold.
TREE_COMPACT_MAX_KEY_LENGTH
).If this configuration parameter is set to zero, the compact representation will not be used.
The default value of this configuration parameter is 16 bytes. The potential drawbacks of specifying a larger length are:
Mutation of the key representation between the default and compact approaches is automatic on a per-Btree internal node basis. For example, if a key that exceeds the configured length is added to a node that uses the compact representation, the node is automatically mutated to the default representation. A best effort is made to prevent frequent mutations that could increase Java GC activity.
To determine how often the compact representation is used in a
running application, see EnvironmentStats.getNINCompactKeyIN()
.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.tree.compactMaxKeyLength" | Integer | No | 16 | 0 | 256 |
DatabaseConfig.setKeyPrefixing(boolean)
,
EnvironmentStats.getNINCompactKeyIN()
,
Constant Field Valuespublic static final transient String COMPRESSOR_WAKEUP_INTERVAL
Name | Type | Mutable | Default | Minimum | Maximum |
"je.compressor.wakeupInterval" | Duration | No | 5 s | 1 s | 75 min |
public static final transient String COMPRESSOR_DEADLOCK_RETRY
Name | Type | Mutable | Default | Minimum | Maximum |
"je.compressor.deadlockRetry" | Integer | No | 3 | 0 | -none- |
public static final transient String COMPRESSOR_LOCK_TIMEOUT
Name | Type | Mutable | Default | Minimum | Maximum |
"je.compressor.lockTimeout" | Duration | No | 500 ms | 0 | 75 min |
public static final transient String COMPRESSOR_PURGE_ROOT
Name | Type | Mutable | Default |
"je.compressor.purgeRoot" | Boolean | No | false |
public static final transient String EVICTOR_EVICT_BYTES
MAX_MEMORY
. No more than 50% of je.maxMemory
will be evicted per eviction cycle, regardless of this setting.
When using the shared cache feature, the value of this property is applied the first time the cache is set up. New environments that join the cache do not alter the cache setting.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.evictor.evictBytes" | Long | No | 524288 (512K) | 1024 (1K) | -none- |
public static final transient String EVICTOR_NODES_PER_SCAN
When using the shared cache feature, the value of this property is applied the first time the cache is set up. New environments that join the cache do not alter the cache setting.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.evictor.nodesPerScan" | Integer | No | 10 | 1 | 1000 |
public static final transient String EVICTOR_DEADLOCK_RETRY
When using the shared cache feature, the value of this property is applied the first time the cache is set up. New environments that join the cache do not alter the cache setting.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.evictor.deadlockRetry" | Integer | No | 3 | 0 | -none- |
public static final transient String EVICTOR_LRU_ONLY
When using the shared cache feature, the value of this property is applied the first time the cache is set up. New environments that join the cache do not alter the cache setting.
Name | Type | Mutable | Default |
"je.evictor.lruOnly" | Boolean | No | true |
public static final transient String EVICTOR_FORCED_YIELD
When using the shared cache feature, the value of this property is applied the first time the cache is set up. New environments that join the cache do not alter the cache setting.
Name | Type | Mutable | Default |
"je.evictor.forcedYield" | Boolean | No | false |
public static final transient String EVICTOR_CORE_THREADS
Name | Type | Mutable | Default | Minimum | Maximum |
"je.evictor.coreThreads" | Integer | yes | 1 | 0 | Integer.MAX_VALUE |
public static final transient String EVICTOR_MAX_THREADS
Name | Type | Mutable | Default | Minimum | Maximum |
"je.evictor.maxThreads" | Integer | yes | 10 | 1 | Integer.MAX_VALUE |
public static final transient String EVICTOR_KEEP_ALIVE
Name | Type | Mutable | Default | Minimum | Maximum |
"je.evictor.keepAlive" | Duration | Yes | 10 min | 1 s | 1 d |
public static final transient String EVICTOR_ALLOW_BIN_DELTAS
Name | Type | Mutable | Default |
"je.evictor.allowBinDeltas" | Boolean | No | true |
public static final transient String CHECKPOINTER_BYTES_INTERVAL
CHECKPOINTER_WAKEUP_INTERVAL
. To use
time based checkpointing, set this to 0.
Name | Type | Mutable | Default | Minimum | Maximum | JVM |
"je.checkpointer.bytesInterval" | Long | No | 20000000 (20M) | 0 | -none- | Conventional JVM |
"je.checkpointer.bytesInterval" | Long | No | 200000 (200K) | 0 | -none- | Dalvik JVM |
public static final transient String CHECKPOINTER_WAKEUP_INTERVAL
CHECKPOINTER_BYTES_INTERVAL
).
Name | Type | Mutable | Default | Minimum | Maximum |
"je.checkpointer.wakeupInterval" | Duration | No | 0 | 1 s | 75 min |
public static final transient String CHECKPOINTER_DEADLOCK_RETRY
Name | Type | Mutable | Default | Minimum | Maximum |
"je.checkpointer.deadlockRetry" | Integer | No | 3 | 0 | -none- |
public static final transient String CHECKPOINTER_HIGH_PRIORITY
CLEANER_LAZY_MIGRATION
). 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.
Note that lazy migration is disabled when the CHECKPOINTER_HIGH_PRIORITY
parameter is set to true, regardless of the
CLEANER_LAZY_MIGRATION
setting.
Name | Type | Mutable | Default |
"je.checkpointer.highPriority" | Boolean | Yes | false |
public static final transient String CLEANER_MIN_UTILIZATION
Name | Type | Mutable | Default | Minimum | Maximum |
"je.cleaner.minUtilization" | Integer | Yes | 50 | 0 | 90 |
public static final transient String CLEANER_MIN_FILE_UTILIZATION
Name | Type | Mutable | Default | Minimum | Maximum |
"je.cleaner.minFileUtilization" | Integer | Yes | 5 | 0 | 50 |
public static final transient String CLEANER_BYTES_INTERVAL
LOG_FILE_MAX
value divided by four.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.cleaner.bytesInterval" | Long | Yes | 0 | 0 | -none- |
public static final transient String CLEANER_FETCH_OBSOLETE_SIZE
Name | Type | Mutable | Default |
"je.cleaner.fetchObsoleteSize" | Boolean | Yes | false |
public static final transient String CLEANER_DEADLOCK_RETRY
Name | Type | Mutable | Default | Minimum | Maximum |
"je.cleaner.deadlockRetry" | Integer | Yes | 3 | 0 | -none- |
public static final transient String CLEANER_LOCK_TIMEOUT
Name | Type | Mutable | Default | Minimum | Maximum |
"je.cleaner.lockTimeout" | Duration | Yes | 500 ms | 0 | 75 min |
public static final transient String CLEANER_EXPUNGE
Name | Type | Mutable | Default |
"je.cleaner.expunge" | Boolean | Yes | true |
public static final transient String CLEANER_MIN_AGE
Name | Type | Mutable | Default | Minimum | Maximum |
"je.cleaner.minAge" | Integer | Yes | 2 | 1 | 1000 |
public static final transient String CLEANER_MAX_BATCH_FILES
Name | Type | Mutable | Default | Minimum | Maximum |
"je.cleaner.maxBatchFiles" | Integer | Yes | 0 | 0 | 100000 |
public static final transient String CLEANER_READ_SIZE
LOG_ITERATOR_READ_SIZE
value is used.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.cleaner.readSize" | Integer | Yes | 0 | 128 | -none- |
public static final transient String CLEANER_DETAIL_MAX_MEMORY_PERCENTAGE
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.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.cleaner.detailMaxMemoryPercentage" | Integer | Yes | 2 | 1 | 90 |
public static final transient String CLEANER_FORCE_CLEAN_FILES
Name | Type | Mutable | Default |
"je.cleaner.forceCleanFiles" | String | No | "" |
public static final transient String CLEANER_UPGRADE_TO_LOG_VERSION
Name | Type | Mutable | Default | Minimum | Maximum |
"je.cleaner.upgradeToLogVersion" | Integer | No | 0 | -1 | -none- |
public static final transient String CLEANER_THREADS
Name | Type | Mutable | Default | Minimum | Maximum |
"je.cleaner.threads" | Integer | Yes | 1 | 1 | -none- |
public static final transient String CLEANER_LOOK_AHEAD_CACHE_SIZE
Name | Type | Mutable | Default | Minimum | Maximum |
"je.cleaner.lookAheadCacheSize" | Integer | Yes | 8192 (8K) | 0 | -none- |
public static final transient String CLEANER_FOREGROUND_PROACTIVE_MIGRATION
This parameter is false by default in order to avoid database
operation delays caused by random I/O during eviction and Btree splits.
This parameter may be set to true to keep the cleaner backlog from
growing when the number of cleaner threads is not sufficient to prevent
a backlog. This should be done only when database operation delays are
acceptable. By database operations we mean ordinary record reads and
writes (get()
and put()
method calls).
Name | Type | Mutable | Default |
"je.cleaner.foregroundProactiveMigration" | Boolean | Yes | false |
public static final transient String CLEANER_BACKGROUND_PROACTIVE_MIGRATION
This parameter is false by default in order to avoid long checkpoint durations caused by random I/O during the checkpoint. This parameter may be set to true to keep the cleaner backlog from growing when the number of cleaner threads is not sufficient to prevent a backlog. This should be done only when the resulting duration of the checkpoint is acceptable.
Name | Type | Mutable | Default |
"je.cleaner.backgroundProactiveMigration" | Boolean | Yes | false |
public static final transient String CLEANER_LAZY_MIGRATION
By default this parameter is false. When set to true, LN migration is performed lazily during eviction (when the cache fills) and checkpointing. LNs are placed into the JE cache by the log cleaner threads as the LNs are read sequentially from the log file, but the LNs are not logged until their parent BIN (Bottom Internal Node) is evicted or checkpointed. Lazy migration has two potential advantages:
If this parameter is set to false (or left false by default), LN
migration will be performed immediately by the log cleaner threads, or
by an application thread calling Environment.cleanLog()
.
Immediate migration has three potential advantages:
CHECKPOINTER_HIGH_PRIORITY
). However, more
cleaner threads may be required to maintain the configured log
utilization.Note that lazy migration is disabled when the CHECKPOINTER_HIGH_PRIORITY
parameter is set to true, regardless of the
CLEANER_LAZY_MIGRATION
setting.
Name | Type | Mutable | Default |
"je.cleaner.lazyMigration" | Boolean | Yes | false |
public static final transient String DOS_PRODUCER_QUEUE_TIMEOUT
Name | Type | Mutable | Default | Minimum | Maximum |
"je.env.diskOrderedScanLockTimeout" | Duration | Yes | 10 secs | 0 | 75 min |
public static final transient String LOCK_N_LOCK_TABLES
Name | Type | Mutable | Default | Minimum | Maximum |
"je.lock.nLockTables" | Integer | No | 1 | 1 | 32767 (32K) |
public static final transient String LOCK_TIMEOUT
LockTimeout
property.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.lock.timeout" | Duration | No | 500 ms | 0 | 75 min |
setLockTimeout(long,TimeUnit)
,
Time Duration
Properties,
Constant Field Valuespublic static final transient String LOCK_OLD_LOCK_EXCEPTIONS
In JE 3.3 and earlier, DeadlockException
or a subclass of it
was always thrown when a lock conflict occurred. Applications typically
caught DeadlockException
in order to detect lock conflicts and
determine whether to retry a transaction. DeadlockException
itself was thrown when a lock or transaction timeout occurred and LockNotGrantedException
(a subclass of DeadlockException
) was
thrown when a lock conflict occurred for a no-wait transaction (see
TransactionConfig.setNoWait(boolean)
).
In all releases after JE 3.3, new exceptions and the new base class
LockConflictException
are available. Now, LockConflictException
should be caught to handle lock conflicts in a
general manner, instead of catching DeadlockException
. New
exceptions are now thrown as follows:
LockTimeoutException
is now thrown when a lock timeout
occurs, rather than DeadlockException
.TransactionTimeoutException
is now thrown when a transaction
timeout occurs, rather than DeadlockException
.LockNotAvailableException
is now thrown when a lock conflict
occurs for a no-wait transaction, rather than LockNotGrantedException
.These three new exceptions are subclasses of LockConflictException
. DeadlockException
is also now a
subclass of LockConflictException
, but is not currently thrown
by JE because true deadlock detection is not used in JE. Currently,
lock timeouts are used instead. When true deadlock detection is added
to JE in the future, DeadlockException
will be thrown. LockNotGrantedException
has been deprecated and replaced by LockNotAvailableException
.
LOCK_OLD_LOCK_EXCEPTIONS
configuraton
parameter may be explicitly set to true to enable the old exception
behavior. By default, this parameter is false.Unless LOCK_OLD_LOCK_EXCEPTIONS
is set to
true, the following changes must be made to JE applications that upgrade
from JE 3.3 or earlier.
DeadlockException
must be replaced with
LockConflictException
or one of its non-deprecated subclasses
(LockTimeoutException
, TransactionTimeoutException
, or
LockNotAvailableException
). It is strongly recommended to
replace it with LockConflictException
, since catching this
exception will catch true deadlocks in the future and other types of
lock conflicts. All lock conflicts all typically handled in the same
way, which is normally to abort and retry the transaction.LockNotGrantedException
must be replaced
with LockNotAvailableException
. LockNotGrantedException
has been deprecated because it misleadingly extends DeadlockException
.Name | Type | Mutable | Default |
"je.lock.oldLockExceptions" | Boolean | No | false |
public static final transient String TXN_TIMEOUT
TxnTimeout
property.
Name | Type | Mutable | Default | Minimum | Maximum |
"je.txn.timeout" | Duration | No | 0 | 0 | 75 min |
setTxnTimeout(long, java.util.concurrent.TimeUnit)
,
Time Duration
Properties,
Constant Field Valuespublic static final transient String TXN_SERIALIZABLE_ISOLATION
TxnSerializableIsolation
property.
Name | Type | Mutable | Default |
"je.txn.serializableIsolation" | Boolean | No | false |
setTxnSerializableIsolation(boolean)
,
Constant Field Valuespublic static final transient String TXN_DEADLOCK_STACK_TRACE
Name | Type | Mutable | Default |
"je.txn.deadlockStackTrace" | Boolean | Yes | false |
public static final transient String TXN_DUMP_LOCKS
Name | Type | Mutable | Default |
"je.txn.dumpLocks" | Boolean | Yes | false |
public static final transient String TRACE_FILE
FILE_LOGGING_LEVEL
As of JE 4.0,
use the standard java.util.logging configuration methodologies. To
enable logging output to the je.info files, set
com.sleepycat.je.util.FileHandler.level = <LEVEL> through the
java.util.logging configuration file, or through the
java.util.logging.LogManager. To set the handler level programmatically,
set "com.sleepycat.je.util.FileHandler.level" in the EnvironmentConfig
object.Name | Type | Mutable | Default |
"java.util.logging.FileHandler.on" | Boolean | No | false |
public static final transient String TRACE_CONSOLE
CONSOLE_LOGGING_LEVEL
As of JE
4.0, use the standard java.util.logging configuration
methodologies. To enable console output, set
com.sleepycat.je.util.ConsoleHandler.level = <LEVEL> through
the java.util.logging configuration file, or through the
java.util.logging.LogManager. To set the handler level programmatically,
set "com.sleepycat.je.util.ConsoleHandler.level" in the
EnvironmentConfig object.Name | Type | Mutable | Default |
"java.util.logging.ConsoleHandler.on" | Boolean | No | false |
public static final transient String TRACE_DB
Name | Type | Mutable | Default |
"java.util.logging.DbLogHandler.on" | Boolean | No | true |
public static final transient String TRACE_FILE_LIMIT
Name | Type | Mutable | Default | Minimum | Maximum |
"java.util.logging.FileHandler.limit" | Integer | No | 10000000 (10M) | 1000 | 1000000000 (1G) |
public static final transient String TRACE_FILE_COUNT
Name | Type | Mutable | Default | Minimum | Maximum |
"java.util.logging.FileHandler.count" | Integer | No | 10 | 1 | -none- |
public static final transient String TRACE_LEVEL
Name | Type | Mutable | Default |
"java.util.logging.level" | String | No | "INFO" |
public static final transient String CONSOLE_LOGGING_LEVEL
Setting this parameter in the je.properties file or through setConfigParam(java.lang.String, java.lang.String)
is analogous to setting
the property in the java.util.logging properties file or MBean.
It is preferred to use the standard java.util.logging mechanisms for
configuring java.util.logging.Handler, but this JE parameter is provided
because the java.util.logging API doesn't provide a method to set
handler levels programmatically.
Name | Type | Mutable | Default |
"com.sleepycat.je.util.ConsoleHandler.level" | String | No | "OFF" |
public static final transient String FILE_LOGGING_LEVEL
Setting this parameter in the je.properties file or through setConfigParam(java.lang.String, java.lang.String)
is analogous to setting
the property in the java.util.logging properties file or MBean.
It is preferred to use the standard java.util.logging mechanisms for
configuring java.util.logging.Handler, but this JE parameter is provided
because the java.util.logging APIs doesn't provide a method to set
handler levels programmatically.
Name | Type | Mutable | Default |
"com.sleepycat.je.util.FileHandler.level" | String | No | "INFO" |
public static final transient String TRACE_LEVEL_LOCK_MANAGER
Name | Type | Mutable | Default |
"java.util.logging.level.lockMgr" | String | No | "FINE" |
public static final transient String TRACE_LEVEL_RECOVERY
Name | Type | Mutable | Default |
"java.util.logging.level.recovery" | String | No | "FINE" |
public static final transient String TRACE_LEVEL_EVICTOR
Name | Type | Mutable | Default |
"java.util.logging.level.evictor" | String | No | "FINE" |
public static final transient String TRACE_LEVEL_CLEANER
Name | Type | Mutable | Default |
"java.util.logging.level.cleaner" | String | Yes | "FINE" |
public static final transient String STARTUP_DUMP_THRESHOLD
Name | Type | Mutable | Default | Minimum | Maximum |
"je.env.startupThreshold" | Duration | No | 5 min | 0 | none |
Constructor Detail |
---|
public EnvironmentConfig()
public EnvironmentConfig(Properties properties) throws IllegalArgumentException
properties
- Supported properties are described in this class
IllegalArgumentException
- If any properties read from the
properties param are invalid.Method Detail |
---|
public EnvironmentConfig setAllowCreate(boolean allowCreate)
allowCreate
- If true, the database environment is created if it
doesn't already exist.
public boolean getAllowCreate()
public EnvironmentConfig setLockTimeout(long timeout, TimeUnit unit) throws IllegalArgumentException
Equivalent to setting the je.lock.timeout parameter in the je.properties file.
timeout
- The lock timeout for all transactional and
non-transactional operations. A value of zero disables lock timeouts,
meaning that no lock wait time limit is enforced and a deadlocked
operation will block indefinitely. We strongly recommend that a large
timeout value, rather than zero, is used when deadlocks are not
expected. That way, a timeout exception will be thrown when an
unexpected deadlock occurs.unit
- the TimeUnit
of the timeout value. May be null only
if timeout is zero.
IllegalArgumentException
- if the value of timeout is invalidTransaction.setLockTimeout(long,TimeUnit)
public EnvironmentConfig setLockTimeout(long timeout) throws IllegalArgumentException
setLockTimeout(long,
TimeUnit)
.
setLockTimeout(long, TimeUnit.MICROSECONDS);
IllegalArgumentException
public long getLockTimeout(TimeUnit unit)
unit
- the TimeUnit
of the returned value. May not be null.
A value of 0 means no timeout is set.public long getLockTimeout()
getLockTimeout(TimeUnit)
.
getLockTimeout(TimeUnit.MICROSECONDS);
public EnvironmentConfig setReadOnly(boolean readOnly)
A read-only environment has several limitations and is recommended only in special circumstances. Note that there is no performance advantage to opening an environment read-only.
The primary reason for opening an environment read-only is to open a
single environment in multiple JVM processes. Only one JVM process at a
time may open the environment read-write. See EnvironmentLockedException
.
When the environment is open read-only, the following limitations apply.
DatabaseConfig.setReadOnly(boolean)
.For these reasons, it is recommended that a read-only environment be used only for short periods and for operations that are not performance critical or memory intensive. With few exceptions, all application functions that require access to a JE environment should be built into a single application so that they can be performed in the JVM process where the environment is open read-write.
In most applications, opening an environment read-only can and should be avoided.
readOnly
- If true, configure the database environment to be read
only, and any attempt to modify a database will fail.
public boolean getReadOnly()
This method may be called at any time during the life of the application.
public EnvironmentConfig setTransactional(boolean transactional)
This configuration option should be used when transactional guarantees such as atomicity of multiple operations and durability are important.
transactional
- If true, configure the database environment for
transactions.
public boolean getTransactional()
This method may be called at any time during the life of the application.
public EnvironmentConfig setLocking(boolean 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.
locking
- If false, configure the database environment for no
locking. The default is true.
public boolean getLocking()
This method may be called at any time during the life of the application.
public EnvironmentConfig setTxnTimeout(long timeout, TimeUnit unit) throws IllegalArgumentException
Equivalent to setting the je.txn.timeout parameter in the je.properties file.
timeout
- The transaction timeout. A value of 0 turns off
transaction timeouts.unit
- the TimeUnit
of the timeout value. May be null only
if timeout is zero.
IllegalArgumentException
- If the value of timeout is negativeTransaction.setTxnTimeout(long, java.util.concurrent.TimeUnit)
public EnvironmentConfig setTxnTimeout(long timeout) throws IllegalArgumentException
setTxnTimeout(long,
TimeUnit)
.
setTxnTimeout(long, TimeUnit.MICROSECONDS);
IllegalArgumentException
public long getTxnTimeout(TimeUnit unit)
A value of 0 means transaction timeouts are not configured.
unit
- the TimeUnit
of the returned value. May not be null.
public long getTxnTimeout()
getTxnTimeout(TimeUnit)
.
getTxnTimeout(TimeUnit.MICROSECONDS);
public EnvironmentConfig setTxnSerializableIsolation(boolean txnSerializableIsolation)
LockMode
public boolean getTxnSerializableIsolation()
LockMode
public EnvironmentConfig setSharedCache(boolean sharedCache)
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.
sharedCache
- If true, the shared cache is used by this
environment.
public boolean getSharedCache()
public EnvironmentConfig setNodeName(String nodeName)
public String getNodeName()
public EnvironmentConfig setLoggingHandler(Handler handler)
Handler
is not serializable, and the logging
handler should be set within the same process.
public Handler getLoggingHandler()
public EnvironmentConfig setConfigParam(String paramName, String value) throws IllegalArgumentException
EnvironmentMutableConfig
setConfigParam
in class EnvironmentMutableConfig
paramName
- the configuration parameter name, one of the String
constants in this classvalue
- The configuration value
IllegalArgumentException
- if the paramName or value is invalid.public EnvironmentConfig setRecoveryProgressListener(ProgressListener<RecoveryProgress> progressListener)
RecoveryProgress
for information about
those stages.
When using progress listeners, review the information at ProgressListener.progress(T, long, long)
to avoid any unintended disruption to
environment startup.
progressListener
- The ProgressListener to callback during
environment startup (recovery).public ProgressListener<RecoveryProgress> getRecoveryProgressListener()
public EnvironmentConfig setClassLoader(ClassLoader classLoader)
public ClassLoader getClassLoader()
public EnvironmentConfig clone()
public String toString()
toString
in class EnvironmentMutableConfig
|
Berkeley DB Java Edition version 5.0.34 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |