pub struct EnvironmentMutableConfig {
pub cache_size: Option<usize>,
pub durability: Option<Durability>,
pub txn_no_sync: bool,
pub txn_write_no_sync: bool,
pub run_cleaner: Option<bool>,
pub run_checkpointer: Option<bool>,
pub run_evictor: Option<bool>,
pub lock_timeout_ms: Option<u64>,
pub txn_timeout_ms: Option<u64>,
}Expand description
The subset of environment properties that can be changed after the environment has been opened.
Obtain via Environment::get_mutable_config
and apply via Environment::set_mutable_config.
Implements EnvironmentMutableConfig.
§Example
let mut cfg = env.get_mutable_config()?;
cfg.cache_size = Some(256 * 1024 * 1024); // 256 MiB
env.set_mutable_config(cfg)?;Fields§
§cache_size: Option<usize>Override the B-tree cache size in bytes. None means unchanged.
Implements EnvironmentMutableConfig.setCacheSize().
durability: Option<Durability>Override the default transaction durability for this environment.
None means unchanged.
Implements EnvironmentMutableConfig.setDurability().
txn_no_sync: boolIf true, committed transactions do not flush to disk (no-sync).
Deprecated since 2.4.1 — use durability
with Durability::commit_no_sync() instead.
txn_write_no_sync: boolIf true, committed transactions flush to the OS buffer but do not
call fdatasync (write-no-sync).
Deprecated since 2.4.1 — use durability
with Durability::commit_write_no_sync() instead.
run_cleaner: Option<bool>Enable or disable the cleaner daemon. None means unchanged.
run_checkpointer: Option<bool>Enable or disable the checkpointer daemon. None means unchanged.
run_evictor: Option<bool>Enable or disable the evictor daemon. None means unchanged.
lock_timeout_ms: Option<u64>Lock timeout in milliseconds. None means unchanged.
To explicitly clear a previously-configured timeout, set
Some(0) (which JE interprets as “no timeout”). v1.5.0 used a
u64 with 0 as the unchanged sentinel which made it
impossible to clear a timeout; see
(Transaction-Env F19/F20).
txn_timeout_ms: Option<u64>Transaction timeout in milliseconds. None means unchanged.
Some(0) clears any previously-configured timeout.
Implementations§
Source§impl EnvironmentMutableConfig
impl EnvironmentMutableConfig
Sourcepub fn with_cache_size(self, bytes: usize) -> Self
pub fn with_cache_size(self, bytes: usize) -> Self
Sets the cache size override.
Sourcepub fn with_durability(self, durability: Durability) -> Self
pub fn with_durability(self, durability: Durability) -> Self
Sets the durability override.
Sourcepub fn with_txn_no_sync(self, no_sync: bool) -> Self
👎Deprecated since 2.4.1: use with_durability(Durability::commit_no_sync()) instead
pub fn with_txn_no_sync(self, no_sync: bool) -> Self
use with_durability(Durability::commit_no_sync()) instead
Sets the txn_no_sync flag.
Deprecated — use
with_durability with
Durability::commit_no_sync() instead.
Sourcepub fn with_txn_write_no_sync(self, write_no_sync: bool) -> Self
👎Deprecated since 2.4.1: use with_durability(Durability::commit_write_no_sync()) instead
pub fn with_txn_write_no_sync(self, write_no_sync: bool) -> Self
use with_durability(Durability::commit_write_no_sync()) instead
Sets the txn_write_no_sync flag.
Deprecated — use
with_durability with
Durability::commit_write_no_sync() instead.
Sourcepub fn with_run_cleaner(self, run: bool) -> Self
pub fn with_run_cleaner(self, run: bool) -> Self
Enables/disables the cleaner daemon.
Sourcepub fn with_run_checkpointer(self, run: bool) -> Self
pub fn with_run_checkpointer(self, run: bool) -> Self
Enables/disables the checkpointer daemon.
Sourcepub fn with_run_evictor(self, run: bool) -> Self
pub fn with_run_evictor(self, run: bool) -> Self
Enables/disables the evictor daemon.
Sourcepub fn with_lock_timeout_ms(self, ms: Option<u64>) -> Self
pub fn with_lock_timeout_ms(self, ms: Option<u64>) -> Self
Sets the lock timeout (milliseconds).
Pass Some(0) to clear a previously-configured timeout, or
None to leave it unchanged.
Sourcepub fn with_txn_timeout_ms(self, ms: Option<u64>) -> Self
pub fn with_txn_timeout_ms(self, ms: Option<u64>) -> Self
Sets the transaction timeout (milliseconds).
Pass Some(0) to clear a previously-configured timeout, or
None to leave it unchanged.
Trait Implementations§
Source§impl Clone for EnvironmentMutableConfig
impl Clone for EnvironmentMutableConfig
Source§fn clone(&self) -> EnvironmentMutableConfig
fn clone(&self) -> EnvironmentMutableConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more