chia7712 commented on code in PR #18254:
URL: https://github.com/apache/kafka/pull/18254#discussion_r1899608078


##########
test-common/test-common-api/src/main/java/org/apache/kafka/common/test/api/RaftClusterInvocationContext.java:
##########
@@ -222,6 +228,24 @@ public void waitForReadyBrokers() throws 
InterruptedException {
             }
         }
 
+        @Override
+        public int getLeaderBrokerId(TopicPartition topicPartition) throws 
ExecutionException, InterruptedException {
+            var leaderBrokerId = -1;
+            try (var admin = admin()) {
+                DescribeTopicsResult result = 
admin.describeTopics(List.of(topicPartition.topic()));

Review Comment:
   Could you please consider using lambda to implement it? Also, this implement 
is using client APIs only so it can be moved to interface to be the default 
implementation



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