Class SstPartitionerFactory
- Namespace
- RocksDbNet
- Assembly
- RocksDb.Net.dll
Forces SST file boundaries to fall on key-prefix boundaries. Maps to
rocksdb_sst_partitioner_factory_t.
public sealed class SstPartitionerFactory : RocksDbHandle, IDisposable
- Inheritance
-
SstPartitionerFactory
- Implements
- Inherited Members
Remarks
Without a partitioner, a compaction splits files wherever the size target falls, so one prefix's data can straddle several files and each file can hold several prefixes. That makes prefix-scoped work less effective: a range delete over one prefix cannot drop whole files, and a prefix scan touches more files than it needs.
Attach with SstPartitionerFactory. RocksDb takes a shared reference, so this object may be disposed once assigned.
Methods
CreateFixedPrefix(int)
Creates a factory that partitions on the first
prefixLength bytes of each key.
public static SstPartitionerFactory CreateFixedPrefix(int prefixLength)
Parameters
prefixLengthintHow many leading bytes make up the prefix. Must be greater than zero.
Returns
DisposeHandle()
Releases the native handle. Called during disposal.
protected override void DisposeHandle()
Remarks
Protected rather than public: it destroys the native object without marking this instance disposed or clearing the handle, so calling it from outside and then disposing normally would free the same pointer twice. It was the most Dispose-looking member on the type. Callers want Dispose().