@ThreadSafe public class BrokerRemovalStateMachine extends StateMachine<BrokerRemovalStateMachine.BrokerRemovalState,BrokerRemovalStateMachine.BrokerRemovalEvent>
SUCCESS SUCCESS SUCCESS SUCCESS
+-----------------------------------------------+ +--------------------------------+ +---------------------------+ +----------------------------------------+
| | | | | | | |
| v | v | v | v
+----------------+-------------------+ +--------------+-+----------+ +-------------+--+-----------+ +---------+--+-------------+ +-----------+--------------+
| INITIAL_PLAN_COMPUTATION_INITIATED | | BROKER_SHUTDOWN_INITIATED | | PLAN_COMPUTATION_INITIATED | | PLAN_EXECUTION_INITIATED | | PLAN_EXECUTION_SUCCEEDED |
| | | | | | | | | |
| PAR=PENDING | | PAR=IN_PROGRESS | | PAR=IN_PROGRESS | | PAR=IN_PROGRESS | | PAR=SUCCESS |
| BSS=PENDING | | BSS=PENDING | | BSS=COMPLETED | | BSS=COMPLETED | | BSS=COMPLETED |
+-------------------+-+--------------+ +-----------+-+-------------+ +-------------+-----+--------+ +--------------------+---+-+ +--------------------------+
| | | | | | |
ERROR | ERROR | | ERROR | | BROKER ERROR | | BROKER
| | | | | RESTART | | RESTART
| | | | | | |
+---------------------------------+ | +------------------------+ | | +-------------------------+ | | +-----------------------+ | |
| INITIAL_PLAN_COMPUTATION_FAILED | | | BROKER_SHUTDOWN_FAILED | | | | PLAN_COMPUTATION_FAILED | | | | PLAN_EXECUTION_FAILED | | |
| | | | | | | | | | | | | | |
| PAR=ERROR +<-----+ | PAR=CANCELED +<----------+ | | PAR=ERROR <-----+ | | PAR=ERROR +<---+ |
| BSS=CANCELED | | BSS=FAILED | | | BSS=COMPLETED | | | BSS=COMPLETED | |
+---------------------------------+ +------------------------+ | +-------------------------+ | +-----------------------+ |
| | |
| | |
+------------------------+ | +-------------------------+ | +------------------------+ |
|BROKER_SHUTDOWN_CANCELED| | |PLAN_COMPUTATION_CANCELED| | | PLAN_EXECUTION_CANCELED| |
| | | | | | | | |
| PAR=CANCELED +<------------+ | PAR=CANCELED +<----------+ | PAR=CANCELED +<------+
| BSS=CANCELED | | BSS=COMPLETED | | BSS=COMPLETED |
+------------------------+ +-------------------------+ +------------------------+
Created via https://asciiflow.com/Modifier and Type | Class and Description |
---|---|
static class |
BrokerRemovalStateMachine.BrokerRemovalEvent |
static class |
BrokerRemovalStateMachine.BrokerRemovalState
All the possible states of the broker removal operation
|
currentState
Constructor and Description |
---|
BrokerRemovalStateMachine(int brokerId) |
BrokerRemovalStateMachine(int brokerId,
BrokerRemovalStateMachine.BrokerRemovalState currentState) |
BrokerRemovalStateMachine(int brokerId,
BrokerRemovalStateMachine.BrokerRemovalState currentState,
org.apache.kafka.common.utils.Time time) |
Modifier and Type | Method and Description |
---|---|
static org.apache.kafka.clients.admin.BalancerOperationStatus |
convertBrokerRemovalStatus(org.apache.kafka.clients.admin.BrokerShutdownStatus shutdownStatus,
org.apache.kafka.clients.admin.PartitionReassignmentsStatus partitionReassignmentsStatus)
Converts the specific status of a broker removal operation to a #
BalancerOperationStatus . |
static boolean |
isStateTerminal(BrokerRemovalStateMachine.BrokerRemovalState state) |
advanceState, createTime, isTerminalState, lastUpdateTime
public BrokerRemovalStateMachine(int brokerId)
public BrokerRemovalStateMachine(int brokerId, BrokerRemovalStateMachine.BrokerRemovalState currentState)
public BrokerRemovalStateMachine(int brokerId, BrokerRemovalStateMachine.BrokerRemovalState currentState, org.apache.kafka.common.utils.Time time)
public static boolean isStateTerminal(BrokerRemovalStateMachine.BrokerRemovalState state)
public static org.apache.kafka.clients.admin.BalancerOperationStatus convertBrokerRemovalStatus(org.apache.kafka.clients.admin.BrokerShutdownStatus shutdownStatus, org.apache.kafka.clients.admin.PartitionReassignmentsStatus partitionReassignmentsStatus)
BalancerOperationStatus
.
In order of priority:
1. If both statuses are completed, the operation is considered in a SUCCESS status
2. If one of both statuses are canceled or failed, the operation is in a FAILEd status
3. If none of the above hold, then the operation is in an IN_PROGRESS status