public class HllSketch extends Object
| Constructor and Description |
|---|
HllSketch(Fields fields)
Construct this class with the given Fields
|
| Modifier and Type | Method and Description |
|---|---|
HllSketch |
asCompact()
Returns this sketch in compact form
|
static HllSketchBuilder |
builder()
Returns an HllSketchBuilder
|
double |
getEstimate()
Gets the unique count estimate.
|
double |
getLowerBound(double numStdDevs)
Gets the lower bound with respect to the Estimate
|
Preamble |
getPreamble()
Gets the Preamble of this sketch
|
double |
getUpperBound(double numStdDevs)
Gets the upper bound with respect to the Estimate
|
protected double |
inversePowerOf2Sum()
The sum of the inverse powers of 2
|
int |
numBuckets()
Returns the number of configured buckets (k)
|
protected int |
numBucketsAtZero() |
protected void |
setUpdateCallback(Fields.UpdateCallback updateCallback)
Set the update callback.
|
byte[] |
toByteArray()
Serializes this sketch to a byte array
|
byte[] |
toByteArrayNoPreamble()
Serializes this sketch without the Preamble as a byte array
|
HllSketch |
union(HllSketch that)
Union this sketch with that one
|
void |
update(byte[] data)
Present this sketch with the given byte array.
|
void |
update(double datum)
Present this sketch with the given double (or float) datum.
|
void |
update(int[] data)
Present this sketch with the given integer array.
|
void |
update(long datum)
Present this sketch with a long.
|
void |
update(long[] data)
Present this sketch with the given long array.
|
void |
update(String datum)
Present this sketch with the given String.
|
public HllSketch(Fields fields)
fields - the given Fieldspublic static HllSketchBuilder builder()
public void update(long datum)
datum - The given long datum.public void update(double datum)
datum - The given double datum.public void update(String datum)
datum - The given String.public void update(byte[] data)
data - The given byte array.public void update(int[] data)
data - The given int array.public void update(long[] data)
data - The given long array.public double getEstimate()
public double getUpperBound(double numStdDevs)
numStdDevs - the number of standard deviations from the Estimatepublic double getLowerBound(double numStdDevs)
numStdDevs - the number of standard deviations from the Estimatepublic HllSketch union(HllSketch that)
that - the other sketchpublic byte[] toByteArray()
public byte[] toByteArrayNoPreamble()
public HllSketch asCompact()
public int numBuckets()
public Preamble getPreamble()
protected final void setUpdateCallback(Fields.UpdateCallback updateCallback)
updateCallback - the update callback for the HllSketch to use when talking with its Fieldsprotected double inversePowerOf2Sum()
protected int numBucketsAtZero()
Copyright © 2015–2017 Yahoo! Inc.. All rights reserved.