@Override public Map<Errors, Integer> errorCounts() { Map<Errors, Integer> errorCounts = new HashMap<>(); for (AclCreationResponse response : aclCreationResponses) updateErrorCounts(errorCounts, response.error.error()); return errorCounts; }
@Override public Map<Errors, Integer> errorCounts() { return errorCounts(error.error()); }
@Override public Map<Errors, Integer> errorCounts() { Map<Errors, Integer> errorCounts = new HashMap<>(); for (Config response : configs.values()) updateErrorCounts(errorCounts, response.error.error()); return errorCounts; }
protected Map<Errors, Integer> apiErrorCounts(Map<?, ApiError> errors) { Map<Errors, Integer> errorCounts = new HashMap<>(); for (ApiError apiError : errors.values()) updateErrorCounts(errorCounts, apiError.error()); return errorCounts; }
@Override public Map<Errors, Integer> errorCounts() { Map<Errors, Integer> errorCounts = new HashMap<>(); for (AclFilterResponse response : responses) updateErrorCounts(errorCounts, response.error.error()); return errorCounts; }
synchronized void addError(Throwable throwable, Node node) { ApiError error = ApiError.fromThrowable(throwable); if (error.message() == null || error.message().isEmpty()) { errors.add(error.error().exception("Error listing groups on " + node)); } else { errors.add(error.error().exception("Error listing groups on " + node + ": " + error.message())); } }
@Override public void handleResponse(AbstractResponse abstractResponse) { CreatePartitionsResponse response = (CreatePartitionsResponse) abstractResponse; // Check for controller change for (ApiError error : response.errors().values()) { if (error.error() == Errors.NOT_CONTROLLER) { metadataManager.clearController(); metadataManager.requestUpdate(); throw error.exception(); } } for (Map.Entry<String, ApiError> result : response.errors().entrySet()) { KafkaFutureImpl<Void> future = futures.get(result.getKey()); if (result.getValue().isSuccess()) { future.complete(null); } else { future.completeExceptionally(result.getValue().exception()); } } }
if (error.error() == Errors.NOT_CONTROLLER) { metadataManager.clearController(); metadataManager.requestUpdate();
@Override public AbstractResponse getErrorResponse(int throttleTimeMs, Throwable e) { ElectPreferredLeadersResponseData response = new ElectPreferredLeadersResponseData(); response.setThrottleTimeMs(throttleTimeMs); ApiError apiError = ApiError.fromThrowable(e); for (TopicPartitions topic : data.topicPartitions()) { ReplicaElectionResult electionResult = new ReplicaElectionResult().setTopic(topic.topic()); for (Integer partitionId : topic.partitionId()) { electionResult.partitionResult().add(new ElectPreferredLeadersResponseData.PartitionResult() .setPartitionId(partitionId) .setErrorCode(apiError.error().code()) .setErrorMessage(apiError.message())); } response.replicaElectionResults().add(electionResult); } return new ElectPreferredLeadersResponse(response); }
r.partitionResult().add(new PartitionResult() .setPartitionId(topic1.partition()) .setErrorCode(ApiError.NONE.error().code()) .setErrorMessage(ApiError.NONE.message())); r.partitionResult().add(new PartitionResult() .setPartitionId(topic2.partition()) .setErrorCode(value.error().code()) .setErrorMessage(value.message())); responseData.replicaElectionResults().add(r); r.partitionResult().add(new PartitionResult() .setPartitionId(topic1.partition()) .setErrorCode(ApiError.NONE.error().code()) .setErrorMessage(ApiError.NONE.message())); r.partitionResult().add(new PartitionResult() .setPartitionId(topic2.partition()) .setErrorCode(ApiError.NONE.error().code()) .setErrorMessage(ApiError.NONE.message())); env.kafkaClient().prepareResponse(new ElectPreferredLeadersResponse(responseData));