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

public abstract class AggregationResult extends ExpressionNode
The result of some aggregation
Author:
baldersheim, Simon Thoresen Hult
See Also:
  • 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

      public AggregationResult setTag(int tag)
      Assigns a tag to this group.
      Parameters:
      tag - the numerical tag to set.
      Returns:
      this, to allow chaining.
    • merge

      public void merge(AggregationResult result)
      Called when merging aggregation results. This method is simply a proxy for the abstract onMerge(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

      public abstract ResultNode getRank()
      Returns a value that can be used for ranking.
    • setExpression

      public AggregationResult setExpression(ExpressionNode exp)
      Sets the expression to aggregate on.
      Parameters:
      exp - the expression
      Returns:
      this, to allow chaining
    • getExpression

      public ExpressionNode getExpression()
      Returns the expression to aggregate on.
    • onMerge

      protected abstract void onMerge(AggregationResult result)
      Mmust be implemented by subclasses to support merge. It is called as the merge(AggregationResult) method is invoked.
      Parameters:
      result - the result to merge with
    • getResult

      public ResultNode getResult()
      Description copied from class: ExpressionNode
      Get the result of this expression.
      Specified by:
      getResult in class ExpressionNode
      Returns:
      the result as a ResultNode.
    • onPrepare

      public void onPrepare()
      Overrides:
      onPrepare in class ExpressionNode
    • onExecute

      public boolean onExecute()
      Overrides:
      onExecute in class ExpressionNode
    • onGetClassId

      protected int onGetClassId()
      Overrides:
      onGetClassId in class ExpressionNode
    • onSerialize

      protected void onSerialize(com.yahoo.vespa.objects.Serializer buf)
      Overrides:
      onSerialize in class ExpressionNode
    • onDeserialize

      protected void onDeserialize(com.yahoo.vespa.objects.Deserializer buf)
      Overrides:
      onDeserialize in class ExpressionNode
    • clone

      public AggregationResult clone()
      Overrides:
      clone in class ExpressionNode
    • equalsExpression

      protected final boolean equalsExpression(ExpressionNode obj)
      Specified by:
      equalsExpression in class ExpressionNode
    • equalsAggregation

      protected abstract boolean equalsAggregation(AggregationResult obj)
    • visitMembers

      public void visitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor)
      Overrides:
      visitMembers in class ExpressionNode