use of org.apache.kafka.common.errors.BrokerIdNotRegisteredException in project kafka by apache.
the class ReplicationControlManager method unregisterBroker.
public ControllerResult<Void> unregisterBroker(int brokerId) {
BrokerRegistration registration = clusterControl.brokerRegistrations().get(brokerId);
if (registration == null) {
throw new BrokerIdNotRegisteredException("Broker ID " + brokerId + " is not currently registered");
}
List<ApiMessageAndVersion> records = new ArrayList<>();
handleBrokerUnregistered(brokerId, registration.epoch(), records);
return ControllerResult.of(records, null);
}
Aggregations