use of com.emc.storageos.volumecontroller.impl.block.taskcompleter.CloneFractureCompleter in project coprhd-controller by CoprHD.
the class BlockDeviceController method fractureListClone.
public void fractureListClone(URI storage, List<URI> cloneList, Boolean sync, String taskId) {
TaskCompleter completer = null;
try {
WorkflowStepCompleter.stepExecuting(taskId);
StorageSystem storageSystem = _dbClient.queryObject(StorageSystem.class, storage);
completer = new CloneFractureCompleter(cloneList, taskId);
getDevice(storageSystem.getSystemType()).doFractureListReplica(storageSystem, cloneList, sync, completer);
} catch (Exception e) {
_log.error(e.getMessage(), e);
ServiceError serviceError = DeviceControllerException.errors.jobFailed(e);
doFailTask(Volume.class, cloneList, taskId, serviceError);
if (completer != null) {
completer.error(_dbClient, serviceError);
}
WorkflowStepCompleter.stepFailed(taskId, serviceError);
}
}
use of com.emc.storageos.volumecontroller.impl.block.taskcompleter.CloneFractureCompleter in project coprhd-controller by CoprHD.
the class BlockDeviceController method fractureClone.
public boolean fractureClone(URI storage, List<URI> clone, boolean isCG, String opId) {
_log.info("Fracture clone: {}", clone.get(0));
TaskCompleter completer = null;
try {
StorageSystem storageDevice = _dbClient.queryObject(StorageSystem.class, storage);
WorkflowStepCompleter.stepExecuting(opId);
if (!isCG) {
Volume cloneVol = _dbClient.queryObject(Volume.class, clone.get(0));
completer = new CloneFractureCompleter(clone.get(0), opId);
WorkflowStepCompleter.stepExecuting(opId);
// Synchronous operation
getDevice(storageDevice.getSystemType()).doFractureClone(storageDevice, cloneVol.getAssociatedSourceVolume(), clone.get(0), completer);
} else {
_log.info("Fracture group clone.");
completer = new CloneFractureCompleter(clone, opId);
WorkflowStepCompleter.stepExecuting(opId);
// Synchronous operation
getDevice(storageDevice.getSystemType()).doFractureGroupClone(storageDevice, clone, completer);
}
} catch (Exception e) {
_log.error(String.format("Fracture restore sessions step failed - storage: %s, clone: %s", storage.toString(), clone.toString()));
ServiceError serviceError = DeviceControllerException.errors.jobFailed(e);
if (completer != null) {
completer.error(_dbClient, serviceError);
}
doFailTask(Volume.class, clone, opId, serviceError);
WorkflowStepCompleter.stepFailed(opId, serviceError);
return false;
}
return true;
}
Aggregations