com.bigdata.btree
Interface IBloomFilter

All Known Implementing Classes:
BloomFilter, FusedView.FusedBloomFilter, NOPBloomFilter

public interface IBloomFilter

Interface for bloom filter implementations using an unsigned byte[] key.

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.

Version:
$Id: IBloomFilter.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Method Summary
 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).
 

Method Detail

add

boolean add(byte[] key)
Adds the key to the filter.

Parameters:
key - The key.
Returns:
true iff the filter state was unchanged by the incorporation of this key into the filter.
Throws:
IllegalArgumentException - if key is null.
UnsupportedOperationException - if the filter does not allow mutation.

contains

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.

Parameters:
key - The key.
Returns:
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.
Throws:
IllegalArgumentException - if key is null.

falsePos

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). This method exists solely for reporting and tracking the actual error rate of the bloom filter.



Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.