use of com.emc.storageos.volumecontroller.impl.block.taskcompleter.BlockMirrorResumeCompleter in project coprhd-controller by CoprHD.
the class BlockDeviceController method resumeNativeContinuousCopy.
public void resumeNativeContinuousCopy(URI storage, List<URI> mirrorList, Boolean isCG, String opId) throws ControllerException {
try {
WorkflowStepCompleter.stepExecuting(opId);
StorageSystem storageObj = _dbClient.queryObject(StorageSystem.class, storage);
TaskCompleter completer = new BlockMirrorResumeCompleter(mirrorList, opId);
if (!isCG) {
getDevice(storageObj.getSystemType()).doResumeNativeContinuousCopy(storageObj, mirrorList.get(0), completer);
} else {
completer.addConsistencyGroupId(ConsistencyGroupUtils.getMirrorsConsistencyGroup(mirrorList, _dbClient).getId());
getDevice(storageObj.getSystemType()).doResumeGroupNativeContinuousCopies(storageObj, mirrorList, completer);
}
} catch (Exception e) {
ServiceError serviceError = DeviceControllerException.errors.jobFailed(e);
WorkflowStepCompleter.stepFailed(opId, serviceError);
}
}
use of com.emc.storageos.volumecontroller.impl.block.taskcompleter.BlockMirrorResumeCompleter in project coprhd-controller by CoprHD.
the class SmisBlockResumeMirrorJob method updateStatus.
@Override
public void updateStatus(JobContext jobContext) throws Exception {
log.info("START updateStatus for resuming {}", getTaskCompleter().getId());
DbClient dbClient = jobContext.getDbClient();
JobStatus jobStatus = getJobStatus();
try {
if (jobStatus == JobStatus.IN_PROGRESS) {
return;
}
BlockMirrorResumeCompleter taskCompleter = (BlockMirrorResumeCompleter) getTaskCompleter();
if (jobStatus == JobStatus.SUCCESS) {
log.info("Mirror resume success");
BlockMirror mirror = dbClient.queryObject(BlockMirror.class, taskCompleter.getMirrorURI());
log.info("Updating sync details for mirror {}", mirror.getId());
WBEMClient client = getWBEMClient(dbClient, jobContext.getCimConnectionFactory());
updateSynchronizationAspects(client, mirror);
dbClient.persistObject(mirror);
getTaskCompleter().ready(dbClient);
} else if (jobStatus == JobStatus.ERROR) {
log.info("Mirror resume failed");
}
} catch (Exception e) {
String errorMsg = "Failed job to resume mirror: " + e.getMessage();
log.error(errorMsg, e);
setPostProcessingErrorStatus(errorMsg);
} finally {
super.updateStatus(jobContext);
log.info("FINISH updateStatus for resuming {}", getTaskCompleter().getId());
}
}
Aggregations