private void forEachValidIndexEntry(IndexSegment indexSegment, long deleteReferenceTimeInMs,
      long expiryReferenceTimeInMs, FileSpan fileSpanUnderCompaction, Map<StoreKey, IndexFinalState> keyFinalStates,
      boolean removeFinalStateOnPut, ValidIndexEntryAction validIndexEntryAction) throws StoreException {
    forEachIndexEntry(indexSegment, deleteReferenceTimeInMs, expiryReferenceTimeInMs, fileSpanUnderCompaction,
        keyFinalStates, removeFinalStateOnPut, (indexEntry, isValid) -> {
          if (isValid) {
            validIndexEntryAction.accept(indexEntry);
          }
        });
  }
Perform an action each valid {@link IndexEntry} from a given {@link IndexSegment}. This is helper method for {@link #forEachIndexEntry}.
It filter out the invalid IndexEntries and only call the callback method on invalid IndexEntries.
@param indexSegment the {@link IndexSegment} where the entries came from
@param deleteReferenceTimeInMs the reference time in ms until which deletes are relevant
@param expiryReferenceTimeInMs the reference time in ms until which expiration are relevant
@param keyFinalStates a {@link Map} of key to {@link IndexFinalState}.
@param removeFinalStateOnPut if {@code True}, then remove the {@link IndexFinalState} from the given map {@code keyFinalStates}
                        when encountering PUT IndexValue. This method iterates through IndexValues from most recent one to
                        earliest one, so PUT IndexValue is the last IndexValue for the same key.
@param validIndexEntryAction the action to take on each valid {@link IndexEntry} found.
@throws StoreException if there are problems reading the index.
ambry-store/src/main/java/com/github/ambry/store/BlobStoreStats.java