public class BrokerShutdownManager
extends java.lang.Object
Constructor and Description |
---|
BrokerShutdownManager(SbkAdminUtils adminUtils,
KafkaCruiseControlConfig config,
BlockingSendClient.Builder blockingSendClientBuilder,
org.apache.kafka.common.utils.Time time) |
Modifier and Type | Method and Description |
---|---|
boolean |
maybeShutdownBroker(int brokerId,
java.util.Optional<java.lang.Long> brokerEpochOpt)
Ensures that the given broker is shut down by initiating shutdown via an #
InitiateShutdownRequest
and awaiting the shutdown of the broker. |
public BrokerShutdownManager(SbkAdminUtils adminUtils, KafkaCruiseControlConfig config, BlockingSendClient.Builder blockingSendClientBuilder, org.apache.kafka.common.utils.Time time)
public boolean maybeShutdownBroker(int brokerId, java.util.Optional<java.lang.Long> brokerEpochOpt) throws java.lang.Exception
InitiateShutdownRequest
and awaiting the shutdown of the broker.
This method is blocking for a long time. Approximately a couple of
request timeouts (request.timeout.ms
) and broker.removal.shutdown.timeout.ms
.org.apache.kafka.common.errors.TimeoutException
- - if a shutdown request was initiated but the broker does not shutdown within the timeoutorg.apache.kafka.common.errors.ApiException
- - if the shutdown request was not successfuljava.lang.Exception
- - if the shutdown failed for any other reason