public class BloomFilter extends Object
Modifier and Type | Class and Description |
---|---|
class |
BloomFilter.BitSet
Bare metal bit set implementation.
|
Modifier and Type | Field and Description |
---|---|
protected BloomFilter.BitSet |
bitSet |
static double |
DEFAULT_FPP |
protected int |
numBits |
protected int |
numHashFunctions |
Constructor and Description |
---|
BloomFilter() |
BloomFilter(List<Long> bits,
int numBits,
int numFuncs)
A constructor to support rebuilding the BloomFilter from a serialized representation.
|
BloomFilter(long expectedEntries) |
BloomFilter(long expectedEntries,
double fpp) |
Modifier and Type | Method and Description |
---|---|
void |
add(byte[] val) |
void |
addBytes(byte[] val,
int offset,
int length) |
void |
addDouble(double val) |
void |
addLong(long val) |
void |
addString(String val) |
long[] |
getBitSet() |
int |
getBitSize() |
int |
getNumHashFunctions() |
void |
merge(BloomFilter that)
Merge the specified bloom filter with current bloom filter.
|
void |
reset() |
long |
sizeInBytes() |
boolean |
test(byte[] val) |
boolean |
testBytes(byte[] val,
int offset,
int length) |
boolean |
testDouble(double val) |
boolean |
testLong(long val) |
boolean |
testString(String val) |
String |
toString() |
public static final double DEFAULT_FPP
protected BloomFilter.BitSet bitSet
protected int numBits
protected int numHashFunctions
public BloomFilter()
public BloomFilter(long expectedEntries)
public BloomFilter(long expectedEntries, double fpp)
public void add(byte[] val)
public void addBytes(byte[] val, int offset, int length)
public void addString(String val)
public void addLong(long val)
public void addDouble(double val)
public boolean test(byte[] val)
public boolean testBytes(byte[] val, int offset, int length)
public boolean testString(String val)
public boolean testLong(long val)
public boolean testDouble(double val)
public long sizeInBytes()
public int getBitSize()
public int getNumHashFunctions()
public long[] getBitSet()
public void merge(BloomFilter that)
that
- - bloom filter to mergepublic void reset()
Copyright © 2016 The Apache Software Foundation. All rights reserved.