public enum TableMigrationStatus extends Enum<TableMigrationStatus>
Table migration follows a 2-phase deployment to consolidate CoordinatorState and WorkerMetricStats from separate DDB tables into the Lease table:
CoordinatorConfig#migrateAllEntitiesToLeaseTable()
= false). Workers emit a min support code in WorkerMetricStats to signal readiness.CoordinatorConfig#migrateAllEntitiesToLeaseTable() = true.
Workers switch to writing all entities (WorkerMetricStats, CoordinatorState) to the Lease table.This enum is persisted in storage, so any changes to it need to be backward compatible. Reorganizing the values is not backward compatible; if versions are removed, the corresponding enum value cannot be reused without backward compatibility considerations.
3.4x -> 3.5x Table Migration
.------------------------------------------------------------------------------------------------------------------.
| .-----------------------.-----------------------------. .-------------------------------. |
| | ^ min support code | | code rollback | |
| | | not met due to rollback | | | |
| V | (Best effort) | V | V
Start ------------------> INIT -----------------------> DEPLOYED -----------------------> PENDING ---------------> COMPLETE
Phase 1 Bake time Phase 2 deployment Bake time
deployment (migrateAllEntitiesToLeaseTable (configured via
Leader writes INIT = true) tableMigrationCompleteBakeTimeSeconds)
when all workers Leader writes PENDING when
emit min support code all workers emit to lease table
in WorkerMetricStats and CoordinatorState entries
are moved to Lease table
There is local state workers use and there is a global state that the leader manages
as a TableMigrationState which is a CoordinatorState entry in DDB.
TableMigrationStateMachineImpl,
CoordinatorConfig#migrateAllEntitiesToLeaseTable()| Enum Constant and Description |
|---|
TABLE_MIGRATION_STATUS_COMPLETE
This status indicates that table migration is complete.
|
TABLE_MIGRATION_STATUS_DEPLOYED
This state in DDB signifies all workers are emitting min support code
in the Worker metric stats steadily for the bake time and the application
is ready to move on to phase 2 deployment.
|
TABLE_MIGRATION_STATUS_INIT
This state in the DDB signifies all workers are emitting min support code in
WorkerMetricStats and the bake time to move to DEPLOYED has started.
|
TABLE_MIGRATION_STATUS_PENDING
This state in DDB signifies, all workers have been deployed with phase 2
cofiguration and have switched writing to workerMetricStats into lease table
and the leader has moved over all other coordinatorState entries from legacy
table to the lease table.
|
TABLE_MIGRATION_STATUS_UNKNOWN
This is a local state before table migration status is either
determined by reading the DDB status and the KCL configuration.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getBakeTimeSeconds(Map<TableMigrationStatus,Long> overrides) |
static TableMigrationStatus |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TableMigrationStatus[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TableMigrationStatus TABLE_MIGRATION_STATUS_UNKNOWN
public static final TableMigrationStatus TABLE_MIGRATION_STATUS_INIT
public static final TableMigrationStatus TABLE_MIGRATION_STATUS_DEPLOYED
public static final TableMigrationStatus TABLE_MIGRATION_STATUS_PENDING
public static final TableMigrationStatus TABLE_MIGRATION_STATUS_COMPLETE
CoordinatorConfig#tableMigrationCompleteBakeTimeSeconds().public static TableMigrationStatus[] values()
for (TableMigrationStatus c : TableMigrationStatus.values()) System.out.println(c);
public static TableMigrationStatus valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic long getBakeTimeSeconds(Map<TableMigrationStatus,Long> overrides)
Copyright © 2026. All rights reserved.