Class CompactTupleSketch<S extends Summary>
java.lang.Object
org.apache.datasketches.tuple.TupleSketch<S>
org.apache.datasketches.tuple.CompactTupleSketch<S>
- Type Parameters:
S- type of Summary
CompactTupleSketches are never created directly. They are created as a result of
the compact() method of an UpdatableTupleSketch or as a result of the getResult()
method of a set operation like TupleUnion, TupleIntersection or TupleAnotB.
CompactTupleSketch consists of a compact list (i.e. no intervening spaces) of hash values,
corresponding list of Summaries, and a value for theta. The lists may or may
not be ordered. CompactTupleSketch is read-only.
-
Method Summary
Modifier and TypeMethodDescriptioncompact()Converts this TupleSketch to a CompactTupleSketch on the Java heap.intgetCountLessThanThetaLong(long thetaLong) Gets the number of hash values less than the given theta expressed as a long.intReturns number of retained entriesiterator()Returns a SketchIteratorbyte[]Serialize this sketch to a byte array.Methods inherited from class TupleSketch
createEmptySketch, getEstimate, getEstimate, getLowerBound, getLowerBound, getSummaryFactory, getTheta, getThetaLong, getUpperBound, getUpperBound, heapifySketch, heapifyUpdatableSketch, isEmpty, isEstimationMode, toString
-
Method Details
-
compact
Description copied from class:TupleSketchConverts this TupleSketch to a CompactTupleSketch on the Java heap.If this sketch is already in compact form this operation returns this.
- Specified by:
compactin classTupleSketch<S extends Summary>- Returns:
- this sketch as a CompactTupleSketch on the Java heap.
-
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.
-
toByteArray
public byte[] toByteArray()Description copied from class:TupleSketchSerialize this sketch to a byte array.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.
- Specified by:
toByteArrayin classTupleSketch<S extends Summary>- Returns:
- serialized representation of this sketch.
-
iterator
Description copied from class:TupleSketchReturns a SketchIterator- Specified by:
iteratorin classTupleSketch<S extends Summary>- Returns:
- a SketchIterator
-