public TimestampOffset readMaxTimestampAndOffsetSoFar() throws IOException {
        if (maxTimestampAndOffsetSoFar == TimestampOffset.UNKNOWN)
            maxTimestampAndOffsetSoFar = timeIndex().lastEntry();
        return maxTimestampAndOffsetSoFar;
    }
The first time this is invoked, it will result in a time index lookup (including potential materialization of
the time index).
storage/src/main/java/org/apache/kafka/storage/internals/log/LogSegment.java