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());
}
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;
}
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;
}
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;
}
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;
}
Aggregations