public class BrokerAdditionStateMachine extends StateMachine<BrokerAdditionStateMachine.BrokerAdditionState,BrokerAdditionStateMachine.BrokerAdditionEvent>
+-----------------------------+
| REASSIGNMENT_CANCELED |
| <-------------------------+
| CANCELED | |
+-----------------------------+ |
|
+-----------------------------+ |
| PLAN_COMPUTATION_CANCELED | |
| <-----------+ |
| CANCELED | | |
+-----------------------------+ | |
| | BROKER_EXCLUSION_DETECTED
BROKER_EXCLUSION_DETECTED | BROKER_REMOVAL_REQUEST_OVERRIDES | BROKER_REMOVAL_REQUEST_OVERRIDES
| |
| |
+-------------+ +---------------+-------------+ SUCCESS +--------------+--------------+ SUCCESS +-----------------------------+
| | | PLAN_COMPUTATION | | REASSIGNMENT | | COMPLETED |
| START +--------->+ +------------------> +-----------------> |
| | | PENDING | | IN_PROGRESS | | COMPLETED |
+-------------+ +---------------+-------------+ +--------------+--------------+ +-----------------------------+
| |
| UNEXPECTED_ERROR | UNEXPECTED_ERROR
| |
+-----------------------------+ | |
| PLAN_COMPUTATION_FAILED | | |
| <-----------+ |
| ERROR | |
+-----------------------------+ |
+-----------------------------+ |
| REASSIGNMENT_FAILED | |
| <------------------------+
| ERROR |
+-----------------------------+
Modifier and Type | Class and Description |
---|---|
static class |
BrokerAdditionStateMachine.BrokerAdditionEvent
An #
BalancerOperationEvent that can take place during the broker addition operation |
static class |
BrokerAdditionStateMachine.BrokerAdditionState
All the possible states of the broker addition operation
|
currentState
Constructor and Description |
---|
BrokerAdditionStateMachine(int brokerId) |
BrokerAdditionStateMachine(int brokerId,
org.apache.kafka.common.utils.Time time) |
Modifier and Type | Method and Description |
---|---|
static org.apache.kafka.clients.admin.BalancerOperationStatus |
convertBrokerAdditionStatus(org.apache.kafka.clients.admin.PartitionReassignmentsStatus partitionReassignmentsStatus)
Converts the specific sub-task status of a broker addition operation to a #
BalancerOperationStatus . |
static boolean |
isStateTerminal(BrokerAdditionStateMachine.BrokerAdditionState state) |
advanceState, createTime, isTerminalState, lastUpdateTime
public BrokerAdditionStateMachine(int brokerId)
public BrokerAdditionStateMachine(int brokerId, org.apache.kafka.common.utils.Time time)
public static boolean isStateTerminal(BrokerAdditionStateMachine.BrokerAdditionState state)
public static org.apache.kafka.clients.admin.BalancerOperationStatus convertBrokerAdditionStatus(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