public class AdaptiveBlockSplitBloomFilter extends Object implements BloomFilter
| Modifier and Type | Class and Description |
|---|---|
protected class |
AdaptiveBlockSplitBloomFilter.BloomFilterCandidate |
BloomFilter.Algorithm, BloomFilter.Compression, BloomFilter.HashStrategy| Constructor and Description |
|---|
AdaptiveBlockSplitBloomFilter(int maximumBytes,
BloomFilter.HashStrategy hashStrategy,
double fpp,
int numCandidates,
ColumnDescriptor column) |
AdaptiveBlockSplitBloomFilter(int maximumBytes,
int numCandidates,
double fpp,
ColumnDescriptor column) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
findHash(long hash)
Determine whether an element is in set or not.
|
BloomFilter.Algorithm |
getAlgorithm()
Return the algorithm that the bloom filter apply.
|
int |
getBitsetSize()
Get the number of bytes for bitset in this Bloom filter.
|
protected List<AdaptiveBlockSplitBloomFilter.BloomFilterCandidate> |
getCandidates() |
BloomFilter.Compression |
getCompression()
Return the compress algorithm that the bloom filter apply.
|
BloomFilter.HashStrategy |
getHashStrategy()
Return the hash strategy that the bloom filter apply.
|
long |
hash(Binary value)
Compute hash for Binary value by using its plain encoding result.
|
long |
hash(double value)
Compute hash for double value by using its plain encoding result.
|
long |
hash(float value)
Compute hash for float value by using its plain encoding result.
|
long |
hash(int value)
Compute hash for int value by using its plain encoding result.
|
long |
hash(long value)
Compute hash for long value by using its plain encoding result.
|
long |
hash(Object value)
Compute hash for Object value by using its plain encoding result.
|
void |
insertHash(long hash)
Insert an element to the multiple bloom filter candidates and remove the bad candidate
if the number of distinct values exceeds its expected size.
|
protected AdaptiveBlockSplitBloomFilter.BloomFilterCandidate |
optimalCandidate()
Used at the end of the insertion, select the candidate of the smallest size.
|
void |
writeTo(OutputStream out)
Write the Bloom filter to an output stream.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcanMergeFrom, equals, mergepublic AdaptiveBlockSplitBloomFilter(int maximumBytes,
int numCandidates,
double fpp,
ColumnDescriptor column)
maximumBytes - the maximum bytes size of candidatenumCandidates - the number of candidatesfpp - the false positive probabilitypublic AdaptiveBlockSplitBloomFilter(int maximumBytes,
BloomFilter.HashStrategy hashStrategy,
double fpp,
int numCandidates,
ColumnDescriptor column)
protected AdaptiveBlockSplitBloomFilter.BloomFilterCandidate optimalCandidate()
protected List<AdaptiveBlockSplitBloomFilter.BloomFilterCandidate> getCandidates()
public void writeTo(OutputStream out) throws IOException
BloomFilterwriteTo in interface BloomFilterout - the output stream to writeIOExceptionpublic void insertHash(long hash)
insertHash in interface BloomFilterhash - the hash result of element.public int getBitsetSize()
BloomFiltergetBitsetSize in interface BloomFilterpublic boolean findHash(long hash)
BloomFilterfindHash in interface BloomFilterhash - the hash value of element plain encoding result.public long hash(Object value)
BloomFilterhash in interface BloomFiltervalue - the value to hashpublic BloomFilter.HashStrategy getHashStrategy()
BloomFiltergetHashStrategy in interface BloomFilterpublic BloomFilter.Algorithm getAlgorithm()
BloomFiltergetAlgorithm in interface BloomFilterpublic BloomFilter.Compression getCompression()
BloomFiltergetCompression in interface BloomFilterpublic long hash(int value)
BloomFilterhash in interface BloomFiltervalue - the value to hashpublic long hash(long value)
BloomFilterhash in interface BloomFiltervalue - the value to hashpublic long hash(double value)
BloomFilterhash in interface BloomFiltervalue - the value to hashpublic long hash(float value)
BloomFilterhash in interface BloomFiltervalue - the value to hashpublic long hash(Binary value)
BloomFilterhash in interface BloomFiltervalue - the value to hashCopyright © 2023 The Apache Software Foundation. All rights reserved.