Shubhendu Tripathi has uploaded a new change for review. Change subject: gluster: WIP - Populate host ip in volume rebalance status ......................................................................
gluster: WIP - Populate host ip in volume rebalance status Modified the query to set the host IP instead of host name in gluster volume rebalance status details. Change-Id: If83755d715df3cf116afa9dfa87b2f8680e8fffa Bug-Url: https://bugzilla.redhat.com/1011885 Signed-off-by: Shubhendu Tripathi <shtri...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetGlusterVolumeRebalanceStatusQuery.java 1 file changed, 18 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/65/19665/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetGlusterVolumeRebalanceStatusQuery.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetGlusterVolumeRebalanceStatusQuery.java index c63daba..61552b9 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetGlusterVolumeRebalanceStatusQuery.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetGlusterVolumeRebalanceStatusQuery.java @@ -3,8 +3,10 @@ import java.util.List; import org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask; +import org.ovirt.engine.core.common.businessentities.VDS; import org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity; import org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity; +import org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusForHost; import org.ovirt.engine.core.common.errors.VdcBllMessages; import org.ovirt.engine.core.common.job.Step; import org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters; @@ -12,6 +14,7 @@ import org.ovirt.engine.core.common.vdscommands.VDSReturnValue; import org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeVDSParameters; import org.ovirt.engine.core.compat.Guid; +import org.ovirt.engine.core.dal.dbbroker.DbFacade; import org.ovirt.engine.core.dao.StepDao; public class GetGlusterVolumeRebalanceStatusQuery<P extends GlusterVolumeQueriesParameters> extends GlusterQueriesCommandBase<P> { @@ -60,9 +63,24 @@ entity.setStartTime(stepsList.get(0).getStartTime()); } + // Set the host ip in status details + updateHostIP(entity); + return entity; } + private void updateHostIP(GlusterVolumeTaskStatusEntity taskStatus) { + for (GlusterVolumeTaskStatusForHost hostStatus : taskStatus.getHostwiseStatusDetails()) { + Guid hostUuid = hostStatus.getHostUuid(); + if (hostUuid != null) { + VDS host = DbFacade.getInstance().getVdsDao().get(hostUuid); + String hostIP = host.getHostName(); + // Set the host ip in the entity + hostStatus.setHostName(hostIP); + } + } + } + public StepDao getStepDao() { return getDbFacade().getStepDao(); } -- To view, visit http://gerrit.ovirt.org/19665 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If83755d715df3cf116afa9dfa87b2f8680e8fffa Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Shubhendu Tripathi <shtri...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches