Search in sources :

Example 1 with GlusterVolumeTaskStatusForHost

use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusForHost in project ovirt-engine by oVirt.

the class GlusterAsyncTaskStatusQueryBase method updateHostIP.

private void updateHostIP(GlusterVolumeTaskStatusEntity taskStatus) {
    if (taskStatus != null) {
        for (GlusterVolumeTaskStatusForHost hostStatus : taskStatus.getHostwiseStatusDetails()) {
            GlusterServer glusterServer = glusterServerDao.getByGlusterServerUuid(hostStatus.getHostUuid());
            if (glusterServer != null) {
                VDS host = vdsDao.get(glusterServer.getId());
                if (host != null) {
                    hostStatus.setHostName(host.getName());
                    hostStatus.setHostId(host.getId());
                }
            }
        }
    }
}
Also used : GlusterServer(org.ovirt.engine.core.common.businessentities.gluster.GlusterServer) GlusterVolumeTaskStatusForHost(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusForHost) VDS(org.ovirt.engine.core.common.businessentities.VDS)

Example 2 with GlusterVolumeTaskStatusForHost

use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusForHost in project ovirt-engine by oVirt.

the class GlusterVolumeTaskReturn method getStatusForNode.

private GlusterVolumeTaskStatusForHost getStatusForNode(Map<String, Object> nodeStatus) {
    GlusterVolumeTaskStatusForHost rebalanceStatusForHost = new GlusterVolumeTaskStatusForHost();
    rebalanceStatusForHost.setHostName(nodeStatus.containsKey(HOST_NAME) ? (String) nodeStatus.get(HOST_NAME) : null);
    rebalanceStatusForHost.setHostUuid(nodeStatus.containsKey(HOST_UUID) ? new Guid((String) nodeStatus.get(HOST_UUID)) : null);
    populateGlusterVolumeTaskStatusDetail(rebalanceStatusForHost, nodeStatus);
    return rebalanceStatusForHost;
}
Also used : GlusterVolumeTaskStatusForHost(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusForHost) Guid(org.ovirt.engine.core.compat.Guid)

Example 3 with GlusterVolumeTaskStatusForHost

use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusForHost in project ovirt-engine by oVirt.

the class GlusterTaskStatisticalQueryTest method getTaskEntity.

private GlusterVolumeTaskStatusEntity getTaskEntity() {
    GlusterVolumeTaskStatusEntity entity = new GlusterVolumeTaskStatusEntity();
    List<GlusterVolumeTaskStatusForHost> hostStatusList = new ArrayList<>();
    hostStatusList.add(getTaskStatusForHost(0));
    hostStatusList.add(getTaskStatusForHost(1));
    entity.setHostwiseStatusDetails(hostStatusList);
    return entity;
}
Also used : GlusterVolumeTaskStatusForHost(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusForHost) ArrayList(java.util.ArrayList) GlusterVolumeTaskStatusEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity)

Example 4 with GlusterVolumeTaskStatusForHost

use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusForHost in project ovirt-engine by oVirt.

the class StepStatisticalQuery method getStatistics.

@Override
public List<Statistic> getStatistics(GlusterVolumeTaskStatusEntity entity) {
    List<Statistic> list = new ArrayList<>();
    if (entity == null) {
        return list;
    }
    for (GlusterVolumeTaskStatusForHost hostStatus : entity.getHostwiseStatusDetails()) {
        Guid hostId = hostStatus.getHostId();
        list.add(adopt(setHostDatum(FILES_MOVED, hostStatus.getFilesMoved(), hostId)));
        list.add(adopt(setHostDatum(SIZE_MOVED, hostStatus.getTotalSizeMoved(), hostId)));
        list.add(adopt(setHostDatum(FILES_SKIPPED, hostStatus.getFilesSkipped(), hostId)));
        list.add(adopt(setHostDatum(FILES_SCANNED, hostStatus.getFilesScanned(), hostId)));
        list.add(adopt(setHostDatum(FILES_FAILED, hostStatus.getFilesFailed(), hostId)));
        list.add(adopt(setHostDatum(RUN_TIME, hostStatus.getRunTime(), hostId)));
        list.add(adopt(setHostDatum(STATUS, hostStatus.getStatus().toString(), hostId)));
    }
    return list;
}
Also used : Statistic(org.ovirt.engine.api.model.Statistic) GlusterVolumeTaskStatusForHost(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusForHost) ArrayList(java.util.ArrayList) Guid(org.ovirt.engine.core.compat.Guid)

Example 5 with GlusterVolumeTaskStatusForHost

use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusForHost in project ovirt-engine by oVirt.

the class GetGlusterVolumeRebalanceStatusQueryTest method getHostwiseStatusDetails.

private List<GlusterVolumeTaskStatusForHost> getHostwiseStatusDetails() {
    List<GlusterVolumeTaskStatusForHost> statusList = new ArrayList<>();
    GlusterVolumeTaskStatusForHost status1 = new GlusterVolumeTaskStatusForHost();
    status1.setHostName(SERVER_1);
    status1.setFilesScanned(100);
    status1.setFilesMoved(100);
    status1.setFilesFailed(0);
    status1.setFilesScanned(100);
    status1.setFilesSkipped(0);
    status1.setRunTime(20);
    status1.setStatus(JobExecutionStatus.FINISHED);
    status1.setTotalSizeMoved(1024);
    status1.setHostUuid(SERVER_UUID_1);
    statusList.add(status1);
    GlusterVolumeTaskStatusForHost status2 = new GlusterVolumeTaskStatusForHost();
    status2.setHostName(SERVER_2);
    status2.setFilesScanned(100);
    status2.setFilesMoved(100);
    status2.setFilesFailed(0);
    status2.setFilesScanned(100);
    status2.setFilesSkipped(0);
    status2.setRunTime(20);
    status2.setStatus(JobExecutionStatus.FINISHED);
    status2.setTotalSizeMoved(1024);
    status2.setHostUuid(SERVER_UUID_1);
    statusList.add(status2);
    return statusList;
}
Also used : GlusterVolumeTaskStatusForHost(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusForHost) ArrayList(java.util.ArrayList)

Aggregations

GlusterVolumeTaskStatusForHost (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusForHost)8 ArrayList (java.util.ArrayList)5 Guid (org.ovirt.engine.core.compat.Guid)2 Statistic (org.ovirt.engine.api.model.Statistic)1 VDS (org.ovirt.engine.core.common.businessentities.VDS)1 GlusterServer (org.ovirt.engine.core.common.businessentities.gluster.GlusterServer)1 GlusterVolumeTaskStatusEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity)1 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)1