@Override
      public boolean accept(File dir, String name) {
        if (logSegmentName.toString().isEmpty()) {
          return (name.endsWith(IndexSegment.INDEX_SEGMENT_FILE_NAME_SUFFIX) || name.endsWith(
              IndexSegment.BLOOM_FILE_NAME_SUFFIX));
        } else {
          return name.startsWith(logSegmentName.toString() + BlobStore.SEPARATOR) && (
              name.endsWith(IndexSegment.INDEX_SEGMENT_FILE_NAME_SUFFIX) || name.endsWith(
                  IndexSegment.BLOOM_FILE_NAME_SUFFIX));
        }
      }
Cleans up all files related to index segments that refer to the log segment with name {@code logSegmentName}.
 @param dataDir the directory where the index files are.
@param logSegmentName the name of the log segment whose index segment related files need to be deleteds.
@throws StoreException if {@code dataDir} could not be read or if a file could not be deleted.
ambry-store/src/main/java/com/github/ambry/store/PersistentIndex.java