protected long shallowOffsetOfMaxTimestampSoFar() throws IOException {
        return readMaxTimestampAndOffsetSoFar().offset;
    }
Note that this may result in time index materialization.
storage/src/main/java/org/apache/kafka/storage/internals/log/LogSegment.java