private void trimStream0(Map<String, Long> trimOffsets) {
        streamManager.streams().forEach((streamName, stream) -> {
            Long trimOffset = trimOffsets.get(streamName);
            if (trimOffset != null && trimOffset > stream.startOffset()) {
                stream.trim(trimOffset);
            }
        });
    }
The lock of {@link #segments} and {@link #inflightCleanedSegments}
core/src/main/scala/kafka/log/streamaspect/ElasticLogSegmentManager.java