use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity in project ovirt-engine by oVirt.
the class GetGlusterVolumeRebalanceStatusQueryTest method setupExpectedVolume.
private void setupExpectedVolume() {
expectedVolumeStatusDetails = new GlusterVolumeTaskStatusEntity();
expectedVolumeStatusDetails.setHostwiseStatusDetails(getHostwiseStatusDetails());
expectedVolumeStatusDetails.setStatusSummary(getStatusSummary());
expectedVolumeStatusDetails.setStartTime(new Date());
expectedVolumeStatusDetails.setStatusTime(new Date());
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity in project ovirt-engine by oVirt.
the class StopRemoveGlusterVolumeBricksCommandTest method mockBackend.
private void mockBackend(boolean succeeded, EngineError errorCode) {
doNothing().when(cmd).endStepJobAborted(any());
doNothing().when(cmd).releaseVolumeLock();
VDSReturnValue vdsReturnValue = new VDSReturnValue();
vdsReturnValue.setSucceeded(succeeded);
if (!succeeded) {
vdsReturnValue.setVdsError(new VDSError(errorCode, ""));
} else {
vdsReturnValue.setReturnValue(new GlusterVolumeTaskStatusEntity());
}
when(vdsBrokerFrontend.runVdsCommand(eq(VDSCommandType.StopRemoveGlusterVolumeBricks), any())).thenReturn(vdsReturnValue);
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity 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);
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity in project ovirt-engine by oVirt.
the class StopRemoveGlusterVolumeBricksCommand method executeCommand.
@Override
protected void executeCommand() {
GlusterVolumeEntity volume = getGlusterVolume();
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.StopRemoveGlusterVolumeBricks, new GlusterVolumeRemoveBricksVDSParameters(getUpServer().getId(), volume.getName(), getParameters().getBricks()));
setSucceeded(returnValue.getSucceeded());
if (!getSucceeded()) {
handleVdsError(AuditLogType.GLUSTER_VOLUME_REMOVE_BRICKS_FAILED, returnValue.getVdsError().getMessage());
return;
}
GlusterVolumeTaskStatusEntity rebalanceStatusEntity = (GlusterVolumeTaskStatusEntity) returnValue.getReturnValue();
endStepJobAborted(glusterTaskUtils.getSummaryMessage(rebalanceStatusEntity.getStatusSummary()));
releaseVolumeLock();
getReturnValue().setActionReturnValue(rebalanceStatusEntity);
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity in project ovirt-engine by oVirt.
the class StopRebalanceGlusterVolumeVDSCommand method executeVdsBrokerCommand.
@Override
protected void executeVdsBrokerCommand() {
String volumeName = getParameters().getVolumeName();
result = getBroker().glusterVolumeRebalanceStop(volumeName);
proceedProxyReturnValue();
// Set the current engine time as status time
GlusterVolumeTaskStatusEntity entity = result.getStatusDetails();
entity.setStatusTime(new Date());
setReturnValue(entity);
}
Aggregations