public boolean hasOverflow() throws IOException {
        long nextOffset = readNextOffset();
        return nextOffset > baseOffset && !canConvertToRelativeOffset(nextOffset - 1);
    }
Check whether the last offset of the last batch in this segment overflows the indexes.
storage/src/main/java/org/apache/kafka/storage/internals/log/LogSegment.java