Search in sources :

Example 11 with GlusterAsyncTask

use of org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask in project ovirt-engine by oVirt.

the class StartRemoveGlusterVolumeBricksCommand method executeCommand.

@Override
protected void executeCommand() {
    int replicaCount = getGlusterVolume().getVolumeType().isReplicatedType() ? getParameters().getReplicaCount() : 0;
    startSubStep();
    VDSReturnValue returnValue = runVdsCommand(VDSCommandType.StartRemoveGlusterVolumeBricks, new GlusterVolumeRemoveBricksVDSParameters(upServer.getId(), getGlusterVolumeName(), getParameters().getBricks(), replicaCount, false));
    setSucceeded(returnValue.getSucceeded());
    if (!getSucceeded()) {
        handleVdsError(AuditLogType.START_REMOVING_GLUSTER_VOLUME_BRICKS_FAILED, returnValue.getVdsError().getMessage());
        return;
    }
    GlusterAsyncTask glusterTask = (GlusterAsyncTask) returnValue.getReturnValue();
    handleTaskReturn(glusterTask);
    updateBricksWithTaskID(glusterTask);
    getReturnValue().setActionReturnValue(returnValue.getReturnValue());
}
Also used : GlusterAsyncTask(org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask) GlusterVolumeRemoveBricksVDSParameters(org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeRemoveBricksVDSParameters) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Example 12 with GlusterAsyncTask

use of org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask in project ovirt-engine by oVirt.

the class StopRebalanceGlusterVolumeCommandTest method getVolumeWithRebalanceTask.

private GlusterVolumeEntity getVolumeWithRebalanceTask(Guid volumeId) {
    GlusterVolumeEntity volume = getVolume(volumeId);
    GlusterAsyncTask asyncTask = new GlusterAsyncTask();
    asyncTask.setStatus(JobExecutionStatus.STARTED);
    asyncTask.setType(GlusterTaskType.REBALANCE);
    volume.setAsyncTask(asyncTask);
    return volume;
}
Also used : GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) GlusterAsyncTask(org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask)

Example 13 with GlusterAsyncTask

use of org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask in project ovirt-engine by oVirt.

the class GetGlusterVolumeRemoveBricksStatusQueryTest method getAsyncTask.

private GlusterAsyncTask getAsyncTask() {
    GlusterAsyncTask asyncTask = new GlusterAsyncTask();
    asyncTask.setStepId(STEP_ID);
    asyncTask.setType(GlusterTaskType.REBALANCE);
    asyncTask.setStatus(JobExecutionStatus.FINISHED);
    asyncTask.setMessage("test_msg");
    asyncTask.setTaskId(Guid.newGuid());
    GlusterTaskParameters params = new GlusterTaskParameters();
    params.setVolumeName("volume1");
    asyncTask.setTaskParameters(params);
    return asyncTask;
}
Also used : GlusterTaskParameters(org.ovirt.engine.core.common.asynctasks.gluster.GlusterTaskParameters) GlusterAsyncTask(org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask)

Example 14 with GlusterAsyncTask

use of org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask in project ovirt-engine by oVirt.

the class GlusterTasksSyncJobTest method createTask.

private GlusterAsyncTask createTask(Guid guid, JobExecutionStatus status) {
    GlusterAsyncTask task = new GlusterAsyncTask();
    task.setTaskId(guid);
    task.setTaskParameters(new GlusterTaskParameters());
    task.getTaskParameters().setVolumeName("VOL");
    task.setMessage("message");
    task.setStatus(status);
    task.setType(GlusterTaskType.REBALANCE);
    return task;
}
Also used : GlusterTaskParameters(org.ovirt.engine.core.common.asynctasks.gluster.GlusterTaskParameters) GlusterAsyncTask(org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask)

Example 15 with GlusterAsyncTask

use of org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask in project ovirt-engine by oVirt.

the class CommitRemoveGlusterVolumeBricksCommandTest method getVolumeWithRemoveBricksTask.

@Override
protected GlusterVolumeEntity getVolumeWithRemoveBricksTask(Guid volumeId) {
    GlusterVolumeEntity volume = getVolume(volumeId);
    GlusterAsyncTask asyncTask = new GlusterAsyncTask();
    asyncTask.setStatus(JobExecutionStatus.FINISHED);
    asyncTask.setType(GlusterTaskType.REMOVE_BRICK);
    volume.setAsyncTask(asyncTask);
    return volume;
}
Also used : GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) GlusterAsyncTask(org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask)

Aggregations

GlusterAsyncTask (org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask)30 GlusterBrickEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity)11 GlusterVolumeEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)10 ArrayList (java.util.ArrayList)7 Test (org.junit.Test)5 GlusterTaskParameters (org.ovirt.engine.core.common.asynctasks.gluster.GlusterTaskParameters)4 Step (org.ovirt.engine.core.common.job.Step)4 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)4 Guid (org.ovirt.engine.core.compat.Guid)4 EngineException (org.ovirt.engine.core.common.errors.EngineException)3 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)3 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)3 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 List (java.util.List)2 JobExecutionStatus (org.ovirt.engine.core.common.job.JobExecutionStatus)2 GlusterVolumeRemoveBricksVDSParameters (org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeRemoveBricksVDSParameters)2 Collection (java.util.Collection)1 Date (java.util.Date)1 Map (java.util.Map)1