public class EvenClusterLoadStateMachine extends StateMachine<EvenClusterLoadStateMachine.EvenClusterLoadState,EvenClusterLoadStateMachine.EvenClusterLoadEvent>
GoalViolationDetector
. This state machine captures
one single run of goal violation fix. As goal violation detection and fixing it is a regular scheduled
process, there will be multiple instances of this state machine created over time.
The EvenClusterLoadStateMachine.EvenClusterLoadState.INITIALIZING
and EvenClusterLoadStateMachine.EvenClusterLoadState.DISABLED
are states that
are defined as part of state enum, but the state machine can never be in that state. These states are
checked and returned to the api caller w/o creating this state machine.
As currently defined, the state machine has only one transition, it starts in
EvenClusterLoadStateMachine.EvenClusterLoadState.BALANCING
state and then makes transition to one of the terminal state. Here
are state transitions:
EvenClusterLoadStateMachine.EvenClusterLoadState.BALANCING
|
|-----on successful rebalancing EvenClusterLoadStateMachine.EvenClusterLoadEvent.BALANCING_SUCCESS
----EvenClusterLoadStateMachine.EvenClusterLoadState.BALANCED
|-----on failed rebalancing EvenClusterLoadStateMachine.EvenClusterLoadEvent.BALANCING_FAILED
----EvenClusterLoadStateMachine.EvenClusterLoadState.BALANCING_FAILED
|-----on remove broker trigger EvenClusterLoadStateMachine.EvenClusterLoadEvent.REMOVE_BROKER_TRIGGERED
----EvenClusterLoadStateMachine.EvenClusterLoadState.ABORTED
|-----on add broker arrival EvenClusterLoadStateMachine.EvenClusterLoadEvent.ADD_BROKER_TRIGGERED
----EvenClusterLoadStateMachine.EvenClusterLoadState.ABORTED
|-----on broker shutdown EvenClusterLoadStateMachine.EvenClusterLoadEvent.STOPPED
----EvenClusterLoadStateMachine.EvenClusterLoadState.ABORTED
|-----on controller failover EvenClusterLoadStateMachine.EvenClusterLoadEvent.STOPPED
----EvenClusterLoadStateMachine.EvenClusterLoadState.ABORTED
|-----on SBC getting disabled EvenClusterLoadStateMachine.EvenClusterLoadEvent.STOPPED
----EvenClusterLoadStateMachine.EvenClusterLoadState.ABORTED
Modifier and Type | Class and Description |
---|---|
static class |
EvenClusterLoadStateMachine.EvenClusterLoadEvent |
static class |
EvenClusterLoadStateMachine.EvenClusterLoadState
All possible states of the even cluster load component.
|
currentState
Constructor and Description |
---|
EvenClusterLoadStateMachine(int brokerId,
EvenClusterLoadStateMachine.EvenClusterLoadState startState,
long stateCreatedAt,
long stateLastUpdatedAt,
org.apache.kafka.common.utils.Time time,
Exception evenLoadBalancingError)
Used when restoring a state machine from persisted state.
|
EvenClusterLoadStateMachine(int brokerId,
EvenClusterLoadStateMachine.EvenClusterLoadState startState,
org.apache.kafka.common.utils.Time time) |
EvenClusterLoadStateMachine(int brokerId,
org.apache.kafka.common.utils.Time time) |
Modifier and Type | Method and Description |
---|---|
EvenClusterLoadStateMachine.EvenClusterLoadState |
advanceState(EvenClusterLoadStateMachine.EvenClusterLoadEvent event)
React to an event #
E by advancing the state machine. |
Exception |
evenLoadBalancingError() |
void |
evenLoadBalancingError(Exception evenLoadBalancingError) |
createTime, isTerminalState, lastUpdateTime
public EvenClusterLoadStateMachine(int brokerId, org.apache.kafka.common.utils.Time time)
public EvenClusterLoadStateMachine(int brokerId, EvenClusterLoadStateMachine.EvenClusterLoadState startState, org.apache.kafka.common.utils.Time time)
public EvenClusterLoadStateMachine(int brokerId, EvenClusterLoadStateMachine.EvenClusterLoadState startState, long stateCreatedAt, long stateLastUpdatedAt, org.apache.kafka.common.utils.Time time, Exception evenLoadBalancingError)
public Exception evenLoadBalancingError()
public void evenLoadBalancingError(Exception evenLoadBalancingError)
public EvenClusterLoadStateMachine.EvenClusterLoadState advanceState(EvenClusterLoadStateMachine.EvenClusterLoadEvent event)
StateMachine
E
by advancing the state machine.advanceState
in class StateMachine<EvenClusterLoadStateMachine.EvenClusterLoadState,EvenClusterLoadStateMachine.EvenClusterLoadEvent>
event
- - the newly-occurred event on the operation this state machine is tracking