Class ArrayOfDoublesUpdatableSketch

java.lang.Object
org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch

public abstract class ArrayOfDoublesUpdatableSketch extends ArrayOfDoublesSketch
The top level for updatable tuple sketches of type ArrayOfDoubles.
  • Method Details

    • heapify

      public static ArrayOfDoublesUpdatableSketch heapify(org.apache.datasketches.memory.Memory mem)
      Heapify the given Memory as an ArrayOfDoublesUpdatableSketch
      Parameters:
      mem - the given Memory
      Returns:
      an ArrayOfDoublesUpdatableSketch
    • heapify

      public static ArrayOfDoublesUpdatableSketch heapify(org.apache.datasketches.memory.Memory mem, long seed)
      Heapify the given Memory and seed as a ArrayOfDoublesUpdatableSketch
      Parameters:
      mem - the given Memory
      seed - the given seed
      Returns:
      an ArrayOfDoublesUpdatableSketch
    • wrap

      public static ArrayOfDoublesUpdatableSketch wrap(org.apache.datasketches.memory.WritableMemory mem)
      Wrap the given WritableMemory as an ArrayOfDoublesUpdatableSketch
      Parameters:
      mem - the given Memory
      Returns:
      an ArrayOfDoublesUpdatableSketch
    • wrap

      public static ArrayOfDoublesUpdatableSketch wrap(org.apache.datasketches.memory.WritableMemory mem, long seed)
      Wrap the given WritableMemory and seed as a ArrayOfDoublesUpdatableSketch
      Parameters:
      mem - the given Memory
      seed - the given seed
      Returns:
      an ArrayOfDoublesUpdatableSketch
    • update

      public void update(long key, double[] values)
      Updates this sketch with a long key and double values. The values will be stored or added to the ones associated with the key
      Parameters:
      key - The given long key
      values - The given values
    • update

      public void update(double key, double[] values)
      Updates this sketch with a double key and double values. The values will be stored or added to the ones associated with the key
      Parameters:
      key - The given double key
      values - The given values
    • update

      public void update(String key, double[] values)
      Updates this sketch with a String key and double values. The values will be stored or added to the ones associated with the key
      Parameters:
      key - The given String key
      values - The given values
    • update

      public void update(byte[] key, double[] values)
      Updates this sketch with a byte[] key and double values. The values will be stored or added to the ones associated with the key
      Parameters:
      key - The given byte[] key
      values - The given values
    • update

      public void update(ByteBuffer key, double[] values)
      Updates this sketch with a ByteBuffer key and double values. The values will be stored or added to the ones associated with the key
      Parameters:
      key - The given ByteBuffer key
      values - The given values
    • update

      public void update(int[] key, double[] values)
      Updates this sketch with a int[] key and double values. The values will be stored or added to the ones associated with the key
      Parameters:
      key - The given int[] key
      values - The given values
    • update

      public void update(long[] key, double[] values)
      Updates this sketch with a long[] key and double values. The values will be stored or added to the ones associated with the key
      Parameters:
      key - The given long[] key
      values - The given values
    • getNominalEntries

      public abstract int getNominalEntries()
      Gets the configured nominal number of entries
      Returns:
      nominal number of entries
    • getResizeFactor

      public abstract ResizeFactor getResizeFactor()
      Gets the configured resize factor
      Returns:
      resize factor
    • getSamplingProbability

      public abstract float getSamplingProbability()
      Gets the configured sampling probability
      Returns:
      sampling probability
    • trim

      public abstract void trim()
      Rebuilds reducing the actual number of entries to the nominal number of entries if needed
    • reset

      public abstract void reset()
      Resets this sketch an empty state.
    • compact

      public ArrayOfDoublesCompactSketch compact()
      Gets an on-heap compact representation of the sketch
      Overrides:
      compact in class ArrayOfDoublesSketch
      Returns:
      compact sketch
    • compact

      public ArrayOfDoublesCompactSketch compact(org.apache.datasketches.memory.WritableMemory dstMem)
      Gets an off-heap compact representation of the sketch using the given memory
      Specified by:
      compact in class ArrayOfDoublesSketch
      Parameters:
      dstMem - memory for the compact sketch (can be null)
      Returns:
      compact sketch (off-heap if memory is provided)