public class BloomCalculations
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
BloomCalculations.BloomSpecification
A wrapper class that holds two key parameters for a Bloom Filter: the
number of hash functions used, and the number of buckets per element used.
|
Constructor and Description |
---|
BloomCalculations() |
Modifier and Type | Method and Description |
---|---|
static BloomCalculations.BloomSpecification |
computeBloomSpec(int bucketsPerElement)
Given the number of buckets that can be used per element, return a
specification that minimizes the false positive rate.
|
static BloomCalculations.BloomSpecification |
computeBloomSpec(int maxBucketsPerElement,
double maxFalsePosProb)
Given a maximum tolerable false positive probability, compute a Bloom
specification which will give less than the specified false positive rate,
but minimize the number of buckets per element and the number of hash
functions used.
|
static int |
maxBucketsPerElement(long numElements)
Calculates the maximum number of buckets per element that this implementation
can support.
|
static double |
minSupportedBloomFilterFpChance()
Retrieves the minimum supported BloomFilterFpChance value
|
public static BloomCalculations.BloomSpecification computeBloomSpec(int bucketsPerElement)
bucketsPerElement
- The number of buckets per element for the filter.public static BloomCalculations.BloomSpecification computeBloomSpec(int maxBucketsPerElement, double maxFalsePosProb)
maxBucketsPerElement
- The maximum number of buckets available for the filter.maxFalsePosProb
- The maximum tolerable false positive rate.java.lang.UnsupportedOperationException
- if a filter satisfying the parameters cannot be metpublic static int maxBucketsPerElement(long numElements)
public static double minSupportedBloomFilterFpChance()
Copyright © 2017 The Apache Software Foundation