Package com.gigaspaces.internal.utils
Class BloomFilter
java.lang.Object
com.gigaspaces.internal.utils.BloomFilter
-
Method Summary
Modifier and TypeMethodDescriptionvoidadd(byte[] key) voidstatic BloomFiltervoidclear()static BloomFiltergetFilter(long numElements, double maxFalsePosProbability) static BloomFiltergetFilter(long numElements, int targetBucketsPerElem) int[]getHashBuckets(byte[] key) int[]getHashBuckets(String key) booleanisPresent(byte[] key) booleantoString()
-
Method Details
-
getHashBuckets
-
getHashBuckets
public int[] getHashBuckets(byte[] key) -
getFilter
- Returns:
- A BloomFilter with the lowest practical false positive probability for the given number of elements.
-
getFilter
- 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
-
isPresent
public boolean isPresent(byte[] key) -
add
-
add
public void add(byte[] key) -
toString
-
alwaysMatchingBloomFilter
- Returns:
- a BloomFilter that always returns a positive match, for testing
-