public static IFilter getFilter(long numElements, int targetBucketsPerElem, boolean offheap)
    {
        int maxBucketsPerElement = Math.max(1, BloomCalculations.maxBucketsPerElement(numElements));
        int bucketsPerElement = Math.min(targetBucketsPerElem, maxBucketsPerElement);
        if (bucketsPerElement < targetBucketsPerElem)
        {
            logger.warn(String.format("Cannot provide an optimal BloomFilter for %d elements (%d/%d buckets per element).", numElements, bucketsPerElement, targetBucketsPerElem));
        }
        BloomCalculations.BloomSpecification spec = BloomCalculations.computeBloomSpec(bucketsPerElement);
        return createFilter(spec.K, numElements, spec.bucketsPerElement, offheap);
    }
public static IFilter getFilter ( long numElements , int targetBucketsPerElem , boolean offheap ) { int maxBucketsPerElement = Math . max ( 1 , BloomCalculations . maxBucketsPerElement ( numElements ) ) ; int bucketsPerElement = Math . min ( targetBucketsPerElem , maxBucketsPerElement ) ; if ( bucketsPerElement < targetBucketsPerElem ) { logger . warn ( String . format ( "Cannot provide an optimal BloomFilter for %d elements (%d/%d buckets per element)." , numElements , bucketsPerElement , targetBucketsPerElem ) ) ; } BloomCalculations . BloomSpecification spec = BloomCalculations . computeBloomSpec ( bucketsPerElement ) ; return createFilter ( spec . K , numElements , spec . bucketsPerElement , offheap ) ; }
@return A BloomFilter with the lowest practical false positive
probability for the given number of elements.