## org.apache.cassandra.utils
Class BloomFilter

    java.lang.Object
      org.apache.cassandra.utils.Filter
          org.apache.cassandra.utils.BloomFilter

    public class BloomFilter

extends Filter

Field Summary
`OpenBitSet` `bitset`

Method Summary
`void` `add(java.nio.ByteBuffer key)`
`void` `clear()`
`static BloomFilter` `emptyFilter()`
`static BloomFilter` `getFilter(long numElements, double maxFalsePosProbability)`
`static BloomFilter` `getFilter(long numElements, int targetBucketsPerElem)`
`boolean` `isPresent(java.nio.ByteBuffer key)`
`long` `serializedSize()`
`static BloomFilterSerializer` `serializer()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### bitset

    public OpenBitSet bitset

Method Detail

### emptyFilter

    public static BloomFilter emptyFilter()

### serializer

    public static BloomFilterSerializer serializer()

### 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.

### add

    public void add(java.nio.ByteBuffer key)

  Specified by:
    `add` in class `Filter`

### isPresent

    public boolean isPresent(java.nio.ByteBuffer key)

  Specified by:
    `isPresent` in class `Filter`

### clear

    public void clear()

### serializedSize

    public long serializedSize()

Copyright © 2012 The Apache Software Foundation