Table of Contents

Class FilterPolicy

Namespace
RocksDbNet
Assembly
RocksDb.Net.dll

A bloom filter or ribbon filter policy for block-based tables. Maps to rocksdb_filterpolicy_t.

public sealed class FilterPolicy : RocksDbHandle, IDisposable
Inheritance
FilterPolicy
Implements
Inherited Members

Methods

CreateBloomFull(double)

Creates a Bloom filter policy.

public static FilterPolicy CreateBloomFull(double bitsPerKey)

Parameters

bitsPerKey double

Returns

FilterPolicy

Remarks

There was a CreateBloom beside this one, documented as the legacy on-disk format against this one as the current format. That difference was not real: RocksDb stopped honouring the parameter that chose between them in version 7.0, and measured over 500 keys the two produced the same policy name and byte-identical files. Keeping both would have been an invitation to think about a choice that does not exist.

Nothing here relates to partitioning, which is PartitionFilters.

CreateRibbon(double)

Creates a Ribbon filter.

public static FilterPolicy CreateRibbon(double bloomEquivalentBitsPerKey)

Parameters

bloomEquivalentBitsPerKey double

Returns

FilterPolicy

CreateRibbonHybrid(double, int)

Creates a Ribbon filter that falls back to Bloom for SST files at or below bloomBeforeLevel.

public static FilterPolicy CreateRibbonHybrid(double bloomEquivalentBitsPerKey, int bloomBeforeLevel = 0)

Parameters

bloomEquivalentBitsPerKey double
bloomBeforeLevel int

Returns

FilterPolicy

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().