public Node leaderFor(TopicPartition topicPartition) {
        PartitionInfo info = partitionsByTopicPartition.get(topicPartition);
        if (info == null)
            return null;
        else
            return info.leader();
    }
Get the current leader for the given topic-partition
@param topicPartition The topic and partition we want to know the leader for
@return The node that is the leader for this topic-partition, or null if there is currently no leader
clients/src/main/java/org/apache/kafka/common/Cluster.java