public static long computeMaxKeys(long bitSize, double errorRate, int hashCount) {
    return (long) (-bitSize * 1.0 / hashCount
      * Math.log(1 - Math.exp(Math.log(errorRate) / hashCount)));
  }
The maximum number of keys we can put into a Bloom filter of a certain size to get the given
error rate, with the given number of hash functions.
@return the maximum number of keys that can be inserted in a Bloom filter to maintain the
        target error rate, if the number of hash functions is provided.
hbase-server/src/main/java/org/apache/hadoop/hbase/util/BloomFilterUtil.java