chia7712 commented on code in PR #16250:
URL: https://github.com/apache/kafka/pull/16250#discussion_r1635784034
##########
clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:
##########
@@ -2760,9 +2760,19 @@ void handleFailure(Throwable throwable) {
}, now);
}
- return new DescribeConfigsResult(new
HashMap<>(nodeFutures.entrySet().stream()
+ return new DescribeConfigsResult(
+ nodeFutures.entrySet()
+ .stream()
.flatMap(x -> x.getValue().entrySet().stream())
- .collect(Collectors.toMap(Map.Entry::getKey,
Map.Entry::getValue))));
+ .collect(Collectors.toMap(
+ Map.Entry::getKey,
+ Map.Entry::getValue,
+ (oldValue, newValue) -> {
+ throw new
IllegalStateException(String.format("Duplicate key for values: %s and %s",
oldValue, newValue));
Review Comment:
Could you please add comments to remind readers that should not happen.
Maybe we can add test which using duplicate `resources` as input for
`describeConfigs`
--
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]