Github user rmetzger commented on the pull request: https://github.com/apache/flink/pull/1623#issuecomment-186201689 Thank you for the good review. I adopted my IntelliJ inspections to find some of the mentioned issues myself in the future (forgotten @Override, unused methods). I'll address all your comments and then merge the pull request. Regarding the `findLeaderForPartitions` method: Its not very well documented and quite hidden in the code, but the `topicPartitionWithLeaderList` list contains the TopicPartitions for ALL requested topics. From a high level, the method does the following: - Get a list of FetchPartitions (usually only a few partitions) - Get the list of topics from the FetchPartitions list and request the partitions for the topics. (Kafka doesn't support getting leaders for a set of partitions) - Build a Map<Leader, List<FetchPartition>> where only the requested partitions are contained. I added some comments into the code and renamed some variables to make it more obvious.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---