Search in sources :

Example 1 with JobExecutionStatus

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);
}
Also used : JobExecutionStatus(org.ovirt.engine.core.common.job.JobExecutionStatus) Step(org.ovirt.engine.core.common.job.Step) Job(org.ovirt.engine.core.common.job.Job)

Example 2 with JobExecutionStatus

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);
        }
    }
}
Also used : JobExecutionStatus(org.ovirt.engine.core.common.job.JobExecutionStatus) Step(org.ovirt.engine.core.common.job.Step)

Example 3 with JobExecutionStatus

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;
}
Also used : JobExecutionStatus(org.ovirt.engine.core.common.job.JobExecutionStatus) GlusterAsyncTask(org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask) GlusterVolumeRemoveBricksVDSParameters(org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeRemoveBricksVDSParameters) GlusterVolumeTaskStatusEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Example 4 with JobExecutionStatus

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);
}
Also used : JobExecutionStatus(org.ovirt.engine.core.common.job.JobExecutionStatus) GlusterVolumeTaskStatusEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity) GlusterVolumeVDSParameters(org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeVDSParameters) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Aggregations

JobExecutionStatus (org.ovirt.engine.core.common.job.JobExecutionStatus)4 GlusterVolumeTaskStatusEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity)2 Step (org.ovirt.engine.core.common.job.Step)2 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)2 GlusterAsyncTask (org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask)1 Job (org.ovirt.engine.core.common.job.Job)1 GlusterVolumeRemoveBricksVDSParameters (org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeRemoveBricksVDSParameters)1 GlusterVolumeVDSParameters (org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeVDSParameters)1