Package org.apache.datasketches.cpc
Class CpcUnion
java.lang.Object
org.apache.datasketches.cpc.CpcUnion
public class CpcUnion extends Object
The union (merge) operation for the CPC sketches.
- Author:
- Lee Rhodes, Kevin Lang
-
Constructor Summary
Constructors Constructor Description CpcUnion()Construct this unioning object with the default LgK and the default update seed.CpcUnion(int lgK)Construct this unioning object with LgK and the default update seed.CpcUnion(int lgK, long seed)Construct this unioning object with LgK and a given seed. -
Method Summary
Modifier and Type Method Description static FamilygetFamily()Return the DataSketches identifier for this CPC family of sketches.intgetLgK()Returns the current value of Log_base2 of K.CpcSketchgetResult()Returns the result of union operations as a CPC sketch.voidupdate(CpcSketch sketch)Update this union with a CpcSketch.
-
Constructor Details
-
CpcUnion
public CpcUnion()Construct this unioning object with the default LgK and the default update seed. -
CpcUnion
public CpcUnion(int lgK)Construct this unioning object with LgK and the default update seed.- Parameters:
lgK- The given log2 of K.
-
CpcUnion
public CpcUnion(int lgK, long seed)Construct this unioning object with LgK and a given seed.- Parameters:
lgK- The given log2 of K.seed- The given seed.
-
-
Method Details
-
update
Update this union with a CpcSketch.- Parameters:
sketch- the given CpcSketch.
-
getResult
Returns the result of union operations as a CPC sketch.- Returns:
- the result of union operations as a CPC sketch.
-
getLgK
public int getLgK()Returns the current value of Log_base2 of K. Note that due to merging with source sketches that may have a lower value of LgK, this value can be less than what the union object was configured with.- Returns:
- the current value of Log_base2 of K.
-
getFamily
Return the DataSketches identifier for this CPC family of sketches.- Returns:
- the DataSketches identifier for this CPC family of sketches.
-