private void generateBloomFilterAndPersist() throws StoreException {
      int numOfIndexEntries = numberOfEntries(serEntries);
      // This is a workaround since we found higher than intended false positive rates with small bloom filter sizes. Note
      // that the number of entries in each index segment varies (from hundreds to thousands), the workaround ensures bloom
      // filter uses at least storeIndexMaxNumberOfInmemElements for creation to achieve decent performance.
      bloomFilter = FilterFactory.getFilter(Math.max(numOfIndexEntries, config.storeIndexMaxNumberOfInmemElements),
          config.storeIndexBloomMaxFalsePositiveProbability, config.storeBloomFilterMaximumPageCount);
      for (int i = 0; i < numOfIndexEntries; i++) {
        StoreKey key = getKeyAt(serEntries, i);
        bloomFilter.add(getStoreKeyBytes(key));
      }
      persistBloomFilter();
    }
Generate bloom filter by walking through all index entries in this segment and persist it.
@throws StoreException
ambry-store/src/main/java/com/github/ambry/store/IndexSegment.java