@InterfaceAudience.Public @InterfaceStability.Stable public final class RetouchedBloomFilter extends BloomFilter implements RemoveScheme
It allows the removal of selected false positives at the cost of introducing random false negatives, and with the benefit of eliminating some random false positives at the same time.
Originally created by European Commission One-Lab Project 034819.
The general behavior of a filter,
A Bloom filter,
The different selective clearing algorithms,
Retouched Bloom Filters: Allowing Networked Applications to Trade Off Selected False Positives Against False NegativesMAXIMUM_FP, MINIMUM_FN, RANDOM, RATIO| Constructor and Description |
|---|
RetouchedBloomFilter()
Default constructor - use with readFields
|
RetouchedBloomFilter(int vectorSize,
int nbHash,
int hashType)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(org.apache.hadoop.util.bloom.Key key)
Adds a key to this filter.
|
void |
addFalsePositive(Collection<org.apache.hadoop.util.bloom.Key> coll)
Adds a collection of false positive information to this retouched Bloom filter.
|
void |
addFalsePositive(org.apache.hadoop.util.bloom.Key key)
Adds a false positive information to this retouched Bloom filter.
|
void |
addFalsePositive(org.apache.hadoop.util.bloom.Key[] keys)
Adds an array of false positive information to this retouched Bloom filter.
|
void |
addFalsePositive(List<org.apache.hadoop.util.bloom.Key> keys)
Adds a list of false positive information to this retouched Bloom filter.
|
void |
readFields(DataInput in)
Deserialize the fields of this object from
in. |
void |
selectiveClearing(org.apache.hadoop.util.bloom.Key k,
short scheme)
Performs the selective clearing for a given key.
|
void |
write(DataOutput out)
Serialize the fields of this object to
out. |
and, getVectorSize, membershipTest, not, or, toString, xorpublic RetouchedBloomFilter()
public RetouchedBloomFilter(int vectorSize,
int nbHash,
int hashType)
vectorSize - The vector size of this filter.nbHash - The number of hash function to consider.hashType - type of the hashing function (see
Hash).public void add(org.apache.hadoop.util.bloom.Key key)
org.apache.hadoop.util.bloom.Filteradd in class BloomFilterkey - The key to add.public void addFalsePositive(org.apache.hadoop.util.bloom.Key key)
Invariant: if the false positive is null, nothing happens.
key - The false positive key to add.public void addFalsePositive(Collection<org.apache.hadoop.util.bloom.Key> coll)
coll - The collection of false positive.public void addFalsePositive(List<org.apache.hadoop.util.bloom.Key> keys)
keys - The list of false positive.public void addFalsePositive(org.apache.hadoop.util.bloom.Key[] keys)
keys - The array of false positive.public void selectiveClearing(org.apache.hadoop.util.bloom.Key k,
short scheme)
k - The false positive key to remove from this retouched Bloom filter.scheme - The selective clearing scheme to apply.public void write(DataOutput out) throws IOException
Writableout.write in interface Writablewrite in class BloomFilterout - DataOuput to serialize this object into.IOExceptionpublic void readFields(DataInput in) throws IOException
Writablein.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields in interface WritablereadFields in class BloomFilterin - DataInput to deseriablize this object from.IOExceptionCopyright © 2008–2022 Apache Software Foundation. All rights reserved.