use of com.ctrip.xpipe.redis.console.migration.model.MigrationShard in project x-pipe by ctripcorp.
the class MigrationCheckingState method doShardCheck.
private void doShardCheck(MigrationCluster migrationCluster) {
List<MigrationShard> migrationShards = migrationCluster.getMigrationShards();
for (final MigrationShard migrationShard : migrationShards) {
migrationShard.retry(ShardMigrationStep.CHECK);
executors.execute(new AbstractExceptionLogTask() {
@Override
public void doRun() {
migrationShard.doCheck();
}
});
}
}
use of com.ctrip.xpipe.redis.console.migration.model.MigrationShard in project x-pipe by ctripcorp.
the class MigrationForcePublishState method doAction.
@Override
public void doAction() {
CountDownLatch latch = new CountDownLatch(getHolder().getMigrationShards().size());
for (MigrationShard migrationShard : getHolder().getMigrationShards()) {
executors.execute(new AbstractExceptionLogTask() {
@Override
public void doRun() {
try {
logger.info("[doOtherDcMigrate][start]{},{}", getHolder().clusterName(), migrationShard.getCurrentShard().getShardName());
migrationShard.doMigrateOtherDc();
logger.info("[doOtherDcMigrate][done]{},{}", getHolder().clusterName(), migrationShard.getCurrentShard().getShardName());
} finally {
latch.countDown();
}
}
});
}
try {
latch.await();
updateAndProcess(nextAfterSuccess());
} catch (InterruptedException e) {
logger.error("[MigrationForcePublishState][tryAction][Interrupted][will retry]", e);
updateAndProcess(nextAfterFail());
}
}
Aggregations