use of org.apache.ignite.internal.processors.cache.query.GridCacheQueryDetailMetricsKey in project ignite by apache.
the class VisorQueryDetailMetricsCollectorTask method reduce0.
/**
* {@inheritDoc}
*/
@Nullable
@Override
protected Collection<VisorQueryDetailMetrics> reduce0(List<ComputeJobResult> results) throws IgniteException {
Map<GridCacheQueryDetailMetricsKey, GridCacheQueryDetailMetricsAdapter> taskRes = new HashMap<>();
for (ComputeJobResult res : results) {
if (res.getException() != null)
throw res.getException();
Collection<GridCacheQueryDetailMetricsAdapter> metrics = res.getData();
VisorCacheQueryDetailMetricsCollectorJob.aggregateMetrics(-1, taskRes, metrics);
}
Collection<GridCacheQueryDetailMetricsAdapter> aggMetrics = taskRes.values();
Collection<VisorQueryDetailMetrics> res = new ArrayList<>(aggMetrics.size());
for (GridCacheQueryDetailMetricsAdapter m : aggMetrics) res.add(new VisorQueryDetailMetrics(m));
return res;
}
Aggregations