public final class NOPBloomFilter extends Object implements IBloomFilter
false (this means that you
must always check the index) and that does not permit anything to be added
and, in fact, has no state.| Modifier and Type | Field and Description |
|---|---|
static NOPBloomFilter |
INSTANCE |
| Constructor and Description |
|---|
NOPBloomFilter() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(byte[] key)
Adds the key to the filter.
|
boolean |
contains(byte[] key)
Returns
true. |
void |
falsePos()
Notify the bloom filter that a false positive was observed for a key that
for which
IBloomFilter.add(byte[]) reported true (the key was
in fact not in the index). |
boolean |
isEnabled()
Returns
true. |
public static final transient NOPBloomFilter INSTANCE
public boolean add(byte[] key)
IBloomFilteradd in interface IBloomFilterkey - The key.true iff the filter state was unchanged by the
incorporation of this key into the filter.UnsupportedOperationException - always.public boolean contains(byte[] key)
true.
Note: The NOP filter returns true because a
true return by a bloom filter means that you have to test
the data, which is how we achieve NOP semantics. If this method were to
return false then it would be claiming that the key was
not in the index!!!
contains in interface IBloomFilterkey - The key.true.public boolean isEnabled()
true.public void falsePos()
IBloomFilterIBloomFilter.add(byte[]) reported true (the key was
in fact not in the index). This method exists solely for reporting and
tracking the actual error rate of the bloom filter.falsePos in interface IBloomFilterCopyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.