pub struct SstPartitionerFactory { /* private fields */ }Expand description
A factory RocksDB asks for a partitioner at the start of every compaction.
Install one with
Options::set_sst_partitioner_factory.
The setter copies the underlying shared_ptr, so a factory can be installed
on any number of Options and dropped as soon as the last call returns.
Implementations§
Source§impl SstPartitionerFactory
impl SstPartitionerFactory
Sourcepub fn fixed_prefix(prefix_len: usize) -> Self
pub fn fixed_prefix(prefix_len: usize) -> Self
Cuts a new SST file whenever the first prefix_len bytes of the user
key change.
Keys shorter than prefix_len are compared whole, so a short key only
groups with keys that share all of it. prefix_len of 0 makes every key
compare equal and never forces a cut, which is the same as installing no
partitioner.
The comparison is over raw bytes of the user key and ignores the column
family comparator, so this is a fit for fixed width prefixes such as a
tenant id, not for prefixes an application defines through a
SliceTransform.
Wraps NewSstPartitionerFixedPrefixFactory.