use of org.apache.kafka.common.message.AlterClientQuotasResponseData.EntityData in project kafka by apache.
the class AlterClientQuotasResponse method complete.
public void complete(Map<ClientQuotaEntity, KafkaFutureImpl<Void>> futures) {
for (EntryData entryData : data.entries()) {
Map<String, String> entityEntries = new HashMap<>(entryData.entity().size());
for (EntityData entityData : entryData.entity()) {
entityEntries.put(entityData.entityType(), entityData.entityName());
}
ClientQuotaEntity entity = new ClientQuotaEntity(entityEntries);
KafkaFutureImpl<Void> future = futures.get(entity);
if (future == null) {
throw new IllegalArgumentException("Future map must contain entity " + entity);
}
Errors error = Errors.forCode(entryData.errorCode());
if (error == Errors.NONE) {
future.complete(null);
} else {
future.completeExceptionally(error.exception(entryData.errorMessage()));
}
}
}
Aggregations