public synchronized Set<Integer> lockedNodes() {
        return new HashSet<>(lockedNodes);
    }
Note: It is costly to check if a node has opening streams, so it is recommended to use this method only when necessary.
metadata/src/main/java/org/apache/kafka/controller/stream/NodeControlManager.java