pub struct WriteEngineConfig {
pub data_dir: PathBuf,
pub wal_dir: PathBuf,
pub memtable_flush_threshold: usize,
pub memtable_hard_limit: usize,
pub schema: TableSchema,
pub durability: Durability,
}Expand description
Write engine configuration
Fields§
§data_dir: PathBufDirectory for SSTable data files
wal_dir: PathBufDirectory for WAL files
memtable_flush_threshold: usizeMemtable flush threshold in bytes (default: 64MB)
memtable_hard_limit: usizeMemtable hard limit in bytes (default: 256MB) When this limit is reached, writes will fail with an error
schema: TableSchemaTable schema for column metadata
durability: DurabilityWAL durability mode (default: Durability::SyncEachWrite)
Implementations§
Source§impl WriteEngineConfig
impl WriteEngineConfig
Sourcepub const DEFAULT_FLUSH_THRESHOLD: usize
pub const DEFAULT_FLUSH_THRESHOLD: usize
Default flush threshold (64 MB)
Sourcepub const DEFAULT_HARD_LIMIT: usize
pub const DEFAULT_HARD_LIMIT: usize
Default hard limit (256 MB)
Sourcepub fn new(data_dir: PathBuf, wal_dir: PathBuf, schema: TableSchema) -> Self
pub fn new(data_dir: PathBuf, wal_dir: PathBuf, schema: TableSchema) -> Self
Create a new configuration with default flush threshold
Sourcepub fn with_flush_threshold(self, threshold: usize) -> Self
pub fn with_flush_threshold(self, threshold: usize) -> Self
Set a custom flush threshold
Sourcepub fn with_hard_limit(self, limit: usize) -> Self
pub fn with_hard_limit(self, limit: usize) -> Self
Set a custom hard limit
Sourcepub fn with_durability(self, durability: Durability) -> Self
pub fn with_durability(self, durability: Durability) -> Self
Set the WAL durability mode.
Mirrors with_flush_threshold in style. See Durability for the
trade-offs between Durability::SyncEachWrite (default, production)
and Durability::Disabled (bulk-load / benchmarking).
§Example
ⓘ
use cqlite_core::storage::write_engine::{Durability, WriteEngineConfig};
let config = WriteEngineConfig::new(data, wal, schema)
.with_durability(Durability::Disabled);Trait Implementations§
Source§impl Clone for WriteEngineConfig
impl Clone for WriteEngineConfig
Source§fn clone(&self) -> WriteEngineConfig
fn clone(&self) -> WriteEngineConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WriteEngineConfig
impl RefUnwindSafe for WriteEngineConfig
impl Send for WriteEngineConfig
impl Sync for WriteEngineConfig
impl Unpin for WriteEngineConfig
impl UnsafeUnpin for WriteEngineConfig
impl UnwindSafe for WriteEngineConfig
Blanket Implementations§
impl<T> Allocation for T
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
Mutably borrows from an owned value. Read more