maybeShutdownBrokers
public Map<Integer,Boolean> maybeShutdownBrokers(Map<Integer,Optional<Long>> brokersToShutdownAndEpochs)
throws Exception
Ensures that the given brokers are shut down by initiating shutdown via an #InitiateShutdownRequest
and awaiting their shutdown.
This method is blocking for a long time. Approximately a couple of
request timeouts (request.timeout.ms
) and broker.removal.shutdown.timeout.ms
.
Note that this method is not atomic. It is possible that a subset of brokers get shut down while another subset fail shutting down.
- Returns:
- a map of broker id to boolean, indicating whether we shut down that specific broker by calling the
InitiateShutdownRequest
.
if false, the broker was already shut down and no request was sent.
- Throws:
org.apache.kafka.common.errors.TimeoutException
- - if shutdown requests were initiated but at least one broker did not shutdown within the timeout
org.apache.kafka.common.errors.ApiException
- - if any shutdown request was not successful
Exception
- - if any broker shutdown failed for any other reason