public void put(long baseOffset, ElasticLogSegment segment) {
        segmentLock.lock();
        try {
            segments.put(baseOffset, segment);
            inflightCleanedSegments.remove(baseOffset, segment);
        } finally {
            segmentLock.unlock();
        }
        notifyLogEventListeners(segment, LogEventListener.Event.SEGMENT_CREATE);
    }
The lock of {@link #segments} and {@link #inflightCleanedSegments}
core/src/main/scala/kafka/log/streamaspect/ElasticLogSegmentManager.java