public class AggregationResult extends Object implements Result<AggregationResult>, IdentifiedDataSerializable
At the end of the aggregation execution path all AggregationResults are merged into one AggregationResult.
| Constructor and Description |
|---|
AggregationResult() |
AggregationResult(Aggregator aggregator,
SerializationService serializationService) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(QueryableEntry entry)
Adds the given entry to this result.
|
void |
combine(AggregationResult result)
Combines the given result with this result modifying this result.
|
void |
completeConstruction(Collection<Integer> partitionIds)
Completes the construction of this result.
|
AggregationResult |
createSubResult()
Creates a new empty sub result of the same type as this result.
|
<R> Aggregator<?,R> |
getAggregator() |
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
int |
getId()
Returns type identifier for this class.
|
Collection<Integer> |
getPartitionIds() |
void |
onCombineFinished()
Invoked when the result combining phase is finished.
|
void |
orderAndLimit(PagingPredicate pagingPredicate,
Map.Entry<Integer,Map.Entry> nearestAnchorEntry)
Performs the order-and-limit operation on this result for the given
paging predicate.
|
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
void |
setPartitionIds(Collection<Integer> partitionIds)
Sets the partition IDs of this result.
|
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public AggregationResult()
public AggregationResult(Aggregator aggregator, SerializationService serializationService)
public <R> Aggregator<?,R> getAggregator()
public Collection<Integer> getPartitionIds()
getPartitionIds in interface Result<AggregationResult>public void combine(AggregationResult result)
Resultcombine in interface Result<AggregationResult>result - the result to combine with.Result.onCombineFinished()public void onCombineFinished()
Result
Implementations may release intermediary resources associated with
the combining. No further calls to Result.combine(T) are expected after
this method invocation.
onCombineFinished in interface Result<AggregationResult>Result.combine(Result)public void add(QueryableEntry entry)
Resultadd in interface Result<AggregationResult>entry - the entry to add.public AggregationResult createSubResult()
ResultThis method is used by the query execution engine while constructing the partial sub results. These sub results are combined with this result during the final stage of the result construction.
createSubResult in interface Result<AggregationResult>public void orderAndLimit(PagingPredicate pagingPredicate, Map.Entry<Integer,Map.Entry> nearestAnchorEntry)
ResultorderAndLimit in interface Result<AggregationResult>pagingPredicate - the paging predicate to perform the operation
for.nearestAnchorEntry - the anchor entry of the paging predicate.public void completeConstruction(Collection<Integer> partitionIds)
ResultImplementations may release intermediary resources associated with the construction in this method. No further modifications of the result are expected after this method invocation except combining the result with other results.
completeConstruction in interface Result<AggregationResult>partitionIds - the partition IDs to associate this result with.Result.combine(Result)public void setPartitionIds(Collection<Integer> partitionIds)
ResultsetPartitionIds in interface Result<AggregationResult>partitionIds - the partition IDs to set.public int getFactoryId()
IdentifiedDataSerializablegetFactoryId in interface IdentifiedDataSerializablepublic int getId()
IdentifiedDataSerializablegetId in interface IdentifiedDataSerializablepublic void writeData(ObjectDataOutput out) throws IOException
DataSerializablewriteData in interface DataSerializableout - outputIOException - if an I/O error occurs. In particular,
an IOException may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializablereadData in interface DataSerializablein - inputIOException - if an I/O error occurs. In particular,
an IOException may be thrown if the
input stream has been closed.Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.