public class BloomCalculations extends 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 int |
computeBestK(int bucketsPerElement)
Given the number of buckets that can be used per element, return the optimal
number of hash functions in order to minimize the false positive rate.
|
static BloomCalculations.BloomSpecification |
computeBucketsAndK(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 double |
getFalsePositiveProbability(int bucketsPerElement,
int hashCount)
Calculate the probability of a false positive given the specified
number of inserted elements.
|
public static int computeBestK(int bucketsPerElement)
bucketsPerElement
- public static BloomCalculations.BloomSpecification computeBucketsAndK(double maxFalsePosProb)
maxFalsePosProb
- The maximum tolerable false positive rate.public static double getFalsePositiveProbability(int bucketsPerElement, int hashCount)
bucketsPerElement
- number of inserted elements.hashCount
- Copyright © 2019. All rights reserved.