T
- the return type of the phasepublic class BrokerRemovalPhaseExecutor<T> extends Object
BrokerRemovalPhaseExecutor
is a wrapper encapsulating the repeatable pattern of each broker removal phase execution.
Namely, the pattern consists of executing an action and depending on the result (exceptional or not), registering
a different #BrokerRemovalStateMachine.BrokerRemovalEvent
and, if exceptional, abandoning subsequent phase execution.
For more information regarding the broker removal phases, see
KafkaCruiseControl.removeBrokers(Map, boolean, BalanceOpExecutionCompletionCallback, BrokerRemovalCallback, String)
Modifier and Type | Class and Description |
---|---|
static class |
BrokerRemovalPhaseExecutor.Builder<T> |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<T> |
execute(BrokerRemovalPhase<T> phase)
Executes the given #
BrokerRemovalPhase , notifies the progress callback and completes the future. |
public CompletableFuture<T> execute(BrokerRemovalPhase<T> phase)
BrokerRemovalPhase
, notifies the progress callback and completes the future.
In case a #InterruptedException
is thrown by the underlying code, the future will
immediately populated with the exception and returned.
Callers are expected to unwrap and handle the interruption appropriately.CompletableFuture
of the removal step