use of com.bonree.brfs.rebalance.recover.MultiRecover in project BRFS by zhangnianli.
the class TaskOperation method launchDelayTaskExecutor.
public void launchDelayTaskExecutor(BalanceTaskSummary taskSummary, String taskPath) {
DataRecover recover = null;
List<String> multiIds = taskSummary.getOutputServers();
if (multiIds.contains(idManager.getSecondServerID(taskSummary.getStorageIndex()))) {
// 注册自身的selfMultiId,并设置为created阶段
if (taskSummary.getTaskType() == RecoverType.NORMAL) {
// 正常迁移任务
StorageRegion node = snManager.findStorageRegionById(taskSummary.getStorageIndex());
if (node == null) {
LOG.error("无法开启对" + taskSummary.getStorageIndex() + "的任务");
return;
}
String storageName = snManager.findStorageRegionById(taskSummary.getStorageIndex()).getName();
recover = new MultiRecover(taskSummary, idManager, serviceManager, taskPath, client, dataDir, storageName, baseRoutesPath);
} else if (taskSummary.getTaskType() == RecoverType.VIRTUAL) {
// 虚拟迁移任务
StorageRegion node = snManager.findStorageRegionById(taskSummary.getStorageIndex());
if (node == null) {
LOG.error("无法开启对" + taskSummary.getStorageIndex() + "的任务");
return;
}
String storageName = snManager.findStorageRegionById(taskSummary.getStorageIndex()).getName();
recover = new VirtualRecover(client, taskSummary, taskPath, dataDir, storageName, idManager, serviceManager);
}
updateTaskStatus(taskSummary, TaskStatus.RUNNING);
launchTask(recover);
}
}
Aggregations