dajac commented on code in PR #12206:
URL: https://github.com/apache/kafka/pull/12206#discussion_r890986175


##########
clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:
##########
@@ -4337,25 +4337,22 @@ public DescribeMetadataQuorumResult 
describeMetadataQuorum(DescribeMetadataQuoru
         final Call call = new Call(
                 "describeMetadataQuorum", calcDeadlineMs(now, 
options.timeoutMs()), provider) {
 
-            private QuorumInfo createQuorumResult(final DescribeQuorumResponse 
response) {
-                Integer partition = 0;
-                String topicName = response.getTopicNameByIndex(0);
-                Integer leaderId = response.getPartitionLeaderId(topicName, 
partition);
+            private QuorumInfo createQuorumResult(final 
DescribeQuorumResponseData.PartitionData partition) {
                 List<QuorumInfo.ReplicaState> voters = new ArrayList<>();
                 List<QuorumInfo.ReplicaState> observers = new ArrayList<>();
-                response.getVoterInfo(topicName, partition).forEach(v -> {
+                partition.currentVoters().forEach(v -> {
                     voters.add(new QuorumInfo.ReplicaState(v.replicaId(),
                                 v.logEndOffset(),
                                 OptionalLong.of(v.lastFetchTimestamp()),
                                 OptionalLong.of(v.lastCaughtUpTimestamp())));

Review Comment:
   When `lastFetchTimestamp` or `lastCaughtUpTimestamp` are not provided 
(equals to -1), don't we want to return an empty option instead of returning an 
option containing -1?



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