Class BloomFilter

java.lang.Object
com.gigaspaces.internal.utils.BloomFilter

public class BloomFilter extends Object
  • Method Details

    • getHashBuckets

      public int[] getHashBuckets(String key)
    • getHashBuckets

      public int[] getHashBuckets(byte[] key)
    • getFilter

      public static BloomFilter getFilter(long numElements, int targetBucketsPerElem)
      Returns:
      A BloomFilter with the lowest practical false positive probability for the given number of elements.
    • getFilter

      public static BloomFilter getFilter(long numElements, double maxFalsePosProbability)
      Returns:
      The smallest BloomFilter that can provide the given false positive probability rate for the given number of elements. Asserts that the given probability can be satisfied using this filter.
    • clear

      public void clear()
    • isPresent

      public boolean isPresent(String key)
    • isPresent

      public boolean isPresent(byte[] key)
    • add

      public void add(String key)
    • add

      public void add(byte[] key)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • alwaysMatchingBloomFilter

      public static BloomFilter alwaysMatchingBloomFilter()
      Returns:
      a BloomFilter that always returns a positive match, for testing