aloknnikhil commented on a change in pull request #9996: URL: https://github.com/apache/kafka/pull/9996#discussion_r568971949
########## File path: clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java ########## @@ -4605,6 +4608,47 @@ void handleFailure(Throwable throwable) { return new UpdateFeaturesResult(new HashMap<>(updateFutures)); } + @Override + public DecommissionBrokerResult decommissionBroker(int brokerId, DecommissionBrokerOptions options) { + final KafkaFutureImpl<Void> future = new KafkaFutureImpl<>(); + final long now = time.milliseconds(); + final Call call = new Call("decommissionBroker", calcDeadlineMs(now, options.timeoutMs()), + new LeastLoadedNodeProvider()) { + + @Override + DecommissionBrokerRequest.Builder createRequest(int timeoutMs) { + DecommissionBrokerRequestData data = + new DecommissionBrokerRequestData().setBrokerId(brokerId); + return new DecommissionBrokerRequest.Builder(data); + } + + @Override + void handleResponse(AbstractResponse abstractResponse) { + final DecommissionBrokerResponse response = + (DecommissionBrokerResponse) abstractResponse; + Errors error = Errors.forCode(response.data().errorCode()); + switch (error) { + case NONE: + future.complete(null); + break; + case NOT_CONTROLLER: + handleNotControllerError(error); Review comment: Hmm. Good point. We don't need a special-case for the REQUEST_TIMED_OUT then. Will update the test and case here ---------------------------------------------------------------- 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: us...@infra.apache.org