Class DoublesUnionBuilder

java.lang.Object
org.apache.datasketches.quantiles.DoublesUnionBuilder

public class DoublesUnionBuilder
extends Object
For building a new DoublesSketch Union operation.
Author:
Lee Rhodes
  • Constructor Summary

    Constructors 
    Constructor Description
    DoublesUnionBuilder()
    Constructor for a new DoublesUnionBuilder.
  • Method Summary

    Modifier and Type Method Description
    DoublesUnion build()
    Returns a new empty Union object with the current configuration of this Builder.
    DoublesUnion build​(org.apache.datasketches.memory.WritableMemory dstMem)
    Returns a new empty Union object with the current configuration of this Builder and the specified backing destination Memory store.
    int getMaxK()
    Gets the current configured value of maxK
    DoublesUnionBuilder setMaxK​(int maxK)
    Sets the parameter masK that determines the maximum size of the sketch that results from a union and its accuracy.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DoublesUnionBuilder

      public DoublesUnionBuilder()
      Constructor for a new DoublesUnionBuilder. The default configuration is
      • k: 128. This produces a normalized rank error of about 1.7%
      • Memory: null
  • Method Details

    • setMaxK

      public DoublesUnionBuilder setMaxK​(int maxK)
      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 value. 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 values of k.
      Returns:
      this builder
    • getMaxK

      public int getMaxK()
      Gets the current configured value of maxK
      Returns:
      the current configured value of maxK
    • build

      public DoublesUnion build()
      Returns a new empty Union object with the current configuration of this Builder.
      Returns:
      a Union object
    • build

      public DoublesUnion build​(org.apache.datasketches.memory.WritableMemory dstMem)
      Returns a new empty Union object with the current configuration of this Builder and the specified backing destination Memory store.
      Parameters:
      dstMem - the destination memory
      Returns:
      a Union object