Class UpdateDoublesSketch

java.lang.Object
org.apache.datasketches.quantiles.DoublesSketch
org.apache.datasketches.quantiles.UpdateDoublesSketch

public abstract class UpdateDoublesSketch
extends DoublesSketch
Author:
Jon Malkin
  • Method Details

    • wrap

      public static UpdateDoublesSketch wrap​(org.apache.datasketches.memory.WritableMemory srcMem)
      Wrap this sketch around the given non-compact Memory image of a DoublesSketch.
      Parameters:
      srcMem - the given Memory image of a DoublesSketch that may have data,
      Returns:
      a sketch that wraps the given srcMem
    • update

      public abstract void update​(double dataItem)
      Updates this sketch with the given double data item
      Parameters:
      dataItem - an item from a stream of items. NaNs are ignored.
    • reset

      public abstract void reset()
      Resets this sketch to the empty state, but retains the original value of k.
    • heapify

      public static UpdateDoublesSketch heapify​(org.apache.datasketches.memory.Memory srcMem)
    • compact

      public CompactDoublesSketch compact()
      Returns:
      a CompactDoublesSketch of this class
    • compact

      public CompactDoublesSketch compact​(org.apache.datasketches.memory.WritableMemory dstMem)
      Returns a compact version of this sketch. If passing in a Memory object, the compact sketch will use that direct memory; otherwise, an on-heap sketch will be returned.
      Parameters:
      dstMem - An optional target memory to hold the sketch.
      Returns:
      A compact version of this sketch