Class UpdatableQuantilesDoublesSketch
- All Implemented Interfaces:
MemorySegmentStatus, QuantilesAPI, QuantilesDoublesAPI
- Author:
- Jon Malkin
-
Field Summary
Fields inherited from interface QuantilesAPI
EMPTY_MSG, MEM_REQ_SVR_NULL_MSG, NOT_SINGLE_ITEM_MSG, SELF_MERGE_MSG, TGT_IS_READ_ONLY_MSG, UNSUPPORTED_MSG -
Method Summary
Modifier and TypeMethodDescriptioncompact()Returns a CompactQuantilesDoublesSketch of this classcompact(MemorySegment dstSeg) Returns a compact version of this sketch.heapify(MemorySegment srcSeg) Factory heapify takes a compact sketch image in MemorySegment and instantiates an on-heap sketch.abstract voidupdate(double item) Updates this sketch with the given item.wrap(MemorySegment srcSeg) Wrap a sketch around the given source MemorySegment containing sketch data that originated from this sketch.wrap(MemorySegment srcSeg, MemorySegmentRequest mSegReq) Wrap a sketch around the given source MemorySegment containing sketch data that originated from this sketch and including an optional, user definedMemorySegmentRequest.Methods inherited from class QuantilesDoublesSketch
builder, downSample, getCDF, getCompactSerialiedSizeBytes, getCurrentCompactSerializedSizeBytes, getCurrentUpdatableSerializedSizeBytes, getK, getKFromEpsilon, getMaxItem, getMinItem, getN, getNormalizedRankError, getNormalizedRankError, getNumRetained, getPMF, getQuantile, getQuantileLowerBound, getQuantiles, getQuantileUpperBound, getRank, getRankLowerBound, getRanks, getRankUpperBound, getSerializedSizeBytes, getSortedView, getUpdatableStorageBytes, hasMemorySegment, isEmpty, isEstimationMode, isOffHeap, isReadOnly, isSameResource, iterator, putIntoMemorySegment, putIntoMemorySegment, reset, toByteArray, toByteArray, toString, toString, toString, toString, writableWrap, writableWrapMethods inherited from interface QuantilesDoublesAPI
getCDF, getPMF, getQuantile, getQuantiles, getRank, getRanks
-
Method Details
-
wrap
Wrap a sketch around the given source MemorySegment containing sketch data that originated from this sketch.The given MemorySegment must be writable and it must contain a UpdatableQuantilesDoublesSketch. The sketch will be updated and managed totally within the MemorySegment. If the given source MemorySegment is created off-heap, then all the management of the sketch's internal data will be off-heap as well.
NOTE:If during updating of the sketch the sketch requires more capacity than the given size of the MemorySegment, the sketch will request more capacity using the
MemorySegmentRequestinterface. The default of this interface will return a new MemorySegment on the heap.- Parameters:
srcSeg- a MemorySegment that contains sketch data.- Returns:
- an instance of this sketch that wraps the given MemorySegment.
-
wrap
public static UpdatableQuantilesDoublesSketch wrap(MemorySegment srcSeg, MemorySegmentRequest mSegReq) Wrap a sketch around the given source MemorySegment containing sketch data that originated from this sketch and including an optional, user definedMemorySegmentRequest.The given MemorySegment must be writable and it must contain a UpdatableQuantilesDoublesSketch. The sketch will be updated and managed totally within the MemorySegment. If the given source MemorySegment is created off-heap, then all the management of the sketch's internal data will be off-heap as well.
NOTE:If during updating of the sketch the sketch requires more capacity than the given size of the MemorySegment, the sketch will request more capacity using the
MemorySegmentRequestinterface. The default of this interface will return a new MemorySegment on the heap. It is up to the user to optionally extend this interface if more flexible handling of requests for more capacity is required.- Parameters:
srcSeg- a MemorySegment that contains sketch data.mSegReq- the MemorySegmentRequest used if the given MemorySegment needs to expand. Otherwise, it can be null and the default MemorySegmentRequest will be used.- Returns:
- an instance of this sketch that wraps the given MemorySegment.
-
heapify
Factory heapify takes a compact sketch image in MemorySegment and instantiates an on-heap sketch. The resulting sketch will not retain any link to the source MemorySegment.- Parameters:
srcSeg- compact MemorySegment image of a sketch serialized by this sketch.- Returns:
- a heap-based sketch based on the given MemorySegment.
-
compact
Returns a CompactQuantilesDoublesSketch of this class- Returns:
- a CompactQuantilesDoublesSketch of this class
-
compact
Returns a compact version of this sketch. If passing in a MemorySegment object, the compact sketch will use and load that MemorySegment; otherwise, an on-heap sketch will be returned.- Parameters:
dstSeg- An optional target MemorySegment to hold the sketch.- Returns:
- A compact version of this sketch
-
update
public abstract void update(double item) Description copied from interface:QuantilesDoublesAPIUpdates this sketch with the given item.- Parameters:
item- from a stream of items. NaNs are ignored.
-