pub struct Config {
pub buffer_size: u64,
pub rotate_threshold: f64,
pub fold_threads: Option<usize>,
}Expand description
Runtime configuration for a DonaDbX instance.
All fields have sensible defaults via Config::default(); most deployments
only need to override buffer_size to match available RAM.
§Example
use donadb_x::Config;
let cfg = Config {
buffer_size: 512 << 20, // 512 MiB segments
rotate_threshold: 0.75,
fold_threads: Some(4),
};Fields§
§buffer_size: u64Maximum size of a single log segment in bytes.
The active log is memory-mapped at this size on creation. When the fill
ratio reaches rotate_threshold, the segment
is sealed and a fresh one is opened.
Default: 2 GiB (2 << 30).
rotate_threshold: f64Fraction of buffer_size at which segment rotation
is triggered, expressed as a value in (0.0, 1.0].
Rotation is checked after every commit(). Once
write_offset / buffer_size >= rotate_threshold, the current segment is
sealed atomically and a new active log is created.
Default: 0.80 (rotate at 80 % full).
fold_threads: Option<usize>Number of threads used by the Rayon fold pool for post-commit hashing.
None lets the engine choose automatically (currently half of the
logical CPU count). Set an explicit value to bound CPU usage on
shared hosts.
Default: None (auto-detect).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more