Class ArrayOfDoublesUpdatableSketch
java.lang.Object
org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch
The top level for updatable tuple sketches of type ArrayOfDoubles.
-
Method Summary
Modifier and TypeMethodDescriptioncompact()
Gets an on-heap compact representation of the sketchcompact
(org.apache.datasketches.memory.WritableMemory dstMem) Gets an off-heap compact representation of the sketch using the given memoryabstract int
Gets the configured nominal number of entriesabstract ResizeFactor
Gets the configured resize factorabstract float
Gets the configured sampling probabilityheapify
(org.apache.datasketches.memory.Memory mem) Heapify the given Memory as an ArrayOfDoublesUpdatableSketchheapify
(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
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.wrap
(org.apache.datasketches.memory.WritableMemory mem) Wrap the given WritableMemory as an ArrayOfDoublesUpdatableSketchwrap
(org.apache.datasketches.memory.WritableMemory mem, long seed) Wrap the given WritableMemory and seed as a ArrayOfDoublesUpdatableSketchMethods 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 Details
-
heapify
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
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
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
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
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
Gets an on-heap compact representation of the sketch- Overrides:
compact
in classArrayOfDoublesSketch
- Returns:
- compact sketch
-
compact
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)
-