public long maxTimestampSoFar() throws IOException {
        return readMaxTimestampAndOffsetSoFar().timestamp;
    }
The maximum timestamp we see so far.

Note that this may result in time index materialization.
storage/src/main/java/org/apache/kafka/storage/internals/log/LogSegment.java