if (!node.getAddress().equals(host)) {
result.setHostname(host + " (" + node.getAddress() + ")");
}
} catch (UnknownHostException e) {
}
MetricsServer metricsServer = storageClientManager.getMetricsServer();
Map<String, Integer> scheduleIdsMap = new HashMap<String, Integer>();
for (Object[] tupple : getChildrenScheduleIds(storageNodeResourceId, true)) {
String definitionName = (String) tupple[0];
Integer scheduleId = (Integer) tupple[2];
scheduleIdsMap.put(definitionName, scheduleId);
}
for (Object[] tupple : getGrandchildrenScheduleIds(storageNodeResourceId, true)) {
String definitionName = (String) tupple[0];
Integer scheduleId = (Integer) tupple[2];
scheduleIdsMap.put(definitionName, scheduleId);
}
List<ListenableFuture<StorageNodeLoadComposite>> compositeFutures = new ArrayList<ListenableFuture<StorageNodeLoadComposite>>();
final MeasurementAggregate totalDiskUsedAggregate = new MeasurementAggregate(0d, 0d, 0d);
Integer scheduleId = null;
// find the aggregates and enrich the result instance
if (scheduleIdsMap.isEmpty()) {
// no sheduled metrics yet
return Futures.successfulAsList(Lists.newArrayList(Futures.immediateFuture(result)));
}
if ((scheduleId = scheduleIdsMap.get(METRIC_FREE_DISK_TO_DATA_RATIO)) != null) {
ListenableFuture<AggregateNumericMetric> dataFuture = metricsServer.getSummaryAggregateAsync(
scheduleId, beginTime, endTime);
ListenableFuture<StorageNodeLoadComposite> compositeFuture = Futures.transform(dataFuture,
new Function<AggregateNumericMetric, StorageNodeLoadComposite>() {
@Override
public StorageNodeLoadComposite apply(AggregateNumericMetric metric) {