@ThreadSafe public class BrokerRemovalStateTracker extends Object implements BrokerRemovalCallback
initialize()
MUST be called on any state tracker instance before it can be utilized.MAX_UUID_LENGTH
Constructor and Description |
---|
BrokerRemovalStateTracker(Set<Integer> brokerIds,
BrokerRemovalStateMachine.BrokerRemovalState initState,
MultiBrokerBalancerOperationProgressListener<BrokerRemovalStateMachine.BrokerRemovalState> progressListener,
MultiBrokerBalancerOperationTerminationListener<BrokerRemovalStateMachine.BrokerRemovalState> terminationListener,
AtomicReference<String> stateReference,
org.apache.kafka.common.utils.Time time) |
BrokerRemovalStateTracker(Set<Integer> brokerIds,
MultiBrokerBalancerOperationProgressListener<BrokerRemovalStateMachine.BrokerRemovalState> progressListener,
MultiBrokerBalancerOperationTerminationListener<BrokerRemovalStateMachine.BrokerRemovalState> terminationListener,
AtomicReference<String> stateReference,
org.apache.kafka.common.utils.Time time) |
Modifier and Type | Method and Description |
---|---|
ImmutableSet<Integer> |
brokerIds() |
BrokerRemovalStateMachine.BrokerRemovalState |
currentState() |
void |
initialize()
Initialize the RemovalStateTracker by setting the current state and notifying the listener of the initial state.
|
boolean |
maybeCancel(BrokerRemovalCancellationProposal brokerRemovalCancellationProposal)
Requests cancellation of the broker removal state tracking by setting a terminal canceled state
|
void |
registerEvent(BrokerRemovalStateMachine.BrokerRemovalEvent pe)
Registers a new #
BalancerOperationEvent as part of the progress changing |
void |
registerEvent(BrokerRemovalStateMachine.BrokerRemovalEvent pe,
Exception eventException)
Registers a new errorful #
BalancerOperationEvent as part of the progress changing |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
logPrefix, uuid
public BrokerRemovalStateTracker(Set<Integer> brokerIds, MultiBrokerBalancerOperationProgressListener<BrokerRemovalStateMachine.BrokerRemovalState> progressListener, MultiBrokerBalancerOperationTerminationListener<BrokerRemovalStateMachine.BrokerRemovalState> terminationListener, AtomicReference<String> stateReference, org.apache.kafka.common.utils.Time time)
brokerIds
- the IDs of the brokers that are going to be removedprogressListener
- the listener to call whenever the broker removal operation's progress changesstateReference
- an atomic reference of the current state name to keep up to datepublic BrokerRemovalStateTracker(Set<Integer> brokerIds, BrokerRemovalStateMachine.BrokerRemovalState initState, MultiBrokerBalancerOperationProgressListener<BrokerRemovalStateMachine.BrokerRemovalState> progressListener, MultiBrokerBalancerOperationTerminationListener<BrokerRemovalStateMachine.BrokerRemovalState> terminationListener, AtomicReference<String> stateReference, org.apache.kafka.common.utils.Time time)
public void initialize()
public ImmutableSet<Integer> brokerIds()
public BrokerRemovalStateMachine.BrokerRemovalState currentState()
public void registerEvent(BrokerRemovalStateMachine.BrokerRemovalEvent pe)
BalancerOperationCallback
BalancerOperationEvent
as part of the progress changingpublic void registerEvent(BrokerRemovalStateMachine.BrokerRemovalEvent pe, Exception eventException)
BalancerOperationCallback
BalancerOperationEvent
as part of the progress changingpublic boolean maybeCancel(BrokerRemovalCancellationProposal brokerRemovalCancellationProposal)
brokerRemovalCancellationProposal
-