static void mergeBlock(LogCacheBlock left, LogCacheBlock right) {
        synchronized (left) {
            left.size.addAndGet(right.size());
            left.confirmOffset = right.confirmOffset;
            left.map.forEach((streamId, leftStreamCache) -> {
                StreamCache rightStreamCache = right.map.get(streamId);
                if (rightStreamCache != null) {
                    leftStreamCache.records.addAll(rightStreamCache.records);
                    leftStreamCache.endOffset(rightStreamCache.endOffset());
                }
            });
            right.map.forEach((streamId, rightStreamCache) -> {
                if (!left.map.containsKey(streamId)) {
                    left.map.put(streamId, rightStreamCache);
                }
            });
        }
    }
Merge the right block to the left block
s3stream/src/main/java/com/automq/stream/s3/cache/LogCache.java