Search in sources :

Example 6 with GlusterVolumeTaskStatusForHost

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

the class GetGlusterVolumeRemoveBricksStatusQueryTest method getHostwiseStatusDetails.

private List<GlusterVolumeTaskStatusForHost> getHostwiseStatusDetails() {
    List<GlusterVolumeTaskStatusForHost> statusList = new ArrayList<>();
    GlusterVolumeTaskStatusForHost status1 = new GlusterVolumeTaskStatusForHost();
    status1.setHostName(SERVER_1);
    status1.setHostUuid(Guid.newGuid());
    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.setHostUuid(Guid.newGuid());
    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)

Example 7 with GlusterVolumeTaskStatusForHost

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

the class GlusterTaskStatisticalQueryTest method getTaskStatusForHost.

private GlusterVolumeTaskStatusForHost getTaskStatusForHost(int index) {
    GlusterVolumeTaskStatusForHost hostStatus = new GlusterVolumeTaskStatusForHost();
    hostStatus.setFilesFailed(FILES_FAILED[index]);
    hostStatus.setFilesSkipped(FILES_SKIPPED[index]);
    hostStatus.setFilesMoved(FILES_MOVED[index]);
    hostStatus.setTotalSizeMoved(SIZE_MOVED[index]);
    hostStatus.setRunTime(RUN_TIME[index]);
    hostStatus.setStatus(JobExecutionStatus.STARTED);
    hostStatus.setHostId(GUIDS[index]);
    return hostStatus;
}
Also used : GlusterVolumeTaskStatusForHost(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusForHost)

Example 8 with GlusterVolumeTaskStatusForHost

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

the class VolumeRebalanceStatusModel method showStatus.

public void showStatus(GlusterVolumeTaskStatusEntity rebalanceStatusEntity) {
    List<GlusterVolumeTaskStatusForHost> rebalanceSessionsList = rebalanceStatusEntity.getHostwiseStatusDetails();
    List<EntityModel<GlusterVolumeTaskStatusForHost>> sessionList = new ArrayList<>();
    for (GlusterVolumeTaskStatusForHost hostDetail : rebalanceSessionsList) {
        EntityModel<GlusterVolumeTaskStatusForHost> sessionModel = new EntityModel<>(hostDetail);
        sessionList.add(sessionModel);
    }
    getStartTime().setEntity(rebalanceStatusEntity.getStartTime());
    getStatusTime().setEntity(rebalanceStatusEntity.getStatusTime());
    getRebalanceSessions().setItems(sessionList);
    setStatusAvailable(rebalanceStatusEntity.getStatusSummary().getStatus() == JobExecutionStatus.FINISHED);
    if (rebalanceStatusEntity.getStatusSummary().getStatus() == JobExecutionStatus.FINISHED) {
        refresh.cancel();
    } else {
        if (rebalanceStatusEntity.getStatusSummary().getStatus() == JobExecutionStatus.ABORTED || rebalanceStatusEntity.getStatusSummary().getStatus() == JobExecutionStatus.FAILED) {
            refresh.cancel();
            if (rebalanceStatusEntity.getStatusSummary().getStatus() == JobExecutionStatus.ABORTED) {
                getStopTime().setEntity(rebalanceStatusEntity.getStopTime());
            }
        }
    }
    setStopTimeVisible(rebalanceStatusEntity.getStatusSummary().getStatus() == JobExecutionStatus.ABORTED);
    if (GlusterTaskType.REBALANCE == getEntity().getAsyncTask().getType()) {
        getStopReblanceFromStatus().setIsExecutionAllowed(rebalanceStatusEntity.getStatusSummary().getStatus() == JobExecutionStatus.STARTED);
    }
}
Also used : GlusterVolumeTaskStatusForHost(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusForHost) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) 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