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 ArrayOfDoublesCompactSketchcompact()Gets an on-heap compact representation of the sketchArrayOfDoublesCompactSketchcompact(org.apache.datasketches.memory.WritableMemory dstMem)Gets an off-heap compact representation of the sketch using the given memoryabstract intgetNominalEntries()Gets the configured nominal number of entriesabstract ResizeFactorgetResizeFactor()Gets the configured resize factorabstract floatgetSamplingProbability()Gets the configured sampling probabilitystatic ArrayOfDoublesUpdatableSketchheapify(org.apache.datasketches.memory.Memory mem)Heapify the given Memory as an ArrayOfDoublesUpdatableSketchstatic ArrayOfDoublesUpdatableSketchheapify(org.apache.datasketches.memory.Memory mem, long seed)Heapify the given Memory 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.voidupdate(String key, double[] values)Updates this sketch with a String key and double values.voidupdate(ByteBuffer key, double[] values)Updates this sketch with a ByteBuffer key and double values.static ArrayOfDoublesUpdatableSketchwrap(org.apache.datasketches.memory.WritableMemory mem)Wrap the given WritableMemory as an ArrayOfDoublesUpdatableSketchstatic ArrayOfDoublesUpdatableSketchwrap(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:
compactin 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:
compactin classArrayOfDoublesSketch- Parameters:
dstMem- memory for the compact sketch (can be null)- Returns:
- compact sketch (off-heap if memory is provided)
-
-