Class BloomFilter
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class BloomFilter extends Filter
Bloom filter policy that uses a bloom filter with approximately the specified number of bits per key.Note: if you are using a custom comparator that ignores some parts of the keys being compared, you must not use this
BloomFilterand must provide your own FilterPolicy that also ignores the corresponding parts of the keys. For example, if the comparator ignores trailing spaces, it would be incorrect to use a FilterPolicy (likeBloomFilter) that does not ignore trailing spaces in keys.
-
-
Field Summary
-
Fields inherited from class org.rocksdb.RocksObject
nativeHandle_
-
Fields inherited from class org.rocksdb.AbstractImmutableNativeReference
owningHandle_
-
-
Constructor Summary
Constructors Constructor Description BloomFilter()BloomFilter constructorBloomFilter(double bitsPerKey)BloomFilter constructorBloomFilter(double bitsPerKey, boolean useBlockBasedMode)BloomFilter constructor
-
Method Summary
-
Methods inherited from class org.rocksdb.Filter
disposeInternal, disposeInternal
-
Methods inherited from class org.rocksdb.RocksObject
getNativeHandle
-
Methods inherited from class org.rocksdb.AbstractImmutableNativeReference
close, disOwnNativeHandle, isOwningHandle
-
Methods inherited from class org.rocksdb.AbstractNativeReference
dispose, finalize
-
-
-
-
Constructor Detail
-
BloomFilter
public BloomFilter()
BloomFilter constructorCallers must delete the result after any database that is using the result has been closed.
-
BloomFilter
public BloomFilter(double bitsPerKey)
BloomFilter constructorbits_per_key: bits per key in bloom filter. A good value for bits_per_key is 9.9, which yields a filter with ~ 1% false positive rate.
Callers must delete the result after any database that is using the result has been closed.
- Parameters:
bitsPerKey- number of bits to use
-
BloomFilter
public BloomFilter(double bitsPerKey, boolean useBlockBasedMode)BloomFilter constructorbits_per_key: bits per key in bloom filter. A good value for bits_per_key is 10, which yields a filter with ~ 1% false positive rate.
default bits_per_key: 10
use_block_based_builder: use block based filter rather than full filter. If you want to builder full filter, it needs to be set to false.
default mode: block based filter
Callers must delete the result after any database that is using the result has been closed.
- Parameters:
bitsPerKey- number of bits to useuseBlockBasedMode- use block based mode or full filter mode
-
-