Class ArrayOfStringsTupleSketch
java.lang.Object
org.apache.datasketches.tuple.TupleSketch<ArrayOfStringsSummary>
org.apache.datasketches.tuple.UpdatableTupleSketch<String[], ArrayOfStringsSummary>
org.apache.datasketches.tuple.strings.ArrayOfStringsTupleSketch
- Direct Known Subclasses:
FdtSketch
public class ArrayOfStringsTupleSketch
extends UpdatableTupleSketch<String[], ArrayOfStringsSummary>
Extends UpdatableTupleSketch<String[], ArrayOfStringsSummary>
- Author:
- Lee Rhodes
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs new sketch with default K = 4096 (lgK = 12), default ResizeFactor=X8, and default p = 1.0.ArrayOfStringsTupleSketch(int lgK) Constructs new sketch with default ResizeFactor=X8, default p = 1.0 and given lgK.ArrayOfStringsTupleSketch(int lgK, ResizeFactor rf, float p) Constructs new sketch with given ResizeFactor, p and lgK.Deprecated.As of 3.0.0, heapifying an UpdatableTupleSketch is deprecated.Copy Constructor -
Method Summary
Modifier and TypeMethodDescriptioncompact()Converts the current state of the sketch into a compact sketchcopy()intgetCountLessThanThetaLong(long thetaLong) Gets the number of hash values less than the given theta expressed as a long.intGet current capacityintgetLgK()Get log_base2 of Nominal EntriesintGet configured nominal number of entriesGet configured resize factorintReturns number of retained entriesfloatGet configured sampling probabilityiterator()Returns a SketchIteratorvoidreset()Resets this sketch an empty state.byte[]Deprecated.As of 3.0.0, serializing an UpdatableTupleSketch is deprecated.voidtrim()Rebuilds reducing the actual number of entries to the nominal number of entries if neededvoidUpdates the sketch with String arrays for both key and value.Methods inherited from class UpdatableTupleSketch
update, update, update, update, update, update, updateMethods inherited from class TupleSketch
createEmptySketch, getEstimate, getEstimate, getLowerBound, getLowerBound, getSummaryFactory, getTheta, getThetaLong, getUpperBound, getUpperBound, heapifySketch, heapifyUpdatableSketch, isEmpty, isEstimationMode, toString
-
Constructor Details
-
ArrayOfStringsTupleSketch
public ArrayOfStringsTupleSketch()Constructs new sketch with default K = 4096 (lgK = 12), default ResizeFactor=X8, and default p = 1.0. -
ArrayOfStringsTupleSketch
public ArrayOfStringsTupleSketch(int lgK) Constructs new sketch with default ResizeFactor=X8, default p = 1.0 and given lgK.- Parameters:
lgK- Log_base2 of Nominal Entries. See Nominal Entries
-
ArrayOfStringsTupleSketch
Constructs new sketch with given ResizeFactor, p and lgK.- Parameters:
lgK- Log_base2 of Nominal Entries. See Nominal Entriesrf- ResizeFactor See Resize Factorp- sampling probability See Sampling Probability
-
ArrayOfStringsTupleSketch
Deprecated.As of 3.0.0, heapifying an UpdatableTupleSketch is deprecated. This capability will be removed in a future release. Heapifying a CompactTupleSketch is not deprecated.Constructs this sketch from a MemorySegment image, which must be from an ArrayOfStringsTupleSketch, and usually with data.- Parameters:
seg- the given MemorySegment
-
ArrayOfStringsTupleSketch
Copy Constructor- Parameters:
sketch- the sketch to copy
-
-
Method Details
-
copy
- Overrides:
copyin classUpdatableTupleSketch<String[], ArrayOfStringsSummary>- Returns:
- a deep copy of this sketch
-
update
-
getRetainedEntries
public int getRetainedEntries()Description copied from class:TupleSketchReturns number of retained entries- Specified by:
getRetainedEntriesin classTupleSketch<S extends Summary>- Returns:
- number of retained entries
-
getCountLessThanThetaLong
public int getCountLessThanThetaLong(long thetaLong) Description copied from class:TupleSketchGets the number of hash values less than the given theta expressed as a long.- Specified by:
getCountLessThanThetaLongin classTupleSketch<S extends Summary>- Parameters:
thetaLong- the given theta as a long in the range (zero, Long.MAX_VALUE].- Returns:
- the number of hash values less than the given thetaLong.
-
getNominalEntries
public int getNominalEntries()Get configured nominal number of entries- Returns:
- nominal number of entries
-
getLgK
public int getLgK()Get log_base2 of Nominal Entries- Returns:
- log_base2 of Nominal Entries
-
getSamplingProbability
public float getSamplingProbability()Get configured sampling probability- Returns:
- sampling probability
-
getCurrentCapacity
public int getCurrentCapacity()Get current capacity- Returns:
- current capacity
-
getResizeFactor
-
trim
public void trim()Rebuilds reducing the actual number of entries to the nominal number of entries if needed -
reset
public void reset()Resets this sketch an empty state. -
compact
Converts the current state of the sketch into a compact sketch- Specified by:
compactin classTupleSketch<S extends Summary>- Returns:
- compact sketch
-
toByteArray
Deprecated.As of 3.0.0, serializing an UpdatableTupleSketch is deprecated. This capability will be removed in a future release. Serializing a CompactTupleSketch is not deprecated.This serializes an UpdatableTupleSketch (QuickSelectSketch).- Specified by:
toByteArrayin classTupleSketch<S extends Summary>- Returns:
- serialized representation of an UpdatableTupleSketch (QuickSelectSketch).
-
iterator
Description copied from class:TupleSketchReturns a SketchIterator- Specified by:
iteratorin classTupleSketch<S extends Summary>- Returns:
- a SketchIterator
-