Class UpdateDoublesSketch

java.lang.Object
org.apache.datasketches.quantiles.DoublesSketch
org.apache.datasketches.quantiles.UpdateDoublesSketch
All Implemented Interfaces:
QuantilesAPI, QuantilesDoublesAPI

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 item)
      Updates this sketch with the given double data item
      Parameters:
      item - an item from a stream of items. NaNs are ignored.
    • heapify

      public static UpdateDoublesSketch heapify(org.apache.datasketches.memory.Memory srcMem)
      Factory heapify takes a compact sketch image in Memory and instantiates an on-heap sketch. The resulting sketch will not retain any link to the source Memory.
      Parameters:
      srcMem - a compact Memory image of a sketch serialized by this sketch. See Memory
      Returns:
      a heap-based sketch based on the given Memory.
    • 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