Class ThetaSketchAccumulator
- java.lang.Object
-
- org.apache.pinot.segment.local.customobject.ThetaSketchAccumulator
-
public class ThetaSketchAccumulator extends Object
Intermediate state used byDistinctCountThetaSketchAggregationFunctionwhich gives the end user more control over how sketches are merged for performance. The end user can set parameters that trade-off more memory usage for more pre-aggregation. This permits use of the Union "early-stop" optimisation where ordered sketches require no further processing beyond the minimum Theta value. The union operation initialises an empty "gadget" bookkeeping sketch that is updated with hashed entries that fall below the minimum Theta value for all input sketches ("Broder Rule"). When the initial Theta value is set to the minimum immediately, further gains can be realised.
-
-
Constructor Summary
Constructors Constructor Description ThetaSketchAccumulator()ThetaSketchAccumulator(org.apache.datasketches.theta.SetOperationBuilder setOperationBuilder, int threshold)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(org.apache.datasketches.theta.Sketch sketch)org.apache.datasketches.theta.SketchgetResult()booleanisEmpty()voidmerge(ThetaSketchAccumulator thetaUnion)voidsetSetOperationBuilder(org.apache.datasketches.theta.SetOperationBuilder setOperationBuilder)voidsetThreshold(int threshold)
-
-
-
Method Detail
-
setSetOperationBuilder
public void setSetOperationBuilder(org.apache.datasketches.theta.SetOperationBuilder setOperationBuilder)
-
setThreshold
public void setThreshold(int threshold)
-
isEmpty
public boolean isEmpty()
-
getResult
@Nonnull public org.apache.datasketches.theta.Sketch getResult()
-
apply
public void apply(org.apache.datasketches.theta.Sketch sketch)
-
merge
public void merge(ThetaSketchAccumulator thetaUnion)
-
-