Skip to main content

EngineConfig

Struct EngineConfig 

Source
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: PathBuf

Environment home directory.

All database files are stored in this directory.

§allow_create: bool

Whether to create the environment if it doesn’t exist.

§transactional: bool

Whether transactions are enabled.

When true, the transaction manager is active and all database operations can optionally be transactional.

§read_only: bool

Whether the environment is read-only.

Read-only environments cannot modify the database or log files.

§cache_size: u64

Maximum cache size in bytes.

Controls the memory budget for the in-memory B-tree cache.

§lock_table_count: u32

Maximum number of lock tables (shards).

Higher values reduce contention but increase memory overhead.

§lock_timeout_ms: u64

Lock timeout in milliseconds (0 = no timeout).

Maximum time to wait for a lock before timing out.

§txn_timeout_ms: u64

Transaction timeout in milliseconds (0 = no timeout).

Maximum time a transaction can run before timing out.

§evictor_enabled: bool

Whether to run the evictor daemon.

The evictor daemon runs in the background evicting nodes from the cache when memory budget is exceeded.

§cleaner_enabled: bool

Whether to run the cleaner daemon.

The cleaner daemon runs in the background performing log file garbage collection.

§checkpointer_enabled: bool

Whether to run the checkpointer daemon.

The checkpointer daemon runs in the background performing periodic checkpoints to bound recovery time.

§checkpoint_bytes_interval: u64

Checkpoint bytes interval.

A checkpoint is performed after approximately this many bytes have been written to the log (0 = disabled).

§cleaner_min_utilization: u32

Cleaner minimum utilization (0-100).

Log files below this utilization percentage are candidates for cleaning.

§cleaner_min_file_count: u32

Cleaner minimum file count.

The cleaner won’t run until at least this many log files exist.

§evictor_wakeup_interval_ms: u64

Evictor wakeup interval in milliseconds.

How often the evictor daemon wakes up to check if eviction is needed.

§cleaner_wakeup_interval_ms: u64

Cleaner wakeup interval in milliseconds.

How often the cleaner daemon wakes up to check if cleaning is needed.

§checkpointer_wakeup_interval_ms: u64

Checkpointer wakeup interval in milliseconds.

How often the checkpointer daemon wakes up to check if checkpoint is needed.

§log_file_max: u64

Maximum size of each log file in bytes (je.log.fileMax).

Range: 1 MB – 1 GB. Default: 10 MB.

§log_mem_only: bool

Whether 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: bool

Whether to verify checksums when reading log entries (je.log.checksumRead).

§log_total_buffer_bytes: u64

Total bytes to use for log write buffers (je.log.totalBufferBytes).

0 means compute automatically from max_memory.

§evictor_evict_bytes: u64

Number of bytes to evict per eviction pass (je.evictor.evictBytes).

Default: 512 KB.

§evictor_core_threads: u32

Number of evictor core threads (je.evictor.coreThreads).

§evictor_max_threads: u32

Maximum number of evictor threads (je.evictor.maxThreads).

§evictor_n_lru_lists: u32

Number of LRU lists for the evictor (je.evictor.nLRULists).

More lists reduce contention. Range: 1–32. Default: 4.

§cleaner_min_file_utilization: u32

Minimum per-file utilization (je.cleaner.minFileUtilization).

Files below this percentage are cleaned regardless of overall utilization. Range: 0–50. Default: 5.

§cleaner_threads: u32

Number of cleaner threads (je.cleaner.threads).

Default: 1.

§cleaner_lock_timeout_ms: u64

Lock timeout for cleaner operations in milliseconds (je.cleaner.lockTimeout).

Default: 500 ms.

§txn_serializable_isolation: bool

If true, all transactions use serializable isolation (je.txn.serializableIsolation).

§lock_deadlock_detect: bool

If true, deadlock detection is enabled (je.lock.deadlockDetect).

§checkpointer_high_priority: bool

If true, the checkpointer runs at high priority (je.checkpointer.highPriority).

Implementations§

Source§

impl EngineConfig

Source

pub fn new(home: impl Into<PathBuf>) -> Self

