public void replay(RemoveS3StreamRecord record) {
        long streamId = record.streamId();
        StreamRuntimeMetadata streamMetadata = this.streamsMetadata.remove(streamId);
        if (streamMetadata == null) {
            return;
        }
        streamMetadata.ranges().values().forEach(rangeMetadata -> {
            node2streams.computeIfPresent(rangeMetadata.nodeId(), (k, v) -> {
                v = v.copy();
                v.remove(m -> streamId == m);
                return v;
            });
        });
    }
Check whether this node is valid to operate the stream related resources.
metadata/src/main/java/org/apache/kafka/controller/stream/StreamControlManager.java