public class AggregationResult extends Object implements Result<AggregationResult>
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()
Returns partition IDs associated with this result or
null if this
result is an empty/failure result. |
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()
Result
null
if this
result is an empty/failure result.getPartitionIds
in interface Result<AggregationResult>
public void combine(AggregationResult result)
Result
combine
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)
Result
add
in interface Result<AggregationResult>
entry
- the entry to add.public AggregationResult createSubResult()
Result
This 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)
Result
orderAndLimit
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)
Result
Implementations 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)
Result
setPartitionIds
in interface Result<AggregationResult>
partitionIds
- the partition IDs to set.public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getId()
IdentifiedDataSerializable
getId
in interface IdentifiedDataSerializable
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- 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
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.Copyright © 2019 Hazelcast, Inc.. All Rights Reserved.