niket-goel commented on code in PR #12206:
URL: https://github.com/apache/kafka/pull/12206#discussion_r891554323
##########
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:
I went back and forth between that and ended up returning a -1 optional
here. I now remember that the original intention was to have an empty optional.
Will address this.
--
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]