Yunyung commented on code in PR #20235: URL: https://github.com/apache/kafka/pull/20235#discussion_r2228614978
########## tools/src/main/java/org/apache/kafka/tools/consumer/group/ConsumerGroupCommand.java: ########## @@ -653,7 +653,7 @@ private List<TopicPartition> filterNoneLeaderPartitions(Collection<TopicPartitio return adminClient.describeTopics(topics).allTopicNames().get().entrySet() .stream() .flatMap(entry -> entry.getValue().partitions().stream() - .filter(partitionInfo -> partitionInfo.leader() == null) + .filter(partitionInfo -> topicPartitions.contains(new TopicPartition(entry.getKey(), partitionInfo.partition())) && partitionInfo.leader() == null) Review Comment: nit: check `partitionInfo.leader() == null` before creating the `TopicPartition` for performance. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org