Search in sources :

Example 1 with RunningHostInfoAgregator

use of com.cloud.info.RunningHostInfoAgregator in project cloudstack by apache.

the class SecondaryStorageManagerImpl method getZoneHostInfo.

private synchronized Map<Long, ZoneHostInfo> getZoneHostInfo() {
    Date cutTime = DateUtil.currentGMTTime();
    List<RunningHostCountInfo> runningHostCountInfos = _hostDao.getRunningHostCounts(new Date(cutTime.getTime() - ClusterManager.HeartbeatThreshold.value()));
    RunningHostInfoAgregator aggregator = new RunningHostInfoAgregator();
    if (CollectionUtils.isNotEmpty(runningHostCountInfos)) {
        for (RunningHostCountInfo countInfo : runningHostCountInfos) {
            aggregator.aggregate(countInfo);
        }
    }
    return aggregator.getZoneHostInfoMap();
}
Also used : RunningHostCountInfo(com.cloud.info.RunningHostCountInfo) RunningHostInfoAgregator(com.cloud.info.RunningHostInfoAgregator) Date(java.util.Date)

Example 2 with RunningHostInfoAgregator

use of com.cloud.info.RunningHostInfoAgregator in project cloudstack by apache.

the class ConsoleProxyManagerImpl method getZoneHostInfo.

private synchronized Map<Long, ZoneHostInfo> getZoneHostInfo() {
    Date cutTime = DateUtil.currentGMTTime();
    List<RunningHostCountInfo> l = hostDao.getRunningHostCounts(new Date(cutTime.getTime() - ClusterManager.HeartbeatThreshold.value()));
    RunningHostInfoAgregator aggregator = new RunningHostInfoAgregator();
    if (l.size() > 0) {
        for (RunningHostCountInfo countInfo : l) {
            aggregator.aggregate(countInfo);
        }
    }
    return aggregator.getZoneHostInfoMap();
}
Also used : RunningHostCountInfo(com.cloud.info.RunningHostCountInfo) RunningHostInfoAgregator(com.cloud.info.RunningHostInfoAgregator) Date(java.util.Date)

Example 3 with RunningHostInfoAgregator

use of com.cloud.info.RunningHostInfoAgregator in project cosmic by MissionCriticalCloud.

the class SystemVmManagerBase method getLongZoneHostInfoMap.

protected static Map<Long, ZoneHostInfo> getLongZoneHostInfoMap(final HostDao _hostDao) {
    final Date cutTime = DateUtil.currentGMTTime();
    final List<RunningHostCountInfo> l = _hostDao.getRunningHostCounts(new Date(cutTime.getTime() - ClusterManager.HeartbeatThreshold.value()));
    final RunningHostInfoAgregator aggregator = new RunningHostInfoAgregator();
    if (l.size() > 0) {
        for (final RunningHostCountInfo countInfo : l) {
            aggregator.aggregate(countInfo);
        }
    }
    return aggregator.getZoneHostInfoMap();
}
Also used : RunningHostCountInfo(com.cloud.info.RunningHostCountInfo) RunningHostInfoAgregator(com.cloud.info.RunningHostInfoAgregator) Date(java.util.Date)

Aggregations

RunningHostCountInfo (com.cloud.info.RunningHostCountInfo)3 RunningHostInfoAgregator (com.cloud.info.RunningHostInfoAgregator)3 Date (java.util.Date)3