public boolean contains(long offset) {
        return segments.containsKey(offset);
    }
Return true if a segment exists at the provided offset, false otherwise.

This method is thread-safe.

@param offset the segment to be checked
storage/src/main/java/org/apache/kafka/storage/internals/log/LogSegments.java