Class QuantilesDoublesUnionBuilder
java.lang.Object
org.apache.datasketches.quantiles.QuantilesDoublesUnionBuilder
For building a new QuantilesDoublesSketch Union operation.
- Author:
- Lee Rhodes
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for a new QuantilesDoublesUnionBuilder. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns a new empty Union object with the current configuration of this Builder.build(MemorySegment dstSeg, MemorySegmentRequest mSegReq) Returns a new empty Union object with the current configuration of this Builder and the specified backing destination MemorySegment store.intgetMaxK()Gets the current configured maxKsetMaxK(int maxK) Sets the parameter masK that determines the maximum size of the sketch that results from a union and its accuracy.
-
Constructor Details
-
QuantilesDoublesUnionBuilder
public QuantilesDoublesUnionBuilder()Constructor for a new QuantilesDoublesUnionBuilder. The default configuration is- k: 128. This produces a normalized rank error of about 1.7%
-
-
Method Details
-
setMaxK
Sets the parameter masK that determines the maximum size of the sketch that results from a union and its accuracy.- Parameters:
maxK- determines the accuracy and size of the union and is a maximum. The effective k can be smaller due to unions with smaller k sketches. It is recommended that maxK be a power of 2 to enable unioning of sketches with different k.- Returns:
- this builder
-
getMaxK
public int getMaxK()Gets the current configured maxK- Returns:
- the current configured maxK
-
build
Returns a new empty Union object with the current configuration of this Builder.- Returns:
- a Union object
-
build
Returns a new empty Union object with the current configuration of this Builder and the specified backing destination MemorySegment store.- Parameters:
dstSeg- the destination MemorySegmentmSegReq- the MemorySegmentRequest used if the given MemorySegment needs to expand. Otherwise, it can be null and the default MemorySegmentRequest will be used.- Returns:
- a Union object
-