pub struct EngineConfig {Show 31 fields
pub home: PathBuf,
pub allow_create: bool,
pub transactional: bool,
pub read_only: bool,
pub cache_size: u64,
pub lock_table_count: u32,
pub lock_timeout_ms: u64,
pub txn_timeout_ms: u64,
pub evictor_enabled: bool,
pub cleaner_enabled: bool,
pub checkpointer_enabled: bool,
pub checkpoint_bytes_interval: u64,
pub cleaner_min_utilization: u32,
pub cleaner_min_file_count: u32,
pub evictor_wakeup_interval_ms: u64,
pub cleaner_wakeup_interval_ms: u64,
pub checkpointer_wakeup_interval_ms: u64,
pub log_file_max: u64,
pub log_mem_only: bool,
pub log_checksum_read: bool,
pub log_total_buffer_bytes: u64,
pub evictor_evict_bytes: u64,
pub evictor_core_threads: u32,
pub evictor_max_threads: u32,
pub evictor_n_lru_lists: u32,
pub cleaner_min_file_utilization: u32,
pub cleaner_threads: u32,
pub cleaner_lock_timeout_ms: u64,
pub txn_serializable_isolation: bool,
pub lock_deadlock_detect: bool,
pub checkpointer_high_priority: bool,
}Expand description
Configuration for the Noxu DB engine.
Aggregates all configuration that affects environment behavior. This is the primary configuration structure for opening an environment.
Fields§
§home: PathBufEnvironment home directory.
All database files are stored in this directory.
allow_create: boolWhether to create the environment if it doesn’t exist.
transactional: boolWhether transactions are enabled.
When true, the transaction manager is active and all database operations can optionally be transactional.
read_only: boolWhether the environment is read-only.
Read-only environments cannot modify the database or log files.
cache_size: u64Maximum cache size in bytes.
Controls the memory budget for the in-memory B-tree cache.
lock_table_count: u32Maximum number of lock tables (shards).
Higher values reduce contention but increase memory overhead.
lock_timeout_ms: u64Lock timeout in milliseconds (0 = no timeout).
Maximum time to wait for a lock before timing out.
txn_timeout_ms: u64Transaction timeout in milliseconds (0 = no timeout).
Maximum time a transaction can run before timing out.
evictor_enabled: boolWhether to run the evictor daemon.
The evictor daemon runs in the background evicting nodes from the cache when memory budget is exceeded.
cleaner_enabled: boolWhether to run the cleaner daemon.
The cleaner daemon runs in the background performing log file garbage collection.
checkpointer_enabled: boolWhether to run the checkpointer daemon.
The checkpointer daemon runs in the background performing periodic checkpoints to bound recovery time.
checkpoint_bytes_interval: u64Checkpoint bytes interval.
A checkpoint is performed after approximately this many bytes have been written to the log (0 = disabled).
cleaner_min_utilization: u32Cleaner minimum utilization (0-100).
Log files below this utilization percentage are candidates for cleaning.
cleaner_min_file_count: u32Cleaner minimum file count.
The cleaner won’t run until at least this many log files exist.
evictor_wakeup_interval_ms: u64Evictor wakeup interval in milliseconds.
How often the evictor daemon wakes up to check if eviction is needed.
cleaner_wakeup_interval_ms: u64Cleaner wakeup interval in milliseconds.
How often the cleaner daemon wakes up to check if cleaning is needed.
checkpointer_wakeup_interval_ms: u64Checkpointer wakeup interval in milliseconds.
How often the checkpointer daemon wakes up to check if checkpoint is needed.
log_file_max: u64Maximum size of each log file in bytes (je.log.fileMax).
Range: 1 MB – 1 GB. Default: 10 MB.
log_mem_only: boolWhether the environment uses an in-memory log only (je.log.memOnly).
When true, no files are written and the log lives entirely in memory.
log_checksum_read: boolWhether to verify checksums when reading log entries (je.log.checksumRead).
log_total_buffer_bytes: u64Total bytes to use for log write buffers (je.log.totalBufferBytes).
0 means compute automatically from max_memory.
evictor_evict_bytes: u64Number of bytes to evict per eviction pass (je.evictor.evictBytes).
Default: 512 KB.
evictor_core_threads: u32Number of evictor core threads (je.evictor.coreThreads).
evictor_max_threads: u32Maximum number of evictor threads (je.evictor.maxThreads).
evictor_n_lru_lists: u32Number of LRU lists for the evictor (je.evictor.nLRULists).
More lists reduce contention. Range: 1–32. Default: 4.
cleaner_min_file_utilization: u32Minimum per-file utilization (je.cleaner.minFileUtilization).
Files below this percentage are cleaned regardless of overall utilization. Range: 0–50. Default: 5.
cleaner_threads: u32Number of cleaner threads (je.cleaner.threads).
Default: 1.
cleaner_lock_timeout_ms: u64Lock timeout for cleaner operations in milliseconds (je.cleaner.lockTimeout).
Default: 500 ms.
txn_serializable_isolation: boolIf true, all transactions use serializable isolation (je.txn.serializableIsolation).
lock_deadlock_detect: boolIf true, deadlock detection is enabled (je.lock.deadlockDetect).
checkpointer_high_priority: boolIf true, the checkpointer runs at high priority (je.checkpointer.highPriority).
Implementations§
Source§impl EngineConfig
impl EngineConfig
Sourcepub fn new(home: impl Into<PathBuf>) -> Self
pub fn new(home: impl Into<PathBuf>) -> Self
Create a new EngineConfig with the given home directory.
Sourcepub fn allow_create(self, allow: bool) -> Self
pub fn allow_create(self, allow: bool) -> Self
Set whether to create the environment if it doesn’t exist.
Sourcepub fn transactional(self, enabled: bool) -> Self
pub fn transactional(self, enabled: bool) -> Self
Set whether transactions are enabled.
Sourcepub fn cache_size(self, size: u64) -> Self
pub fn cache_size(self, size: u64) -> Self
Set the maximum cache size in bytes.
Sourcepub fn lock_table_count(self, count: u32) -> Self
pub fn lock_table_count(self, count: u32) -> Self
Set the number of lock table shards.
Sourcepub fn lock_timeout_ms(self, timeout: u64) -> Self
pub fn lock_timeout_ms(self, timeout: u64) -> Self
Set the lock timeout in milliseconds.
Sourcepub fn txn_timeout_ms(self, timeout: u64) -> Self
pub fn txn_timeout_ms(self, timeout: u64) -> Self
Set the transaction timeout in milliseconds.
Sourcepub fn evictor_enabled(self, enabled: bool) -> Self
pub fn evictor_enabled(self, enabled: bool) -> Self
Enable or disable the evictor daemon.
Sourcepub fn cleaner_enabled(self, enabled: bool) -> Self
pub fn cleaner_enabled(self, enabled: bool) -> Self
Enable or disable the cleaner daemon.
Sourcepub fn checkpointer_enabled(self, enabled: bool) -> Self
pub fn checkpointer_enabled(self, enabled: bool) -> Self
Enable or disable the checkpointer daemon.
Sourcepub fn checkpoint_bytes_interval(self, bytes: u64) -> Self
pub fn checkpoint_bytes_interval(self, bytes: u64) -> Self
Set the checkpoint bytes interval.
Sourcepub fn cleaner_min_utilization(self, percent: u32) -> Self
pub fn cleaner_min_utilization(self, percent: u32) -> Self
Set the cleaner minimum utilization percentage.
Sourcepub fn evictor_wakeup_interval_ms(self, ms: u64) -> Self
pub fn evictor_wakeup_interval_ms(self, ms: u64) -> Self
Set the evictor wakeup interval in milliseconds.
Sourcepub fn cleaner_wakeup_interval_ms(self, ms: u64) -> Self
pub fn cleaner_wakeup_interval_ms(self, ms: u64) -> Self
Set the cleaner wakeup interval in milliseconds.
Sourcepub fn checkpointer_wakeup_interval_ms(self, ms: u64) -> Self
pub fn checkpointer_wakeup_interval_ms(self, ms: u64) -> Self
Set the checkpointer wakeup interval in milliseconds.
Sourcepub fn log_file_max(self, bytes: u64) -> Self
pub fn log_file_max(self, bytes: u64) -> Self
Set the maximum log file size in bytes (je.log.fileMax).
Sourcepub fn log_mem_only(self, mem_only: bool) -> Self
pub fn log_mem_only(self, mem_only: bool) -> Self
Enable or disable in-memory-only log (je.log.memOnly).
Sourcepub fn log_checksum_read(self, enabled: bool) -> Self
pub fn log_checksum_read(self, enabled: bool) -> Self
Enable or disable log checksum verification on read (je.log.checksumRead).
Sourcepub fn log_total_buffer_bytes(self, bytes: u64) -> Self
pub fn log_total_buffer_bytes(self, bytes: u64) -> Self
Set total log buffer bytes (je.log.totalBufferBytes). 0 = auto.
Sourcepub fn evictor_evict_bytes(self, bytes: u64) -> Self
pub fn evictor_evict_bytes(self, bytes: u64) -> Self
Set the number of bytes to evict per pass (je.evictor.evictBytes).
Sourcepub fn evictor_core_threads(self, n: u32) -> Self
pub fn evictor_core_threads(self, n: u32) -> Self
Set the number of evictor core threads (je.evictor.coreThreads).
Sourcepub fn evictor_max_threads(self, n: u32) -> Self
pub fn evictor_max_threads(self, n: u32) -> Self
Set the maximum number of evictor threads (je.evictor.maxThreads).
Sourcepub fn evictor_n_lru_lists(self, n: u32) -> Self
pub fn evictor_n_lru_lists(self, n: u32) -> Self
Set the number of LRU lists for the evictor (je.evictor.nLRULists).
Sourcepub fn cleaner_min_file_utilization(self, percent: u32) -> Self
pub fn cleaner_min_file_utilization(self, percent: u32) -> Self
Set the per-file minimum utilization (je.cleaner.minFileUtilization).
Sourcepub fn cleaner_threads(self, n: u32) -> Self
pub fn cleaner_threads(self, n: u32) -> Self
Set the number of cleaner threads (je.cleaner.threads).
Sourcepub fn cleaner_lock_timeout_ms(self, ms: u64) -> Self
pub fn cleaner_lock_timeout_ms(self, ms: u64) -> Self
Set the cleaner lock timeout in milliseconds (je.cleaner.lockTimeout).
Sourcepub fn txn_serializable_isolation(self, enabled: bool) -> Self
pub fn txn_serializable_isolation(self, enabled: bool) -> Self
Enable or disable serializable isolation for all transactions.
Sourcepub fn lock_deadlock_detect(self, enabled: bool) -> Self
pub fn lock_deadlock_detect(self, enabled: bool) -> Self
Enable or disable automatic deadlock detection.
Sourcepub fn checkpointer_high_priority(self, enabled: bool) -> Self
pub fn checkpointer_high_priority(self, enabled: bool) -> Self
Enable or disable high-priority checkpointing.
Trait Implementations§
Source§impl Clone for EngineConfig
impl Clone for EngineConfig
Source§fn clone(&self) -> EngineConfig
fn clone(&self) -> EngineConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more