public class ArrayOfStringsSketch extends UpdatableSketch<String[],ArrayOfStringsSummary>
PREAMBLE_LONGS, summaryFactory_
Constructor and Description |
---|
ArrayOfStringsSketch()
Constructs new sketch with default K = 4096 (lgK = 12), default ResizeFactor=X8,
and default p = 1.0.
|
ArrayOfStringsSketch(ArrayOfStringsSketch sketch)
Copy Constructor
|
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.
This capability will be removed in a future release.
Heapifying a CompactSketch is not deprecated.
|
Modifier and Type | Method and Description |
---|---|
CompactSketch<S> |
compact()
Converts the current state of the sketch into a compact sketch
|
ArrayOfStringsSketch |
copy() |
int |
getCountLessThanThetaLong(long thetaLong)
Gets the number of hash values less than the given theta expressed as a long.
|
int |
getCurrentCapacity()
Get current capacity
|
int |
getLgK()
Get log_base2 of Nominal Entries
|
int |
getNominalEntries()
Get configured nominal number of entries
|
ResizeFactor |
getResizeFactor()
Get configured resize factor
|
int |
getRetainedEntries() |
float |
getSamplingProbability()
Get configured sampling probability
|
protected void |
insertSummary(int index,
S summary) |
TupleSketchIterator<S> |
iterator()
Returns a SketchIterator
|
void |
reset()
Resets this sketch an empty state.
|
byte[] |
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.
|
void |
trim()
Rebuilds reducing the actual number of entries to the nominal number of entries if needed
|
void |
update(String[] strArrKey,
String[] strArr)
Updates the sketch with String arrays for both key and value.
|
update, update, update, update, update, update, update
getEstimate, getEstimate, getLowerBound, getLowerBound, getSummaryFactory, getTheta, getThetaLong, getUpperBound, getUpperBound, isEmpty, isEstimationMode, toString
public ArrayOfStringsSketch()
public ArrayOfStringsSketch(int lgK)
lgK
- Log_base2 of Nominal Entries.
See Nominal Entriespublic ArrayOfStringsSketch(int lgK, ResizeFactor rf, float p)
lgK
- Log_base2 of Nominal Entries.
See Nominal Entriesrf
- ResizeFactor
See Resize Factorp
- sampling probability
See Sampling Probability@Deprecated public ArrayOfStringsSketch(org.apache.datasketches.memory.Memory mem)
mem
- the given Memorypublic ArrayOfStringsSketch(ArrayOfStringsSketch sketch)
sketch
- the sketch to copypublic ArrayOfStringsSketch copy()
copy
in class UpdatableSketch<String[],ArrayOfStringsSummary>
public void update(String[] strArrKey, String[] strArr)
strArrKey
- the given String array keystrArr
- the given String array valuepublic int getRetainedEntries()
getRetainedEntries
in class Sketch<S extends Summary>
public int getCountLessThanThetaLong(long thetaLong)
Sketch
getCountLessThanThetaLong
in class Sketch<S extends Summary>
thetaLong
- the given theta as a long between zero and Long.MAX_VALUE.public int getNominalEntries()
public int getLgK()
public float getSamplingProbability()
public int getCurrentCapacity()
public ResizeFactor getResizeFactor()
public void trim()
public void reset()
public CompactSketch<S> compact()
@Deprecated public byte[] toByteArray()
toByteArray
in class Sketch<S extends Summary>
protected void insertSummary(int index, S summary)
public TupleSketchIterator<S> iterator()
Sketch
Copyright © 2015–2024 The Apache Software Foundation. All rights reserved.