You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/12/02 21:03:10 UTC

[GitHub] [kafka] hachikuji commented on a diff in pull request #12897: KAFKA-14379: consumer should refresh preferred read replica on update metadata

hachikuji commented on code in PR #12897:
URL: https://github.com/apache/kafka/pull/12897#discussion_r1038530374


##########
clients/src/test/java/org/apache/kafka/common/requests/RequestTestUtils.java:
##########
@@ -208,10 +209,10 @@ public static MetadataResponse metadataUpdateWith(final String clusterId,
             for (int i = 0; i < numPartitions; i++) {
                 TopicPartition tp = new TopicPartition(topic, i);
                 Node leader = nodes.get(i % nodes.size());
-                List<Integer> replicaIds = Collections.singletonList(leader.id());
+                List<Integer> replicaIds = nodes.stream().map(Node::id).collect(Collectors.toList());

Review Comment:
   Leaving the replication factor as implicit seems less than ideal. Perhaps we could make it an explicit argument? 



-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org