use of com.hazelcast.aggregation.Aggregator in project hazelcast by hazelcast.
the class CallerRunsAccumulationExecutor method execute.
@Override
@SuppressWarnings("unchecked")
public AggregationResult execute(Aggregator aggregator, Collection<QueryableEntry> entries, Collection<Integer> partitionIds) {
Aggregator resultAggregator = serializationService.toObject(serializationService.toData(aggregator));
try {
for (QueryableEntry entry : entries) {
resultAggregator.accumulate(entry);
}
} finally {
resultAggregator.onAccumulationFinished();
}
AggregationResult result = new AggregationResult(resultAggregator);
result.setPartitionIds(partitionIds);
return result;
}
use of com.hazelcast.aggregation.Aggregator in project hazelcast by hazelcast.
the class ParallelAccumulationExecutor method execute.
@Override
@SuppressWarnings("unchecked")
public AggregationResult execute(Aggregator aggregator, Collection<QueryableEntry> entries, Collection<Integer> partitionIds) {
Collection<Aggregator> chunkAggregators = accumulateParallel(aggregator, entries);
Aggregator resultAggregator = clone(aggregator);
try {
for (Aggregator chunkAggregator : chunkAggregators) {
resultAggregator.combine(chunkAggregator);
}
} finally {
resultAggregator.onCombinationFinished();
}
AggregationResult result = new AggregationResult(resultAggregator);
result.setPartitionIds(partitionIds);
return result;
}
use of com.hazelcast.aggregation.Aggregator in project hazelcast by hazelcast.
the class CallerRunsAccumulationExecutor method execute.
@Override
@SuppressWarnings("unchecked")
public AggregationResult execute(Aggregator aggregator, Iterable<QueryableEntry> entries, PartitionIdSet partitionIds) {
Aggregator resultAggregator = serializationService.toObject(serializationService.toData(aggregator));
try {
for (QueryableEntry entry : entries) {
resultAggregator.accumulate(entry);
}
} finally {
resultAggregator.onAccumulationFinished();
}
AggregationResult result = new AggregationResult(resultAggregator, serializationService);
result.setPartitionIds(partitionIds);
return result;
}
use of com.hazelcast.aggregation.Aggregator in project hazelcast by hazelcast.
the class ParallelAccumulationExecutor method execute.
@Override
@SuppressWarnings("unchecked")
public AggregationResult execute(Aggregator aggregator, Iterable<QueryableEntry> entries, PartitionIdSet partitionIds) {
Collection<Aggregator> chunkAggregators = accumulateParallel(aggregator, entries);
Aggregator resultAggregator = clone(aggregator);
try {
for (Aggregator chunkAggregator : chunkAggregators) {
resultAggregator.combine(chunkAggregator);
}
} finally {
resultAggregator.onCombinationFinished();
}
AggregationResult result = new AggregationResult(resultAggregator, serializationService);
result.setPartitionIds(partitionIds);
return result;
}
Aggregations