org.apache.cassandra.utils
Class LegacyBloomFilter
java.lang.Object
org.apache.cassandra.utils.LegacyBloomFilter
- All Implemented Interfaces:
- java.io.Closeable, IFilter
public class LegacyBloomFilter
- extends java.lang.Object
- implements IFilter
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
serializer
public static final LegacyBloomFilterSerializer serializer
getFilter
public static LegacyBloomFilter getFilter(long numElements,
int targetBucketsPerElem)
- Returns:
- A LegacyBloomFilter with the lowest practical false positive probability
for the given number of elements.
getFilter
public static LegacyBloomFilter getFilter(long numElements,
double maxFalsePosProbability)
- Returns:
- The smallest LegacyBloomFilter 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()
- Specified by:
clear
in interface IFilter
isPresent
public boolean isPresent(java.nio.ByteBuffer key)
- Specified by:
isPresent
in interface IFilter
add
public void add(java.nio.ByteBuffer key)
- Specified by:
add
in interface IFilter
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
alwaysMatchingBloomFilter
public static LegacyBloomFilter alwaysMatchingBloomFilter()
- Returns:
- a LegacyBloomFilter that always returns a positive match, for testing
getHashBuckets
public int[] getHashBuckets(java.nio.ByteBuffer key)
getBitSet
public java.util.BitSet getBitSet()
close
public void close()
throws java.io.IOException
- Specified by:
close
in interface java.io.Closeable
- Throws:
java.io.IOException
Copyright © 2012 The Apache Software Foundation