public Optional<LogSegment> floorSegment(long offset) {
        return floorEntry(offset).map(Map.Entry::getValue);
    }
Return the log segment with the greatest offset less than or equal to the given offset,
if it exists.

This method is thread-safe.
storage/src/main/java/org/apache/kafka/storage/internals/log/LogSegments.java