public class ArrayOfStringsSketch extends UpdatableSketch<String[],ArrayOfStringsSummary>
PREAMBLE_LONGS
Constructor and Description |
---|
ArrayOfStringsSketch()
Constructs 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)
Constructs this sketch from a Memory image, which must be from an ArrayOfStringsSketch, and
usually with data.
|
Modifier and Type | Method and Description |
---|---|
CompactSketch<S> |
compact()
Converts the current state of the sketch into a compact sketch
|
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) |
SketchIterator<S> |
iterator()
Returns a SketchIterator
|
void |
reset()
Resets this sketch an empty state.
|
byte[] |
toByteArray()
This is to serialize an instance to a byte array.
|
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
getEstimate, getEstimate, getLowerBound, getLowerBound, 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 Probabilitypublic ArrayOfStringsSketch(org.apache.datasketches.memory.Memory mem)
mem
- the given Memorypublic 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 getNominalEntries()
public int getLgK()
public float getSamplingProbability()
public int getCurrentCapacity()
public ResizeFactor getResizeFactor()
public void trim()
public void reset()
public CompactSketch<S> compact()
public byte[] toByteArray()
Sketch
toByteArray
in class Sketch<S extends Summary>
protected void insertSummary(int index, S summary)
public SketchIterator<S> iterator()
Sketch
Copyright © 2015–2021 The Apache Software Foundation. All rights reserved.