chia7712 commented on a change in pull request #9781:
URL: https://github.com/apache/kafka/pull/9781#discussion_r549580987
##########
File path:
clients/src/main/java/org/apache/kafka/common/requests/UpdateFeaturesResponse.java
##########
@@ -45,16 +44,18 @@ public UpdateFeaturesResponse(UpdateFeaturesResponseData
data) {
this.data = data;
}
- public Map<String, ApiError> errors() {
- return data.results().valuesSet().stream().collect(
- Collectors.toMap(
- result -> result.feature(),
- result -> new ApiError(Errors.forCode(result.errorCode()),
result.errorMessage())));
+ public ApiError topLevelError() {
+ return new ApiError(Errors.forCode(data.errorCode()),
data.errorMessage());
}
@Override
public Map<Errors, Integer> errorCounts() {
- return apiErrorCounts(errors());
+ Map<Errors, Integer> errorCounts = new HashMap<>();
+ updateErrorCounts(errorCounts, Errors.forCode(data.errorCode()));
+ for (UpdatableFeatureResult result : data.results().valuesSet()) {
Review comment:
Is ```valuesSet``` necessary?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]