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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
protected abstract boolean
protected final boolean
Returns the expression to aggregate on.abstract ResultNode
getRank()
Returns a value that can be used for ranking.Get the result of this expression.int
getTag()
Returns the tag of this aggregation result.void
merge
(AggregationResult result) Called when merging aggregation results.protected void
onDeserialize
(com.yahoo.vespa.objects.Deserializer buf) boolean
protected int
protected abstract void
onMerge
(AggregationResult result) Mmust be implemented by subclasses to support merge.void
protected void
onSerialize
(com.yahoo.vespa.objects.Serializer buf) void
Hook called when all aggregation results have been merged.Sets the expression to aggregate on.setTag
(int tag) Assigns a tag to this group.void
visitMembers
(com.yahoo.vespa.objects.ObjectVisitor visitor) Methods inherited from class com.yahoo.searchlib.expression.ExpressionNode
equals, execute, executeIterative, onArgument, prepare
Methods inherited from class com.yahoo.vespa.objects.Identifiable
create, createFromId, deserialize, deserializeOptional, deserializeWithId, equals, getClassId, getRawUtf8Bytes, getUtf8, hashCode, putUtf8, registerClass, serialize, serializeOptional, serializeWithId, toString
Methods 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:ExpressionNode
Get the result of this expression.- Specified by:
getResult
in classExpressionNode
- Returns:
- the result as a ResultNode.
-
onPrepare
public void onPrepare()- Overrides:
onPrepare
in classExpressionNode
-
onExecute
public boolean onExecute()- Overrides:
onExecute
in classExpressionNode
-
onGetClassId
protected int onGetClassId()- Overrides:
onGetClassId
in classExpressionNode
-
onSerialize
protected void onSerialize(com.yahoo.vespa.objects.Serializer buf) - Overrides:
onSerialize
in classExpressionNode
-
onDeserialize
protected void onDeserialize(com.yahoo.vespa.objects.Deserializer buf) - Overrides:
onDeserialize
in classExpressionNode
-
clone
- Overrides:
clone
in classExpressionNode
-
equalsExpression
- Specified by:
equalsExpression
in classExpressionNode
-
equalsAggregation
-
visitMembers
public void visitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor) - Overrides:
visitMembers
in classExpressionNode
-