public interface IBloomFilter
Bloom filters give a 100% guarantee when reporting that a key was NOT found
but only a statistical guarantee when reporting that a key was found.
Therefore if either add(byte[])
or contains(byte[])
reports
true
then you MUST also test the data into order to determine
whether the response is a false positive.
Modifier and Type | Method and Description |
---|---|
boolean |
add(byte[] key)
Adds the key to the filter.
|
boolean |
contains(byte[] key)
Test the filter for the key a
true return DOES NOT
guarantee that the key has been added to the filter while a
false return guarantees that the key HAS NOT been added to
the filter. |
void |
falsePos()
Notify the bloom filter that a false positive was observed for a key that
for which
add(byte[]) reported true (the key was
in fact not in the index). |
boolean add(byte[] key)
key
- The key.true
iff the filter state was unchanged by the
incorporation of this key into the filter.IllegalArgumentException
- if key is null
.UnsupportedOperationException
- if the filter does not allow mutation.boolean contains(byte[] key)
true
return DOES NOT
guarantee that the key has been added to the filter while a
false
return guarantees that the key HAS NOT been added to
the filter.key
- The key.true
if the filter has either that key or some key
that is hash equivalent to that key using the hashing function
imposed by the filter; false
iff the filter can
guarantee that the key has not been added to the filter.IllegalArgumentException
- if key is null
.void falsePos()
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.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.