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(MemorySegment dstSeg) Gets an off-heap compact representation of the sketch using the given MemorySegmentabstract intGets the configured nominal number of entriesabstract ResizeFactorGets the configured resize factorabstract floatGets the configured sampling probabilityheapify(MemorySegment seg) Heapify the given MemorySegment as an ArrayOfDoublesUpdatableSketchheapify(MemorySegment seg, long seed) Heapify the given MemorySegment and seed as a ArrayOfDoublesUpdatableSketchabstract voidreset()Resets this sketch an empty state.abstract voidtrim()Rebuilds reducing the actual number of entries to the nominal number of entries if neededvoidupdate(byte[] key, double[] values) Updates this sketch with a byte[] key and double values.voidupdate(double key, double[] values) Updates this sketch with a double key and double values.voidupdate(int[] key, double[] values) Updates this sketch with a int[] key and double values.voidupdate(long[] key, double[] values) Updates this sketch with a long[] key and double values.voidupdate(long key, double[] values) Updates this sketch with a long key and double values.voidUpdates this sketch with a String key and double values.voidupdate(ByteBuffer key, double[] values) Updates this sketch with a ByteBuffer key and double values.wrap(MemorySegment seg) Wrap the given MemorySegment as an ArrayOfDoublesUpdatableSketch.wrap(MemorySegment seg, long seed) Wrap the given MemorySegment and seed as a ArrayOfDoublesUpdatableSketch.Methods inherited from class ArrayOfDoublesSketch
getCurrentBytes, getEstimate, getLowerBound, getMaxBytes, getNumValues, getRetainedEntries, getTheta, getUpperBound, getValues, hasMemorySegment, heapifySketch, heapifySketch, heapifyUnion, heapifyUnion, heapifyUpdatableSketch, heapifyUpdatableSketch, isEmpty, isEstimationMode, iterator, toByteArray, toString, wrapSketch, wrapSketch, wrapUnion, wrapUnion, wrapUpdatableSketch, wrapUpdatableSketch
-
Method Details
-
heapify
Heapify the given MemorySegment as an ArrayOfDoublesUpdatableSketch- Parameters:
seg- the given MemorySegment- Returns:
- an ArrayOfDoublesUpdatableSketch
-
heapify
Heapify the given MemorySegment and seed as a ArrayOfDoublesUpdatableSketch- Parameters:
seg- the given MemorySegmentseed- the given seed- Returns:
- an ArrayOfDoublesUpdatableSketch
-
wrap
Wrap the given MemorySegment as an ArrayOfDoublesUpdatableSketch. If the given source MemorySegment is read-only, the returned TupleUnion object will also be read-only.- Parameters:
seg- the given MemorySegment- Returns:
- an ArrayOfDoublesUpdatableSketch
-
wrap
Wrap the given MemorySegment and seed as a ArrayOfDoublesUpdatableSketch. If the given source MemorySegment is read-only, the returned TupleUnion object will also be read-only.- Parameters:
seg- the given MemorySegmentseed- 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:
compactin classArrayOfDoublesSketch- Returns:
- compact sketch
-
compact
Gets an off-heap compact representation of the sketch using the given MemorySegment- Specified by:
compactin classArrayOfDoublesSketch- Parameters:
dstSeg- MemorySegment for the compact sketch (can be null)- Returns:
- compact sketch (off-heap if MemorySegment is provided)
-