use of com.palantir.atlasdb.schema.TaskProgress in project atlasdb by palantir.
the class KeyValueServiceMigrators method setupMigrator.
public static KeyValueServiceMigrator setupMigrator(MigratorSpec migratorSpec) {
AtlasDbServices fromServices = migratorSpec.fromServices();
long migrationStartTimestamp = fromServices.getTimestampService().getFreshTimestamp();
long migrationCommitTimestamp = fromServices.getTimestampService().getFreshTimestamp();
AtlasDbServices toServices = migratorSpec.toServices();
TimestampManagementService toTimestampManagementService = getTimestampManagementService(toServices);
toServices.getTransactionService().putUnlessExists(migrationStartTimestamp, migrationCommitTimestamp);
toTimestampManagementService.fastForwardTimestamp(migrationCommitTimestamp + 1);
return new KeyValueServiceMigrator(CHECKPOINT_NAMESPACE, fromServices.getTransactionManager(), toServices.getTransactionManager(), fromServices.getKeyValueService(), toServices.getKeyValueService(), Suppliers.ofInstance(migrationStartTimestamp), migratorSpec.threads(), migratorSpec.batchSize(), ImmutableMap.of(), (String message, KeyValueServiceMigrator.KvsMigrationMessageLevel level) -> printer.info(level.toString() + ": " + message), new TaskProgress() {
@Override
public void beginTask(String message, int tasks) {
printer.info(message);
}
@Override
public void subTaskComplete() {
//
}
@Override
public void taskComplete() {
//
}
}, ImmutableSet.of());
}
Aggregations