public static IFilter getFilter(long numElements, int targetBucketsPerElem, int maxPageCount) {
    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, maxPageCount);
  }
@return A BloomFilter with the lowest practical false positive
        probability for the given number of elements.
ambry-utils/src/main/java/com/github/ambry/utils/FilterFactory.java