use of org.ovirt.engine.core.common.job.JobExecutionStatus in project ovirt-engine by oVirt.
the class TaskStatusColumn method getTooltip.
@Override
public SafeHtml getTooltip(EntityModel jobOrStep) {
JobExecutionStatus jobExecutionStatus = null;
if (jobOrStep.getEntity() instanceof Job) {
jobExecutionStatus = ((Job) jobOrStep.getEntity()).getStatus();
} else if (jobOrStep.getEntity() instanceof Step) {
jobExecutionStatus = ((Step) jobOrStep.getEntity()).getStatus();
} else {
return null;
}
String tooltipContent = EnumTranslator.getInstance().translate(jobExecutionStatus);
return SafeHtmlUtils.fromString(tooltipContent);
}
use of org.ovirt.engine.core.common.job.JobExecutionStatus in project ovirt-engine by oVirt.
the class GlusterTaskUtils method updateSteps.
public void updateSteps(Cluster cluster, GlusterAsyncTask task, List<Step> steps) {
// update status in step table
for (Step step : steps) {
if (step.getEndTime() != null) {
// we have already processed the task
continue;
}
JobExecutionStatus oldStatus = step.getStatus();
step.setDescription(getTaskMessage(cluster, step.getStepType(), task));
step.setStatus(task.getStatus());
logEventMessage(task, oldStatus, cluster);
if (hasTaskCompleted(task)) {
step.markStepEnded(task.getStatus());
endStepJob(step);
releaseVolumeLock(task.getTaskId());
} else {
jobRepository.updateStep(step);
}
}
}
use of org.ovirt.engine.core.common.job.JobExecutionStatus in project ovirt-engine by oVirt.
the class GetGlusterVolumeRemoveBricksStatusQuery method fetchTaskStatusDetails.
@Override
protected GlusterVolumeTaskStatusEntity fetchTaskStatusDetails() {
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeRemoveBricksStatus, new GlusterVolumeRemoveBricksVDSParameters(getUpServerId(clusterId), volume.getName(), getParameters().getBricks(), volume.getReplicaCount()));
GlusterVolumeTaskStatusEntity entity = (GlusterVolumeTaskStatusEntity) returnValue.getReturnValue();
// Update the latest status details
GlusterAsyncTask asyncTask = volume.getAsyncTask();
if (asyncTask != null) {
// take a copy of the task status with engine for further use
JobExecutionStatus jobStatusWithEngine = volume.getAsyncTask().getStatus();
// update the status entity with required details
updateStatusEntity(entity);
// be set to aborted. This is required only in case of remove bricks
if (jobStatusWithEngine == JobExecutionStatus.ABORTED) {
entity.getStatusSummary().setStatus(JobExecutionStatus.ABORTED);
}
}
return entity;
}
use of org.ovirt.engine.core.common.job.JobExecutionStatus in project ovirt-engine by oVirt.
the class StopRebalanceGlusterVolumeCommand method executeCommand.
@Override
protected void executeCommand() {
VDSReturnValue vdsReturnaValue = runVdsCommand(VDSCommandType.StopRebalanceGlusterVolume, new GlusterVolumeVDSParameters(upServer.getId(), getGlusterVolumeName()));
if (!vdsReturnaValue.getSucceeded()) {
handleVdsError(AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP_FAILED, vdsReturnaValue.getVdsError().getMessage());
setSucceeded(false);
return;
}
GlusterVolumeTaskStatusEntity rebalanceStatusEntity = (GlusterVolumeTaskStatusEntity) vdsReturnaValue.getReturnValue();
JobExecutionStatus stepStatus = rebalanceStatusEntity.getStatusSummary().getStatus();
if (stepStatus != null) {
endStepJob(stepStatus, getStepMessageMap(stepStatus, glusterTaskUtils.getSummaryMessage(rebalanceStatusEntity.getStatusSummary())), glusterTaskUtils.isTaskSuccess(stepStatus));
} else {
endStepJob(JobExecutionStatus.ABORTED, getStepMessageMap(JobExecutionStatus.ABORTED, null), false);
}
releaseVolumeLock();
setSucceeded(vdsReturnaValue.getSucceeded());
getReturnValue().setActionReturnValue(rebalanceStatusEntity);
}
Aggregations