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 Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ArrayOfDoublesCompactSketch
compact()
Gets an on-heap compact representation of the sketchArrayOfDoublesCompactSketch
compact(org.apache.datasketches.memory.WritableMemory dstMem)
Gets an off-heap compact representation of the sketch using the given memoryabstract int
getNominalEntries()
Gets the configured nominal number of entriesabstract ResizeFactor
getResizeFactor()
Gets the configured resize factorabstract float
getSamplingProbability()
Gets the configured sampling probabilitystatic ArrayOfDoublesUpdatableSketch
heapify(org.apache.datasketches.memory.Memory mem)
Heapify the given Memory as an ArrayOfDoublesUpdatableSketchstatic ArrayOfDoublesUpdatableSketch
heapify(org.apache.datasketches.memory.Memory mem, long seed)
Heapify the given Memory and seed as a ArrayOfDoublesUpdatableSketchabstract void
reset()
Resets this sketch an empty state.abstract void
trim()
Rebuilds reducing the actual number of entries to the nominal number of entries if neededvoid
update(byte[] key, double[] values)
Updates this sketch with a byte[] key and double values.void
update(double key, double[] values)
Updates this sketch with a double key and double values.void
update(int[] key, double[] values)
Updates this sketch with a int[] key and double values.void
update(long[] key, double[] values)
Updates this sketch with a long[] key and double values.void
update(long key, double[] values)
Updates this sketch with a long key and double values.void
update(String key, double[] values)
Updates this sketch with a String key and double values.void
update(ByteBuffer key, double[] values)
Updates this sketch with a ByteBuffer key and double values.static ArrayOfDoublesUpdatableSketch
wrap(org.apache.datasketches.memory.WritableMemory mem)
Wrap the given WritableMemory as an ArrayOfDoublesUpdatableSketchstatic ArrayOfDoublesUpdatableSketch
wrap(org.apache.datasketches.memory.WritableMemory mem, long seed)
Wrap the given WritableMemory and seed as a ArrayOfDoublesUpdatableSketch-
Methods inherited from class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
getCurrentBytes, getEstimate, getLowerBound, getMaxBytes, getNumValues, getRetainedEntries, getTheta, getUpperBound, getValues, hasMemory, isEmpty, isEstimationMode, iterator, toByteArray, toString, wrap, wrap
-
-
-
-
Method Detail
-
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 Memoryseed
- 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 Memoryseed
- 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 keyvalues
- 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 keyvalues
- 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 keyvalues
- 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[] keyvalues
- 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 keyvalues
- 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[] keyvalues
- 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[] keyvalues
- 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 classArrayOfDoublesSketch
- 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 classArrayOfDoublesSketch
- Parameters:
dstMem
- memory for the compact sketch (can be null)- Returns:
- compact sketch (off-heap if memory is provided)
-
-