Create a new EngineConfig with the given home directory.

Source

pub fn allow_create(self, allow: bool) -> Self

Set whether to create the environment if it doesn’t exist.

Source

pub fn transactional(self, enabled: bool) -> Self

Set whether transactions are enabled.

Source

pub fn read_only(self, read_only: bool) -> Self

Set whether the environment is read-only.

Source

pub fn cache_size(self, size: u64) -> Self

Set the maximum cache size in bytes.

Source

pub fn lock_table_count(self, count: u32) -> Self

Set the number of lock table shards.

Source

pub fn lock_timeout_ms(self, timeout: u64) -> Self

Set the lock timeout in milliseconds.

Source

pub fn txn_timeout_ms(self, timeout: u64) -> Self

Set the transaction timeout in milliseconds.

Source

pub fn evictor_enabled(self, enabled: bool) -> Self

Enable or disable the evictor daemon.

Source

pub fn cleaner_enabled(self, enabled: bool) -> Self

Enable or disable the cleaner daemon.

Source

pub fn checkpointer_enabled(self, enabled: bool) -> Self

Enable or disable the checkpointer daemon.

Source

pub fn checkpoint_bytes_interval(self, bytes: u64) -> Self

Set the checkpoint bytes interval.

Source

pub fn cleaner_min_utilization(self, percent: u32) -> Self

Set the cleaner minimum utilization percentage.

Source

pub fn evictor_wakeup_interval_ms(self, ms: u64) -> Self

Set the evictor wakeup interval in milliseconds.

Source

pub fn cleaner_wakeup_interval_ms(self, ms: u64) -> Self

Set the cleaner wakeup interval in milliseconds.

Source

pub fn checkpointer_wakeup_interval_ms(self, ms: u64) -> Self

Set the checkpointer wakeup interval in milliseconds.

Source

pub fn log_file_max(self, bytes: u64) -> Self

Set the maximum log file size in bytes (je.log.fileMax).

Source

pub fn log_mem_only(self, mem_only: bool) -> Self

Enable or disable in-memory-only log (je.log.memOnly).

Source

pub fn log_checksum_read(self, enabled: bool) -> Self

Enable or disable log checksum verification on read (je.log.checksumRead).

Source

pub fn log_total_buffer_bytes(self, bytes: u64) -> Self

Set total log buffer bytes (je.log.totalBufferBytes). 0 = auto.

Source

pub fn evictor_evict_bytes(self, bytes: u64) -> Self

Set the number of bytes to evict per pass (je.evictor.evictBytes).

Source

pub fn evictor_core_threads(self, n: u32) -> Self

Set the number of evictor core threads (je.evictor.coreThreads).

Source

pub fn evictor_max_threads(self, n: u32) -> Self

Set the maximum number of evictor threads (je.evictor.maxThreads).

Source

pub fn evictor_n_lru_lists(self, n: u32) -> Self

Set the number of LRU lists for the evictor (je.evictor.nLRULists).

Source

pub fn cleaner_min_file_utilization(self, percent: u32) -> Self

Set the per-file minimum utilization (je.cleaner.minFileUtilization).

Source

pub fn cleaner_threads(self, n: u32) -> Self

Set the number of cleaner threads (je.cleaner.threads).

Source

pub fn cleaner_lock_timeout_ms(self, ms: u64) -> Self

Set the cleaner lock timeout in milliseconds (je.cleaner.lockTimeout).

Source

pub fn txn_serializable_isolation(self, enabled: bool) -> Self

Enable or disable serializable isolation for all transactions.

Source

pub fn lock_deadlock_detect(self, enabled: bool) -> Self

Enable or disable automatic deadlock detection.

Source

pub fn checkpointer_high_priority(self, enabled: bool) -> Self

Enable or disable high-priority checkpointing.

Source

pub fn validate(&self) -> Result<(), String>

Validate the configuration.

Returns an error if any configuration parameters are invalid.

Trait Implementations§

Source§

impl Clone for EngineConfig

Source§

fn clone(&self) -> EngineConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EngineConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EngineConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.