pub struct Config {Show 16 fields
pub level_count: u8,
pub data_block_compression_policy: CompressionPolicy,
pub index_block_compression_policy: CompressionPolicy,
pub data_block_restart_interval_policy: RestartIntervalPolicy,
pub index_block_restart_interval_policy: RestartIntervalPolicy,
pub data_block_size_policy: BlockSizePolicy,
pub index_block_pinning_policy: PinningPolicy,
pub filter_block_pinning_policy: PinningPolicy,
pub top_level_index_block_pinning_policy: PinningPolicy,
pub top_level_filter_block_pinning_policy: PinningPolicy,
pub data_block_hash_ratio_policy: HashRatioPolicy,
pub index_block_partitioning_policy: PartioningPolicy,
pub filter_block_partitioning_policy: PartioningPolicy,
pub index_block_partition_size_policy: BlockSizePolicy,
pub filter_block_partition_size_policy: BlockSizePolicy,
pub filter_policy: FilterPolicy,
/* private fields */
}Expand description
Tree configuration builder
Fields§
§level_count: u8Number of levels of the LSM tree (depth of tree)
Once set, the level count is fixed (in the “manifest” file)
data_block_compression_policy: CompressionPolicyWhat type of compression is used for data blocks
index_block_compression_policy: CompressionPolicyWhat type of compression is used for index blocks
data_block_restart_interval_policy: RestartIntervalPolicyRestart interval inside data blocks
index_block_restart_interval_policy: RestartIntervalPolicyRestart interval inside index blocks
data_block_size_policy: BlockSizePolicyBlock size of data blocks
index_block_pinning_policy: PinningPolicyWhether to pin index blocks
filter_block_pinning_policy: PinningPolicyWhether to pin filter blocks
top_level_index_block_pinning_policy: PinningPolicyWhether to pin top level index of partitioned index
top_level_filter_block_pinning_policy: PinningPolicyWhether to pin top level index of partitioned filter
data_block_hash_ratio_policy: HashRatioPolicyData block hash ratio
index_block_partitioning_policy: PartioningPolicyWhether to partition index blocks
filter_block_partitioning_policy: PartioningPolicyWhether to partition filter blocks
index_block_partition_size_policy: BlockSizePolicyPartition size when using partitioned indexes
filter_block_partition_size_policy: BlockSizePolicyPartition size when using partitioned filters
filter_policy: FilterPolicyFilter construction policy
Implementations§
Source§impl Config
impl Config
Sourcepub fn use_cache(self, cache: Arc<Cache>) -> Self
pub fn use_cache(self, cache: Arc<Cache>) -> Self
Sets the global cache.
You can create a global Cache and share it between multiple
trees to cap global cache memory usage.
Defaults to a cache with 16 MiB of capacity per tree.
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 filter_block_partitioning_policy(self, policy: PinningPolicy) -> Self
pub fn filter_block_partitioning_policy(self, policy: PinningPolicy) -> Self
Sets the partitioning policy for filter blocks.
Sourcepub fn index_block_partitioning_policy(self, policy: PinningPolicy) -> Self
pub fn index_block_partitioning_policy(self, policy: PinningPolicy) -> Self
Sets the partitioning policy for index blocks.
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.
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.
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_policy(self, policy: FilterPolicy) -> Self
pub fn filter_policy(self, policy: FilterPolicy) -> Self
Sets the filter construction policy.
Sourcepub fn data_block_compression_policy(self, policy: CompressionPolicy) -> Self
pub fn data_block_compression_policy(self, policy: CompressionPolicy) -> Self
Sets the compression method 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 method for index blocks.
Sourcepub fn data_block_size_policy(self, policy: BlockSizePolicy) -> Self
pub fn data_block_size_policy(self, policy: BlockSizePolicy) -> Self
Sets the data block size policy.
Sourcepub fn data_block_hash_ratio_policy(self, policy: HashRatioPolicy) -> Self
pub fn data_block_hash_ratio_policy(self, policy: HashRatioPolicy) -> Self
Sets the hash ratio policy for data blocks.
If greater than 0.0, a hash index is embedded into data blocks that can speed up reads inside the data block.
Sourcepub fn with_kv_separation(self, opts: Option<KvSeparationOptions>) -> Self
pub fn with_kv_separation(self, opts: Option<KvSeparationOptions>) -> Self
Toggles key-value separation.