FrankYang0529 commented on code in PR #20319:
URL: https://github.com/apache/kafka/pull/20319#discussion_r2265554451


##########
tools/src/main/java/org/apache/kafka/tools/reassign/ReassignPartitionsCommand.java:
##########
@@ -1514,4 +1520,30 @@ static Set<TopicPartitionReplica> 
alterReplicaLogDirs(Admin adminClient,
         }
         return results;
     }
+
+    static Map<TopicPartitionReplica, String> getReplicaToLogDir(Admin 
adminClient, List<TopicPartitionReplica> replicas) {
+        try {
+            return adminClient.describeReplicaLogDirs(replicas).all().get()
+                    .entrySet()
+                    .stream()
+                    .filter(entry -> entry.getValue() != null && 
entry.getValue().getCurrentReplicaLogDir() != null)
+                    .collect(Collectors.toMap(
+                        Entry::getKey,
+                        entry -> entry.getValue().getCurrentReplicaLogDir()
+                    ));
+        } catch (InterruptedException | ExecutionException e) {
+            throw new AdminOperationException(e.getCause());
+        }

Review Comment:
   We don't do other handling for `InterruptedException` and 
`ExecutionException`.  Could we move the exceptions to function signatures?



-- 
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

Reply via email to