org.apache.cassandra.utils
Class FilterFactory

java.lang.Object
  extended by org.apache.cassandra.utils.FilterFactory

public class FilterFactory
extends java.lang.Object


Nested Class Summary
static class FilterFactory.Type
           
 
Constructor Summary
FilterFactory()
           
 
Method Summary
static IFilter deserialize(java.io.DataInput input, FilterFactory.Type type, boolean offheap)
           
static IFilter getFilter(long numElements, double maxFalsePosProbability, boolean offheap)
           
static IFilter getFilter(long numElements, int targetBucketsPerElem, boolean offheap)
           
static void serialize(IFilter bf, java.io.DataOutput output)
           
static void serialize(IFilter bf, java.io.DataOutput output, FilterFactory.Type type)
           
static long serializedSize(IFilter bf)
           
static long serializedSize(IFilter bf, FilterFactory.Type type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterFactory

public FilterFactory()
Method Detail

serialize

public static void serialize(IFilter bf,
                             java.io.DataOutput output)
                      throws java.io.IOException
Throws:
java.io.IOException

serialize

public static void serialize(IFilter bf,
                             java.io.DataOutput output,
                             FilterFactory.Type type)
                      throws java.io.IOException
Throws:
java.io.IOException

deserialize

public static IFilter deserialize(java.io.DataInput input,
                                  FilterFactory.Type type,
                                  boolean offheap)
                           throws java.io.IOException
Throws:
java.io.IOException

serializedSize

public static long serializedSize(IFilter bf)

serializedSize

public static long serializedSize(IFilter bf,
                                  FilterFactory.Type type)

getFilter

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

getFilter

public static IFilter getFilter(long numElements,
                                double maxFalsePosProbability,
                                boolean offheap)
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.


Copyright © 2012 The Apache Software Foundation