brandboat commented on code in PR #15659:
URL: https://github.com/apache/kafka/pull/15659#discussion_r1554519247
##########
tools/src/main/java/org/apache/kafka/tools/reassign/ReassignPartitionsCommand.java:
##########
@@ -654,6 +654,13 @@ static Map<TopicPartition, List<Integer>>
getReplicaAssignmentForPartitions(Admi
res.put(tp,
info.replicas().stream().map(Node::id).collect(Collectors.toList()));
})
);
+
+ if (!res.keySet().equals(partitions)) {
+ Set<TopicPartition> missingPartitions = new HashSet<>(partitions);
+ missingPartitions.removeAll(res.keySet());
+ throw new UnknownTopicOrPartitionException("Unable to find
partition: " +
+
missingPartitions.stream().map(TopicPartition::toString).collect(Collectors.joining(",
")));
Review Comment:
Though I don't know why do we do this, but follow the pattern is a good
choice. Thanks for the comment :smiley:
--
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]