use of com.ctrip.xpipe.redis.console.migration.model.impl.DefaultMigrationEvent in project x-pipe by ctripcorp.
the class MigrationEventDao method loadMigrationEvent.
private MigrationEvent loadMigrationEvent(List<MigrationEventTbl> details) {
if (!CollectionUtils.isEmpty(details)) {
MigrationEvent event = new DefaultMigrationEvent(details.get(0));
for (MigrationEventTbl detail : details) {
MigrationClusterTbl cluster = detail.getRedundantClusters();
MigrationShardTbl shard = detail.getRedundantShards();
if (null == event.getMigrationCluster(cluster.getClusterId())) {
event.addMigrationCluster(new DefaultMigrationCluster(executors, scheduled, event, detail.getRedundantClusters(), dcService, clusterService, shardService, redisService, migrationService));
}
MigrationCluster migrationCluster = event.getMigrationCluster(cluster.getClusterId());
migrationCluster.addNewMigrationShard(new DefaultMigrationShard(migrationCluster, shard, migrationCluster.getClusterShards().get(shard.getShardId()), migrationCluster.getClusterDcs(), migrationService));
}
return event;
}
throw new BadRequestException("Cannot load migration event from null.");
}
Aggregations