use of org.apache.kafka.common.message.UpdateFeaturesResponseData.UpdatableFeatureResultCollection in project kafka by apache.
the class UpdateFeaturesResponse method createWithErrors.
public static UpdateFeaturesResponse createWithErrors(ApiError topLevelError, Map<String, ApiError> updateErrors, int throttleTimeMs) {
final UpdatableFeatureResultCollection results = new UpdatableFeatureResultCollection();
for (final Map.Entry<String, ApiError> updateError : updateErrors.entrySet()) {
final String feature = updateError.getKey();
final ApiError error = updateError.getValue();
final UpdatableFeatureResult result = new UpdatableFeatureResult();
result.setFeature(feature).setErrorCode(error.error().code()).setErrorMessage(error.message());
results.add(result);
}
final UpdateFeaturesResponseData responseData = new UpdateFeaturesResponseData().setThrottleTimeMs(throttleTimeMs).setErrorCode(topLevelError.error().code()).setErrorMessage(topLevelError.message()).setResults(results).setThrottleTimeMs(throttleTimeMs);
return new UpdateFeaturesResponse(responseData);
}
Aggregations