pub struct KeyspaceCreateOptions {
pub data_block_hash_ratio_policy: HashRatioPolicy,
/* private fields */
}Expand description
Options to configure a keyspace
Fields§
§data_block_hash_ratio_policy: HashRatioPolicyData block hash ratio
Implementations§
Source§impl CreateOptions
impl CreateOptions
Sourcepub fn with_kv_separation(self, opts: Option<KvSeparationOptions>) -> Self
pub fn with_kv_separation(self, opts: Option<KvSeparationOptions>) -> Self
Toggles key-value separation.
Sourcepub fn data_block_restart_interval_policy(
self,
policy: RestartIntervalPolicy,
) -> Self
pub fn data_block_restart_interval_policy( self, policy: RestartIntervalPolicy, ) -> Self
Sets the restart interval inside data blocks.
A higher restart interval saves space while increasing lookup times inside data blocks.
Default = 16
Sourcepub fn filter_block_pinning_policy(self, policy: PinningPolicy) -> Self
pub fn filter_block_pinning_policy(self, policy: PinningPolicy) -> Self
Sets the pinning policy for filter blocks.
By default, L0 filter blocks are pinned.
Sourcepub fn index_block_pinning_policy(self, policy: PinningPolicy) -> Self
pub fn index_block_pinning_policy(self, policy: PinningPolicy) -> Self
Sets the pinning policy for index blocks.
By default, L0 and L1 index blocks are pinned.
Sourcepub fn filter_block_partitioning_policy(
self,
policy: PartitioningPolicy,
) -> Self
pub fn filter_block_partitioning_policy( self, policy: PartitioningPolicy, ) -> Self
Sets the partitioning policy for filter blocks.
Sourcepub fn index_block_partitioning_policy(self, policy: PartitioningPolicy) -> Self
pub fn index_block_partitioning_policy(self, policy: PartitioningPolicy) -> Self
Sets the partitioning policy for index blocks.
Sourcepub fn filter_policy(self, policy: FilterPolicy) -> Self
pub fn filter_policy(self, policy: FilterPolicy) -> Self
Sets the filter policy for data blocks.
Sourcepub fn expect_point_read_hits(self, b: bool) -> Self
pub fn expect_point_read_hits(self, b: bool) -> Self
If true, the last level will not build filters, reducing the filter size of a database
by ~90% typically.
Enable this only if you know that point reads generally are expected to find a key-value pair.
Sourcepub fn data_block_compression_policy(self, policy: CompressionPolicy) -> Self
pub fn data_block_compression_policy(self, policy: CompressionPolicy) -> Self
Sets the compression policy for data blocks.
Sourcepub fn index_block_compression_policy(self, policy: CompressionPolicy) -> Self
pub fn index_block_compression_policy(self, policy: CompressionPolicy) -> Self
Sets the compression policy for index blocks.
Sourcepub fn compaction_strategy(
self,
compaction_strategy: Arc<dyn CompactionStrategy + Send + Sync>,
) -> Self
pub fn compaction_strategy( self, compaction_strategy: Arc<dyn CompactionStrategy + Send + Sync>, ) -> 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: u64) -> Self
pub fn max_memtable_size(self, bytes: u64) -> Self
Sets the maximum memtable size.
Default = 64 MiB
Recommended size 8 - 64 MiB, depending on how much memory is available.
Conversely, if max_memtable_size is larger than 64 MiB,
it may require increasing the database’s max_write_buffer_size.
Sourcepub fn data_block_size_policy(self, policy: BlockSizePolicy) -> Self
pub fn data_block_size_policy(self, policy: BlockSizePolicy) -> Self
Sets the block size.
Once set for a keyspace, 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 more space efficiency, block size between 16 - 64 KiB are sensible.
§Panics
Panics if the block size is smaller than 1 KiB or larger than 1 MiB.
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