public class BloomFilter extends Object
Constructor and Description |
---|
BloomFilter(DrillBuf byteBuf) |
BloomFilter(int numBytes,
BufferAllocator bufferAllocator) |
BloomFilter(int ndv,
double fpp,
BufferAllocator bufferAllocator) |
Modifier and Type | Method and Description |
---|---|
static int |
adjustByteSize(int numBytes) |
boolean |
find(long hash)
Determine whether an element is set or not.
|
DrillBuf |
getContent() |
void |
insert(long hash)
Add an element's hash value to this bloom filter.
|
static int |
optimalNumOfBytes(long ndv,
double fpp)
Calculate optimal size according to the number of distinct values and false positive probability.
|
void |
or(BloomFilter other)
Merge this bloom filter with other one
|
public BloomFilter(int numBytes, BufferAllocator bufferAllocator)
public BloomFilter(int ndv, double fpp, BufferAllocator bufferAllocator)
public BloomFilter(DrillBuf byteBuf)
public static int adjustByteSize(int numBytes)
public void insert(long hash)
hash
- hash result of element.public boolean find(long hash)
hash
- the hash value of element.public void or(BloomFilter other)
other
- other bloom filterpublic static int optimalNumOfBytes(long ndv, double fpp)
ndv
- The number of distinct values.fpp
- The false positive probability.public DrillBuf getContent()
Copyright © 1970 The Apache Software Foundation. All rights reserved.