Class ArrayOfStringsSketch
java.lang.Object
org.apache.datasketches.tuple.Sketch<S>
org.apache.datasketches.tuple.UpdatableSketch<String[],ArrayOfStringsSummary>
org.apache.datasketches.tuple.strings.ArrayOfStringsSketch
- Direct Known Subclasses:
FdtSketch
- Author:
- Lee Rhodes
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs new sketch with default K = 4096 (lgK = 12), default ResizeFactor=X8, and default p = 1.0.ArrayOfStringsSketch(int lgK) Constructs new sketch with default ResizeFactor=X8, default p = 1.0 and given lgK.ArrayOfStringsSketch(int lgK, ResizeFactor rf, float p) Constructs new sketch with given ResizeFactor, p and lgK.ArrayOfStringsSketch(org.apache.datasketches.memory.Memory mem) Deprecated.As of 3.0.0, heapifying an UpdatableSketch 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 factorintfloatGet configured sampling probabilityiterator()Returns a SketchIteratorvoidreset()Resets this sketch an empty state.byte[]Deprecated.As of 3.0.0, serializing an UpdatableSketch 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 org.apache.datasketches.tuple.UpdatableSketch
update, update, update, update, update, update, updateMethods inherited from class org.apache.datasketches.tuple.Sketch
getEstimate, getEstimate, getLowerBound, getLowerBound, getSummaryFactory, getTheta, getThetaLong, getUpperBound, getUpperBound, isEmpty, isEstimationMode, toString
-
Constructor Details
-
ArrayOfStringsSketch
public ArrayOfStringsSketch()Constructs new sketch with default K = 4096 (lgK = 12), default ResizeFactor=X8, and default p = 1.0. -
ArrayOfStringsSketch
public ArrayOfStringsSketch(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
-
ArrayOfStringsSketch
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
-
ArrayOfStringsSketch
Deprecated.As of 3.0.0, heapifying an UpdatableSketch is deprecated. This capability will be removed in a future release. Heapifying a CompactSketch is not deprecated.Constructs this sketch from a Memory image, which must be from an ArrayOfStringsSketch, and usually with data.- Parameters:
mem- the given Memory
-
ArrayOfStringsSketch
Copy Constructor- Parameters:
sketch- the sketch to copy
-
-
Method Details
-
copy
- Overrides:
copyin classUpdatableSketch<String[],ArrayOfStringsSummary> - Returns:
- a deep copy of this sketch
-
update
Updates the sketch with String arrays for both key and value.- Parameters:
strArrKey- the given String array keystrArr- the given String array value
-
getRetainedEntries
public int getRetainedEntries()- Specified by:
getRetainedEntriesin classSketch<S extends Summary>- Returns:
- number of retained entries
-
getCountLessThanThetaLong
public int getCountLessThanThetaLong(long thetaLong) Description copied from class:SketchGets the number of hash values less than the given theta expressed as a long.- Specified by:
getCountLessThanThetaLongin classSketch<S extends Summary>- Parameters:
thetaLong- the given theta as a long between zero and 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
Get configured resize factor- Returns:
- resize factor
-
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 -
toByteArray
Deprecated.As of 3.0.0, serializing an UpdatableSketch is deprecated. This capability will be removed in a future release. Serializing a CompactSketch is not deprecated.This serializes an UpdatableSketch (QuickSelectSketch).- Specified by:
toByteArrayin classSketch<S extends Summary>- Returns:
- serialized representation of an UpdatableSketch (QuickSelectSketch).
-
iterator
Description copied from class:SketchReturns a SketchIterator
-