Package com.yahoo.searchlib.aggregation
Class AggregationResult
java.lang.Object
com.yahoo.vespa.objects.Selectable
com.yahoo.vespa.objects.Identifiable
com.yahoo.searchlib.expression.ExpressionNode
com.yahoo.searchlib.aggregation.AggregationResult
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
AverageAggregationResult,CountAggregationResult,ExpressionCountAggregationResult,HitsAggregationResult,MaxAggregationResult,MinAggregationResult,StandardDeviationAggregationResult,SumAggregationResult,XorAggregationResult
The result of some aggregation
- Author:
- baldersheim, Simon Thoresen Hult
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()protected abstract booleanprotected final booleanReturns the expression to aggregate on.abstract ResultNodegetRank()Returns a value that can be used for ranking.Get the result of this expression.intgetTag()Returns the tag of this aggregation result.voidmerge(AggregationResult result) Called when merging aggregation results.protected voidonDeserialize(com.yahoo.vespa.objects.Deserializer buf) booleanprotected intprotected abstract voidonMerge(AggregationResult result) Mmust be implemented by subclasses to support merge.voidprotected voidonSerialize(com.yahoo.vespa.objects.Serializer buf) voidHook called when all aggregation results have been merged.Sets the expression to aggregate on.setTag(int tag) Assigns a tag to this group.voidvisitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor) Methods inherited from class com.yahoo.searchlib.expression.ExpressionNode
equals, execute, executeIterative, onArgument, prepareMethods inherited from class com.yahoo.vespa.objects.Identifiable
create, createFromId, deserialize, deserializeOptional, deserializeWithId, equals, getClassId, getRawUtf8Bytes, getUtf8, hashCode, putUtf8, registerClass, serialize, serializeOptional, serializeWithId, toStringMethods inherited from class com.yahoo.vespa.objects.Selectable
select, select, selectMembers
-
Field Details
-
classId
public static final int classId
-
-
Constructor Details
-
AggregationResult
public AggregationResult()
-
-
Method Details
-
getTag
public int getTag()Returns the tag of this aggregation result. This is useful for uniquely identifying a result.- Returns:
- The numerical tag.
-
setTag
Assigns a tag to this group.- Parameters:
tag- the numerical tag to set.- Returns:
- this, to allow chaining.
-
merge
Called when merging aggregation results. This method is simply a proxy for the abstractonMerge(AggregationResult)method.- Parameters:
result- the result to merge with.
-
postMerge
public void postMerge()Hook called when all aggregation results have been merged. This method can be overloaded by subclasses that need special behaviour to occur after merge. -
getRank
Returns a value that can be used for ranking. -
setExpression
Sets the expression to aggregate on.- Parameters:
exp- the expression- Returns:
- this, to allow chaining
-
getExpression
Returns the expression to aggregate on. -
onMerge
Mmust be implemented by subclasses to support merge. It is called as themerge(AggregationResult)method is invoked.- Parameters:
result- the result to merge with
-
getResult
Description copied from class:ExpressionNodeGet the result of this expression.- Specified by:
getResultin classExpressionNode- Returns:
- the result as a ResultNode.
-
onPrepare
public void onPrepare()- Overrides:
onPreparein classExpressionNode
-
onExecute
public boolean onExecute()- Overrides:
onExecutein classExpressionNode
-
onGetClassId
protected int onGetClassId()- Overrides:
onGetClassIdin classExpressionNode
-
onSerialize
protected void onSerialize(com.yahoo.vespa.objects.Serializer buf) - Overrides:
onSerializein classExpressionNode
-
onDeserialize
protected void onDeserialize(com.yahoo.vespa.objects.Deserializer buf) - Overrides:
onDeserializein classExpressionNode
-
clone
- Overrides:
clonein classExpressionNode
-
equalsExpression
- Specified by:
equalsExpressionin classExpressionNode
-
equalsAggregation
-
visitMembers
public void visitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor) - Overrides:
visitMembersin classExpressionNode
-