anmolbabu has uploaded a new change for review. Change subject: engine:BLL Command modified to return status after rebalance stop ......................................................................
engine:BLL Command modified to return status after rebalance stop BLL Command modified to return status after rebalance stop Change-Id: Ica92511e4898e2119eec312854f390a22152e212 Signed-off-by: Anmol Babu <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopRebalanceGlusterVolumeCommand.java 1 file changed, 23 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/85/19585/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopRebalanceGlusterVolumeCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopRebalanceGlusterVolumeCommand.java index cfa82e7..1d27ac1 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopRebalanceGlusterVolumeCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopRebalanceGlusterVolumeCommand.java @@ -1,12 +1,16 @@ package org.ovirt.engine.core.bll.gluster; +import java.util.List; + import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute; import org.ovirt.engine.core.common.AuditLogType; import org.ovirt.engine.core.common.action.gluster.GlusterVolumeRebalanceParameters; import org.ovirt.engine.core.common.asynctasks.gluster.GlusterTaskType; import org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity; +import org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity; import org.ovirt.engine.core.common.errors.VdcBllMessages; import org.ovirt.engine.core.common.job.JobExecutionStatus; +import org.ovirt.engine.core.common.job.Step; import org.ovirt.engine.core.common.job.StepEnum; import org.ovirt.engine.core.common.vdscommands.VDSCommandType; import org.ovirt.engine.core.common.vdscommands.VDSReturnValue; @@ -61,10 +65,28 @@ .getMessage()); return; } + else { + // Run the VDSM verb to get the status + VDSReturnValue vdsRettunValueStatus = + runVdsCommand(VDSCommandType.GetGlusterVolumeRebalanceStatus, + new GlusterVolumeVDSParameters(upServer.getId(), getGlusterVolumeName())); + + // Set the volume re-balance start time + GlusterVolumeTaskStatusEntity entity = + (GlusterVolumeTaskStatusEntity) vdsRettunValueStatus.getReturnValue(); + List<Step> stepsList = + getDbFacade().getStepDao() + .getStepsByExternalId(getGlusterVolumeDao().getById(getParameters().getVolumeId()) + .getAsyncTask() + .getStepId()); + if (stepsList != null && !stepsList.isEmpty()) { + entity.setStartTime(stepsList.get(0).getStartTime()); + } + getReturnValue().setActionReturnValue(entity); + } endStepJob(); releaseVolumeLock(); - getReturnValue().setActionReturnValue(vdsReturnaValue); } @Override -- To view, visit http://gerrit.ovirt.org/19585 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ica92511e4898e2119eec312854f390a22152e212 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: anmolbabu <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
