muralibasani commented on code in PR #24098:
URL: https://github.com/apache/kafka/pull/24098#discussion_r4542114119


##########
tools/src/main/java/org/apache/kafka/tools/GroupOffsetsResetter.java:
##########
@@ -459,17 +459,22 @@ public List<TopicPartition> 
filterNoneLeaderPartitions(Collection<TopicPartition
         // collect all topics
         Set<String> topics = 
topicPartitions.stream().map(TopicPartition::topic).collect(Collectors.toSet());
 
-        try {
-            return adminClient.describeTopics(topics, withTimeoutMs(new 
DescribeTopicsOptions())).allTopicNames().get().entrySet()
-                .stream()
-                .flatMap(entry -> entry.getValue().partitions().stream()
+        List<TopicPartition> noneLeaderPartitions = new ArrayList<>();
+        adminClient.describeTopics(topics, withTimeoutMs(new 
DescribeTopicsOptions())).topicNameValues().forEach((topic, future) -> {
+            try {
+                future.get().partitions().stream()
                     .filter(partitionInfo -> partitionInfo.leader() == null)
-                    .map(partitionInfo -> new TopicPartition(entry.getKey(), 
partitionInfo.partition())))
+                    .map(partitionInfo -> new TopicPartition(topic, 
partitionInfo.partition()))
                     .filter(topicPartitions::contains)

Review Comment:
   > I will fix it in this PR tomorrow.
   
   I did not check yet, was it already done?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to