@ThreadSafe public class MigrationStateMachineImpl extends Object implements MigrationStateMachine
MigrationStateMachine| Modifier and Type | Field and Description |
|---|---|
static String |
FAULT_METRIC |
static String |
METRICS_OPERATION |
| Constructor and Description |
|---|
MigrationStateMachineImpl(MetricsFactory metricsFactory,
Callable<Long> timeProvider,
CoordinatorStateDAO coordinatorStateDAO,
ScheduledExecutorService stateMachineThreadPool,
CoordinatorConfig.ClientVersionConfig clientVersionConfig,
Random random,
DynamicMigrationComponentsInitializer initializer,
String workerId,
long flipTo3XStabilizerTimeInSeconds) |
| Modifier and Type | Method and Description |
|---|---|
ClientVersion |
getCurrentClientVersion()
Get the ClientVersion of current state machine state.
|
void |
initialize()
Initialize the state machine by identifying the initial state when the KCL worker comes up for the first time.
|
void |
shutdown()
Shutdown state machine and perform necessary cleanup for the worker to gracefully shutdown
|
void |
terminate()
Terminate the state machine when it reaches a terminal state, which is a successful upgrade
to v3.x.
|
void |
transitionTo(ClientVersion nextClientVersion,
MigrationState migrationState)
Peform transition from current state to the given new ClientVersion
|
public static final String FAULT_METRIC
public static final String METRICS_OPERATION
public MigrationStateMachineImpl(MetricsFactory metricsFactory, Callable<Long> timeProvider, CoordinatorStateDAO coordinatorStateDAO, ScheduledExecutorService stateMachineThreadPool, CoordinatorConfig.ClientVersionConfig clientVersionConfig, Random random, DynamicMigrationComponentsInitializer initializer, String workerId, long flipTo3XStabilizerTimeInSeconds)
public void initialize()
throws DependencyException
MigrationStateMachineinitialize in interface MigrationStateMachineDependencyException - When unable to identify the initial state.public void shutdown()
MigrationStateMachineshutdown in interface MigrationStateMachinepublic void terminate()
MigrationStateMachineterminate in interface MigrationStateMachinepublic void transitionTo(ClientVersion nextClientVersion, MigrationState migrationState) throws DependencyException
MigrationStateMachinetransitionTo in interface MigrationStateMachinenextClientVersion - clientVersion of the new state the state machine must transition tomigrationState - the current MigrationState in dynamoDependencyException - when transition fails due to dependency on DDB failing in
unexpected ways.public ClientVersion getCurrentClientVersion()
MigrationStateMachinegetCurrentClientVersion in interface MigrationStateMachineCopyright © 2025. All rights reserved.