pub struct Config { /* private fields */ }
Expand description
Tree configuration builder
Implementations§
source§impl Config
impl Config
sourcepub fn level_count(self, n: u8) -> Self
pub fn level_count(self, n: u8) -> Self
Sets the amount of levels of the LSM tree (depth of tree).
Defaults to 7, like LevelDB
and RocksDB
.
§Panics
Panics if n
is 0.
sourcepub fn level_ratio(self, n: u8) -> Self
pub fn level_ratio(self, n: u8) -> Self
Sets the size ratio between levels of the LSM tree (a.k.a. fanout, growth rate).
Defaults to 8.
§Panics
Panics if n
is less than 2.
sourcepub fn block_size(self, block_size: u32) -> Self
pub fn block_size(self, block_size: u32) -> Self
Sets the block size.
Defaults to 4 KiB (4096 bytes).
For point read heavy workloads (get) a sensible default is somewhere between 4 - 8 KiB, depending on the average value size.
For scan heavy workloads (range, prefix), use 16 - 64 KiB which also increases compression efficiency.
§Panics
Panics if the block size is smaller than 1 KiB (1024 bytes).
sourcepub fn block_cache(self, block_cache: Arc<BlockCache>) -> Self
pub fn block_cache(self, block_cache: Arc<BlockCache>) -> Self
Sets the block cache.
You can create a global BlockCache
and share it between multiple
trees to cap global cache memory usage.
Defaults to a block cache with 8 MiB of capacity per tree.
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)