Skip to content

Commit

Permalink
Refactor MigrateTableUpdater (#29221)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Nov 27, 2023
1 parent 0df0325 commit 2422d4b
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@
*/
public final class MigrateTableUpdater implements RALUpdater<MigrateTableStatement> {

private final MigrationJobAPI jobAPI = (MigrationJobAPI) TypedSPILoader.getService(TransmissionJobAPI.class, "MIGRATION");

@Override
public void executeUpdate(final String databaseName, final MigrateTableStatement sqlStatement) {
String targetDatabaseName = null == sqlStatement.getTargetDatabaseName() ? databaseName : sqlStatement.getTargetDatabaseName();
ShardingSpherePreconditions.checkNotNull(targetDatabaseName, MissingRequiredTargetDatabaseException::new);
MigrationJobAPI jobAPI = (MigrationJobAPI) TypedSPILoader.getService(TransmissionJobAPI.class, "MIGRATION");
jobAPI.start(new PipelineContextKey(InstanceType.PROXY), new MigrateTableStatement(sqlStatement.getSourceTargetEntries(), targetDatabaseName));
}

Expand Down

0 comments on commit 2422d4b

Please sign in to comment.