Package com.yahoo.searchlib.aggregation
Class ExpressionCountAggregationResult
- java.lang.Object
-
- com.yahoo.vespa.objects.Selectable
-
- com.yahoo.vespa.objects.Identifiable
-
- com.yahoo.searchlib.expression.ExpressionNode
-
- com.yahoo.searchlib.aggregation.AggregationResult
-
- com.yahoo.searchlib.aggregation.ExpressionCountAggregationResult
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class ExpressionCountAggregationResult extends AggregationResult
This is an aggregated result holding the number of unique documents matching a given expression.- Author:
- bjorncs
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
classId
-
Constructor Summary
Constructors Constructor Description ExpressionCountAggregationResult()
Constructor used for deserialization.ExpressionCountAggregationResult(Sketch<?> initialSketch, UniqueCountEstimator<Sketch<?>> estimator)
Constructs an instance with a given sketch, sketch merger and unique count estimator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
equalsAggregation(AggregationResult obj)
long
getEstimatedUniqueCount()
ResultNode
getRank()
Returns a value that can be used for ranking.Sketch<?>
getSketch()
int
hashCode()
protected void
onDeserialize(com.yahoo.vespa.objects.Deserializer buf)
protected int
onGetClassId()
protected void
onMerge(AggregationResult result)
Mmust be implemented by subclasses to support merge.protected void
onSerialize(com.yahoo.vespa.objects.Serializer buf)
void
visitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor)
-
Methods inherited from class com.yahoo.searchlib.aggregation.AggregationResult
clone, equalsExpression, getExpression, getResult, getTag, merge, onExecute, onPrepare, postMerge, setExpression, setTag
-
Methods inherited from class com.yahoo.searchlib.expression.ExpressionNode
equals, execute, executeIterative, onArgument, prepare
-
-
-
-
Constructor Detail
-
ExpressionCountAggregationResult
public ExpressionCountAggregationResult()
Constructor used for deserialization. Will be instantiated with a default sketch.
-
ExpressionCountAggregationResult
public ExpressionCountAggregationResult(Sketch<?> initialSketch, UniqueCountEstimator<Sketch<?>> estimator)
Constructs an instance with a given sketch, sketch merger and unique count estimator. For test purposes.- Parameters:
initialSketch
- The HLL sketch.
-
-
Method Detail
-
getEstimatedUniqueCount
public long getEstimatedUniqueCount()
- Returns:
- The unique count estimated by the HyperLogLog algorithm.
-
getRank
public ResultNode getRank()
Description copied from class:AggregationResult
Returns a value that can be used for ranking.- Specified by:
getRank
in classAggregationResult
-
onMerge
protected void onMerge(AggregationResult result)
Description copied from class:AggregationResult
Mmust be implemented by subclasses to support merge. It is called as theAggregationResult.merge(AggregationResult)
method is invoked.- Specified by:
onMerge
in classAggregationResult
- Parameters:
result
- the result to merge with
-
getSketch
public Sketch<?> getSketch()
-
onGetClassId
protected int onGetClassId()
- Overrides:
onGetClassId
in classAggregationResult
-
onSerialize
protected void onSerialize(com.yahoo.vespa.objects.Serializer buf)
- Overrides:
onSerialize
in classAggregationResult
-
onDeserialize
protected void onDeserialize(com.yahoo.vespa.objects.Deserializer buf)
- Overrides:
onDeserialize
in classAggregationResult
-
equalsAggregation
protected boolean equalsAggregation(AggregationResult obj)
- Specified by:
equalsAggregation
in classAggregationResult
-
visitMembers
public void visitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor)
- Overrides:
visitMembers
in classAggregationResult
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classcom.yahoo.vespa.objects.Identifiable
-
-