|
Berkeley DB Java Edition version 1.5.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sleepycat.je.EnvironmentMutableConfig
Specifies the environment attributes that may be changed after the environment
has been opened. EnvironmentMutableConfig is a parameter to Environment.setMutableConfig(com.sleepycat.je.EnvironmentMutableConfig)
and is returned by Environment.getMutableConfig()
.
There are two types of mutable environment properties: per-environment handle properties, and environment wide properties.
Per-environment handle properties apply only to a single Environment instance. For example, to change the default transaction commit behavior for a single environment handle, do this:
// Specify no-sync behavior for a given handle. EnvironmentMutableConfig mutableConfig = myEnvHandle.getMutableConfig(); mutableConfig.setTxnNoSync(true); myEnvHandle.setMutableConfig(mutableConfig);
Currently the only per-environment handle property is TxnNoSync, which may be changed as described above.
Environment-wide mutable properties are those that can be changed for an environment as a whole, irrespective of which environment instance (for the same physical environment) is used. For example, to stop the cleaner daemon thread, do this:
// Stop the cleaner daemon thread for the environment. EnvironmentMutableConfig mutableConfig = myEnvHandle.getMutableConfig(); mutableConfig.setConfigParam("je.env.runCleaner", "false"); myEnvHandle.setMutableConfig(mutableConfig);
Currently the environment-wide mutable properties are:
Constructor Summary | |
EnvironmentMutableConfig()
An instance created using the default constructor is initialized with the system's default settings. |
Method Summary | |
String |
getConfigParam(String configParamName)
Return the value for this configuration parameter. |
boolean |
getTxnNoSync()
Return if the database environment is configured for asynchronous transactions. |
void |
setConfigParam(String configParamName,
String value)
Validate the value prescribed for the configuration parameter; if it is valid, the value is set in the configuration. |
void |
setTxnNoSync(boolean txnNoSync)
Configure the database environment for asynchronous transactions. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EnvironmentMutableConfig()
Method Detail |
public void setTxnNoSync(boolean txnNoSync)
txnNoSync
- If true, do not write or synchronously flush the log on transaction
commit. This means that transactions exhibit the ACI (Atomicity,
Consistency, and Isolation) properties, but not D (Durability); that
is, database integrity is maintained, but if the application or
system fails, it is possible some number of the most recently
committed transactions may be undone during recovery. The number of
transactions at risk is governed by how many updates fit into a log
buffer, how often the operating system flushes dirty buffers to
disk, and how often the database environment is checkpointed.
This attribute is false by default for this class and for the database environment.
DatabaseException
- if a failure occurs.public boolean getTxnNoSync()
public void setConfigParam(String configParamName, String value) throws IllegalArgumentException
configParamName
- The name of the configuration parameter. See the sample je.properties
file for descriptions of all parameters.
value
- The value for this configuration parameter.
IllegalArgumentException
- if an invalid parameter was specified.
DatabaseException
- if a failure occurs.public String getConfigParam(String configParamName) throws IllegalArgumentException
configParamName
- Name of the requested parameter.
IllegalArgumentException
- if the configParamName is invalid.
|
Berkeley DB Java Edition version 1.5.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |