boolean isSanityCheckFailed(List<StreamMetadata> streamMetadataList, CommitStreamSetObjectRequest request) {
        Map<Long, StreamMetadata> streamMetadataMap = streamMetadataList.stream()
            .collect(Collectors.toMap(StreamMetadata::streamId, e -> e));

        List<StreamOffsetRange> compactedStreamOffsetRanges = new ArrayList<>();
        request.getStreamRanges().forEach(o -> compactedStreamOffsetRanges.add(new StreamOffsetRange(o.getStreamId(), o.getStartOffset(), o.getEndOffset())));
        request.getStreamObjects().forEach(o -> compactedStreamOffsetRanges.add(new StreamOffsetRange(o.getStreamId(), o.getStartOffset(), o.getEndOffset())));
        Map<Long, StreamOffsetRangeSearchList> searchListMap = compactedStreamOffsetRanges
            .stream()
            .collect(Collectors.groupingBy(StreamOffsetRange::streamId))
            .entrySet()
            .stream()
            .collect(Collectors.toMap(Map.Entry::getKey, e -> sortAndMerge(e.getValue())));
        for (long objectId : request.getCompactedObjectIds()) {
            for (StreamDataBlock originalBlock : streamDataBlockMap.get(objectId)) {
                long streamId = originalBlock.getStreamId();
                if (!streamMetadataMap.containsKey(streamId)) {
                    // skip non-exist stream
                    continue;
                }
                long streamStartOffset = streamMetadataMap.get(streamId).startOffset();
                if (originalBlock.getEndOffset() <= streamStartOffset) {
                    // skip block that has been trimmed
                    continue;
                }
                StreamOffsetRangeSearchList searchList = searchListMap.get(streamId);
                if (searchList == null) {
                    logger.error("Sanity check failed, stream {} is missing after compact", streamId);
                    return true;
                }
                if (searchList.search(originalBlock) < 0) {
                    logger.error("Sanity check failed, object {} block {} is missing after compact", objectId, originalBlock);
                    return true;
                }
            }
        }

        return false;
    }
Split specified stream set object into stream objects.

@param objectMetadata     stream set object to split
@param cfs                List of CompletableFuture of StreamObject
@return true if split succeed, false otherwise
s3stream/src/main/java/com/automq/stream/s3/compact/CompactionManager.java