private long getAbsolutePositionInLogForOffset(Offset offset,
      ConcurrentSkipListMap<Offset, IndexSegment> indexSegments) {
    LogSegment logSegment = log.getSegment(offset.getName());
    if (logSegment == null || offset.getOffset() > logSegment.getEndOffset()) {
      throw new IllegalArgumentException("Offset is invalid: " + offset + "; LogSegment: " + logSegment);
    }
    int numPrecedingLogSegments = getLogSegmentToIndexSegmentMapping(indexSegments).headMap(offset.getName()).size();
    return numPrecedingLogSegments * log.getSegmentCapacity() + offset.getOffset();
  }
Gets the absolute position represented by {@code offset} in the {@link Log}.
@param offset the {@link Offset} whose absolute position is required.
@param indexSegments the map of index segment start {@link Offset} to {@link IndexSegment} instances
@return he absolute position represented by {@code offset} in the {@link Log}.
ambry-store/src/main/java/com/github/ambry/store/PersistentIndex.java