void updateBeforeAndAfterIndexSegmentOffsetsWithValidOffset(Offset validOffset) {
    if (!isIndexSegmentOffsetsPersisted()) {
      return;
    }
    logger.info("{}: Validate offsets map with: {}", file, validOffset);
    if (validOffset == null) {
      beforeAndAfterIndexSegmentOffsets.clear();
    } else {
      for (Offset before : beforeAndAfterIndexSegmentOffsets.keySet()) {
        beforeAndAfterIndexSegmentOffsets.put(before, validOffset);
      }
    }
    flush();
  }
Update all the index segment offset values added through method {@link #addBeforeAndAfterIndexSegmentOffsetPair}. If the input is
null, the index segment offsets map would be cleared.
@param validOffset The valid {@link Offset} to replace all the previous invalid {@link Offset}.
ambry-store/src/main/java/com/github/ambry/store/CompactionLog.java