@Override
  public long getLogSegmentSize(LogSegmentName logSegmentName) {
    LogSegment segment = log.getSegment(logSegmentName);
    if (segment == null) {
      throw new IllegalArgumentException("LogSegment " + logSegmentName + " doesn't exist");
    }
    return segment.getEndOffset() - segment.getStartOffset();
  }
@return the number of valid log segments starting from the first segment.
ambry-store/src/main/java/com/github/ambry/store/PersistentIndex.java