public List<PartitionInfo> partitionsForNode(int nodeId) {
        return partitionsByNode.getOrDefault(nodeId, Collections.emptyList());
    }
Get the list of partitions whose leader is this node
@param nodeId The node id
@return A list of partitions
clients/src/main/java/org/apache/kafka/common/Cluster.java