@ThreadSafe public class BalancerStatusTracker extends Object implements BalancerStatusCallback
initialize()
MUST be called on the state tracker instance
before it can be utilized.Constructor and Description |
---|
BalancerStatusTracker(int brokerId,
AtomicReference<String> stateMetricReference,
org.apache.kafka.common.utils.Time time) |
Modifier and Type | Method and Description |
---|---|
int |
brokerId() |
BalancerStatusStateMachine.BalancerState |
currentState() |
Optional<Exception> |
exception() |
void |
initialize()
Initialize the #
BalancerStatusTracker by setting the current state and notify the
listener if it's the initial balancer state. |
boolean |
isInitialized() |
void |
registerEvent(BalancerStatusStateMachine.BalancerEvent event)
Registers a new #
BalancerOperationEvent as part of the progress changing |
void |
registerEvent(BalancerStatusStateMachine.BalancerEvent event,
Exception e)
Registers a new errorful #
BalancerOperationEvent as part of the progress changing |
public BalancerStatusTracker(int brokerId, AtomicReference<String> stateMetricReference, org.apache.kafka.common.utils.Time time)
public void initialize()
BalancerStatusTracker
by setting the current state and notify the
listener if it's the initial balancer state.public boolean isInitialized()
public BalancerStatusStateMachine.BalancerState currentState()
currentState
in interface BalancerOperationCallback<BalancerStatusStateMachine.BalancerState,BalancerStatusStateMachine.BalancerEvent>
public int brokerId()
public void registerEvent(BalancerStatusStateMachine.BalancerEvent event)
BalancerOperationCallback
BalancerOperationEvent
as part of the progress changingregisterEvent
in interface BalancerOperationCallback<BalancerStatusStateMachine.BalancerState,BalancerStatusStateMachine.BalancerEvent>
public void registerEvent(BalancerStatusStateMachine.BalancerEvent event, Exception e)
BalancerOperationCallback
BalancerOperationEvent
as part of the progress changingregisterEvent
in interface BalancerOperationCallback<BalancerStatusStateMachine.BalancerState,BalancerStatusStateMachine.BalancerEvent>