chia7712 commented on PR #21078:
URL: https://github.com/apache/kafka/pull/21078#issuecomment-3625444319
> The new param description doesn't look fully accurate either?
According to the current logic, it passes `null` instead of `noNode`. We
should revisit the usage in the test code
```java
private Node leader(PartitionInfo partitionInfo) {
if (partitionInfo.leader() == null || partitionInfo.leader().id() ==
Node.noNode().id())
return null;
return partitionInfo.leader();
}
return new TopicPartitionInfo(
partition.partitionIndex(),
nodes.get(partition.leaderId()),
partition.replicaNodes().stream().map(id ->
nodes.getOrDefault(id, new Node(id, "", -1))).collect(Collectors.toList()),
partition.isrNodes().stream().map(id -> nodes.getOrDefault(id,
new Node(id, "", -1))).collect(Collectors.toList()),
partition.eligibleLeaderReplicas().stream().map(id ->
nodes.getOrDefault(id, new Node(id, "", -1))).collect(Collectors.toList()),
partition.lastKnownElr().stream().map(id ->
nodes.getOrDefault(id, new Node(id, "", -1))).collect(Collectors.toList()));
```
--
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]