pub struct PartitionCreateOptions { /* private fields */ }Expand description
Options to configure a partition
Implementations§
Source§impl CreateOptions
impl CreateOptions
Sourcepub fn compression(self, compression: CompressionType) -> Self
pub fn compression(self, compression: CompressionType) -> Self
Sets the compression method.
Once set for a partition, this property is not considered in the future.
Default = In order: Lz4 -> Miniz -> None, depending on compilation flags
Sourcepub fn compaction_strategy(
self,
compaction_strategy: CompactionStrategy,
) -> Self
pub fn compaction_strategy( self, compaction_strategy: CompactionStrategy, ) -> Self
Sets the compaction strategy.
Default = Leveled
Sourcepub fn manual_journal_persist(self, flag: bool) -> Self
pub fn manual_journal_persist(self, flag: bool) -> Self
If false, writes will flush data to the operating system.
Default = false
Set to true to handle persistence manually, e.g. manually using PersistMode::SyncData.
Sourcepub fn max_memtable_size(self, bytes: u32) -> Self
pub fn max_memtable_size(self, bytes: u32) -> Self
Sets the maximum memtable size.
Default = 16 MiB
Recommended size 8 - 64 MiB, depending on how much memory is available.
Note that the memory usage may temporarily be max_memtable_size * flush_worker_count
because of parallel flushing.
Use the keyspace’s max_write_buffer_size to cap global memory usage.
Conversely, if max_memtable_size is larger than 64 MiB,
it may require increasing the keyspace’s max_write_buffer_size.
Sourcepub fn block_size(self, block_size: u32) -> Self
pub fn block_size(self, block_size: u32) -> Self
Sets the block size.
Once set for a partition, this property is not considered in the future.
Default = 4 KiB
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 or larger than 512 KiB.
Sourcepub fn with_kv_separation(self, opts: KvSeparationOptions) -> Self
pub fn with_kv_separation(self, opts: KvSeparationOptions) -> Self
Enables key-value separation for this partition.
Key-value separation is intended for large value scenarios (1 KiB+ per KV). Large values will be separated into a log-structured value log, which heavily decreases compaction overhead at the cost of slightly higher read latency and higher temporary space usage. Also, garbage collection for deleted or outdated values becomes lazy, so GC needs to be triggered manually. See https://fjall-rs.github.io/post/announcing-fjall-2/#key-value-separation for more information.
Once set for a partition, this property is not considered in the future.
Default = disabled
Trait Implementations§
Source§impl Clone for CreateOptions
impl Clone for CreateOptions
Source§fn clone(&self) -> CreateOptions
fn clone(&self) -> CreateOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more