pub struct Config { /* private fields */ }Expand description
Global keyspace configuration
Implementations§
source§impl Config
impl Config
sourcepub fn manual_journal_persist(self, flag: bool) -> Self
pub fn manual_journal_persist(self, flag: bool) -> Self
If false, write batches or transactions automatically flush data to the operating system.
Default = false
Set to true to handle persistence manually, e.g. manually using PersistMode::SyncData for ACID transactions.
sourcepub fn flush_workers(self, n: usize) -> Self
pub fn flush_workers(self, n: usize) -> Self
Sets the amount of flush workers
Default = # CPU cores
sourcepub fn compaction_workers(self, n: usize) -> Self
pub fn compaction_workers(self, n: usize) -> Self
Sets the amount of compaction workers
Default = # CPU cores
sourcepub fn max_open_files(self, n: usize) -> Self
pub fn max_open_files(self, n: usize) -> Self
sourcepub fn block_cache(self, block_cache: Arc<BlockCache>) -> Self
pub fn block_cache(self, block_cache: Arc<BlockCache>) -> Self
Sets the block cache.
Defaults to a block cache with 16 MiB of capacity shared between all partitions inside this keyspace.
sourcepub fn blob_cache(self, blob_cache: Arc<BlobCache>) -> Self
pub fn blob_cache(self, blob_cache: Arc<BlobCache>) -> Self
Sets the blob cache.
Defaults to a block cache with 16 MiB of capacity shared between all partitions inside this keyspace.
sourcepub fn max_journaling_size(self, bytes: u64) -> Self
pub fn max_journaling_size(self, bytes: u64) -> Self
Max size of all journals in bytes.
Default = 512 MiB
§Panics
Panics if bytes < 24 MiB.
This option should be at least 24 MiB, as one journal takes up at least 16 MiB, so anything less will immediately stall the system.
Same as max_total_wal_size in RocksDB.
sourcepub fn max_write_buffer_size(self, bytes: u64) -> Self
pub fn max_write_buffer_size(self, bytes: u64) -> Self
Max size of all memtables in bytes.
Similar to db_write_buffer_size in RocksDB, however it is disabled by default in RocksDB.
Set to u64::MAX to disable it.
Default = 64 MiB
§Panics
Panics if bytes < 1 MiB.
sourcepub fn fsync_ms(self, ms: Option<u16>) -> Self
pub fn fsync_ms(self, ms: Option<u16>) -> Self
If Some, starts an fsync thread that asynchronously persists data.
Default = 1 second
§Panics
Panics if ms is 0
sourcepub fn open_transactional(self) -> Result<TxKeyspace>
pub fn open_transactional(self) -> Result<TxKeyspace>
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 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)