void addBeforeAndAfterIndexSegmentOffsetPair(Offset before, Offset after) {
    if (!isIndexSegmentOffsetsPersisted()) {
      return;
    }
    // If the before offset already exists, it means the index segment has already been copied, or half way through
    // copying. Either way, we should keep the original after offset, since the after offset should reference to the
    // first index segment that has data from before index segment.
    if (beforeAndAfterIndexSegmentOffsets.containsKey(before)) {
      logger.trace("{}: Offset {} already exist in the map", file, before);
      return;
    }
    LogSegmentName logSegmentName = before.getName();
    if (!getCompactionDetails().getLogSegmentsUnderCompaction().contains(logSegmentName)) {
      throw new IllegalArgumentException("Offset is not part of the under compaction log segments: " + before);
    }
    // TODO: Can we find a way to validate the after offset?
    beforeAndAfterIndexSegmentOffsets.put(before, after);
    logger.trace("{}: Add offsets pair to {}: {}", file, before, after);
    flush();
  }
Add a pair of index segment start offsets. The first offset has to be an index segment start offset that belongs to
an under compaction log segment. The second offset hast to be an index segment start offset that belongs to a log
segment created this compaction.
@param before The index segment start offset before compaction
@param after The index segment start offset after compaction
ambry-store/src/main/java/com/github/ambry/store/CompactionLog.java