diff --git a/docs/5.0.2/allclasses-index.html b/docs/5.0.2/allclasses-index.html new file mode 100644 index 000000000..7a5ce5f89 --- /dev/null +++ b/docs/5.0.2/allclasses-index.html @@ -0,0 +1,1319 @@ + + + + + +All Classes (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

All Classes

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/allclasses.html b/docs/5.0.2/allclasses.html new file mode 100644 index 000000000..4607477ab --- /dev/null +++ b/docs/5.0.2/allclasses.html @@ -0,0 +1,213 @@ + + + + + +All Classes (datasketches-java 5.0.2 API) + + + + + + + + + + + + +
+

All Classes

+
+ +
+
+ + diff --git a/docs/5.0.2/allpackages-index.html b/docs/5.0.2/allpackages-index.html new file mode 100644 index 000000000..3c848f150 --- /dev/null +++ b/docs/5.0.2/allpackages-index.html @@ -0,0 +1,298 @@ + + + + + +All Packages (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

All Packages

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/constant-values.html b/docs/5.0.2/constant-values.html new file mode 100644 index 000000000..1fa556797 --- /dev/null +++ b/docs/5.0.2/constant-values.html @@ -0,0 +1,472 @@ + + + + + +Constant Field Values (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Constant Field Values

+
+

Contents

+ +
+
+
+ + +
+

org.apache.*

+ +
    +
  • + + + + + + + + + + + + + + +
    org.apache.datasketches.cpc.CpcSketch 
    Modifier and TypeConstant FieldValue
    + +public static final intDEFAULT_LG_K11
    +
  • +
+
    +
  • + + + + + + + + + + + + + + +
    org.apache.datasketches.hll.HllSketch 
    Modifier and TypeConstant FieldValue
    + +public static final intDEFAULT_LG_K12
    +
  • +
+
    +
  • + + + + + + + + + + + + + + + + + + + +
    org.apache.datasketches.kll.KllSketch 
    Modifier and TypeConstant FieldValue
    + +public static final intDEFAULT_K200
    + +public static final intMAX_K65535
    +
  • +
+ + +
    +
  • + + + + + + + + + + + + + + +
    org.apache.datasketches.tuple.Sketch<S extends Summary> 
    Modifier and TypeConstant FieldValue
    + +protected static final bytePREAMBLE_LONGS1
    +
  • +
+ +
+
+
+ + + diff --git a/docs/5.0.2/deprecated-list.html b/docs/5.0.2/deprecated-list.html new file mode 100644 index 000000000..ef9b3d640 --- /dev/null +++ b/docs/5.0.2/deprecated-list.html @@ -0,0 +1,249 @@ + + + + + +Deprecated List (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Deprecated API

+

Contents

+ +
+
+ + + + + + + +
+
+ + + diff --git a/docs/5.0.2/element-list b/docs/5.0.2/element-list new file mode 100644 index 000000000..1f7c062b8 --- /dev/null +++ b/docs/5.0.2/element-list @@ -0,0 +1,21 @@ +org.apache.datasketches +org.apache.datasketches.common +org.apache.datasketches.cpc +org.apache.datasketches.fdt +org.apache.datasketches.frequencies +org.apache.datasketches.hash +org.apache.datasketches.hll +org.apache.datasketches.hllmap +org.apache.datasketches.kll +org.apache.datasketches.partitions +org.apache.datasketches.quantiles +org.apache.datasketches.quantilescommon +org.apache.datasketches.req +org.apache.datasketches.sampling +org.apache.datasketches.theta +org.apache.datasketches.thetacommon +org.apache.datasketches.tuple +org.apache.datasketches.tuple.adouble +org.apache.datasketches.tuple.aninteger +org.apache.datasketches.tuple.arrayofdoubles +org.apache.datasketches.tuple.strings diff --git a/docs/5.0.2/help-doc.html b/docs/5.0.2/help-doc.html new file mode 100644 index 000000000..85083d0df --- /dev/null +++ b/docs/5.0.2/help-doc.html @@ -0,0 +1,281 @@ + + + + + +API Help (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+ +
+This help file applies to API documentation generated by the standard doclet.
+
+ + + diff --git a/docs/5.0.2/index-all.html b/docs/5.0.2/index-all.html new file mode 100644 index 000000000..c4f5e684a --- /dev/null +++ b/docs/5.0.2/index-all.html @@ -0,0 +1,7425 @@ + + + + + +Index (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
A B C D E F G H I J K L M N O P Q R S T U V W X Z 
All Classes All Packages + + +

A

+
+
A_NOT_B - org.apache.datasketches.common.Family
+
+
The A and not B family is an operation for the Theta Sketch Framework of sketches.
+
+
ALPHA - org.apache.datasketches.common.Family
+
+
The Alpha Sketch family is a member of the Theta Sketch Framework of sketches and is best + suited for real-time processes where both the updating of the sketch and getting the estimate + is performed directly on the sketch.
+
+
AlwaysOne - org.apache.datasketches.tuple.adouble.DoubleSummary.Mode
+
+
The aggregation mode is always one.
+
+
AlwaysOne - org.apache.datasketches.tuple.aninteger.IntegerSummary.Mode
+
+
The aggregation mode is always one.
+
+
aNotB(Sketch, Sketch) - Method in class org.apache.datasketches.theta.AnotB
+
+
Perform A-and-not-B set operation on the two given sketches and return the result as an + ordered CompactSketch on the heap.
+
+
aNotB(Sketch, Sketch, boolean, WritableMemory) - Method in class org.apache.datasketches.theta.AnotB
+
+
Perform A-and-not-B set operation on the two given sketches and return the result as a + CompactSketch.
+
+
aNotB(Sketch<S>, Sketch) - Static method in class org.apache.datasketches.tuple.AnotB
+
+
Returns the A-and-not-B set operation on a Tuple sketch and a Theta sketch.
+
+
aNotB(Sketch<S>, Sketch<S>) - Static method in class org.apache.datasketches.tuple.AnotB
+
+
Returns the A-and-not-B set operation on the two given Tuple sketches.
+
+
AnotB - Class in org.apache.datasketches.theta
+
+
Computes a set difference, A-AND-NOT-B, of two theta sketches.
+
+
AnotB<S extends Summary> - Class in org.apache.datasketches.tuple
+
+
Computes a set difference, A-AND-NOT-B, of two generic tuple sketches.
+
+
AnotB() - Constructor for class org.apache.datasketches.theta.AnotB
+
 
+
AnotB() - Constructor for class org.apache.datasketches.tuple.AnotB
+
 
+
approximateLowerBoundOnP(long, long, double) - Static method in class org.apache.datasketches.common.BoundsOnBinomialProportions
+
+
Computes lower bound of approximate Clopper-Pearson confidence interval for a binomial + proportion.
+
+
approximateUpperBoundOnP(long, long, double) - Static method in class org.apache.datasketches.common.BoundsOnBinomialProportions
+
+
Computes upper bound of approximate Clopper-Pearson confidence interval for a binomial + proportion.
+
+
approxNumDeltaItems - Variable in class org.apache.datasketches.partitions.Partitioner.PartitionBoundsRow
+
 
+
ArrayOfBooleansSerDe - Class in org.apache.datasketches.common
+
+
Methods of serializing and deserializing arrays of Boolean as a bit array.
+
+
ArrayOfBooleansSerDe() - Constructor for class org.apache.datasketches.common.ArrayOfBooleansSerDe
+
 
+
ArrayOfDoublesAnotB - Class in org.apache.datasketches.tuple.arrayofdoubles
+
+
Computes a set difference of two tuple sketches of type ArrayOfDoubles
+
+
ArrayOfDoublesAnotBImpl - Class in org.apache.datasketches.tuple.arrayofdoubles
+
+
Computes a set difference, A-AND-NOT-B, of two ArrayOfDoublesSketches.
+
+
ArrayOfDoublesCombiner - Interface in org.apache.datasketches.tuple.arrayofdoubles
+
+
Combines two arrays of double values for use with ArrayOfDoubles tuple sketches
+
+
ArrayOfDoublesCompactSketch - Class in org.apache.datasketches.tuple.arrayofdoubles
+
+
Top level compact tuple sketch of type ArrayOfDoubles.
+
+
ArrayOfDoublesCompactSketch - org.apache.datasketches.tuple.SerializerDeserializer.SketchType
+
 
+
ArrayOfDoublesIntersection - Class in org.apache.datasketches.tuple.arrayofdoubles
+
+
Computes the intersection of two or more tuple sketches of type ArrayOfDoubles.
+
+
ArrayOfDoublesQuickSelectSketch - org.apache.datasketches.tuple.SerializerDeserializer.SketchType
+
 
+
ArrayOfDoublesSerDe - Class in org.apache.datasketches.common
+
+
Methods of serializing and deserializing arrays of Double.
+
+
ArrayOfDoublesSerDe() - Constructor for class org.apache.datasketches.common.ArrayOfDoublesSerDe
+
 
+
ArrayOfDoublesSetOperationBuilder - Class in org.apache.datasketches.tuple.arrayofdoubles
+
+
Builds set operations object for tuple sketches of type ArrayOfDoubles.
+
+
ArrayOfDoublesSetOperationBuilder() - Constructor for class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSetOperationBuilder
+
+
Creates an instance of the builder with default parameters
+
+
ArrayOfDoublesSketch - Class in org.apache.datasketches.tuple.arrayofdoubles
+
+
The base class for the tuple sketch of type ArrayOfDoubles, where an array of double values + is associated with each key.
+
+
ArrayOfDoublesSketches - Class in org.apache.datasketches.tuple.arrayofdoubles
+
+
Convenient static methods to instantiate tuple sketches of type ArrayOfDoubles.
+
+
ArrayOfDoublesSketches() - Constructor for class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches
+
 
+
ArrayOfDoublesSketchIterator - Interface in org.apache.datasketches.tuple.arrayofdoubles
+
+
Interface for iterating over tuple sketches of type ArrayOfDoubles
+
+
ArrayOfDoublesUnion - Class in org.apache.datasketches.tuple.arrayofdoubles
+
+
The base class for unions of tuple sketches of type ArrayOfDoubles.
+
+
ArrayOfDoublesUnion - org.apache.datasketches.tuple.SerializerDeserializer.SketchType
+
 
+
ArrayOfDoublesUpdatableSketch - Class in org.apache.datasketches.tuple.arrayofdoubles
+
+
The top level for updatable tuple sketches of type ArrayOfDoubles.
+
+
ArrayOfDoublesUpdatableSketchBuilder - Class in org.apache.datasketches.tuple.arrayofdoubles
+
+
For building a new ArrayOfDoublesUpdatableSketch
+
+
ArrayOfDoublesUpdatableSketchBuilder() - Constructor for class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder
+
+
Creates an instance of builder with default parameters
+
+
ArrayOfItemsSerDe<T> - Class in org.apache.datasketches.common
+
+
Base class for serializing and deserializing custom types.
+
+
ArrayOfItemsSerDe() - Constructor for class org.apache.datasketches.common.ArrayOfItemsSerDe
+
 
+
ArrayOfLongsSerDe - Class in org.apache.datasketches.common
+
+
Methods of serializing and deserializing arrays of Long.
+
+
ArrayOfLongsSerDe() - Constructor for class org.apache.datasketches.common.ArrayOfLongsSerDe
+
 
+
ArrayOfNumbersSerDe - Class in org.apache.datasketches.common
+
+
Methods of serializing and deserializing arrays of the object version of primitive types of + Number.
+
+
ArrayOfNumbersSerDe() - Constructor for class org.apache.datasketches.common.ArrayOfNumbersSerDe
+
 
+
ArrayOfStringsSerDe - Class in org.apache.datasketches.common
+
+
Methods of serializing and deserializing arrays of String.
+
+
ArrayOfStringsSerDe() - Constructor for class org.apache.datasketches.common.ArrayOfStringsSerDe
+
 
+
ArrayOfStringsSketch - Class in org.apache.datasketches.tuple.strings
+
 
+
ArrayOfStringsSketch() - Constructor for class org.apache.datasketches.tuple.strings.ArrayOfStringsSketch
+
+
Constructs new sketch with default K = 4096 (lgK = 12), default ResizeFactor=X8, + and default p = 1.0.
+
+
ArrayOfStringsSketch(int) - Constructor for class org.apache.datasketches.tuple.strings.ArrayOfStringsSketch
+
+
Constructs new sketch with default ResizeFactor=X8, default p = 1.0 and given lgK.
+
+
ArrayOfStringsSketch(int, ResizeFactor, float) - Constructor for class org.apache.datasketches.tuple.strings.ArrayOfStringsSketch
+
+
Constructs new sketch with given ResizeFactor, p and lgK.
+
+
ArrayOfStringsSketch(Memory) - Constructor for class org.apache.datasketches.tuple.strings.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.
+
+
+
ArrayOfStringsSketch(ArrayOfStringsSketch) - Constructor for class org.apache.datasketches.tuple.strings.ArrayOfStringsSketch
+
+
Copy Constructor
+
+
ArrayOfStringsSummary - Class in org.apache.datasketches.tuple.strings
+
 
+
ArrayOfStringsSummaryDeserializer - Class in org.apache.datasketches.tuple.strings
+
 
+
ArrayOfStringsSummaryDeserializer() - Constructor for class org.apache.datasketches.tuple.strings.ArrayOfStringsSummaryDeserializer
+
 
+
ArrayOfStringsSummaryFactory - Class in org.apache.datasketches.tuple.strings
+
 
+
ArrayOfStringsSummaryFactory() - Constructor for class org.apache.datasketches.tuple.strings.ArrayOfStringsSummaryFactory
+
 
+
ArrayOfStringsSummarySetOperations - Class in org.apache.datasketches.tuple.strings
+
 
+
ArrayOfStringsSummarySetOperations() - Constructor for class org.apache.datasketches.tuple.strings.ArrayOfStringsSummarySetOperations
+
 
+
ArrayOfUtf16StringsSerDe - Class in org.apache.datasketches.common
+
+
Methods of serializing and deserializing arrays of String.
+
+
ArrayOfUtf16StringsSerDe() - Constructor for class org.apache.datasketches.common.ArrayOfUtf16StringsSerDe
+
 
+
asDouble(long[]) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Returns a uniform random double with a minimum inclusive value of zero and a maximum exclusive + value of 1.0.
+
+
asInt(byte[], int) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Returns a deterministic uniform random integer between zero (inclusive) and + n (exclusive) given the input data.
+
+
asInt(double, int) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Returns a deterministic uniform random integer between zero (inclusive) and + n (exclusive) given the input double.
+
+
asInt(int[], int) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Returns a deterministic uniform random integer between zero (inclusive) and + n (exclusive) given the input data.
+
+
asInt(long[], int) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Returns a deterministic uniform random integer between zero (inclusive) and + n (exclusive) given the input data.
+
+
asInt(long, int) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Returns a deterministic uniform random integer between zero (inclusive) and + n (exclusive) given the input datum.
+
+
asInt(String, int) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Returns a deterministic uniform random integer between zero (inclusive) and + n (exclusive) given the input datum.
+
+
+ + + +

B

+
+
BinarySearch - Class in org.apache.datasketches.quantilescommon
+
+
Contains common equality binary search algorithms.
+
+
BinarySearch() - Constructor for class org.apache.datasketches.quantilescommon.BinarySearch
+
 
+
BinomialBoundsN - Class in org.apache.datasketches.thetacommon
+
+
This class enables the estimation of error bounds given a sample set size, the sampling + probability theta, the number of standard deviations and a simple noDataSeen flag.
+
+
BitPacking - Class in org.apache.datasketches.theta
+
 
+
BitPacking() - Constructor for class org.apache.datasketches.theta.BitPacking
+
 
+
BoundsOnBinomialProportions - Class in org.apache.datasketches.common
+
+
Confidence intervals for binomial proportions.
+
+
BoundsOnRatiosInSampledSets - Class in org.apache.datasketches.common
+
+
This class is used to compute the bounds on the estimate of the ratio |B| / |A|, where: + + |A| is the unknown size of a set A of unique identifiers. + |B| is the unknown size of a subset B of A. + a = |SA| is the observed size of a sample of A + that was obtained by Bernoulli sampling with a known inclusion probability f. + b = |SA ∩ B| is the observed size of a subset + of SA. +
+
+
BoundsOnRatiosInThetaSketchedSets - Class in org.apache.datasketches.thetacommon
+
+
This class is used to compute the bounds on the estimate of the ratio B / A, where: + + A is a Theta Sketch of population PopA. + B is a Theta Sketch of population PopB that is a subset of A, + obtained by an intersection of A with some other Theta Sketch C, + which acts like a predicate or selection clause. + The estimate of the ratio PopB/PopA is + BoundsOnRatiosInThetaSketchedSets.getEstimateOfBoverA(A, B). + The Upper Bound estimate on the ratio PopB/PopA is + BoundsOnRatiosInThetaSketchedSets.getUpperBoundForBoverA(A, B). + The Lower Bound estimate on the ratio PopB/PopA is + BoundsOnRatiosInThetaSketchedSets.getLowerBoundForBoverA(A, B). + + Note: The theta of A cannot be greater than the theta of B.
+
+
BoundsOnRatiosInTupleSketchedSets - Class in org.apache.datasketches.thetacommon
+
+
This class is used to compute the bounds on the estimate of the ratio B / A, where: + + A is a Tuple Sketch of population PopA. + B is a Tuple or Theta Sketch of population PopB that is a subset of A, + obtained by an intersection of A with some other Tuple or Theta Sketch C, + which acts like a predicate or selection clause. + The estimate of the ratio PopB/PopA is + BoundsOnRatiosInThetaSketchedSets.getEstimateOfBoverA(A, B). + The Upper Bound estimate on the ratio PopB/PopA is + BoundsOnRatiosInThetaSketchedSets.getUpperBoundForBoverA(A, B). + The Lower Bound estimate on the ratio PopB/PopA is + BoundsOnRatiosInThetaSketchedSets.getLowerBoundForBoverA(A, B). + + Note: The theta of A cannot be greater than the theta of B.
+
+
BoundsRule - Enum in org.apache.datasketches.partitions
+
 
+
build() - Method in class org.apache.datasketches.quantiles.DoublesSketchBuilder
+
+
Returns an UpdateDoublesSketch with the current configuration of this Builder.
+
+
build() - Method in class org.apache.datasketches.quantiles.DoublesUnionBuilder
+
+
Returns a new empty Union object with the current configuration of this Builder.
+
+
build() - Method in class org.apache.datasketches.req.ReqSketchBuilder
+
+
Returns a new ReqSketch with the current configuration of the builder.
+
+
build() - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Returns an UpdateSketch with the current configuration of this Builder.
+
+
build() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder
+
+
Returns an ArrayOfDoublesUpdatableSketch with the current configuration of this Builder.
+
+
build() - Method in class org.apache.datasketches.tuple.UpdatableSketchBuilder
+
+
Returns an UpdatableSketch with the current configuration of this Builder.
+
+
build(Family) - Method in class org.apache.datasketches.theta.SetOperationBuilder
+
+
Returns a SetOperation with the current configuration of this Builder and the given Family.
+
+
build(Family, WritableMemory) - Method in class org.apache.datasketches.theta.SetOperationBuilder
+
+
Returns a SetOperation with the current configuration of this Builder, the given Family + and the given destination memory.
+
+
build(WritableMemory) - Method in class org.apache.datasketches.quantiles.DoublesSketchBuilder
+
+
Returns a quantiles UpdateDoublesSketch with the current configuration of this builder + and the specified backing destination Memory store.
+
+
build(WritableMemory) - Method in class org.apache.datasketches.quantiles.DoublesUnionBuilder
+
+
Returns a new empty Union object with the current configuration of this Builder + and the specified backing destination Memory store.
+
+
build(WritableMemory) - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Returns an UpdateSketch with the current configuration of this Builder + with the specified backing destination Memory store.
+
+
build(WritableMemory) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder
+
+
Returns an ArrayOfDoublesUpdatableSketch with the current configuration of this Builder.
+
+
buildAnotB() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSetOperationBuilder
+
+
Creates an instance of ArrayOfDoublesAnotB based on the current configuration of the builder.
+
+
buildANotB() - Method in class org.apache.datasketches.theta.SetOperationBuilder
+
+
Convenience method, returns a configured SetOperation ANotB with + Default Update Seed
+
+
builder() - Static method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Returns a new builder
+
+
builder() - Static method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Returns a new UnionBuilder
+
+
builder() - Static method in class org.apache.datasketches.req.ReqSketch
+
+
Returns a new ReqSketchBuilder
+
+
builder() - Static method in class org.apache.datasketches.theta.SetOperation
+
+
Makes a new builder
+
+
builder() - Static method in class org.apache.datasketches.theta.UpdateSketch
+
+
Returns a new builder
+
+
buildIntersection() - Method in class org.apache.datasketches.theta.SetOperationBuilder
+
+
Convenience method, returns a configured SetOperation Intersection with + Default Nominal Entries
+
+
buildIntersection() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSetOperationBuilder
+
+
Creates an instance of ArrayOfDoublesIntersection based on the current configuration of the + builder.
+
+
buildIntersection(WritableMemory) - Method in class org.apache.datasketches.theta.SetOperationBuilder
+
+
Convenience method, returns a configured SetOperation Intersection with + Default Nominal Entries + and the given destination memory.
+
+
buildIntersection(WritableMemory) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSetOperationBuilder
+
+
Creates an instance of ArrayOfDoublesIntersection based on the current configuration of the + builder.
+
+
buildLocal(UpdateSketch) - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Returns a local, on-heap, concurrent UpdateSketch to be used as a per-thread local buffer + along with the given concurrent shared UpdateSketch and the current configuration of this + Builder.
+
+
buildShared() - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Returns an on-heap concurrent shared UpdateSketch with the current configuration of the + Builder.
+
+
buildShared(WritableMemory) - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Returns a direct (potentially off-heap) concurrent shared UpdateSketch with the current + configuration of the Builder and the given destination WritableMemory.
+
+
buildSharedFromSketch(UpdateSketch, WritableMemory) - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Returns a direct (potentially off-heap) concurrent shared UpdateSketch with the current + configuration of the Builder, the data from the given sketch, and the given destination + WritableMemory.
+
+
buildUnion() - Method in class org.apache.datasketches.theta.SetOperationBuilder
+
+
Convenience method, returns a configured SetOperation Union with + Default Nominal Entries
+
+
buildUnion() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSetOperationBuilder
+
+
Creates an instance of ArrayOfDoublesUnion based on the current configuration of the builder.
+
+
buildUnion(WritableMemory) - Method in class org.apache.datasketches.theta.SetOperationBuilder
+
+
Convenience method, returns a configured SetOperation Union with + Default Nominal Entries + and the given destination memory.
+
+
buildUnion(WritableMemory) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSetOperationBuilder
+
+
Creates an instance of ArrayOfDoublesUnion based on the current configuration of the builder + and the given destination memory.
+
+
ByteArrayUtil - Class in org.apache.datasketches.common
+
+
Useful methods for byte arrays.
+
+
ByteArrayUtil() - Constructor for class org.apache.datasketches.common.ByteArrayUtil
+
 
+
bytesToInt(byte[]) - Static method in class org.apache.datasketches.common.Util
+
+
Returns an int extracted from a Little-Endian byte array.
+
+
bytesToLong(byte[]) - Static method in class org.apache.datasketches.common.Util
+
+
Returns a long extracted from a Little-Endian byte array.
+
+
bytesToString(byte[], boolean, boolean, String) - Static method in class org.apache.datasketches.common.Util
+
+
Returns a string view of a byte array
+
+
+ + + +

C

+
+
caseIdToCornerCase(int) - Static method in enum org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
ceilingIntPowerOf2(int) - Static method in class org.apache.datasketches.common.Util
+
+
Computes the int ceiling power of 2 within the range [1, 2^30].
+
+
ceilingLongPowerOf2(long) - Static method in class org.apache.datasketches.common.Util
+
+
Computes the long ceiling power of 2 within the range [1, 2^62].
+
+
ceilingPowerBaseOfDouble(double, double) - Static method in class org.apache.datasketches.common.Util
+
+
Returns the ceiling of a given n given a base, where the ceiling is an integral power of the base.
+
+
characterPad(String, int, char, boolean) - Static method in class org.apache.datasketches.common.Util
+
+
Prepend or postpend the given string with the given character to fill the given field length.
+
+
checkBounds(long, long, long) - Static method in class org.apache.datasketches.common.Util
+
+
Check the requested offset and length against the allocated size.
+
+
checkDoublesSplitPointsOrder(double[]) - Static method in class org.apache.datasketches.quantilescommon.QuantilesUtil
+
+
Checks the sequential validity of the given array of double values.
+
+
checkFamilyID(int) - Method in enum org.apache.datasketches.common.Family
+
 
+
checkFloatsSplitPointsOrder(float[]) - Static method in class org.apache.datasketches.quantilescommon.QuantilesUtil
+
+
Checks the sequential validity of the given array of float values.
+
+
checkHashCorruption(long) - Static method in class org.apache.datasketches.thetacommon.HashOperations
+
 
+
checkIfIntPowerOf2(int, String) - Static method in class org.apache.datasketches.common.Util
+
+
Checks the given int argument to make sure it is a positive power of 2 and greater than zero.
+
+
checkIfLongPowerOf2(long, String) - Static method in class org.apache.datasketches.common.Util
+
+
Checks the given long argument to make sure it is a positive power of 2 and greater than zero.
+
+
checkIfMultipleOf8AndGT0(long, String) - Static method in class org.apache.datasketches.common.Util
+
+
Checks if parameter v is a multiple of 8 and greater than zero.
+
+
checkMinSizeMemory(Memory) - Static method in class org.apache.datasketches.theta.Intersection
+
 
+
checkNomLongs(int) - Static method in class org.apache.datasketches.thetacommon.ThetaUtil
+
+
Checks that the given nomLongs is within bounds and returns the Log2 of the ceiling power of 2 + of the given nomLongs.
+
+
checkNormalizedRankBounds(double) - Static method in class org.apache.datasketches.quantilescommon.QuantilesUtil
+
+
Checks that the given normalized rank: 0 ≤ nRank ≤ 1.0.
+
+
checkProbability(double, String) - Static method in class org.apache.datasketches.common.Util
+
+
Checks the given parameter to make sure it is positive and between 0.0 inclusive and 1.0 + inclusive.
+
+
checkSeedHashes(short, short) - Static method in class org.apache.datasketches.thetacommon.ThetaUtil
+
+
Check if the two seed hashes are equal.
+
+
checkSeedHashes(short, short) - Static method in class org.apache.datasketches.tuple.Util
+
+
Checks the two given seed hashes.
+
+
checkThetaCorruption(long) - Static method in class org.apache.datasketches.thetacommon.HashOperations
+
 
+
ClassicUtil - Class in org.apache.datasketches.quantiles
+
+
Utilities for the classic quantiles sketches and independent of the type.
+
+
combine(double[], double[]) - Method in interface org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesCombiner
+
+
Method of combining two arrays of double values
+
+
compact() - Method in class org.apache.datasketches.quantiles.UpdateDoublesSketch
+
 
+
compact() - Method in class org.apache.datasketches.theta.Sketch
+
+
Converts this sketch to a ordered CompactSketch.
+
+
compact() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
 
+
compact() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch
+
+
Gets an on-heap compact representation of the sketch
+
+
compact() - Method in class org.apache.datasketches.tuple.CompactSketch
+
 
+
compact() - Method in class org.apache.datasketches.tuple.Sketch
+
+
Converts this sketch to a CompactSketch on the Java heap.
+
+
compact(boolean, WritableMemory) - Method in class org.apache.datasketches.theta.CompactSketch
+
 
+
compact(boolean, WritableMemory) - Method in class org.apache.datasketches.theta.Sketch
+
+
Convert this sketch to a CompactSketch.
+
+
compact(boolean, WritableMemory) - Method in class org.apache.datasketches.theta.UpdateSketch
+
 
+
compact(WritableMemory) - Method in class org.apache.datasketches.quantiles.UpdateDoublesSketch
+
+
Returns a compact version of this sketch.
+
+
compact(WritableMemory) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
 
+
compact(WritableMemory) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch
+
+
Gets an off-heap compact representation of the sketch using the given memory
+
+
COMPACT - org.apache.datasketches.common.Family
+
+
The Compact Sketch family is a member of the Theta Sketch Framework of sketches.
+
+
COMPACT_EMPTY - org.apache.datasketches.kll.KllSketch.SketchStructure
+
 
+
COMPACT_FULL - org.apache.datasketches.kll.KllSketch.SketchStructure
+
 
+
COMPACT_SINGLE - org.apache.datasketches.kll.KllSketch.SketchStructure
+
 
+
CompactDoublesSketch - Class in org.apache.datasketches.quantiles
+
+
Compact sketches are inherently read ony.
+
+
CompactSketch - Class in org.apache.datasketches.theta
+
+
The parent class of all the CompactSketches.
+
+
CompactSketch<S extends Summary> - Class in org.apache.datasketches.tuple
+
+
CompactSketches are never created directly.
+
+
CompactSketch - org.apache.datasketches.tuple.SerializerDeserializer.SketchType
+
 
+
CompactSketch() - Constructor for class org.apache.datasketches.theta.CompactSketch
+
 
+
compareTo(Group) - Method in class org.apache.datasketches.fdt.Group
+
 
+
compareTo(ItemsSketch.Row<T>) - Method in class org.apache.datasketches.frequencies.ItemsSketch.Row
+
+
This compareTo is strictly limited to the Row.getEstimate() value and does not imply any + ordering whatsoever to the other elements of the row: item and upper and lower bounds.
+
+
compareTo(LongsSketch.Row) - Method in class org.apache.datasketches.frequencies.LongsSketch.Row
+
+
This compareTo is strictly limited to the Row.getEstimate() value and does not imply any + ordering whatsoever to the other elements of the row: item and upper and lower bounds.
+
+
CompressionCharacterization - Class in org.apache.datasketches.cpc
+
+
This code is used both by unit tests, for short running tests, + and by the characterization repository for longer running, more exhaustive testing.
+
+
CompressionCharacterization(int, int, int, int, int, int, int, PrintStream, PrintWriter) - Constructor for class org.apache.datasketches.cpc.CompressionCharacterization
+
 
+
computeBytesNeeded(int) - Static method in class org.apache.datasketches.common.ArrayOfBooleansSerDe
+
+
Computes number of bytes needed for packed bit encoding of the array of booleans.
+
+
computeSeedHash(long) - Static method in class org.apache.datasketches.thetacommon.ThetaUtil
+
+
Computes and checks the 16-bit seed hash from the given long seed.
+
+
computeSeedHash(long) - Static method in class org.apache.datasketches.tuple.Util
+
+
Computes and checks the 16-bit seed hash from the given long seed.
+
+
ConcurrentBufferInserted - org.apache.datasketches.theta.UpdateReturnState
+
+
The hash was inserted into the local concurrent buffer, + but has not yet been propagated to the concurrent shared sketch.
+
+
ConcurrentPropagated - org.apache.datasketches.theta.UpdateReturnState
+
+
The hash has been propagated to the concurrent shared sketch.
+
+
continueCondition(long, long) - Static method in class org.apache.datasketches.thetacommon.HashOperations
+
+
Return true (continue) if hash is greater than or equal to thetaLong, or if hash == 0, + or if hash == Long.MAX_VALUE.
+
+
convertToHashTable(long[], int, long, double) - Static method in class org.apache.datasketches.thetacommon.HashOperations
+
+
Converts the given array to a hash table.
+
+
copy() - Method in class org.apache.datasketches.fdt.FdtSketch
+
 
+
copy() - Method in class org.apache.datasketches.hll.HllSketch
+
+
Return a copy of this sketch onto the Java heap.
+
+
copy() - Method in class org.apache.datasketches.tuple.adouble.DoubleSummary
+
 
+
copy() - Method in class org.apache.datasketches.tuple.aninteger.IntegerSummary
+
 
+
copy() - Method in class org.apache.datasketches.tuple.strings.ArrayOfStringsSketch
+
 
+
copy() - Method in class org.apache.datasketches.tuple.strings.ArrayOfStringsSummary
+
 
+
copy() - Method in interface org.apache.datasketches.tuple.Summary
+
+
Deep copy.
+
+
copy() - Method in class org.apache.datasketches.tuple.UpdatableSketch
+
 
+
copyAs(TgtHllType) - Method in class org.apache.datasketches.hll.HllSketch
+
+
Return a deep copy of this sketch onto the Java heap with the specified TgtHllType.
+
+
copyBytes(byte[], int, byte[], int, int) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Copies bytes from source to target with offsets on both the source and target.
+
+
copySummaryArray(S[]) - Static method in class org.apache.datasketches.tuple.Util
+
+
Will copy compact summary arrays as well as hashed summary tables (with nulls).
+
+
count(long[], long) - Static method in class org.apache.datasketches.thetacommon.HashOperations
+
+
Counts the cardinality of the given source array.
+
+
COUNTMIN - org.apache.datasketches.common.Family
+
+
CountMin Sketch
+
+
countPart(long[], int, long) - Static method in class org.apache.datasketches.thetacommon.HashOperations
+
+
Counts the cardinality of the first Log2 values of the given source array.
+
+
CPC - org.apache.datasketches.common.Family
+
+
Compressed Probabilistic Counting (CPC) Sketch
+
+
CpcSketch - Class in org.apache.datasketches.cpc
+
+
This is a unique-counting sketch that implements the + Compressed Probabilistic Counting (CPC, a.k.a FM85) algorithms developed by Kevin Lang in + his paper + Back to the Future: an Even More Nearly + Optimal Cardinality Estimation Algorithm.
+
+
CpcSketch() - Constructor for class org.apache.datasketches.cpc.CpcSketch
+
+
Constructor with default log_base2 of k
+
+
CpcSketch(int) - Constructor for class org.apache.datasketches.cpc.CpcSketch
+
+
Constructor with log_base2 of k.
+
+
CpcSketch(int, long) - Constructor for class org.apache.datasketches.cpc.CpcSketch
+
+
Constructor with log_base2 of k and seed.
+
+
CpcUnion - Class in org.apache.datasketches.cpc
+
+
The union (merge) operation for the CPC sketches.
+
+
CpcUnion() - Constructor for class org.apache.datasketches.cpc.CpcUnion
+
+
Construct this unioning object with the default LgK and the default update seed.
+
+
CpcUnion(int) - Constructor for class org.apache.datasketches.cpc.CpcUnion
+
+
Construct this unioning object with LgK and the default update seed.
+
+
CpcUnion(int, long) - Constructor for class org.apache.datasketches.cpc.CpcUnion
+
+
Construct this unioning object with LgK and a given seed.
+
+
CpcWrapper - Class in org.apache.datasketches.cpc
+
+
This provides a read-only view of a serialized image of a CpcSketch, which can be + on-heap or off-heap represented as a Memory object, or on-heap represented as a byte array.
+
+
CpcWrapper(byte[]) - Constructor for class org.apache.datasketches.cpc.CpcWrapper
+
+
Construct a read-only view of the given byte array that contains a CpcSketch.
+
+
CpcWrapper(Memory) - Constructor for class org.apache.datasketches.cpc.CpcWrapper
+
+
Construct a read-only view of the given Memory that contains a CpcSketch
+
+
createCornerCaseId(long, int, boolean, long, int, boolean) - Static method in class org.apache.datasketches.thetacommon.SetOperationCornerCases
+
 
+
createEmptySketch() - Static method in class org.apache.datasketches.tuple.Sketches
+
 
+
createSketch(int, int, long) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesIntersection
+
 
+
cumWeights - Variable in class org.apache.datasketches.quantilescommon.SortedViewIterator
+
 
+
+ + + +

D

+
+
DEFAULT_HLL_TYPE - Static variable in class org.apache.datasketches.hll.HllSketch
+
+
The default HLL-TYPE is HLL_4
+
+
DEFAULT_K - Static variable in class org.apache.datasketches.kll.KllSketch
+
+
The default K
+
+
DEFAULT_LG_K - Static variable in class org.apache.datasketches.cpc.CpcSketch
+
+
The default Log_base2 of K
+
+
DEFAULT_LG_K - Static variable in class org.apache.datasketches.hll.HllSketch
+
+
The default Log_base2 of K
+
+
DEFAULT_NOMINAL_ENTRIES - Static variable in class org.apache.datasketches.thetacommon.ThetaUtil
+
+
The default nominal entries is provided as a convenience for those cases where the + nominal sketch size in number of entries is not provided.
+
+
DEFAULT_NOMINAL_ENTRIES - Static variable in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSetOperationBuilder
+
+
Default Nominal Entries (a.k.a.
+
+
DEFAULT_NUMBER_OF_VALUES - Static variable in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSetOperationBuilder
+
+
Default number of values
+
+
DEFAULT_UPDATE_SEED - Static variable in class org.apache.datasketches.thetacommon.ThetaUtil
+
+
The seed 9001 used in the sketch update methods is a prime number that + was chosen very early on in experimental testing.
+
+
Degen_Degen - org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
Degen_Empty - org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
Degen_Estimation - org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
Degen_Exact - org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
DEGEN_MIN_0_F - org.apache.datasketches.thetacommon.SetOperationCornerCases.AnotbAction
+
 
+
DEGEN_MIN_0_F - org.apache.datasketches.thetacommon.SetOperationCornerCases.IntersectAction
+
 
+
DEGEN_MIN_0_F - org.apache.datasketches.thetacommon.SetOperationCornerCases.UnionAction
+
 
+
DEGEN_THA_0_F - org.apache.datasketches.thetacommon.SetOperationCornerCases.AnotbAction
+
 
+
DEGEN_THA_0_F - org.apache.datasketches.thetacommon.SetOperationCornerCases.UnionAction
+
 
+
DEGEN_THB_0_F - org.apache.datasketches.thetacommon.SetOperationCornerCases.UnionAction
+
 
+
desc(double[], int, int, double, int) - Method in enum org.apache.datasketches.quantilescommon.InequalitySearch
+
+
Optional call that describes the details of the results of the search.
+
+
desc(float[], int, int, float, int) - Method in enum org.apache.datasketches.quantilescommon.InequalitySearch
+
+
Optional call that describes the details of the results of the search.
+
+
desc(long[], int, int, double, int) - Method in enum org.apache.datasketches.quantilescommon.InequalitySearch
+
+
Optional call that describes the details of the results of the search.
+
+
desc(long[], int, int, long, int) - Method in enum org.apache.datasketches.quantilescommon.InequalitySearch
+
+
Optional call that describes the details of the results of the search.
+
+
deserializeFromMemory(Memory, int) - Method in class org.apache.datasketches.common.ArrayOfBooleansSerDe
+
+
Deprecated.
+
+
deserializeFromMemory(Memory, int) - Method in class org.apache.datasketches.common.ArrayOfDoublesSerDe
+
+
Deprecated.
+
+
deserializeFromMemory(Memory, int) - Method in class org.apache.datasketches.common.ArrayOfItemsSerDe
+
+ +
+
deserializeFromMemory(Memory, int) - Method in class org.apache.datasketches.common.ArrayOfLongsSerDe
+
+
Deprecated.
+
+
deserializeFromMemory(Memory, int) - Method in class org.apache.datasketches.common.ArrayOfNumbersSerDe
+
+
Deprecated.
+
+
deserializeFromMemory(Memory, int) - Method in class org.apache.datasketches.common.ArrayOfStringsSerDe
+
+
Deprecated.
+
+
deserializeFromMemory(Memory, int) - Method in class org.apache.datasketches.common.ArrayOfUtf16StringsSerDe
+
+
Deprecated.
+
+
deserializeFromMemory(Memory, long, int) - Method in class org.apache.datasketches.common.ArrayOfBooleansSerDe
+
 
+
deserializeFromMemory(Memory, long, int) - Method in class org.apache.datasketches.common.ArrayOfDoublesSerDe
+
 
+
deserializeFromMemory(Memory, long, int) - Method in class org.apache.datasketches.common.ArrayOfItemsSerDe
+
+
Deserialize a contiguous sequence of serialized items from a given Memory.
+
+
deserializeFromMemory(Memory, long, int) - Method in class org.apache.datasketches.common.ArrayOfLongsSerDe
+
 
+
deserializeFromMemory(Memory, long, int) - Method in class org.apache.datasketches.common.ArrayOfNumbersSerDe
+
 
+
deserializeFromMemory(Memory, long, int) - Method in class org.apache.datasketches.common.ArrayOfStringsSerDe
+
 
+
deserializeFromMemory(Memory, long, int) - Method in class org.apache.datasketches.common.ArrayOfUtf16StringsSerDe
+
 
+
DeserializeResult<T> - Class in org.apache.datasketches.tuple
+
+
Returns an object and its size in bytes as a result of a deserialize operation
+
+
DeserializeResult(T, int) - Constructor for class org.apache.datasketches.tuple.DeserializeResult
+
+
Creates an instance.
+
+
dissimilarityTest(Sketch, Sketch, double) - Static method in class org.apache.datasketches.theta.JaccardSimilarity
+
+
Tests dissimilarity of a measured Sketch against an expected Sketch.
+
+
dissimilarityTest(Sketch<S>, Sketch, S, SummarySetOperations<S>, double) - Static method in class org.apache.datasketches.tuple.JaccardSimilarity
+
+
Tests dissimilarity of a measured Sketch against an expected Sketch.
+
+
dissimilarityTest(Sketch<S>, Sketch<S>, SummarySetOperations<S>, double) - Static method in class org.apache.datasketches.tuple.JaccardSimilarity
+
+
Tests dissimilarity of a measured Sketch against an expected Sketch.
+
+
DOUBLES_SKETCH - org.apache.datasketches.kll.KllSketch.SketchType
+
 
+
DoubleSketch - Class in org.apache.datasketches.tuple.adouble
+
 
+
DoubleSketch(int, int, float, DoubleSummary.Mode) - Constructor for class org.apache.datasketches.tuple.adouble.DoubleSketch
+
+
Creates this sketch with the following parameters:
+
+
DoubleSketch(int, DoubleSummary.Mode) - Constructor for class org.apache.datasketches.tuple.adouble.DoubleSketch
+
+
Constructs this sketch with given lgK.
+
+
DoubleSketch(Memory, DoubleSummary.Mode) - Constructor for class org.apache.datasketches.tuple.adouble.DoubleSketch
+
+
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.
+
+
+
DoublesSketch - Class in org.apache.datasketches.quantiles
+
+
This is an implementation of the Low Discrepancy Mergeable Quantiles Sketch, using doubles, + described in section 3.2 of the journal version of the paper "Mergeable Summaries" + by Agarwal, Cormode, Huang, Phillips, Wei, and Yi:
+
+
DoublesSketchBuilder - Class in org.apache.datasketches.quantiles
+
+
For building a new quantiles DoublesSketch.
+
+
DoublesSketchBuilder() - Constructor for class org.apache.datasketches.quantiles.DoublesSketchBuilder
+
+
Constructor for a new DoublesSketchBuilder.
+
+
DoublesSketchIterator - Class in org.apache.datasketches.quantiles
+
+
Iterator over DoublesSketch.
+
+
DoublesSketchSortedView - Class in org.apache.datasketches.quantiles
+
+
The SortedView of the Classic Quantiles DoublesSketch.
+
+
DoublesSketchSortedView(DoublesSketch) - Constructor for class org.apache.datasketches.quantiles.DoublesSketchSortedView
+
+
Constructs this Sorted View given the sketch
+
+
DoublesSortedView - Interface in org.apache.datasketches.quantilescommon
+
+
The Sorted View for quantile sketches of primitive type double.
+
+
DoublesSortedViewIterator - Class in org.apache.datasketches.quantilescommon
+
+
Iterator over quantile sketches of primitive type double.
+
+
DoublesSortedViewIterator(double[], long[]) - Constructor for class org.apache.datasketches.quantilescommon.DoublesSortedViewIterator
+
 
+
DoubleSummary - Class in org.apache.datasketches.tuple.adouble
+
+
Summary for generic tuple sketches of type Double.
+
+
DoubleSummary(DoubleSummary.Mode) - Constructor for class org.apache.datasketches.tuple.adouble.DoubleSummary
+
+
Creates an instance of DoubleSummary with a given mode.
+
+
DoubleSummary.Mode - Enum in org.apache.datasketches.tuple.adouble
+
+
The aggregation modes for this Summary
+
+
DoubleSummaryDeserializer - Class in org.apache.datasketches.tuple.adouble
+
 
+
DoubleSummaryDeserializer() - Constructor for class org.apache.datasketches.tuple.adouble.DoubleSummaryDeserializer
+
 
+
DoubleSummaryFactory - Class in org.apache.datasketches.tuple.adouble
+
+
Factory for DoubleSummary.
+
+
DoubleSummaryFactory(DoubleSummary.Mode) - Constructor for class org.apache.datasketches.tuple.adouble.DoubleSummaryFactory
+
+
Creates an instance of DoubleSummaryFactory with a given mode
+
+
DoubleSummarySetOperations - Class in org.apache.datasketches.tuple.adouble
+
+
Methods for defining how unions and intersections of two objects of type DoubleSummary + are performed.
+
+
DoubleSummarySetOperations() - Constructor for class org.apache.datasketches.tuple.adouble.DoubleSummarySetOperations
+
+
Creates an instance with default mode of sum for both union and intersection.
+
+
DoubleSummarySetOperations(DoubleSummary.Mode) - Constructor for class org.apache.datasketches.tuple.adouble.DoubleSummarySetOperations
+
+
Creates an instance given a DoubleSummary update mode where the mode is the same for both + union and intersection.
+
+
DoubleSummarySetOperations(DoubleSummary.Mode, DoubleSummary.Mode) - Constructor for class org.apache.datasketches.tuple.adouble.DoubleSummarySetOperations
+
+
Creates an instance with two modes.
+
+
DoublesUnion - Class in org.apache.datasketches.quantiles
+
+
The API for Union operations for quantiles DoublesSketches
+
+
DoublesUnion() - Constructor for class org.apache.datasketches.quantiles.DoublesUnion
+
 
+
DoublesUnionBuilder - Class in org.apache.datasketches.quantiles
+
+
For building a new DoublesSketch Union operation.
+
+
DoublesUnionBuilder() - Constructor for class org.apache.datasketches.quantiles.DoublesUnionBuilder
+
+
Constructor for a new DoublesUnionBuilder.
+
+
doubleToLongArray(double) - Static method in class org.apache.datasketches.tuple.Util
+
+
Converts a double to a long[].
+
+
downSample(int) - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
+
From an existing sketch, this creates a new sketch that can have a smaller K.
+
+
downSample(DoublesSketch, int, WritableMemory) - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
From an source sketch, create a new sketch that must have a smaller K.
+
+
+ + + +

E

+
+
emitAdjSecSizeNumSec(byte) - Method in interface org.apache.datasketches.req.ReqDebug
+
+
Emit adjusting section size and number of sections.
+
+
emitAllHorizList() - Method in interface org.apache.datasketches.req.ReqDebug
+
+
Emit all horizontal lists
+
+
emitCompactingStart(byte) - Method in interface org.apache.datasketches.req.ReqDebug
+
+
Emit Compaction Start.
+
+
emitCompactionDetail(int, int, int, int, boolean) - Method in interface org.apache.datasketches.req.ReqDebug
+
+
Emit Compaction details.
+
+
emitCompactionDone(byte) - Method in interface org.apache.datasketches.req.ReqDebug
+
+
Emit compaction done and number of compactions so far.
+
+
emitCompressDone() - Method in interface org.apache.datasketches.req.ReqDebug
+
+
Emit compress done.
+
+
emitMustAddCompactor() - Method in interface org.apache.datasketches.req.ReqDebug
+
+
Emit Must add compactor
+
+
emitNewCompactor(byte) - Method in interface org.apache.datasketches.req.ReqDebug
+
+
Emit new compactor configuration
+
+
emitStart(ReqSketch) - Method in interface org.apache.datasketches.req.ReqDebug
+
+
Emit the start signal
+
+
emitStartCompress() - Method in interface org.apache.datasketches.req.ReqDebug
+
+
Emit Start Compress
+
+
EMPTY_1_0_T - org.apache.datasketches.thetacommon.SetOperationCornerCases.AnotbAction
+
 
+
EMPTY_1_0_T - org.apache.datasketches.thetacommon.SetOperationCornerCases.IntersectAction
+
 
+
EMPTY_1_0_T - org.apache.datasketches.thetacommon.SetOperationCornerCases.UnionAction
+
 
+
Empty_Degen - org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
Empty_Empty - org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
Empty_Estimation - org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
Empty_Exact - org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
EMPTY_MSG - Static variable in interface org.apache.datasketches.quantilescommon.QuantilesAPI
+
 
+
EQ - org.apache.datasketches.quantilescommon.GenericInequalitySearch.Inequality
+
+
Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the adjacent pair of + values {A,B} such that A ≤ V ≤ B.
+
+
EQ - org.apache.datasketches.quantilescommon.InequalitySearch
+
+
Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the adjacent pair of + values {A,B} such that A ≤ V ≤ B.
+
+
equallySpacedDoubles(int) - Static method in class org.apache.datasketches.quantilescommon.QuantilesUtil
+
+
Returns an array of (num + 1) values that define equally sized intervals between 0.0, inclusive, and 1.0, + inclusive.
+
+
equallySpacedLongs(long, long, int) - Static method in class org.apache.datasketches.quantilescommon.QuantilesUtil
+
+
Returns an array of (num + 1) longs that define, approximately, equally spaced intervals between the given + max, inclusive, and min, inclusive.
+
+
equals(Object) - Method in class org.apache.datasketches.fdt.Group
+
 
+
equals(Object) - Method in class org.apache.datasketches.frequencies.ItemsSketch.Row
+
+
This equals is computed only from the Row.getEstimate() value and does not imply equality + of the other items within the row: item and upper and lower bounds.
+
+
equals(Object) - Method in class org.apache.datasketches.frequencies.LongsSketch.Row
+
+
This equals is computed only from the Row.getEstimate() value and does not imply equality + of the other items within the row: item and upper and lower bounds.
+
+
equals(Object) - Method in class org.apache.datasketches.tuple.strings.ArrayOfStringsSummary
+
 
+
erf(double) - Static method in class org.apache.datasketches.common.BoundsOnBinomialProportions
+
+
Computes an approximation to the erf() function.
+
+
ErrorType - Enum in org.apache.datasketches.frequencies
+
+
Specifies one of two types of error regions of the statistical classification Confusion Matrix + that can be excluded from a returned sample of Frequent Items.
+
+
estimateSubsetSum(Predicate<Long>) - Method in class org.apache.datasketches.sampling.ReservoirLongsSketch
+
+
Computes an estimated subset sum from the entire stream for objects matching a given + predicate.
+
+
estimateSubsetSum(Predicate<T>) - Method in class org.apache.datasketches.sampling.ReservoirItemsSketch
+
+
Computes an estimated subset sum from the entire stream for objects matching a given + predicate.
+
+
estimateSubsetSum(Predicate<T>) - Method in class org.apache.datasketches.sampling.VarOptItemsSketch
+
+
Computes an estimated subset sum from the entire stream for objects matching a given + predicate.
+
+
estimateUnknownP(long, long) - Static method in class org.apache.datasketches.common.BoundsOnBinomialProportions
+
+
Computes an estimate of an unknown binomial proportion.
+
+
Estimation_Degen - org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
Estimation_Empty - org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
Estimation_Estimation - org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
Estimation_Exact - org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
evenlyLogSpaced(double, double, int) - Static method in class org.apache.datasketches.quantilescommon.QuantilesUtil
+
+
Returns a double array of values between min and max inclusive where the log of the + returned values are evenly spaced.
+
+
evenlySpacedDoubles(double, double, int) - Static method in class org.apache.datasketches.quantilescommon.QuantilesUtil
+
+
Returns a double array of evenly spaced values between value1, inclusive, and value2 inclusive.
+
+
evenlySpacedFloats(float, float, int) - Static method in class org.apache.datasketches.quantilescommon.QuantilesUtil
+
+
Returns a float array of evenly spaced values between value1, inclusive, and value2 inclusive.
+
+
Exact_Degen - org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
Exact_Empty - org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
Exact_Estimation - org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
Exact_Exact - org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
exactLog2OfInt(int) - Static method in class org.apache.datasketches.common.Util
+
+
Returns the log2 of the given int value if it is an exact power of 2 and greater than zero.
+
+
exactLog2OfInt(int, String) - Static method in class org.apache.datasketches.common.Util
+
+
Returns the log2 of the given int value if it is an exact power of 2 and greater than zero.
+
+
exactLog2OfLong(long) - Static method in class org.apache.datasketches.common.Util
+
+
Returns the log2 of the given long value if it is an exact power of 2 and greater than zero.
+
+
exactLog2OfLong(long, String) - Static method in class org.apache.datasketches.common.Util
+
+
Returns the log2 of the given long value if it is an exact power of 2 and greater than zero.
+
+
exactlyEqual(Sketch, Sketch) - Static method in class org.apache.datasketches.theta.JaccardSimilarity
+
+
Returns true if the two given sketches have exactly the same hash values and the same + theta values.
+
+
exactlyEqual(Sketch<S>, Sketch, S, SummarySetOperations<S>) - Static method in class org.apache.datasketches.tuple.JaccardSimilarity
+
+
Returns true if the two given sketches have exactly the same hash values and the same + theta values.
+
+
exactlyEqual(Sketch<S>, Sketch<S>, SummarySetOperations<S>) - Static method in class org.apache.datasketches.tuple.JaccardSimilarity
+
+
Returns true if the two given sketches have exactly the same hash values and the same + theta values.
+
+
EXCLUSIVE - org.apache.datasketches.quantilescommon.QuantileSearchCriteria
+
+
Definition of EXCLUSIVE getQuantile(r) search:
+ Given rank r, return the quantile of the smallest rank that is + strictly greater than r.
+
+
+ + + +

F

+
+
Family - Enum in org.apache.datasketches.common
+
+
Defines the various families of sketch and set operation classes.
+
+
FdtSketch - Class in org.apache.datasketches.fdt
+
+
A Frequent Distinct Tuples sketch.
+
+
FdtSketch(double, double) - Constructor for class org.apache.datasketches.fdt.FdtSketch
+
+
Create a new instance of Frequent Distinct Tuples sketch with a size determined by the given + threshold and rse.
+
+
FdtSketch(int) - Constructor for class org.apache.datasketches.fdt.FdtSketch
+
+
Create new instance of Frequent Distinct Tuples sketch with the given + Log-base2 of required nominal entries.
+
+
FdtSketch(FdtSketch) - Constructor for class org.apache.datasketches.fdt.FdtSketch
+
+
Copy Constructor
+
+
filter(Sketch<T>) - Method in class org.apache.datasketches.tuple.Filter
+
+
Filters elements on the provided Sketch
+
+
Filter<T extends Summary> - Class in org.apache.datasketches.tuple
+
+
Class for filtering entries from a Sketch given a Summary
+
+
Filter(Predicate<T>) - Constructor for class org.apache.datasketches.tuple.Filter
+
+
Filter constructor with a Predicate
+
+
find(double[], int, int, double) - Static method in class org.apache.datasketches.quantilescommon.BinarySearch
+
+
Binary Search for the index of the exact double value in the given search range.
+
+
find(double[], int, int, double, InequalitySearch) - Static method in enum org.apache.datasketches.quantilescommon.InequalitySearch
+
+
Binary Search for the index of the double value in the given search range that satisfies + the given InequalitySearch criterion.
+
+
find(float[], int, int, float) - Static method in class org.apache.datasketches.quantilescommon.BinarySearch
+
+
Binary Search for the index of the exact float value in the given search range.
+
+
find(float[], int, int, float, InequalitySearch) - Static method in enum org.apache.datasketches.quantilescommon.InequalitySearch
+
+
Binary Search for the index of the float value in the given search range that satisfies + the given InequalitySearch criterion.
+
+
find(long[], int, int, double, InequalitySearch) - Static method in enum org.apache.datasketches.quantilescommon.InequalitySearch
+
+
Binary Search for the index of the double value in the given search range that satisfies + the given InequalitySearch criterion.
+
+
find(long[], int, int, long) - Static method in class org.apache.datasketches.quantilescommon.BinarySearch
+
+
Binary Search for the index of the exact long value in the given search range.
+
+
find(long[], int, int, long, InequalitySearch) - Static method in enum org.apache.datasketches.quantilescommon.InequalitySearch
+
+
Binary Search for the index of the long value in the given search range that satisfies + the given InequalitySearch criterion.
+
+
find(T[], int, int, T, GenericInequalitySearch.Inequality, Comparator<T>) - Static method in class org.apache.datasketches.quantilescommon.GenericInequalitySearch
+
+
Binary Search for the index of the generic value in the given search range that satisfies + the given Inequality criterion.
+
+
FLOATS_SKETCH - org.apache.datasketches.kll.KllSketch.SketchType
+
 
+
FloatsSortedView - Interface in org.apache.datasketches.quantilescommon
+
+
The Sorted View for quantiles of primitive type float.
+
+
FloatsSortedViewIterator - Class in org.apache.datasketches.quantilescommon
+
+
Iterator over quantile sketches of primitive type float.
+
+
FloatsSortedViewIterator(float[], long[]) - Constructor for class org.apache.datasketches.quantilescommon.FloatsSortedViewIterator
+
 
+
floorPowerBaseOfDouble(double, double) - Static method in class org.apache.datasketches.common.Util
+
+
Computes the floor of a given n given base, where the floor is an integral power of the base.
+
+
floorPowerOf2(int) - Static method in class org.apache.datasketches.common.Util
+
+
Computes the floor power of 2 given n is in the range [1, 2^31-1].
+
+
floorPowerOf2(long) - Static method in class org.apache.datasketches.common.Util
+
+
Computes the floor power of 2 given n is in the range [1, 2^63-1].
+
+
FREQUENCY - org.apache.datasketches.common.Family
+
+
The Frequency family of sketches.
+
+
fromMemory(Memory) - Static method in class org.apache.datasketches.tuple.adouble.DoubleSummary
+
+
Creates an instance of the DoubleSummary given a serialized representation
+
+
fromMemory(Memory) - Static method in class org.apache.datasketches.tuple.aninteger.IntegerSummary
+
+
Creates an instance of the IntegerSummary given a serialized representation
+
+
fromOrdinal(int) - Static method in enum org.apache.datasketches.hll.TgtHllType
+
 
+
FULL_ANOTB - org.apache.datasketches.thetacommon.SetOperationCornerCases.AnotbAction
+
 
+
FULL_INTERSECT - org.apache.datasketches.thetacommon.SetOperationCornerCases.IntersectAction
+
 
+
FULL_UNION - org.apache.datasketches.thetacommon.SetOperationCornerCases.UnionAction
+
 
+
+ + + +

G

+
+
GE - org.apache.datasketches.quantilescommon.GenericInequalitySearch.Inequality
+
+
Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the lowest adjacent pair of + values {A,B} such that A < V ≤ B.
+ Let low = index of the lowest value in the range.
+ Let high = index of the highest value in the range.
+
+
GE - org.apache.datasketches.quantilescommon.InequalitySearch
+
+
Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the lowest adjacent pair of + values {A,B} such that A < V ≤ B.
+ Let low = index of the lowest value in the range.
+ Let high = index of the highest value in the range.
+
+
GenericInequalitySearch - Class in org.apache.datasketches.quantilescommon
+
+
This provides efficient, unique and unambiguous binary searching for inequality comparison criteria + for ordered arrays of values that may include duplicate values.
+
+
GenericInequalitySearch() - Constructor for class org.apache.datasketches.quantilescommon.GenericInequalitySearch
+
 
+
GenericInequalitySearch.Inequality - Enum in org.apache.datasketches.quantilescommon
+
+
The enumerator of inequalities
+
+
GenericPartitionBoundaries<T> - Class in org.apache.datasketches.quantilescommon
+
+
Implements PartitionBoundaries
+
+
GenericPartitionBoundaries(long, T[], long[], double[], T, T, QuantileSearchCriteria) - Constructor for class org.apache.datasketches.quantilescommon.GenericPartitionBoundaries
+
 
+
GenericSortedView<T> - Interface in org.apache.datasketches.quantilescommon
+
+
The Sorted View for quantiles of generic type.
+
+
GenericSortedViewIterator<T> - Class in org.apache.datasketches.quantilescommon
+
+
Iterator over quantile sketches of generic type.
+
+
GenericSortedViewIterator(T[], long[]) - Constructor for class org.apache.datasketches.quantilescommon.GenericSortedViewIterator
+
 
+
get() - Method in interface org.apache.datasketches.theta.HashIterator
+
+
Gets the hash value
+
+
getActionDescription() - Method in enum org.apache.datasketches.thetacommon.SetOperationCornerCases.AnotbAction
+
 
+
getActionDescription() - Method in enum org.apache.datasketches.thetacommon.SetOperationCornerCases.IntersectAction
+
 
+
getActionDescription() - Method in enum org.apache.datasketches.thetacommon.SetOperationCornerCases.UnionAction
+
 
+
getActionId() - Method in enum org.apache.datasketches.thetacommon.SetOperationCornerCases.AnotbAction
+
 
+
getActionId() - Method in enum org.apache.datasketches.thetacommon.SetOperationCornerCases.IntersectAction
+
 
+
getActionId() - Method in enum org.apache.datasketches.thetacommon.SetOperationCornerCases.UnionAction
+
 
+
getActiveEntries() - Method in class org.apache.datasketches.hllmap.UniqueCountMap
+
+
Returns the number of active, unique keys across all internal maps
+
+
getAnotbAction() - Method in enum org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
getAprioriError(int, long) - Static method in class org.apache.datasketches.frequencies.ItemsSketch
+
+
Returns the estimated a priori error given the maxMapSize for the sketch and the + estimatedTotalStreamWeight.
+
+
getAprioriError(int, long) - Static method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Returns the estimated a priori error given the maxMapSize for the sketch and the + estimatedTotalStreamWeight.
+
+
getAverageSketchMemoryPerKey() - Method in class org.apache.datasketches.hllmap.UniqueCountMap
+
+
Returns the average memory storage per key that is dedicated to sketching the unique counts.
+
+
getBoundaries() - Method in class org.apache.datasketches.quantilescommon.GenericPartitionBoundaries
+
+
Gets an ordered array of boundaries that sequentially define the upper and lower boundaries of partitions.
+
+
getBytes() - Method in enum org.apache.datasketches.kll.KllSketch.SketchType
+
 
+
getCaseDescription() - Method in enum org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
getCDF(double[]) - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
This is equivalent to getCDF(splitPoints, INCLUSIVE)
+
+
getCDF(double[], QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllDoublesSketch
+
 
+
getCDF(double[], QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
getCDF(double[], QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.DoublesSortedView
+
+
Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints.
+
+
getCDF(double[], QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints.
+
+
getCDF(float[]) - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
This is equivalent to getCDF(splitPoints, INCLUSIVE)
+
+
getCDF(float[], QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllFloatsSketch
+
 
+
getCDF(float[], QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.FloatsSortedView
+
+
Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints.
+
+
getCDF(float[], QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints.
+
+
getCDF(float[], QuantileSearchCriteria) - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
getCDF(T[]) - Method in interface org.apache.datasketches.quantilescommon.QuantilesGenericAPI
+
+
This is equivalent to getCDF(splitPoints, INCLUSIVE)
+
+
getCDF(T[], QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllItemsSketch
+
 
+
getCDF(T[], QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllItemsSketchSortedView
+
 
+
getCDF(T[], QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
getCDF(T[], QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.ItemsSketchSortedView
+
 
+
getCDF(T[], QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.GenericSortedView
+
+
Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints.
+
+
getCDF(T[], QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.QuantilesGenericAPI
+
+
Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints.
+
+
getClassOfT() - Method in class org.apache.datasketches.common.ArrayOfBooleansSerDe
+
 
+
getClassOfT() - Method in class org.apache.datasketches.common.ArrayOfDoublesSerDe
+
 
+
getClassOfT() - Method in class org.apache.datasketches.common.ArrayOfItemsSerDe
+
+
Returns the concrete class of type T
+
+
getClassOfT() - Method in class org.apache.datasketches.common.ArrayOfLongsSerDe
+
 
+
getClassOfT() - Method in class org.apache.datasketches.common.ArrayOfNumbersSerDe
+
 
+
getClassOfT() - Method in class org.apache.datasketches.common.ArrayOfStringsSerDe
+
 
+
getClassOfT() - Method in class org.apache.datasketches.common.ArrayOfUtf16StringsSerDe
+
 
+
getCompactBytes() - Method in class org.apache.datasketches.theta.CompactSketch
+
 
+
getCompactBytes() - Method in class org.apache.datasketches.theta.Sketch
+
+
Returns the number of storage bytes required for this Sketch if its current state were + compacted.
+
+
getCompactBytes() - Method in class org.apache.datasketches.theta.UpdateSketch
+
 
+
getCompactSerialiedSizeBytes(int, long) - Static method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Returns the number of bytes a DoublesSketch would require to store in compact form + given k and n.
+
+
getCompactSerializationBytes() - Method in class org.apache.datasketches.hll.HllSketch
+
 
+
getCompactSerializationBytes() - Method in class org.apache.datasketches.hll.Union
+
 
+
getCompositeEstimate() - Method in class org.apache.datasketches.hll.HllSketch
+
 
+
getCompositeEstimate() - Method in class org.apache.datasketches.hll.Union
+
 
+
getCount() - Method in class org.apache.datasketches.fdt.Group
+
 
+
getCountLessThanThetaLong(long) - Method in class org.apache.datasketches.theta.Sketch
+
+
Gets the number of hash values less than the given theta expressed as a long.
+
+
getCountLessThanThetaLong(long) - Method in class org.apache.datasketches.tuple.CompactSketch
+
 
+
getCountLessThanThetaLong(long) - Method in class org.apache.datasketches.tuple.Sketch
+
+
Gets the number of hash values less than the given theta expressed as a long.
+
+
getCumulativeWeights() - Method in class org.apache.datasketches.kll.KllDoublesSketchSortedView
+
 
+
getCumulativeWeights() - Method in class org.apache.datasketches.kll.KllFloatsSketchSortedView
+
 
+
getCumulativeWeights() - Method in class org.apache.datasketches.kll.KllItemsSketchSortedView
+
 
+
getCumulativeWeights() - Method in class org.apache.datasketches.quantiles.DoublesSketchSortedView
+
 
+
getCumulativeWeights() - Method in class org.apache.datasketches.quantiles.ItemsSketchSortedView
+
 
+
getCumulativeWeights() - Method in interface org.apache.datasketches.quantilescommon.SortedView
+
+
Returns the array of cumulative weights from the sketch.
+
+
getCumulativeWeights() - Method in class org.apache.datasketches.req.ReqSketchSortedView
+
 
+
getCurrentBytes() - Method in class org.apache.datasketches.theta.Sketch
+
+
Returns the number of storage bytes required for this sketch in its current state.
+
+
getCurrentBytes() - Method in class org.apache.datasketches.theta.Union
+
+
Returns the number of storage bytes required for this union in its current state.
+
+
getCurrentBytes() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesCompactSketch
+
 
+
getCurrentBytes() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
+
For compact sketches this is the same as getMaxBytes().
+
+
getCurrentCompactSerializedSizeBytes() - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Returns the current number of bytes this sketch would require to store in the compact Memory Format.
+
+
getCurrentMapCapacity() - Method in class org.apache.datasketches.frequencies.ItemsSketch
+
+
Returns the current number of counters the sketch is configured to support.
+
+
getCurrentMapCapacity() - Method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Returns the current number of counters the sketch is configured to support.
+
+
getCurrentUpdatableSerializedSizeBytes() - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Returns the current number of bytes this sketch would require to store in the updatable Memory Format.
+
+
getDoubleBE(byte[], int) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Get a double from the given byte array starting at the given offset + in big endian order.
+
+
getDoubleLE(byte[], int) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Get a double from the given byte array starting at the given offset + in little endian order.
+
+
getEffectiveK() - Method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Returns the effective k of this Union.
+
+
getEffectiveK() - Method in class org.apache.datasketches.quantiles.ItemsUnion
+
+
Returns the effective k of this Union.
+
+
getEpsilon(int) - Static method in class org.apache.datasketches.frequencies.ItemsSketch
+
+
Returns epsilon used to compute a priori error.
+
+
getEpsilon(int) - Static method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Returns epsilon used to compute a priori error.
+
+
getEstimate() - Method in class org.apache.datasketches.cpc.CpcSketch
+
+
Returns the best estimate of the cardinality of the sketch.
+
+
getEstimate() - Method in class org.apache.datasketches.cpc.CpcWrapper
+
+
Returns the best estimate of the cardinality of the sketch.
+
+
getEstimate() - Method in class org.apache.datasketches.fdt.Group
+
 
+
getEstimate() - Method in class org.apache.datasketches.frequencies.ItemsSketch.Row
+
 
+
getEstimate() - Method in class org.apache.datasketches.frequencies.LongsSketch.Row
+
 
+
getEstimate() - Method in class org.apache.datasketches.hll.HllSketch
+
 
+
getEstimate() - Method in class org.apache.datasketches.hll.Union
+
 
+
getEstimate() - Method in class org.apache.datasketches.sampling.SampleSubsetSummary
+
 
+
getEstimate() - Method in class org.apache.datasketches.theta.Sketch
+
+
Gets the unique count estimate.
+
+
getEstimate() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
+
Estimates the cardinality of the set (number of unique values presented to the sketch)
+
+
getEstimate() - Method in class org.apache.datasketches.tuple.Sketch
+
+
Estimates the cardinality of the set (number of unique values presented to the sketch)
+
+
getEstimate(byte[]) - Method in class org.apache.datasketches.hllmap.UniqueCountMap
+
+
Retrieves the current estimate of unique count for a given key.
+
+
getEstimate(int) - Method in class org.apache.datasketches.tuple.Sketch
+
+
Gets the estimate of the true distinct population of subset tuples represented by the count + of entries in a subset of the total retained entries of the sketch.
+
+
getEstimate(long) - Method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Gets the estimate of the frequency of the given item.
+
+
getEstimate(Memory) - Static method in class org.apache.datasketches.theta.Sketches
+
+
Gets the unique count estimate from a valid memory image of a Sketch
+
+
getEstimate(T) - Method in class org.apache.datasketches.frequencies.ItemsSketch
+
+
Gets the estimate of the frequency of the given item.
+
+
getEstimateOfA(long, double) - Static method in class org.apache.datasketches.common.BoundsOnRatiosInSampledSets
+
+
Return the estimate of A.
+
+
getEstimateOfB(long, double) - Static method in class org.apache.datasketches.common.BoundsOnRatiosInSampledSets
+
+
Return the estimate of B.
+
+
getEstimateOfBoverA(long, long) - Static method in class org.apache.datasketches.common.BoundsOnRatiosInSampledSets
+
+
Return the estimate of b over a
+
+
getEstimateOfBoverA(Sketch, Sketch) - Static method in class org.apache.datasketches.thetacommon.BoundsOnRatiosInThetaSketchedSets
+
+
Gets the estimate for B over A
+
+
getEstimateOfBoverA(Sketch<S>, Sketch) - Static method in class org.apache.datasketches.thetacommon.BoundsOnRatiosInTupleSketchedSets
+
+
Gets the estimate for B over A
+
+
getEstimateOfBoverA(Sketch<S>, Sketch<S>) - Static method in class org.apache.datasketches.thetacommon.BoundsOnRatiosInTupleSketchedSets
+
+
Gets the estimate for B over A
+
+
getFamily() - Static method in class org.apache.datasketches.cpc.CpcSketch
+
+
Return the DataSketches identifier for this CPC family of sketches.
+
+
getFamily() - Static method in class org.apache.datasketches.cpc.CpcUnion
+
+
Return the DataSketches identifier for this CPC family of sketches.
+
+
getFamily() - Static method in class org.apache.datasketches.cpc.CpcWrapper
+
+
Return the DataSketches identifier for this CPC family of sketches.
+
+
getFamily() - Method in class org.apache.datasketches.theta.AnotB
+
 
+
getFamily() - Method in class org.apache.datasketches.theta.CompactSketch
+
 
+
getFamily() - Method in class org.apache.datasketches.theta.Intersection
+
 
+
getFamily() - Method in class org.apache.datasketches.theta.SetOperation
+
+
Gets the Family of this SetOperation
+
+
getFamily() - Method in class org.apache.datasketches.theta.Sketch
+
+
Returns the Family that this sketch belongs to
+
+
getFamily() - Method in class org.apache.datasketches.theta.Union
+
 
+
getFamily() - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Returns the Family
+
+
getFamilyName() - Method in enum org.apache.datasketches.common.Family
+
+
Returns the name for this family
+
+
getFloatBE(byte[], int) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Get a float from the given byte array starting at the given offset + in big endian order.
+
+
getFloatLE(byte[], int) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Get a float from the given byte array starting at the given offset + in little endian order.
+
+
getFraction() - Method in class org.apache.datasketches.fdt.Group
+
 
+
getFrequentItems(long, ErrorType) - Method in class org.apache.datasketches.frequencies.ItemsSketch
+
+
Returns an array of Rows that include frequent items, estimates, upper and lower bounds + given a threshold and an ErrorCondition.
+
+
getFrequentItems(long, ErrorType) - Method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Returns an array of Rows that include frequent items, estimates, upper and lower bounds + given a threshold and an ErrorCondition.
+
+
getFrequentItems(ErrorType) - Method in class org.apache.datasketches.frequencies.ItemsSketch
+
+
Returns an array of Rows that include frequent items, estimates, upper and lower bounds + given an ErrorCondition and the default threshold.
+
+
getFrequentItems(ErrorType) - Method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Returns an array of Rows that include frequent items, estimates, upper and lower bounds + given an ErrorCondition and the default threshold.
+
+
getGroupCount() - Method in class org.apache.datasketches.fdt.PostProcessor
+
+
Returns the number of groups in the final sketch.
+
+
getGroupList(int[], int, int) - Method in class org.apache.datasketches.fdt.PostProcessor
+
+
Return the most frequent Groups associated with Primary Keys based on the size of the groups.
+
+
getHash() - Method in class org.apache.datasketches.tuple.TupleSketchIterator
+
+
Gets the hash from the current entry in the sketch, which is a hash + of the original key passed to update().
+
+
getHeader() - Method in class org.apache.datasketches.fdt.Group
+
 
+
getHighRankAccuracy() - Method in class org.apache.datasketches.req.ReqSketchBuilder
+
+
Gets the builder configured High Rank Accuracy.
+
+
getHighRankAccuracyMode() - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
getId() - Method in enum org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
getID() - Method in enum org.apache.datasketches.common.Family
+
+
Returns the byte ID for this family
+
+
getInstance(Class<T>, int, Comparator<? super T>) - Static method in class org.apache.datasketches.quantiles.ItemsSketch
+
+
Obtains a new instance of an ItemsSketch.
+
+
getInstance(Class<T>, int, Comparator<? super T>) - Static method in class org.apache.datasketches.quantiles.ItemsUnion
+
+
Create an instance of ItemsUnion
+
+
getInstance(Class<T>, Comparator<? super T>) - Static method in class org.apache.datasketches.quantiles.ItemsSketch
+
+
Obtains a new instance of an ItemsSketch using the DEFAULT_K.
+
+
getInstance(Class<T>, Comparator<? super T>) - Static method in class org.apache.datasketches.quantiles.ItemsUnion
+
+
Create an instance of ItemsUnion with the default k
+
+
getInstance(Class<T>, Memory, Comparator<? super T>, ArrayOfItemsSerDe<T>) - Static method in class org.apache.datasketches.quantiles.ItemsSketch
+
+
Heapifies the given srcMem, which must be a Memory image of a ItemsSketch
+
+
getInstance(Class<T>, Memory, Comparator<? super T>, ArrayOfItemsSerDe<T>) - Static method in class org.apache.datasketches.quantiles.ItemsUnion
+
+
Heapify the given srcMem into a Union object.
+
+
getInstance(String) - Static method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Returns a sketch instance of this class from the given String, + which must be a String representation of this sketch class.
+
+
getInstance(Memory) - Static method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Returns a sketch instance of this class from the given srcMem, + which must be a Memory representation of this sketch class.
+
+
getInstance(Memory, ArrayOfItemsSerDe<T>) - Static method in class org.apache.datasketches.frequencies.ItemsSketch
+
+
Returns a sketch instance of this class from the given srcMem, + which must be a Memory representation of this sketch class.
+
+
getInstance(ItemsSketch<T>) - Static method in class org.apache.datasketches.quantiles.ItemsUnion
+
+
Create an instance of ItemsUnion based on ItemsSketch
+
+
getIntBE(byte[], int) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Get a int from the given byte array starting at the given offset + in big endian order.
+
+
getIntersectAction() - Method in enum org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
getIntLE(byte[], int) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Get a int from the given byte array starting at the given offset + in little endian order.
+
+
getItem() - Method in class org.apache.datasketches.frequencies.ItemsSketch.Row
+
 
+
getItem() - Method in class org.apache.datasketches.frequencies.LongsSketch.Row
+
 
+
getItem() - Method in class org.apache.datasketches.sampling.VarOptItemsSamples.WeightedSample
+
+
Accesses the iterator's current object
+
+
getK() - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
getK() - Method in class org.apache.datasketches.quantiles.DoublesSketchBuilder
+
+
Gets the current configured k
+
+
getK() - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
getK() - Method in interface org.apache.datasketches.quantilescommon.QuantilesAPI
+
+
Gets the user configured parameter k, which controls the accuracy of the sketch + and its memory space usage.
+
+
getK() - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
getK() - Method in class org.apache.datasketches.req.ReqSketchBuilder
+
+
Gets the builder configured k.
+
+
getK() - Method in class org.apache.datasketches.sampling.ReservoirItemsSketch
+
+
Returns the sketch's value of k, the maximum number of samples stored in the + reservoir.
+
+
getK() - Method in class org.apache.datasketches.sampling.ReservoirLongsSketch
+
+
Returns the sketch's value of k, the maximum number of samples stored in the reservoir.
+
+
getK() - Method in class org.apache.datasketches.sampling.VarOptItemsSketch
+
+
Returns the sketch's value of k, the maximum number of samples stored in the + sketch.
+
+
getKey() - Method in interface org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketchIterator
+
+
Gets a key from the current entry in the sketch, which is a hash + of the original key passed to update().
+
+
getKeyMemoryUsageBytes() - Method in class org.apache.datasketches.hllmap.UniqueCountMap
+
+
Returns total bytes used for key storage
+
+
getKFromEpsilon(double, boolean) - Static method in class org.apache.datasketches.kll.KllSketch
+
+
Gets the approximate k to use given epsilon, the normalized rank error.
+
+
getKFromEpsilon(double, boolean) - Static method in class org.apache.datasketches.quantiles.ClassicUtil
+
+
Used by Classic Quantiles.
+
+
getKFromEpsilon(double, boolean) - Static method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Gets the approximate k to use given epsilon, the normalized rank error.
+
+
getKFromEpsilon(double, boolean) - Static method in class org.apache.datasketches.quantiles.ItemsSketch
+
+
Gets the approximate k to use given epsilon, the normalized rank error.
+
+
getLgConfigK() - Method in class org.apache.datasketches.hll.HllSketch
+
 
+
getLgConfigK() - Method in class org.apache.datasketches.hll.Union
+
+
Gets the effective lgConfigK for the union operator, which may be less than + lgMaxK.
+
+
getLgK() - Method in class org.apache.datasketches.cpc.CpcSketch
+
+
Return the parameter LgK.
+
+
getLgK() - Method in class org.apache.datasketches.cpc.CpcUnion
+
+
Returns the current value of Log_base2 of K.
+
+
getLgK() - Method in class org.apache.datasketches.cpc.CpcWrapper
+
+
Returns the configured Log_base2 of K of this sketch.
+
+
getLgNominalEntries() - Method in class org.apache.datasketches.theta.SetOperationBuilder
+
+
Returns Log-base 2 Nominal Entries
+
+
getLgNominalEntries() - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Returns Log-base 2 Nominal Entries
+
+
getLgNomLongs() - Method in class org.apache.datasketches.theta.UpdateSketch
+
+
Gets the Log base 2 of the configured nominal entries
+
+
getLocalLgNominalEntries() - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Returns Log-base 2 Nominal Entries for the concurrent local sketch
+
+
getLongBE(byte[], int) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Get a long from the source byte array starting at the given offset + in big endian order.
+
+
getLongLE(byte[], int) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Get a long from the given byte array starting at the given offset + in little endian order.
+
+
getLowerBound() - Method in class org.apache.datasketches.fdt.Group
+
 
+
getLowerBound() - Method in class org.apache.datasketches.frequencies.ItemsSketch.Row
+
 
+
getLowerBound() - Method in class org.apache.datasketches.frequencies.LongsSketch.Row
+
 
+
getLowerBound() - Method in class org.apache.datasketches.sampling.SampleSubsetSummary
+
 
+
getLowerBound(byte[]) - Method in class org.apache.datasketches.hllmap.UniqueCountMap
+
+
Returns the lower bound cardinality with respect to UniqueCountMap.getEstimate(byte[]) associated + with the given key.
+
+
getLowerBound(int) - Method in class org.apache.datasketches.cpc.CpcSketch
+
+
Returns the best estimate of the lower bound of the confidence interval given kappa, + the number of standard deviations from the mean.
+
+
getLowerBound(int) - Method in class org.apache.datasketches.cpc.CpcWrapper
+
+
Returns the best estimate of the lower bound of the confidence interval given kappa, + the number of standard deviations from the mean.
+
+
getLowerBound(int) - Method in class org.apache.datasketches.hll.HllSketch
+
 
+
getLowerBound(int) - Method in class org.apache.datasketches.hll.Union
+
 
+
getLowerBound(int) - Method in class org.apache.datasketches.theta.Sketch
+
+
Gets the approximate lower error bound given the specified number of Standard Deviations.
+
+
getLowerBound(int) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
+
Gets the approximate lower error bound given the specified number of Standard Deviations.
+
+
getLowerBound(int) - Method in class org.apache.datasketches.tuple.Sketch
+
+
Gets the approximate lower error bound given the specified number of Standard Deviations.
+
+
getLowerBound(int, int) - Method in class org.apache.datasketches.tuple.Sketch
+
+
Gets the estimate of the lower bound of the true distinct population represented by the count + of entries in a subset of the total retained entries of the sketch.
+
+
getLowerBound(int, Memory) - Static method in class org.apache.datasketches.theta.Sketches
+
+
Gets the approximate lower error bound from a valid memory image of a Sketch + given the specified number of Standard Deviations.
+
+
getLowerBound(long) - Method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Gets the guaranteed lower bound frequency of the given item, which can never be + negative.
+
+
getLowerBound(long, double, int, boolean) - Static method in class org.apache.datasketches.thetacommon.BinomialBoundsN
+
+
Returns the approximate lower bound value
+
+
getLowerBound(T) - Method in class org.apache.datasketches.frequencies.ItemsSketch
+
+
Gets the guaranteed lower bound frequency of the given item, which can never be + negative.
+
+
getLowerBoundForBoverA(long, long, double) - Static method in class org.apache.datasketches.common.BoundsOnRatiosInSampledSets
+
+
Return the approximate lower bound based on a 95% confidence interval
+
+
getLowerBoundForBoverA(Sketch, Sketch) - Static method in class org.apache.datasketches.thetacommon.BoundsOnRatiosInThetaSketchedSets
+
+
Gets the approximate lower bound for B over A based on a 95% confidence interval
+
+
getLowerBoundForBoverA(Sketch<S>, Sketch) - Static method in class org.apache.datasketches.thetacommon.BoundsOnRatiosInTupleSketchedSets
+
+
Gets the approximate lower bound for B over A based on a 95% confidence interval
+
+
getLowerBoundForBoverA(Sketch<S>, Sketch<S>) - Static method in class org.apache.datasketches.thetacommon.BoundsOnRatiosInTupleSketchedSets
+
+
Gets the approximate lower bound for B over A based on a 95% confidence interval
+
+
getMaxAnotBResultBytes(int) - Static method in class org.apache.datasketches.theta.SetOperation
+
+
Returns the maximum number of bytes for the returned CompactSketch, given the + value of nomEntries of the first sketch A of AnotB.
+
+
getMaxAnotBResultBytes(int) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
getMaxBytes() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesCompactSketch
+
 
+
getMaxBytes() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
 
+
getMaxBytes(int, int) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUnion
+
 
+
getMaxCompactSketchBytes(int) - Static method in class org.apache.datasketches.theta.Sketch
+
+
Returns the maximum number of storage bytes required for a CompactSketch with the given + number of actual entries.
+
+
getMaxCompactSketchBytes(int) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
getMaxConcurrencyError() - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Gets the Maximum Concurrency Error
+
+
getMaximumError() - Method in class org.apache.datasketches.frequencies.ItemsSketch
+
 
+
getMaximumError() - Method in class org.apache.datasketches.frequencies.LongsSketch
+
 
+
getMaximumMapCapacity() - Method in class org.apache.datasketches.frequencies.ItemsSketch
+
+
Returns the maximum number of counters the sketch is configured to support.
+
+
getMaximumMapCapacity() - Method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Returns the maximum number of counters the sketch is configured to support.
+
+
getMaxIntersectionBytes(int) - Static method in class org.apache.datasketches.theta.SetOperation
+
+
Returns the maximum required storage bytes given a nomEntries parameter for Intersection + operations
+
+
getMaxIntersectionBytes(int) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
getMaxItem() - Method in class org.apache.datasketches.kll.KllDoublesSketchSortedView
+
 
+
getMaxItem() - Method in class org.apache.datasketches.kll.KllFloatsSketchSortedView
+
 
+
getMaxItem() - Method in class org.apache.datasketches.kll.KllItemsSketchSortedView
+
 
+
getMaxItem() - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
getMaxItem() - Method in class org.apache.datasketches.quantiles.DoublesSketchSortedView
+
 
+
getMaxItem() - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
getMaxItem() - Method in class org.apache.datasketches.quantiles.ItemsSketchSortedView
+
 
+
getMaxItem() - Method in interface org.apache.datasketches.quantilescommon.DoublesSortedView
+
+
Returns the maximum item of the stream.
+
+
getMaxItem() - Method in interface org.apache.datasketches.quantilescommon.FloatsSortedView
+
+
Returns the maximum item of the stream.
+
+
getMaxItem() - Method in class org.apache.datasketches.quantilescommon.GenericPartitionBoundaries
+
+
Returns the maximum item of the stream.
+
+
getMaxItem() - Method in interface org.apache.datasketches.quantilescommon.GenericSortedView
+
+
Returns the maximum item of the stream.
+
+
getMaxItem() - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
Returns the maximum item of the stream.
+
+
getMaxItem() - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
Returns the maximum item of the stream.
+
+
getMaxItem() - Method in interface org.apache.datasketches.quantilescommon.QuantilesGenericAPI
+
+
Returns the maximum item of the stream.
+
+
getMaxItem() - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
getMaxItem() - Method in class org.apache.datasketches.req.ReqSketchSortedView
+
 
+
getMaxK() - Method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Returns the configured maxK of this Union.
+
+
getMaxK() - Method in class org.apache.datasketches.quantiles.DoublesUnionBuilder
+
+
Gets the current configured maxK
+
+
getMaxK() - Method in class org.apache.datasketches.quantiles.ItemsUnion
+
+
Returns the configured maxK of this Union.
+
+
getMaxK() - Method in class org.apache.datasketches.sampling.ReservoirItemsUnion
+
+
Returns the maximum allowed reservoir capacity in this union.
+
+
getMaxK() - Method in class org.apache.datasketches.sampling.ReservoirLongsUnion
+
+
Returns the maximum allowed reservoir capacity in this union.
+
+
getMaxLgArrLongs(Memory) - Static method in class org.apache.datasketches.theta.Intersection
+
+
Returns the maximum lgArrLongs given the capacity of the Memory.
+
+
getMaxNumLocalThreads() - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Gets the Maximum Number of Local Threads.
+
+
getMaxPreLongs() - Method in enum org.apache.datasketches.common.Family
+
+
Returns the maximum preamble size for this family in longs
+
+
getMaxSerializationBytes(int) - Static method in class org.apache.datasketches.hll.Union
+
+
Returns the maximum size in bytes that this union operator can grow to given a lgK.
+
+
getMaxSerializedBytes(int) - Static method in class org.apache.datasketches.cpc.CpcSketch
+
+
The actual size of a compressed CPC sketch has a small random variance, but the following + empirically measured size should be large enough for at least 99.9 percent of sketches.
+
+
getMaxSerializedSizeBytes(int, long, KllSketch.SketchType, boolean) - Static method in class org.apache.datasketches.kll.KllSketch
+
+
Returns upper bound on the serialized size of a KllSketch given the following parameters.
+
+
getMaxUnionBytes() - Method in class org.apache.datasketches.theta.Union
+
+
Returns the maximum required storage bytes for this union.
+
+
getMaxUnionBytes(int) - Static method in class org.apache.datasketches.theta.SetOperation
+
+
Returns the maximum required storage bytes given a nomEntries parameter for Union operations
+
+
getMaxUnionBytes(int) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
getMaxUpdatableSerializationBytes(int, TgtHllType) - Static method in class org.apache.datasketches.hll.HllSketch
+
+
Returns the maximum size in bytes that this sketch can grow to given lgConfigK.
+
+
getMaxUpdateSketchBytes(int) - Static method in class org.apache.datasketches.theta.Sketch
+
+
Returns the maximum number of storage bytes required for an UpdateSketch with the given + number of nominal entries (power of 2).
+
+
getMaxUpdateSketchBytes(int) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
getMemoryRequestServer() - Method in class org.apache.datasketches.theta.SetOperationBuilder
+
+
Returns the MemoryRequestServer
+
+
getMemoryRequestServer() - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Returns the MemoryRequestServer
+
+
getMemoryUsageBytes() - Method in class org.apache.datasketches.hllmap.UniqueCountMap
+
+
Returns total bytes used by all internal maps
+
+
getMinItem() - Method in class org.apache.datasketches.kll.KllDoublesSketchSortedView
+
 
+
getMinItem() - Method in class org.apache.datasketches.kll.KllFloatsSketchSortedView
+
 
+
getMinItem() - Method in class org.apache.datasketches.kll.KllItemsSketchSortedView
+
 
+
getMinItem() - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
getMinItem() - Method in class org.apache.datasketches.quantiles.DoublesSketchSortedView
+
 
+
getMinItem() - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
getMinItem() - Method in class org.apache.datasketches.quantiles.ItemsSketchSortedView
+
 
+
getMinItem() - Method in interface org.apache.datasketches.quantilescommon.DoublesSortedView
+
+
Returns the minimum item of the stream.
+
+
getMinItem() - Method in interface org.apache.datasketches.quantilescommon.FloatsSortedView
+
+
Returns the minimum item of the stream.
+
+
getMinItem() - Method in class org.apache.datasketches.quantilescommon.GenericPartitionBoundaries
+
+
Returns the minimum item of the stream.
+
+
getMinItem() - Method in interface org.apache.datasketches.quantilescommon.GenericSortedView
+
+
Returns the minimum item of the stream.
+
+
getMinItem() - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
Returns the minimum item of the stream.
+
+
getMinItem() - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
Returns the minimum item of the stream.
+
+
getMinItem() - Method in interface org.apache.datasketches.quantilescommon.QuantilesGenericAPI
+
+
Returns the minimum item of the stream.
+
+
getMinItem() - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
getMinItem() - Method in class org.apache.datasketches.req.ReqSketchSortedView
+
 
+
getMinPreLongs() - Method in enum org.apache.datasketches.common.Family
+
+
Returns the minimum preamble size for this family in longs
+
+
getN() - Method in class org.apache.datasketches.kll.KllDoublesSketchSortedView
+
 
+
getN() - Method in class org.apache.datasketches.kll.KllFloatsSketchSortedView
+
 
+
getN() - Method in class org.apache.datasketches.kll.KllItemsSketchSortedView
+
 
+
getN() - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
getN() - Method in class org.apache.datasketches.quantiles.DoublesSketchSortedView
+
 
+
getN() - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
getN() - Method in class org.apache.datasketches.quantiles.ItemsSketchSortedView
+
 
+
getN() - Method in class org.apache.datasketches.quantilescommon.GenericPartitionBoundaries
+
 
+
getN() - Method in interface org.apache.datasketches.quantilescommon.PartitionBoundaries
+
+
Gets the length of the input stream offered to the underlying sketch.
+
+
getN() - Method in interface org.apache.datasketches.quantilescommon.QuantilesAPI
+
+
Gets the length of the input stream offered to the sketch..
+
+
getN() - Method in interface org.apache.datasketches.quantilescommon.SortedView
+
+
Returns the total number of items presented to the sourcing sketch.
+
+
getN() - Method in class org.apache.datasketches.quantilescommon.SortedViewIterator
+
+
Gets the total count of all items presented to the sketch.
+
+
getN() - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
getN() - Method in class org.apache.datasketches.req.ReqSketchSortedView
+
 
+
getN() - Method in class org.apache.datasketches.sampling.ReservoirItemsSketch
+
+
Returns the number of items processed from the input stream
+
+
getN() - Method in class org.apache.datasketches.sampling.ReservoirLongsSketch
+
+
Returns the number of items processed from the input stream
+
+
getN() - Method in class org.apache.datasketches.sampling.VarOptItemsSketch
+
+
Returns the number of items processed from the input stream
+
+
getName() - Method in enum org.apache.datasketches.kll.KllSketch.SketchType
+
 
+
getNaturalRank(double, long, QuantileSearchCriteria) - Static method in class org.apache.datasketches.quantilescommon.QuantilesUtil
+
 
+
getNaturalRank(QuantileSearchCriteria) - Method in class org.apache.datasketches.quantilescommon.SortedViewIterator
+
+
Gets the natural rank at the current index (or previous index) based on the chosen search criterion.
+
+
getNaturalRanks() - Method in class org.apache.datasketches.quantilescommon.GenericPartitionBoundaries
+
 
+
getNaturalRanks() - Method in interface org.apache.datasketches.quantilescommon.PartitionBoundaries
+
+
Gets an ordered array of natural ranks of the associated array of partition boundaries utilizing + a specified search criterion.
+
+
getNominalEntries() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch
+
+
Gets the configured nominal number of entries
+
+
getNormalizedRank(QuantileSearchCriteria) - Method in class org.apache.datasketches.quantilescommon.SortedViewIterator
+
+
Gets the normalized rank at the current index (or previous index) + based on the chosen search criterion.
+
+
getNormalizedRankError(boolean) - Method in class org.apache.datasketches.kll.KllSketch
+
+
Gets the approximate rank error of this sketch normalized as a fraction between zero and one.
+
+
getNormalizedRankError(boolean) - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Gets the approximate rank error of this sketch normalized as a fraction between zero and one.
+
+
getNormalizedRankError(boolean) - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
+
Gets the approximate rank error of this sketch normalized as a fraction between zero and one.
+
+
getNormalizedRankError(int, boolean) - Static method in class org.apache.datasketches.kll.KllSketch
+
+
Gets the normalized rank error given k and pmf.
+
+
getNormalizedRankError(int, boolean) - Static method in class org.apache.datasketches.quantiles.ClassicUtil
+
+
Used by Classic Quantiles.
+
+
getNormalizedRankError(int, boolean) - Static method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Gets the normalized rank error given k and pmf.
+
+
getNormalizedRankError(int, boolean) - Static method in class org.apache.datasketches.quantiles.ItemsSketch
+
+
Gets the normalized rank error given k and pmf.
+
+
getNormalizedRanks() - Method in class org.apache.datasketches.quantilescommon.GenericPartitionBoundaries
+
 
+
getNormalizedRanks() - Method in interface org.apache.datasketches.quantilescommon.PartitionBoundaries
+
+
Gets an ordered array of normalized ranks of the associated array of partition boundaries utilizing + a specified search criterion.
+
+
getNumActiveItems() - Method in class org.apache.datasketches.frequencies.ItemsSketch
+
 
+
getNumActiveItems() - Method in class org.apache.datasketches.frequencies.LongsSketch
+
 
+
getNumDeltaItems() - Method in class org.apache.datasketches.quantilescommon.GenericPartitionBoundaries
+
 
+
getNumDeltaItems() - Method in interface org.apache.datasketches.quantilescommon.PartitionBoundaries
+
+
Gets the number of items to be included for each partition as an array.
+
+
getNumPartitions() - Method in class org.apache.datasketches.quantilescommon.GenericPartitionBoundaries
+
 
+
getNumPartitions() - Method in interface org.apache.datasketches.quantilescommon.PartitionBoundaries
+
+
Gets the number of partitions
+
+
getNumPoolThreads() - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Gets the number of background pool threads used for propagation in the concurrent sketches.
+
+
getNumRetained() - Method in class org.apache.datasketches.kll.KllSketch
+
 
+
getNumRetained() - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
getNumRetained() - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
getNumRetained() - Method in interface org.apache.datasketches.quantilescommon.QuantilesAPI
+
+
Gets the number of quantiles retained by the sketch.
+
+
getNumRetained() - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
getNumSamples() - Method in class org.apache.datasketches.sampling.ReservoirItemsSketch
+
+
Returns the current number of items in the reservoir, which may be smaller than the + reservoir capacity.
+
+
getNumSamples() - Method in class org.apache.datasketches.sampling.ReservoirLongsSketch
+
+
Returns the current number of items in the reservoir, which may be smaller than the reservoir + capacity.
+
+
getNumSamples() - Method in class org.apache.datasketches.sampling.VarOptItemsSamples
+
+
Returns the length Copies items and weights from the sketch, if necessary, and returns the + length of + any + resulting array.
+
+
getNumSamples() - Method in class org.apache.datasketches.sampling.VarOptItemsSketch
+
+
Returns the current number of items in the sketch, which may be smaller than the + sketch capacity.
+
+
getNumValues() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
 
+
getObject() - Method in class org.apache.datasketches.tuple.DeserializeResult
+
 
+
getP() - Method in class org.apache.datasketches.theta.SetOperationBuilder
+
+
Returns the pre-sampling probability p
+
+
getP() - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Returns the pre-sampling probability p
+
+
getPartitionBoundaries(int) - Method in interface org.apache.datasketches.quantilescommon.PartitioningFeature
+
+
This method returns an instance of + GenericPartitionBoundaries which provides + sufficient information for the user to create the given number of equally sized partitions, where "equally sized" + refers to an approximately equal number of items per partition.
+
+
getPartitionBoundaries(int, QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllItemsSketch
+
 
+
getPartitionBoundaries(int, QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllItemsSketchSortedView
+
 
+
getPartitionBoundaries(int, QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
getPartitionBoundaries(int, QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.ItemsSketchSortedView
+
 
+
getPartitionBoundaries(int, QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.PartitioningFeature
+
+
This method returns an instance of + GenericPartitionBoundaries which provides + sufficient information for the user to create the given number of equally sized partitions, where "equally sized" + refers to an approximately equal number of items per partition.
+
+
getPMF(double[]) - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
This is equivalent to getPMF(splitPoints, INCLUSIVE)
+
+
getPMF(double[], QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllDoublesSketch
+
 
+
getPMF(double[], QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
getPMF(double[], QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.DoublesSortedView
+
+
Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints.
+
+
getPMF(double[], QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints.
+
+
getPMF(float[]) - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
This is equivalent to getPMF(splitPoints, INCLUSIVE)
+
+
getPMF(float[], QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllFloatsSketch
+
 
+
getPMF(float[], QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.FloatsSortedView
+
+
Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints.
+
+
getPMF(float[], QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints.
+
+
getPMF(float[], QuantileSearchCriteria) - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
getPMF(T[]) - Method in interface org.apache.datasketches.quantilescommon.QuantilesGenericAPI
+
+
This is equivalent to getPMF(splitPoints, INCLUSIVE)
+
+
getPMF(T[], QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllItemsSketch
+
 
+
getPMF(T[], QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllItemsSketchSortedView
+
 
+
getPMF(T[], QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
getPMF(T[], QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.ItemsSketchSortedView
+
 
+
getPMF(T[], QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.GenericSortedView
+
+
Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints.
+
+
getPMF(T[], QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.QuantilesGenericAPI
+
+
Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints.
+
+
getPostProcessor() - Method in class org.apache.datasketches.fdt.FdtSketch
+
+
Returns the PostProcessor that enables multiple queries against the sketch results.
+
+
getPostProcessor(Group, char) - Method in class org.apache.datasketches.fdt.FdtSketch
+
+
Returns the PostProcessor that enables multiple queries against the sketch results.
+
+
getPreInts() - Method in enum org.apache.datasketches.kll.KllSketch.SketchStructure
+
 
+
getPrimaryKey() - Method in class org.apache.datasketches.fdt.Group
+
 
+
getPropagateOrderedCompact() - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Gets the Propagate Ordered Compact flag used with concurrent sketches.
+
+
getQuantile() - Method in class org.apache.datasketches.kll.KllDoublesSketchIterator
+
 
+
getQuantile() - Method in class org.apache.datasketches.kll.KllFloatsSketchIterator
+
 
+
getQuantile() - Method in class org.apache.datasketches.kll.KllItemsSketchIterator
+
 
+
getQuantile() - Method in class org.apache.datasketches.quantiles.DoublesSketchIterator
+
 
+
getQuantile() - Method in class org.apache.datasketches.quantiles.ItemsSketchIterator
+
 
+
getQuantile() - Method in class org.apache.datasketches.quantilescommon.DoublesSortedViewIterator
+
+
Gets the quantile at the current index.
+
+
getQuantile() - Method in class org.apache.datasketches.quantilescommon.FloatsSortedViewIterator
+
+
Gets the quantile at the current index.
+
+
getQuantile() - Method in class org.apache.datasketches.quantilescommon.GenericSortedViewIterator
+
+
Gets the quantile at the current index.
+
+
getQuantile() - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesSketchIterator
+
+
Gets the double quantile at the current index.
+
+
getQuantile() - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsSketchIterator
+
+
Gets the float quantile at the current index.
+
+
getQuantile() - Method in interface org.apache.datasketches.quantilescommon.QuantilesGenericSketchIterator
+
+
Gets the generic quantile at the current index.
+
+
getQuantile() - Method in class org.apache.datasketches.req.ReqSketchIterator
+
 
+
getQuantile(double) - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
This is equivalent to getQuantile(rank, INCLUSIVE)
+
+
getQuantile(double) - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
This is equivalent to getQuantile(rank, INCLUSIVE)
+
+
getQuantile(double) - Method in interface org.apache.datasketches.quantilescommon.QuantilesGenericAPI
+
+
This is equivalent to getQuantile(rank, INCLUSIVE)
+
+
getQuantile(double, QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllDoublesSketch
+
 
+
getQuantile(double, QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllDoublesSketchSortedView
+
 
+
getQuantile(double, QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllFloatsSketch
+
 
+
getQuantile(double, QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllFloatsSketchSortedView
+
 
+
getQuantile(double, QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllItemsSketch
+
 
+
getQuantile(double, QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllItemsSketchSortedView
+
 
+
getQuantile(double, QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
getQuantile(double, QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.DoublesSketchSortedView
+
 
+
getQuantile(double, QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
getQuantile(double, QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.ItemsSketchSortedView
+
 
+
getQuantile(double, QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.DoublesSortedView
+
+
Gets the approximate quantile of the given normalized rank and the given search criterion.
+
+
getQuantile(double, QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.FloatsSortedView
+
+
Gets the approximate quantile of the given normalized rank and the given search criterion.
+
+
getQuantile(double, QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.GenericSortedView
+
+
Gets the approximate quantile of the given normalized rank and the given search criterion.
+
+
getQuantile(double, QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
Gets the approximate quantile of the given normalized rank and the given search criterion.
+
+
getQuantile(double, QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
Gets the approximate quantile of the given normalized rank and the given search criterion.
+
+
getQuantile(double, QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.QuantilesGenericAPI
+
+
Gets the approximate quantile of the given normalized rank and the given search criterion.
+
+
getQuantile(double, QuantileSearchCriteria) - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
getQuantile(double, QuantileSearchCriteria) - Method in class org.apache.datasketches.req.ReqSketchSortedView
+
 
+
getQuantileLowerBound(double) - Method in class org.apache.datasketches.kll.KllDoublesSketch
+
+
Gets the lower bound of the quantile confidence interval in which the quantile of the + given rank exists.
+
+
getQuantileLowerBound(double) - Method in class org.apache.datasketches.kll.KllFloatsSketch
+
+
Gets the lower bound of the quantile confidence interval in which the quantile of the + given rank exists.
+
+
getQuantileLowerBound(double) - Method in class org.apache.datasketches.kll.KllItemsSketch
+
 
+
getQuantileLowerBound(double) - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Gets the lower bound of the quantile confidence interval in which the quantile of the + given rank exists.
+
+
getQuantileLowerBound(double) - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
getQuantileLowerBound(double) - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
Gets the lower bound of the quantile confidence interval in which the quantile of the + given rank exists.
+
+
getQuantileLowerBound(double) - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
Gets the lower bound of the quantile confidence interval in which the quantile of the + given rank exists.
+
+
getQuantileLowerBound(double) - Method in interface org.apache.datasketches.quantilescommon.QuantilesGenericAPI
+
+
Gets the lower bound of the quantile confidence interval in which the quantile of the + given rank exists.
+
+
getQuantileLowerBound(double) - Method in class org.apache.datasketches.req.ReqSketch
+
+
Gets the lower bound of the quantile confidence interval in which the quantile of the + given rank exists.
+
+
getQuantileLowerBound(double, int) - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
getQuantiles() - Method in class org.apache.datasketches.kll.KllDoublesSketchSortedView
+
 
+
getQuantiles() - Method in class org.apache.datasketches.kll.KllFloatsSketchSortedView
+
 
+
getQuantiles() - Method in class org.apache.datasketches.kll.KllItemsSketchSortedView
+
 
+
getQuantiles() - Method in class org.apache.datasketches.quantiles.DoublesSketchSortedView
+
 
+
getQuantiles() - Method in class org.apache.datasketches.quantiles.ItemsSketchSortedView
+
 
+
getQuantiles() - Method in interface org.apache.datasketches.quantilescommon.DoublesSortedView
+
+
Returns an array of all retained quantiles by the sketch.
+
+
getQuantiles() - Method in interface org.apache.datasketches.quantilescommon.FloatsSortedView
+
+
Returns an array of all retained quantiles by the sketch.
+
+
getQuantiles() - Method in interface org.apache.datasketches.quantilescommon.GenericSortedView
+
+
Returns the full array of quantiles.
+
+
getQuantiles() - Method in class org.apache.datasketches.req.ReqSketchSortedView
+
 
+
getQuantiles(double[]) - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
This is equivalent to getQuantiles(ranks, INCLUSIVE)
+
+
getQuantiles(double[]) - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
This is equivalent to getQuantiles(ranks, INCLUSIVE)
+
+
getQuantiles(double[]) - Method in interface org.apache.datasketches.quantilescommon.QuantilesGenericAPI
+
+
This is equivalent to getQuantiles(ranks, INCLUSIVE)
+
+
getQuantiles(double[], QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllDoublesSketch
+
 
+
getQuantiles(double[], QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllFloatsSketch
+
 
+
getQuantiles(double[], QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllItemsSketch
+
 
+
getQuantiles(double[], QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllItemsSketchSortedView
+
 
+
getQuantiles(double[], QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
getQuantiles(double[], QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
getQuantiles(double[], QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.ItemsSketchSortedView
+
 
+
getQuantiles(double[], QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
Gets an array of quantiles from the given array of normalized ranks.
+
+
getQuantiles(double[], QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
Gets an array of quantiles from the given array of normalized ranks.
+
+
getQuantiles(double[], QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.QuantilesGenericAPI
+
+
Gets an array of quantiles from the given array of normalized ranks.
+
+
getQuantiles(double[], QuantileSearchCriteria) - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
getQuantileUpperBound(double) - Method in class org.apache.datasketches.kll.KllDoublesSketch
+
+
Gets the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists.
+
+
getQuantileUpperBound(double) - Method in class org.apache.datasketches.kll.KllFloatsSketch
+
+
Gets the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists.
+
+
getQuantileUpperBound(double) - Method in class org.apache.datasketches.kll.KllItemsSketch
+
 
+
getQuantileUpperBound(double) - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Gets the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists.
+
+
getQuantileUpperBound(double) - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
getQuantileUpperBound(double) - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
Gets the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists.
+
+
getQuantileUpperBound(double) - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
Gets the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists.
+
+
getQuantileUpperBound(double) - Method in interface org.apache.datasketches.quantilescommon.QuantilesGenericAPI
+
+
Gets the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists.
+
+
getQuantileUpperBound(double) - Method in class org.apache.datasketches.req.ReqSketch
+
+
Gets the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists.
+
+
getQuantileUpperBound(double, int) - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
getRange(T, T, BoundsRule) - Method in interface org.apache.datasketches.partitions.SketchFillRequest
+
+
This is a callback request to the data source to fill a quantiles sketch + with a range of data between upper and lower bounds.
+
+
getRank(double) - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
This is equivalent to getRank(quantile, INCLUSIVE)
+
+
getRank(double, QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllDoublesSketch
+
 
+
getRank(double, QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllDoublesSketchSortedView
+
 
+
getRank(double, QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
getRank(double, QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.DoublesSketchSortedView
+
 
+
getRank(double, QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.DoublesSortedView
+
+
Gets the normalized rank corresponding to the given a quantile.
+
+
getRank(double, QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
Gets the normalized rank corresponding to the given a quantile.
+
+
getRank(float) - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
This is equivalent to getRank(quantile, INCLUSIVE)
+
+
getRank(float, QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllFloatsSketch
+
 
+
getRank(float, QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllFloatsSketchSortedView
+
 
+
getRank(float, QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.FloatsSortedView
+
+
Gets the normalized rank corresponding to the given a quantile.
+
+
getRank(float, QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
Gets the normalized rank corresponding to the given a quantile.
+
+
getRank(float, QuantileSearchCriteria) - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
getRank(float, QuantileSearchCriteria) - Method in class org.apache.datasketches.req.ReqSketchSortedView
+
 
+
getRank(T) - Method in interface org.apache.datasketches.quantilescommon.QuantilesGenericAPI
+
+
This is equivalent to getRank(T quantile, INCLUSIVE)
+
+
getRank(T, QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllItemsSketch
+
 
+
getRank(T, QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllItemsSketchSortedView
+
 
+
getRank(T, QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
getRank(T, QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.ItemsSketchSortedView
+
 
+
getRank(T, QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.GenericSortedView
+
+
Gets the normalized rank corresponding to the given a quantile.
+
+
getRank(T, QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.QuantilesGenericAPI
+
+
Gets the normalized rank corresponding to the given a quantile.
+
+
getRankLowerBound(double) - Method in class org.apache.datasketches.kll.KllDoublesSketch
+
+
Gets the lower bound of the rank confidence interval in which the true rank of the + given rank exists.
+
+
getRankLowerBound(double) - Method in class org.apache.datasketches.kll.KllFloatsSketch
+
+
Gets the lower bound of the rank confidence interval in which the true rank of the + given rank exists.
+
+
getRankLowerBound(double) - Method in class org.apache.datasketches.kll.KllItemsSketch
+
+
Gets the lower bound of the rank confidence interval in which the true rank of the + given rank exists.
+
+
getRankLowerBound(double) - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Gets the lower bound of the rank confidence interval in which the true rank of the + given rank exists.
+
+
getRankLowerBound(double) - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
getRankLowerBound(double) - Method in interface org.apache.datasketches.quantilescommon.QuantilesAPI
+
+
Gets the lower bound of the rank confidence interval in which the true rank of the + given rank exists.
+
+
getRankLowerBound(double) - Method in class org.apache.datasketches.req.ReqSketch
+
+
Gets the lower bound of the rank confidence interval in which the true rank of the + given rank exists.
+
+
getRankLowerBound(double, int) - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
getRanks(double[]) - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
This is equivalent to getRanks(quantiles, INCLUSIVE)
+
+
getRanks(double[], QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllDoublesSketch
+
 
+
getRanks(double[], QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
getRanks(double[], QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
Gets an array of normalized ranks corresponding to the given array of quantiles and the given + search criterion.
+
+
getRanks(float[]) - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
This is equivalent to getRanks(quantiles, INCLUSIVE)
+
+
getRanks(float[], QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllFloatsSketch
+
 
+
getRanks(float[], QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
Gets an array of normalized ranks corresponding to the given array of quantiles and the given + search criterion.
+
+
getRanks(float[], QuantileSearchCriteria) - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
getRanks(T[]) - Method in interface org.apache.datasketches.quantilescommon.QuantilesGenericAPI
+
+
This is equivalent to getRanks(quantiles, INCLUSIVE)
+
+
getRanks(T[], QuantileSearchCriteria) - Method in class org.apache.datasketches.kll.KllItemsSketch
+
 
+
getRanks(T[], QuantileSearchCriteria) - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
getRanks(T[], QuantileSearchCriteria) - Method in interface org.apache.datasketches.quantilescommon.QuantilesGenericAPI
+
+
Gets an array of normalized ranks corresponding to the given array of quantiles and the given + search criterion.
+
+
getRankUpperBound(double) - Method in class org.apache.datasketches.kll.KllDoublesSketch
+
+
Gets the upper bound of the rank confidence interval in which the true rank of the + given rank exists.
+
+
getRankUpperBound(double) - Method in class org.apache.datasketches.kll.KllFloatsSketch
+
+
Gets the upper bound of the rank confidence interval in which the true rank of the + given rank exists.
+
+
getRankUpperBound(double) - Method in class org.apache.datasketches.kll.KllItemsSketch
+
+
Gets the upper bound of the rank confidence interval in which the true rank of the + given rank exists.
+
+
getRankUpperBound(double) - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Gets the upper bound of the rank confidence interval in which the true rank of the + given rank exists.
+
+
getRankUpperBound(double) - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
getRankUpperBound(double) - Method in interface org.apache.datasketches.quantilescommon.QuantilesAPI
+
+
Gets the upper bound of the rank confidence interval in which the true rank of the + given rank exists.
+
+
getRankUpperBound(double) - Method in class org.apache.datasketches.req.ReqSketch
+
+
Gets the upper bound of the rank confidence interval in which the true rank of the + given rank exists.
+
+
getRankUpperBound(double, int) - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
getReqDebug() - Method in class org.apache.datasketches.req.ReqSketchBuilder
+
+
Gets the builder configured ReqDebug
+
+
getResizeFactor() - Method in class org.apache.datasketches.theta.SetOperationBuilder
+
+
Returns the Resize Factor
+
+
getResizeFactor() - Method in class org.apache.datasketches.theta.UpdateSketch
+
+
Returns the configured ResizeFactor
+
+
getResizeFactor() - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Returns the Resize Factor
+
+
getResizeFactor() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch
+
+
Gets the configured resize factor
+
+
getResult() - Method in class org.apache.datasketches.cpc.CpcUnion
+
+
Returns the result of union operations as a CPC sketch.
+
+
getResult() - Method in class org.apache.datasketches.hll.Union
+
+
Return the result of this union operator as an HLL_4 sketch.
+
+
getResult() - Method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Gets the result of this Union as an UpdateDoublesSketch, which enables further update + operations on the resulting sketch.
+
+
getResult() - Method in class org.apache.datasketches.quantiles.ItemsUnion
+
+
Gets the result of this Union operation as a copy of the internal state.
+
+
getResult() - Method in class org.apache.datasketches.sampling.ReservoirItemsUnion
+
+
Returns a sketch representing the current state of the union.
+
+
getResult() - Method in class org.apache.datasketches.sampling.ReservoirLongsUnion
+
+
Returns a sketch representing the current state of the union.
+
+
getResult() - Method in class org.apache.datasketches.sampling.VarOptItemsUnion
+
+
Gets the varopt sketch resulting from the union of any input sketches.
+
+
getResult() - Method in class org.apache.datasketches.theta.Intersection
+
+
Gets the result of this operation as an ordered CompactSketch on the Java heap.
+
+
getResult() - Method in class org.apache.datasketches.theta.Union
+
+
Gets the result of this operation as an ordered CompactSketch on the Java heap.
+
+
getResult() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesAnotB
+
+
Gets the result of this operation in the form of a ArrayOfDoublesCompactSketch
+
+
getResult() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesAnotBImpl
+
 
+
getResult() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesIntersection
+
+
Gets the internal set as an on-heap compact sketch.
+
+
getResult() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUnion
+
+
Returns the resulting union in the form of a compact sketch
+
+
getResult() - Method in class org.apache.datasketches.tuple.Intersection
+
+
Gets the internal set as an unordered CompactSketch
+
+
getResult() - Method in class org.apache.datasketches.tuple.Union
+
+
Gets the result of a sequence of stateful union operations as an unordered CompactSketch
+
+
getResult(boolean) - Method in class org.apache.datasketches.theta.AnotB
+
+
Gets the result of the multistep, stateful operation AnotB that have been executed with calls + to AnotB.setA(Sketch) and (AnotB.notB(Sketch) or + AnotB.notB(org.apache.datasketches.theta.Sketch)).
+
+
getResult(boolean) - Method in class org.apache.datasketches.tuple.AnotB
+
+
Gets the result of the multistep, stateful operation AnotB that have been executed with calls + to AnotB.setA(Sketch) and (AnotB.notB(Sketch) or + AnotB.notB(org.apache.datasketches.theta.Sketch)).
+
+
getResult(boolean) - Method in class org.apache.datasketches.tuple.Union
+
+
Gets the result of a sequence of stateful union operations as an unordered CompactSketch.
+
+
getResult(boolean, WritableMemory) - Method in class org.apache.datasketches.theta.Intersection
+
+
Gets the result of this operation as a CompactSketch in the given dstMem.
+
+
getResult(boolean, WritableMemory) - Method in class org.apache.datasketches.theta.Union
+
+
Gets the result of this operation as a CompactSketch of the chosen form.
+
+
getResult(boolean, WritableMemory, boolean) - Method in class org.apache.datasketches.theta.AnotB
+
+
Gets the result of the multistep, stateful operation AnotB that have been executed with calls + to AnotB.setA(Sketch) and (AnotB.notB(Sketch) or + AnotB.notB(org.apache.datasketches.theta.Sketch)).
+
+
getResult(int[], int, int, char) - Method in class org.apache.datasketches.fdt.FdtSketch
+
+
Returns an ordered List of Groups of the most frequent distinct population of subset tuples + represented by the count of entries of each group.
+
+
getResult(TgtHllType) - Method in class org.apache.datasketches.hll.Union
+
+
Return the result of this union operator with the specified TgtHllType
+
+
getResult(WritableMemory) - Method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Places the result of this Union into the provided memory as an UpdateDoublesSketch, + which enables further update operations on the resulting sketch.
+
+
getResult(WritableMemory) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesAnotB
+
+
Gets the result of this operation in the form of a ArrayOfDoublesCompactSketch
+
+
getResult(WritableMemory) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesAnotBImpl
+
 
+
getResult(WritableMemory) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesIntersection
+
+
Gets the result of stateful intersections so far.
+
+
getResult(WritableMemory) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUnion
+
+
Returns the resulting union in the form of a compact sketch
+
+
getResultAndReset() - Method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Gets the result of this Union as an UpdateDoublesSketch, which enables further update + operations on the resulting sketch.
+
+
getResultAndReset() - Method in class org.apache.datasketches.quantiles.ItemsUnion
+
+
Gets the result of this Union operation (without a copy) and resets this Union to the + virgin state.
+
+
getRetainedEntries() - Method in class org.apache.datasketches.theta.Sketch
+
+
Returns the number of valid entries that have been retained by the sketch.
+
+
getRetainedEntries() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
 
+
getRetainedEntries() - Method in class org.apache.datasketches.tuple.CompactSketch
+
 
+
getRetainedEntries() - Method in class org.apache.datasketches.tuple.Sketch
+
 
+
getRetainedEntries(boolean) - Method in class org.apache.datasketches.theta.Sketch
+
+
Returns the number of entries that have been retained by the sketch.
+
+
getRF(int) - Static method in enum org.apache.datasketches.common.ResizeFactor
+
+
Returns the Resize Factor given the Log-base 2 of the Resize Factor
+
+
getRowHeader() - Static method in class org.apache.datasketches.frequencies.ItemsSketch.Row
+
 
+
getRowHeader() - Static method in class org.apache.datasketches.frequencies.LongsSketch.Row
+
 
+
getRse() - Method in class org.apache.datasketches.fdt.Group
+
 
+
getSamples() - Method in class org.apache.datasketches.sampling.ReservoirItemsSketch
+
+
Returns a copy of the items in the reservoir, or null if empty.
+
+
getSamples() - Method in class org.apache.datasketches.sampling.ReservoirLongsSketch
+
+
Returns a copy of the items in the reservoir.
+
+
getSamples(Class<?>) - Method in class org.apache.datasketches.sampling.ReservoirItemsSketch
+
+
Returns a copy of the items in the reservoir as members of Class clazz, or null + if empty.
+
+
getSamplingProbability() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch
+
+
Gets the configured sampling probability
+
+
getSearchCriteria() - Method in class org.apache.datasketches.quantilescommon.GenericPartitionBoundaries
+
 
+
getSearchCriteria() - Method in interface org.apache.datasketches.quantilescommon.PartitionBoundaries
+
+
Gets the search criteria specified for the source sketch
+
+
getSeed() - Method in class org.apache.datasketches.theta.SetOperationBuilder
+
+
Returns the seed
+
+
getSeed() - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Returns the seed
+
+
getSerializationVersion(Memory) - Static method in class org.apache.datasketches.theta.Sketch
+
+
Returns the serialization version from the given Memory
+
+
getSerializationVersion(Memory) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
getSerializedSizeBytes() - Method in class org.apache.datasketches.kll.KllSketch
+
+
Returns the current number of bytes this Sketch would require if serialized in compact form.
+
+
getSerializedSizeBytes() - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
getSerializedSizeBytes() - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
Returns the current number of bytes this Sketch would require if serialized.
+
+
getSerializedSizeBytes() - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
Returns the current number of bytes this Sketch would require if serialized.
+
+
getSerializedSizeBytes() - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
getSerVer() - Method in enum org.apache.datasketches.kll.KllSketch.SketchStructure
+
 
+
getShortBE(byte[], int) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Get a short from the given byte array starting at the given offset + in big endian order.
+
+
getShortLE(byte[], int) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Get a short from the given byte array starting at the given offset + in little endian order.
+
+
getSize() - Method in class org.apache.datasketches.tuple.DeserializeResult
+
 
+
getSketchSamples() - Method in class org.apache.datasketches.sampling.VarOptItemsSketch
+
+
Gets a result iterator object.
+
+
getSketchStructure(int, int) - Static method in enum org.apache.datasketches.kll.KllSketch.SketchStructure
+
 
+
getSketchType() - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
getSketchType(Memory) - Static method in class org.apache.datasketches.tuple.SerializerDeserializer
+
+
Gets the sketch type byte from the given Memory image
+
+
getSortedView() - Method in class org.apache.datasketches.kll.KllDoublesSketch
+
 
+
getSortedView() - Method in class org.apache.datasketches.kll.KllFloatsSketch
+
 
+
getSortedView() - Method in class org.apache.datasketches.kll.KllItemsSketch
+
 
+
getSortedView() - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
getSortedView() - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
getSortedView() - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
Gets the sorted view of this sketch
+
+
getSortedView() - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
Gets the sorted view of this sketch
+
+
getSortedView() - Method in interface org.apache.datasketches.quantilescommon.QuantilesGenericAPI
+
+
Gets the sorted view of this sketch
+
+
getSortedView() - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
getStartingCapacity(int, int) - Static method in class org.apache.datasketches.tuple.Util
+
+
Gets the starting capacity of a new sketch given the Nominal Entries and the log Resize Factor.
+
+
getStorageBytes() - Method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Returns the number of bytes required to store this sketch as an array of bytes.
+
+
getStreamLength() - Method in class org.apache.datasketches.frequencies.ItemsSketch
+
+
Returns the sum of the frequencies in the stream seen so far by the sketch
+
+
getStreamLength() - Method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Returns the sum of the frequencies (weights or counts) in the stream seen so far by the sketch
+
+
getSummary() - Method in class org.apache.datasketches.tuple.TupleSketchIterator
+
+
Gets a Summary object from the current entry in the sketch.
+
+
getSummaryFactory() - Method in class org.apache.datasketches.tuple.Sketch
+
+
Gets the Summary Factory class of type S
+
+
getTgtHllType() - Method in class org.apache.datasketches.hll.HllSketch
+
 
+
getTgtHllType() - Method in class org.apache.datasketches.hll.Union
+
 
+
getTheta() - Method in class org.apache.datasketches.theta.Sketch
+
+
Gets the value of theta as a double with a value between zero and one
+
+
getTheta() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
+
Gets the value of theta as a double between zero and one
+
+
getTheta() - Method in class org.apache.datasketches.tuple.Sketch
+
+
Gets the value of theta as a double between zero and one
+
+
getThetaLong() - Method in class org.apache.datasketches.theta.Sketch
+
+
Gets the value of theta as a long
+
+
getThetaLong() - Method in class org.apache.datasketches.tuple.Sketch
+
+
Returns Theta as a long
+
+
getTotalSketchWeight() - Method in class org.apache.datasketches.sampling.SampleSubsetSummary
+
 
+
getUnionAction() - Method in enum org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
 
+
getUpdatableSerializationBytes() - Method in class org.apache.datasketches.hll.HllSketch
+
 
+
getUpdatableSerializationBytes() - Method in class org.apache.datasketches.hll.Union
+
 
+
getUpdatableStorageBytes(int, long) - Static method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Returns the number of bytes a sketch would require to store in updatable form.
+
+
getUpperBound() - Method in class org.apache.datasketches.fdt.Group
+
 
+
getUpperBound() - Method in class org.apache.datasketches.frequencies.ItemsSketch.Row
+
 
+
getUpperBound() - Method in class org.apache.datasketches.frequencies.LongsSketch.Row
+
 
+
getUpperBound() - Method in class org.apache.datasketches.sampling.SampleSubsetSummary
+
 
+
getUpperBound(byte[]) - Method in class org.apache.datasketches.hllmap.UniqueCountMap
+
+
Returns the upper bound cardinality with respect to UniqueCountMap.getEstimate(byte[]) associated + with the given key.
+
+
getUpperBound(int) - Method in class org.apache.datasketches.cpc.CpcSketch
+
+
Returns the best estimate of the upper bound of the confidence interval given kappa, + the number of standard deviations from the mean.
+
+
getUpperBound(int) - Method in class org.apache.datasketches.cpc.CpcWrapper
+
+
Returns the best estimate of the upper bound of the confidence interval given kappa, + the number of standard deviations from the mean.
+
+
getUpperBound(int) - Method in class org.apache.datasketches.hll.HllSketch
+
 
+
getUpperBound(int) - Method in class org.apache.datasketches.hll.Union
+
 
+
getUpperBound(int) - Method in class org.apache.datasketches.theta.Sketch
+
+
Gets the approximate upper error bound given the specified number of Standard Deviations.
+
+
getUpperBound(int) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
+
Gets the approximate upper error bound given the specified number of Standard Deviations.
+
+
getUpperBound(int) - Method in class org.apache.datasketches.tuple.Sketch
+
+
Gets the approximate upper error bound given the specified number of Standard Deviations.
+
+
getUpperBound(int, int) - Method in class org.apache.datasketches.tuple.Sketch
+
+
Gets the estimate of the upper bound of the true distinct population represented by the count + of entries in a subset of the total retained entries of the sketch.
+
+
getUpperBound(int, Memory) - Static method in class org.apache.datasketches.theta.Sketches
+
+
Gets the approximate upper error bound from a valid memory image of a Sketch + given the specified number of Standard Deviations.
+
+
getUpperBound(long) - Method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Gets the guaranteed upper bound frequency of the given item.
+
+
getUpperBound(long, double, int, boolean) - Static method in class org.apache.datasketches.thetacommon.BinomialBoundsN
+
+
Returns the approximate upper bound value
+
+
getUpperBound(T) - Method in class org.apache.datasketches.frequencies.ItemsSketch
+
+
Gets the guaranteed upper bound frequency of the given item.
+
+
getUpperBoundForBoverA(long, long, double) - Static method in class org.apache.datasketches.common.BoundsOnRatiosInSampledSets
+
+
Return the approximate upper bound based on a 95% confidence interval
+
+
getUpperBoundForBoverA(Sketch, Sketch) - Static method in class org.apache.datasketches.thetacommon.BoundsOnRatiosInThetaSketchedSets
+
+
Gets the approximate upper bound for B over A based on a 95% confidence interval
+
+
getUpperBoundForBoverA(Sketch<S>, Sketch) - Static method in class org.apache.datasketches.thetacommon.BoundsOnRatiosInTupleSketchedSets
+
+
Gets the approximate upper bound for B over A based on a 95% confidence interval
+
+
getUpperBoundForBoverA(Sketch<S>, Sketch<S>) - Static method in class org.apache.datasketches.thetacommon.BoundsOnRatiosInTupleSketchedSets
+
+
Gets the approximate upper bound for B over A based on a 95% confidence interval
+
+
getValue() - Method in enum org.apache.datasketches.common.ResizeFactor
+
+
Returns the Resize Factor
+
+
getValue() - Method in class org.apache.datasketches.tuple.adouble.DoubleSummary
+
 
+
getValue() - Method in class org.apache.datasketches.tuple.aninteger.IntegerSummary
+
 
+
getValue() - Method in class org.apache.datasketches.tuple.strings.ArrayOfStringsSummary
+
 
+
getValues() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
 
+
getValues() - Method in interface org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketchIterator
+
+
Gets an array of values from the current entry in the sketch.
+
+
getWeight() - Method in class org.apache.datasketches.kll.KllSketchIterator
+
 
+
getWeight() - Method in class org.apache.datasketches.quantiles.DoublesSketchIterator
+
 
+
getWeight() - Method in class org.apache.datasketches.quantiles.ItemsSketchIterator
+
 
+
getWeight() - Method in interface org.apache.datasketches.quantilescommon.QuantilesSketchIterator
+
+
Gets the natural weight at the current index.
+
+
getWeight() - Method in class org.apache.datasketches.quantilescommon.SortedViewIterator
+
+
Gets the weight contribution of the item at the current index.
+
+
getWeight() - Method in class org.apache.datasketches.req.ReqSketchIterator
+
 
+
getWeight() - Method in class org.apache.datasketches.sampling.VarOptItemsSamples.WeightedSample
+
+
Accesses the iterator's current weight value
+
+
gpb - Variable in class org.apache.datasketches.partitions.Partitioner.StackElement
+
 
+
Group - Class in org.apache.datasketches.fdt
+
+
Defines a Group from a Frequent Distinct Tuple query.
+
+
Group() - Constructor for class org.apache.datasketches.fdt.Group
+
+
Construct an empty Group
+
+
GT - org.apache.datasketches.quantilescommon.GenericInequalitySearch.Inequality
+
+
Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the lowest adjacent pair of + values {A,B} such that A ≤ V < B.
+ Let low = index of the lowest value in the range.
+ Let high = index of the highest value in the range.
+
+
GT - org.apache.datasketches.quantilescommon.InequalitySearch
+
+
Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the lowest adjacent pair of + values {A,B} such that A ≤ V < B.
+ Let low = index of the lowest value in the range.
+ Let high = index of the highest value in the range.
+
+
+ + + +

H

+
+
hash(byte[], int, int, long) - Static method in class org.apache.datasketches.hash.MurmurHash3
+
+
Hash a portion of the given byte[] array.
+
+
hash(byte[], long) - Static method in class org.apache.datasketches.hash.MurmurHash3
+
+
Hash the given byte[] array.
+
+
hash(char[], int, int, long) - Static method in class org.apache.datasketches.hash.MurmurHash3
+
+
Hash a portion of the given char[] array.
+
+
hash(char[], long) - Static method in class org.apache.datasketches.hash.MurmurHash3
+
+
Hash the given char[] array.
+
+
hash(int[], int, int, long) - Static method in class org.apache.datasketches.hash.MurmurHash3
+
+
Hash a portion of the given int[] array.
+
+
hash(int[], long) - Static method in class org.apache.datasketches.hash.MurmurHash3
+
+
Hash the given int[] array.
+
+
hash(long[], int, int, long) - Static method in class org.apache.datasketches.hash.MurmurHash3
+
+
Hash a portion of the given long[] array.
+
+
hash(long[], long) - Static method in class org.apache.datasketches.hash.MurmurHash3
+
+
Hash the given long[] array.
+
+
hash(long, long) - Static method in class org.apache.datasketches.hash.MurmurHash3
+
+
Hash the given long.
+
+
hash(long, long) - Static method in class org.apache.datasketches.hash.XxHash
+
+
Returns a 64-bit hash.
+
+
hash(ByteBuffer, long) - Static method in class org.apache.datasketches.hash.MurmurHash3
+
+
Hash the remaining bytes of the given ByteBuffer starting at position().
+
+
hash(Memory, long) - Static method in class org.apache.datasketches.hash.MurmurHash3
+
+
Hash the given Memory.
+
+
hash(Memory, long, long, long) - Static method in class org.apache.datasketches.hash.XxHash
+
+
Compute the hash of the given Memory object.
+
+
hashArrayInsert(long[], long[], int, long) - Static method in class org.apache.datasketches.thetacommon.HashOperations
+
+
Inserts the given long array into the given OADH hashTable of the target size, + ignores duplicates and counts the values inserted.
+
+
hashCode() - Method in class org.apache.datasketches.fdt.Group
+
 
+
hashCode() - Method in class org.apache.datasketches.frequencies.ItemsSketch.Row
+
+
This hashCode is computed only from the Row.getEstimate() value.
+
+
hashCode() - Method in class org.apache.datasketches.frequencies.LongsSketch.Row
+
+
This hashCode is computed only from the Row.getEstimate() value.
+
+
hashCode() - Method in class org.apache.datasketches.tuple.strings.ArrayOfStringsSummary
+
 
+
hashInsertOnly(long[], int, long) - Static method in class org.apache.datasketches.thetacommon.HashOperations
+
+
This is a classical Knuth-style Open Addressing, Double Hash (OADH) insert scheme for on-heap.
+
+
hashInsertOnlyMemory(WritableMemory, int, long, int) - Static method in class org.apache.datasketches.thetacommon.HashOperations
+
+
This is a classical Knuth-style Open Addressing, Double Hash (OADH) insert scheme for Memory.
+
+
HashIterator - Interface in org.apache.datasketches.theta
+
+
This is used to iterate over the retained hash values of the Theta sketch.
+
+
HashOperations - Class in org.apache.datasketches.thetacommon
+
+
Helper class for the common hash table methods.
+
+
hashSearch(long[], int, long) - Static method in class org.apache.datasketches.thetacommon.HashOperations
+
+
This is a classical Knuth-style Open Addressing, Double Hash (OADH) search scheme for on-heap.
+
+
hashSearchMemory(Memory, int, long, int) - Static method in class org.apache.datasketches.thetacommon.HashOperations
+
+
This is a classical Knuth-style Open Addressing, Double Hash (OADH) search scheme for Memory.
+
+
hashSearchOrInsert(long[], int, long) - Static method in class org.apache.datasketches.thetacommon.HashOperations
+
+
This is a classical Knuth-style Open Addressing, Double Hash (OADH) insert scheme for on-heap.
+
+
hashSearchOrInsertMemory(WritableMemory, int, long, int) - Static method in class org.apache.datasketches.thetacommon.HashOperations
+
+
This is a classical Knuth-style Open Addressing, Double Hash insert scheme, but inserts + values directly into a Memory.
+
+
hashToBytes(byte[], long) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Hash a byte[] and long seed.
+
+
hashToBytes(char[], long) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Hash a char[] and long seed.
+
+
hashToBytes(double, long) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Hash a double and long seed.
+
+
hashToBytes(int[], long) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Hash an int[] and long seed.
+
+
hashToBytes(long[], long) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Hash a long[] and long seed.
+
+
hashToBytes(long, long) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Hash a long and long seed.
+
+
hashToBytes(String, long) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Hash a String and long seed.
+
+
hashToLongs(byte[], long) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Hash a byte[] and long seed.
+
+
hashToLongs(char[], long) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Hash a char[] and long seed.
+
+
hashToLongs(double, long) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Hash a double and long seed.
+
+
hashToLongs(int[], long) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Hash a int[] and long seed.
+
+
hashToLongs(long[], long) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Hash a long[] and long seed.
+
+
hashToLongs(long, long) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Hash a long and long seed.
+
+
hashToLongs(String, long) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Hash a String and long seed.
+
+
hasMemory() - Method in class org.apache.datasketches.kll.KllSketch
+
 
+
hasMemory() - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
hasMemory() - Method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Returns true if this union's data structure is backed by Memory or WritableMemory.
+
+
hasMemory() - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
hasMemory() - Method in interface org.apache.datasketches.quantilescommon.QuantilesAPI
+
+
Returns true if this sketch's data structure is backed by Memory or WritableMemory.
+
+
hasMemory() - Method in class org.apache.datasketches.theta.Sketch
+
+
Returns true if this sketch's data structure is backed by Memory or WritableMemory.
+
+
hasMemory() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
+
Returns true if this sketch's data structure is backed by Memory or WritableMemory.
+
+
hasNext() - Method in class org.apache.datasketches.sampling.VarOptItemsSamples.VarOptItemsIterator
+
 
+
hasResult() - Method in class org.apache.datasketches.theta.Intersection
+
+
Returns true if there is a valid intersection result available
+
+
hasResult() - Method in class org.apache.datasketches.tuple.Intersection
+
+
Returns true if there is a valid intersection result available
+
+
heapify(byte[]) - Static method in class org.apache.datasketches.cpc.CpcSketch
+
+
Return the given byte array as a CpcSketch on the Java heap using the DEFAULT_UPDATE_SEED.
+
+
heapify(byte[]) - Static method in class org.apache.datasketches.hll.HllSketch
+
+
Heapify the given byte array, which must be a valid HllSketch image and may have data.
+
+
heapify(byte[]) - Static method in class org.apache.datasketches.hll.Union
+
+
Construct a union operator populated with the given byte array image of an HllSketch.
+
+
heapify(byte[], long) - Static method in class org.apache.datasketches.cpc.CpcSketch
+
+
Return the given byte array as a CpcSketch on the Java heap.
+
+
heapify(Memory) - Static method in class org.apache.datasketches.cpc.CpcSketch
+
+
Return the given Memory as a CpcSketch on the Java heap using the DEFAULT_UPDATE_SEED.
+
+
heapify(Memory) - Static method in class org.apache.datasketches.hll.HllSketch
+
+
Heapify the given Memory, which must be a valid HllSketch image and may have data.
+
+
heapify(Memory) - Static method in class org.apache.datasketches.hll.Union
+
+
Construct a union operator populated with the given Memory image of an HllSketch.
+
+
heapify(Memory) - Static method in class org.apache.datasketches.kll.KllDoublesSketch
+
+
Factory heapify takes a compact sketch image in Memory and instantiates an on-heap sketch.
+
+
heapify(Memory) - Static method in class org.apache.datasketches.kll.KllFloatsSketch
+
+
Factory heapify takes a compact sketch image in Memory and instantiates an on-heap sketch.
+
+
heapify(Memory) - Static method in class org.apache.datasketches.quantiles.CompactDoublesSketch
+
 
+
heapify(Memory) - Static method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Heapify takes the sketch image in Memory and instantiates an on-heap Sketch.
+
+
heapify(Memory) - Static method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Returns a Heap Union object that has been initialized with the data from the given memory + image of a sketch.
+
+
heapify(Memory) - Static method in class org.apache.datasketches.quantiles.UpdateDoublesSketch
+
 
+
heapify(Memory) - Static method in class org.apache.datasketches.req.ReqSketch
+
+
Returns an ReqSketch on the heap from a Memory image of the sketch.
+
+
heapify(Memory) - Static method in class org.apache.datasketches.sampling.ReservoirLongsSketch
+
+
Returns a sketch instance of this class from the given srcMem, which must be a Memory + representation of this sketch class.
+
+
heapify(Memory) - Static method in class org.apache.datasketches.sampling.ReservoirLongsUnion
+
+
Instantiates a Union from Memory
+
+
heapify(Memory) - Static method in class org.apache.datasketches.theta.CompactSketch
+
+
Heapify takes a CompactSketch image in Memory and instantiates an on-heap CompactSketch.
+
+
heapify(Memory) - Static method in class org.apache.datasketches.theta.SetOperation
+
+
Heapify takes the SetOperations image in Memory and instantiates an on-heap + SetOperation using the + Default Update Seed.
+
+
heapify(Memory) - Static method in class org.apache.datasketches.theta.Sketch
+
+
Heapify takes the sketch image in Memory and instantiates an on-heap Sketch.
+
+
heapify(Memory) - Static method in class org.apache.datasketches.theta.UpdateSketch
+
+
Instantiates an on-heap UpdateSketch from Memory.
+
+
heapify(Memory) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
+
Heapify the given Memory as an ArrayOfDoublesSketch
+
+
heapify(Memory) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUnion
+
+
Heapify the given Memory as an ArrayOfDoublesUnion
+
+
heapify(Memory) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch
+
+
Heapify the given Memory as an ArrayOfDoublesUpdatableSketch
+
+
heapify(Memory, long) - Static method in class org.apache.datasketches.cpc.CpcSketch
+
+
Return the given Memory as a CpcSketch on the Java heap.
+
+
heapify(Memory, long) - Static method in class org.apache.datasketches.theta.CompactSketch
+
+
Heapify takes a CompactSketch image in Memory and instantiates an on-heap CompactSketch.
+
+
heapify(Memory, long) - Static method in class org.apache.datasketches.theta.SetOperation
+
+
Heapify takes the SetOperation image in Memory and instantiates an on-heap + SetOperation using the given expectedSeed.
+
+
heapify(Memory, long) - Static method in class org.apache.datasketches.theta.Sketch
+
+
Heapify takes the sketch image in Memory and instantiates an on-heap Sketch.
+
+
heapify(Memory, long) - Static method in class org.apache.datasketches.theta.UpdateSketch
+
+
Instantiates an on-heap UpdateSketch from Memory.
+
+
heapify(Memory, long) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
+
Heapify the given Memory and seed as a ArrayOfDoublesSketch
+
+
heapify(Memory, long) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUnion
+
+
Heapify the given Memory and seed as an ArrayOfDoublesUnion
+
+
heapify(Memory, long) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch
+
+
Heapify the given Memory and seed as a ArrayOfDoublesUpdatableSketch
+
+
heapify(Memory, Comparator<? super T>, ArrayOfItemsSerDe<T>) - Static method in class org.apache.datasketches.kll.KllItemsSketch
+
+
Factory heapify takes a compact sketch image in Memory and instantiates an on-heap sketch.
+
+
heapify(Memory, ArrayOfItemsSerDe<T>) - Static method in class org.apache.datasketches.sampling.ReservoirItemsSketch
+
+
Returns a sketch instance of this class from the given srcMem, + which must be a Memory representation of this sketch class.
+
+
heapify(Memory, ArrayOfItemsSerDe<T>) - Static method in class org.apache.datasketches.sampling.ReservoirItemsUnion
+
+
Instantiates a Union from Memory
+
+
heapify(Memory, ArrayOfItemsSerDe<T>) - Static method in class org.apache.datasketches.sampling.VarOptItemsSketch
+
+
Returns a sketch instance of this class from the given srcMem, + which must be a Memory representation of this sketch class.
+
+
heapify(Memory, ArrayOfItemsSerDe<T>) - Static method in class org.apache.datasketches.sampling.VarOptItemsUnion
+
+
Instantiates a Union from Memory
+
+
heapify(DoublesSketch) - Static method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Returns a Heap Union object that has been initialized with the data from the given sketch.
+
+
heapifyCompactSketch(Memory) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
heapifyCompactSketch(Memory, long) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
heapifySetOperation(Memory) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
heapifySetOperation(Memory, long) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
heapifySketch(Memory) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
heapifySketch(Memory) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches
+
+
Heapify the given Memory as an ArrayOfDoublesSketch
+
+
heapifySketch(Memory, long) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
heapifySketch(Memory, long) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches
+
+
Heapify the given Memory and seed as a ArrayOfDoublesSketch
+
+
heapifySketch(Memory, SummaryDeserializer<S>) - Static method in class org.apache.datasketches.tuple.Sketches
+
+
Instantiate a Sketch from a given Memory.
+
+
heapifySummary(Memory) - Method in class org.apache.datasketches.tuple.adouble.DoubleSummaryDeserializer
+
 
+
heapifySummary(Memory) - Method in class org.apache.datasketches.tuple.aninteger.IntegerSummaryDeserializer
+
 
+
heapifySummary(Memory) - Method in class org.apache.datasketches.tuple.strings.ArrayOfStringsSummaryDeserializer
+
 
+
heapifySummary(Memory) - Method in interface org.apache.datasketches.tuple.SummaryDeserializer
+
+
This is to create an instance of a Summary given a serialized representation.
+
+
heapifyUnion(Memory) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches
+
+
Heapify the given Memory as an ArrayOfDoublesUnion
+
+
heapifyUnion(Memory, long) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches
+
+
Heapify the given Memory and seed as an ArrayOfDoublesUnion
+
+
heapifyUpdatableSketch(Memory) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches
+
+
Heapify the given Memory as an ArrayOfDoublesUpdatableSketch
+
+
heapifyUpdatableSketch(Memory, long) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches
+
+
Heapify the given Memory and seed as a ArrayOfDoublesUpdatableSketch
+
+
heapifyUpdatableSketch(Memory, SummaryDeserializer<S>, SummaryFactory<S>) - Static method in class org.apache.datasketches.tuple.Sketches
+
+
Instantiate UpdatableSketch from a given Memory
+
+
heapifyUpdateSketch(Memory) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
heapifyUpdateSketch(Memory, long) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
HLL - org.apache.datasketches.common.Family
+
+
The HLL family of sketches.
+
+
HLL_4 - org.apache.datasketches.hll.TgtHllType
+
 
+
HLL_6 - org.apache.datasketches.hll.TgtHllType
+
 
+
HLL_8 - org.apache.datasketches.hll.TgtHllType
+
 
+
HllSketch - Class in org.apache.datasketches.hll
+
+
The HllSketch is actually a collection of compact implementations of Phillipe Flajolet’s HyperLogLog (HLL) + sketch but with significantly improved error behavior and excellent speed performance.
+
+
HllSketch() - Constructor for class org.apache.datasketches.hll.HllSketch
+
+
Constructs a new on-heap sketch with the default lgConfigK and tgtHllType.
+
+
HllSketch(int) - Constructor for class org.apache.datasketches.hll.HllSketch
+
+
Constructs a new on-heap sketch with the default tgtHllType.
+
+
HllSketch(int, TgtHllType) - Constructor for class org.apache.datasketches.hll.HllSketch
+
+
Constructs a new on-heap sketch with the type of HLL sketch to configure.
+
+
HllSketch(int, TgtHllType, WritableMemory) - Constructor for class org.apache.datasketches.hll.HllSketch
+
+
Constructs a new sketch with the type of HLL sketch to configure and the given + WritableMemory as the destination for the sketch.
+
+
+ + + +

I

+
+
idToFamily(int) - Static method in enum org.apache.datasketches.common.Family
+
+
Returns the Family given the ID
+
+
INCLUDE_BOTH - org.apache.datasketches.partitions.BoundsRule
+
+
Include both the upper and lower bounds
+
+
INCLUDE_LOWER - org.apache.datasketches.partitions.BoundsRule
+
+
Include only the lower bound but not the upper bound
+
+
INCLUDE_UPPER - org.apache.datasketches.partitions.BoundsRule
+
+
Include only the upper bound but not the lower bound
+
+
INCLUSIVE - org.apache.datasketches.quantilescommon.QuantileSearchCriteria
+
+
Definition of INCLUSIVE getQuantile(r) search:
+ Given rank r, return the quantile of the smallest rank that is + strictly greater than or equal to r.
+
+
index - Variable in class org.apache.datasketches.kll.KllSketchIterator
+
 
+
index - Variable in class org.apache.datasketches.quantilescommon.SortedViewIterator
+
 
+
InequalitySearch - Enum in org.apache.datasketches.quantilescommon
+
+
This provides efficient, unique and unambiguous binary searching for inequality comparison criteria + for ordered arrays of values that may include duplicate values.
+
+
init(String, int, double, double, double, double, double) - Method in class org.apache.datasketches.fdt.Group
+
+
Specifies the parameters to be listed as columns
+
+
InsertedCountIncremented - org.apache.datasketches.theta.UpdateReturnState
+
+
The hash was accepted into the sketch and the retained count was incremented.
+
+
InsertedCountIncrementedRebuilt - org.apache.datasketches.theta.UpdateReturnState
+
+
The hash was accepted into the sketch, the retained count was incremented.
+
+
InsertedCountIncrementedResized - org.apache.datasketches.theta.UpdateReturnState
+
+
The hash was accepted into the sketch, the retained count was incremented.
+
+
InsertedCountNotIncremented - org.apache.datasketches.theta.UpdateReturnState
+
+
The hash was accepted into the sketch and the retained count was not incremented.
+
+
IntegerSketch - Class in org.apache.datasketches.tuple.aninteger
+
 
+
IntegerSketch(int, int, float, IntegerSummary.Mode) - Constructor for class org.apache.datasketches.tuple.aninteger.IntegerSketch
+
+
Creates this sketch with the following parameters:
+
+
IntegerSketch(int, IntegerSummary.Mode) - Constructor for class org.apache.datasketches.tuple.aninteger.IntegerSketch
+
+
Constructs this sketch with given lgK.
+
+
IntegerSketch(Memory, IntegerSummary.Mode) - Constructor for class org.apache.datasketches.tuple.aninteger.IntegerSketch
+
+
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.
+
+
+
IntegerSummary - Class in org.apache.datasketches.tuple.aninteger
+
+
Summary for generic tuple sketches of type Integer.
+
+
IntegerSummary(IntegerSummary.Mode) - Constructor for class org.apache.datasketches.tuple.aninteger.IntegerSummary
+
+
Creates an instance of IntegerSummary with a given mode.
+
+
IntegerSummary.Mode - Enum in org.apache.datasketches.tuple.aninteger
+
+
The aggregation modes for this Summary
+
+
IntegerSummaryDeserializer - Class in org.apache.datasketches.tuple.aninteger
+
 
+
IntegerSummaryDeserializer() - Constructor for class org.apache.datasketches.tuple.aninteger.IntegerSummaryDeserializer
+
 
+
IntegerSummaryFactory - Class in org.apache.datasketches.tuple.aninteger
+
+
Factory for IntegerSummary.
+
+
IntegerSummaryFactory(IntegerSummary.Mode) - Constructor for class org.apache.datasketches.tuple.aninteger.IntegerSummaryFactory
+
+
Creates an instance of IntegerSummaryFactory with a given mode
+
+
IntegerSummarySetOperations - Class in org.apache.datasketches.tuple.aninteger
+
+
Methods for defining how unions and intersections of two objects of type IntegerSummary + are performed.
+
+
IntegerSummarySetOperations(IntegerSummary.Mode, IntegerSummary.Mode) - Constructor for class org.apache.datasketches.tuple.aninteger.IntegerSummarySetOperations
+
+
Creates a new instance with two modes
+
+
intersect(Sketch) - Method in class org.apache.datasketches.theta.Intersection
+
+
Intersect the given sketch with the internal state.
+
+
intersect(Sketch, Sketch) - Method in class org.apache.datasketches.theta.Intersection
+
+
Perform intersect set operation on the two given sketch arguments and return the result as an + ordered CompactSketch on the heap.
+
+
intersect(Sketch, Sketch, boolean, WritableMemory) - Method in class org.apache.datasketches.theta.Intersection
+
+
Perform intersect set operation on the two given sketches and return the result as a + CompactSketch.
+
+
intersect(Sketch, S) - Method in class org.apache.datasketches.tuple.Intersection
+
+
Performs a stateful intersection of the internal set with the given thetaSketch by combining entries + using the hashes from the theta sketch and summary values from the given summary and rules + from the summarySetOps defined by the Intersection constructor.
+
+
intersect(ArrayOfDoublesSketch, ArrayOfDoublesCombiner) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesIntersection
+
+
Performs a stateful intersection of the internal set with the given tupleSketch.
+
+
intersect(Sketch<S>) - Method in class org.apache.datasketches.tuple.Intersection
+
+
Performs a stateful intersection of the internal set with the given tupleSketch.
+
+
intersect(Sketch<S>, Sketch, S) - Method in class org.apache.datasketches.tuple.Intersection
+
+
Perform a stateless intersect set operation on a tuple sketch and a theta sketch and returns the + result as an unordered CompactSketch on the heap.
+
+
intersect(Sketch<S>, Sketch<S>) - Method in class org.apache.datasketches.tuple.Intersection
+
+
Perform a stateless intersect set operation on the two given tuple sketches and returns the + result as an unordered CompactSketch on the heap.
+
+
intersection(DoubleSummary, DoubleSummary) - Method in class org.apache.datasketches.tuple.adouble.DoubleSummarySetOperations
+
 
+
intersection(IntegerSummary, IntegerSummary) - Method in class org.apache.datasketches.tuple.aninteger.IntegerSummarySetOperations
+
 
+
intersection(ArrayOfStringsSummary, ArrayOfStringsSummary) - Method in class org.apache.datasketches.tuple.strings.ArrayOfStringsSummarySetOperations
+
 
+
intersection(S, S) - Method in interface org.apache.datasketches.tuple.SummarySetOperations
+
+
This is called by the intersection operator when both sketches have the same hash value.
+
+
Intersection - Class in org.apache.datasketches.theta
+
+
The API for intersection operations
+
+
Intersection<S extends Summary> - Class in org.apache.datasketches.tuple
+
+
Computes an intersection of two or more generic tuple sketches or generic tuple sketches + combined with theta sketches.
+
+
Intersection() - Constructor for class org.apache.datasketches.theta.Intersection
+
 
+
Intersection(SummarySetOperations<S>) - Constructor for class org.apache.datasketches.tuple.Intersection
+
+
Creates new Intersection instance with instructions on how to process two summaries that + intersect.
+
+
INTERSECTION - org.apache.datasketches.common.Family
+
+
The Intersection family is an operation for the Theta Sketch Framework of sketches.
+
+
intToBytes(int, byte[]) - Static method in class org.apache.datasketches.common.Util
+
+
Returns a Little-Endian byte array extracted from the given int.
+
+
intToFixedLengthString(int, int) - Static method in class org.apache.datasketches.common.Util
+
+
Converts the given number to a string prepended with spaces, if necessary, to + match the given length.
+
+
INVERSE_GOLDEN - Static variable in class org.apache.datasketches.common.Util
+
+
The inverse golden ratio as a fraction.
+
+
INVERSE_GOLDEN_U64 - Static variable in class org.apache.datasketches.common.Util
+
+
The inverse golden ratio as an unsigned long.
+
+
invPow2(int) - Static method in class org.apache.datasketches.common.Util
+
+
Computes the inverse integer power of 2: 1/(2^e) = 2^(-e).
+
+
isCompact() - Method in class org.apache.datasketches.hll.HllSketch
+
 
+
isCompact() - Method in class org.apache.datasketches.hll.Union
+
 
+
isCompact() - Method in class org.apache.datasketches.theta.CompactSketch
+
 
+
isCompact() - Method in class org.apache.datasketches.theta.Sketch
+
+
Returns true if this sketch is in compact form.
+
+
isCompact() - Method in class org.apache.datasketches.theta.UpdateSketch
+
 
+
isCompactMemoryFormat() - Method in class org.apache.datasketches.kll.KllSketch
+
 
+
isDirect() - Method in class org.apache.datasketches.kll.KllSketch
+
 
+
isDirect() - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
isDirect() - Method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Returns true if this union is off-heap (direct)
+
+
isDirect() - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
isDirect() - Method in class org.apache.datasketches.quantiles.ItemsUnion
+
+
Returns true if this union is direct
+
+
isDirect() - Method in interface org.apache.datasketches.quantilescommon.QuantilesAPI
+
+
Returns true if this sketch's data structure is off-heap (a.k.a., Direct or Native memory).
+
+
isDirect() - Method in class org.apache.datasketches.theta.Sketch
+
+
Returns true if the this sketch's internal data structure is backed by direct (off-heap) + Memory.
+
+
isEmpty() - Method in class org.apache.datasketches.cpc.CpcSketch
+
+
Return true if this sketch is empty
+
+
isEmpty() - Method in class org.apache.datasketches.frequencies.ItemsSketch
+
+
Returns true if this sketch is empty
+
+
isEmpty() - Method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Returns true if this sketch is empty
+
+
isEmpty() - Method in class org.apache.datasketches.hll.HllSketch
+
 
+
isEmpty() - Method in class org.apache.datasketches.hll.Union
+
 
+
isEmpty() - Method in class org.apache.datasketches.kll.KllDoublesSketchSortedView
+
 
+
isEmpty() - Method in class org.apache.datasketches.kll.KllFloatsSketchSortedView
+
 
+
isEmpty() - Method in class org.apache.datasketches.kll.KllItemsSketchSortedView
+
 
+
isEmpty() - Method in class org.apache.datasketches.kll.KllSketch
+
 
+
isEmpty() - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
isEmpty() - Method in class org.apache.datasketches.quantiles.DoublesSketchSortedView
+
 
+
isEmpty() - Method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Returns true if this union is empty
+
+
isEmpty() - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
isEmpty() - Method in class org.apache.datasketches.quantiles.ItemsSketchSortedView
+
 
+
isEmpty() - Method in class org.apache.datasketches.quantiles.ItemsUnion
+
+
Returns true if this union is empty
+
+
isEmpty() - Method in interface org.apache.datasketches.quantilescommon.QuantilesAPI
+
+
Returns true if this sketch is empty.
+
+
isEmpty() - Method in interface org.apache.datasketches.quantilescommon.SortedView
+
+
Returns true if this sorted view is empty.
+
+
isEmpty() - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
isEmpty() - Method in class org.apache.datasketches.req.ReqSketchSortedView
+
 
+
isEmpty() - Method in class org.apache.datasketches.theta.Sketch
+
+ +
+
isEmpty() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
+ +
+
isEmpty() - Method in class org.apache.datasketches.tuple.Sketch
+
+ +
+
isEstimationMode() - Method in class org.apache.datasketches.kll.KllSketch
+
 
+
isEstimationMode() - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
isEstimationMode() - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
isEstimationMode() - Method in interface org.apache.datasketches.quantilescommon.QuantilesAPI
+
+
Returns true if this sketch is in estimation mode.
+
+
isEstimationMode() - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
isEstimationMode() - Method in class org.apache.datasketches.theta.Sketch
+
+
Returns true if the sketch is Estimation Mode (as opposed to Exact Mode).
+
+
isEstimationMode() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
+
Returns true if the sketch is Estimation Mode (as opposed to Exact Mode).
+
+
isEstimationMode() - Method in class org.apache.datasketches.tuple.Sketch
+
+
Returns true if the sketch is Estimation Mode (as opposed to Exact Mode).
+
+
isEven(long) - Static method in class org.apache.datasketches.common.Util
+
+
Returns true if given n is even.
+
+
isInitialized_ - Variable in class org.apache.datasketches.kll.KllSketchIterator
+
 
+
isIntPowerOf2(int) - Static method in class org.apache.datasketches.common.Util
+
+
Returns true if given int argument is exactly a positive power of 2 and greater than zero.
+
+
isLessThanUnsigned(long, long) - Static method in class org.apache.datasketches.common.Util
+
+
Unsigned compare with longs.
+
+
isLongPowerOf2(long) - Static method in class org.apache.datasketches.common.Util
+
+
Returns true if given long argument is exactly a positive power of 2 and greater than zero.
+
+
isMemory() - Method in class org.apache.datasketches.hll.HllSketch
+
 
+
isMemory() - Method in class org.apache.datasketches.hll.Union
+
 
+
isMemoryUpdatableFormat() - Method in class org.apache.datasketches.kll.KllSketch
+
+
Returns true if the backing WritableMemory is in updatable format.
+
+
isMultipleOf8AndGT0(long) - Static method in class org.apache.datasketches.common.Util
+
+
Returns true if v is a multiple of 8 and greater than zero
+
+
isOdd(long) - Static method in class org.apache.datasketches.common.Util
+
+
Returns true if given n is odd.
+
+
isOffHeap() - Method in class org.apache.datasketches.hll.HllSketch
+
 
+
isOffHeap() - Method in class org.apache.datasketches.hll.Union
+
 
+
isOrdered() - Method in class org.apache.datasketches.theta.Sketch
+
+
Returns true if internal cache is ordered
+
+
isOrdered() - Method in class org.apache.datasketches.theta.UpdateSketch
+
 
+
isReadOnly() - Method in class org.apache.datasketches.kll.KllSketch
+
 
+
isReadOnly() - Method in class org.apache.datasketches.quantiles.CompactDoublesSketch
+
 
+
isReadOnly() - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
isReadOnly() - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
isReadOnly() - Method in interface org.apache.datasketches.quantilescommon.QuantilesAPI
+
+
Returns true if this sketch is read only.
+
+
isSameResource(Memory) - Method in class org.apache.datasketches.hll.HllSketch
+
 
+
isSameResource(Memory) - Method in class org.apache.datasketches.hll.Union
+
 
+
isSameResource(Memory) - Method in class org.apache.datasketches.kll.KllSketch
+
+
Returns true if the backing resource of this is identical with the backing resource + of that.
+
+
isSameResource(Memory) - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Returns true if the backing resource of this is identical with the backing resource + of that.
+
+
isSameResource(Memory) - Method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Returns true if the backing resource of this is identical with the backing resource + of that.
+
+
isSameResource(Memory) - Method in class org.apache.datasketches.theta.SetOperation
+
+
Returns true if the backing resource of this is identical with the backing resource + of that.
+
+
isSameResource(Memory) - Method in class org.apache.datasketches.theta.Sketch
+
+
Returns true if the backing resource of this is identical with the backing resource + of that.
+
+
items() - Method in class org.apache.datasketches.sampling.VarOptItemsSamples
+
+
Returns a shallow copy of the array of sample items contained in the sketch.
+
+
items(int) - Method in class org.apache.datasketches.sampling.VarOptItemsSamples
+
+
Returns a single item from the samples contained in the sketch.
+
+
ITEMS_SKETCH - org.apache.datasketches.kll.KllSketch.SketchType
+
 
+
ItemsSketch<T> - Class in org.apache.datasketches.frequencies
+
+
This sketch is useful for tracking approximate frequencies of items of type <T> + with optional associated counts (<T> item, long count) that are members of a + multiset of such items.
+
+
ItemsSketch<T> - Class in org.apache.datasketches.quantiles
+
+
This is an implementation of the Low Discrepancy Mergeable Quantiles Sketch, using generic items, + described in section 3.2 of the journal version of the paper "Mergeable Summaries" + by Agarwal, Cormode, Huang, Phillips, Wei, and Yi:
+
+
ItemsSketch(int) - Constructor for class org.apache.datasketches.frequencies.ItemsSketch
+
+
Construct this sketch with the parameter maxMapSize and the default initialMapSize (8).
+
+
ItemsSketch.Row<T> - Class in org.apache.datasketches.frequencies
+
+
Row class that defines the return values from a getFrequentItems query.
+
+
ItemsSketchIterator<T> - Class in org.apache.datasketches.quantiles
+
+
Iterator over ItemsSketch.
+
+
ItemsSketchSortedView<T> - Class in org.apache.datasketches.quantiles
+
+
The SortedView of the Classic Quantiles ItemsSketch.
+
+
ItemsUnion<T> - Class in org.apache.datasketches.quantiles
+
+
The API for Union operations for generic ItemsSketches
+
+
iterator() - Method in class org.apache.datasketches.kll.KllDoublesSketch
+
 
+
iterator() - Method in class org.apache.datasketches.kll.KllDoublesSketchSortedView
+
 
+
iterator() - Method in class org.apache.datasketches.kll.KllFloatsSketch
+
 
+
iterator() - Method in class org.apache.datasketches.kll.KllFloatsSketchSortedView
+
 
+
iterator() - Method in class org.apache.datasketches.kll.KllItemsSketch
+
 
+
iterator() - Method in class org.apache.datasketches.kll.KllItemsSketchSortedView
+
 
+
iterator() - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
iterator() - Method in class org.apache.datasketches.quantiles.DoublesSketchSortedView
+
 
+
iterator() - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
iterator() - Method in class org.apache.datasketches.quantiles.ItemsSketchSortedView
+
 
+
iterator() - Method in interface org.apache.datasketches.quantilescommon.DoublesSortedView
+
 
+
iterator() - Method in interface org.apache.datasketches.quantilescommon.FloatsSortedView
+
 
+
iterator() - Method in interface org.apache.datasketches.quantilescommon.GenericSortedView
+
 
+
iterator() - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
Gets the iterator for this sketch, which is not sorted.
+
+
iterator() - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
Gets the iterator for this sketch, which is not sorted.
+
+
iterator() - Method in interface org.apache.datasketches.quantilescommon.QuantilesGenericAPI
+
+
Gets the iterator for this sketch, which is not sorted.
+
+
iterator() - Method in interface org.apache.datasketches.quantilescommon.SortedView
+
+
Returns an iterator for this Sorted View.
+
+
iterator() - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
iterator() - Method in class org.apache.datasketches.req.ReqSketchSortedView
+
 
+
iterator() - Method in class org.apache.datasketches.sampling.VarOptItemsSamples
+
 
+
iterator() - Method in class org.apache.datasketches.theta.Sketch
+
+
Returns a HashIterator that can be used to iterate over the retained hash values of the + Theta sketch.
+
+
iterator() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
 
+
iterator() - Method in class org.apache.datasketches.tuple.CompactSketch
+
 
+
iterator() - Method in class org.apache.datasketches.tuple.Sketch
+
+
Returns a SketchIterator
+
+
+ + + +

J

+
+
jaccard(Sketch, Sketch) - Static method in class org.apache.datasketches.theta.JaccardSimilarity
+
+
Computes the Jaccard similarity index with upper and lower bounds.
+
+
jaccard(Sketch<S>, Sketch, S, SummarySetOperations<S>) - Static method in class org.apache.datasketches.tuple.JaccardSimilarity
+
+
Computes the Jaccard similarity index with upper and lower bounds.
+
+
jaccard(Sketch<S>, Sketch<S>, SummarySetOperations<S>) - Static method in class org.apache.datasketches.tuple.JaccardSimilarity
+
+
Computes the Jaccard similarity index with upper and lower bounds.
+
+
JaccardSimilarity - Class in org.apache.datasketches.theta
+
+
Jaccard similarity of two Theta Sketches.
+
+
JaccardSimilarity - Class in org.apache.datasketches.tuple
+
+
Jaccard similarity of two Tuple Sketches, or alternatively, of a Tuple and Theta Sketch.
+
+
JaccardSimilarity() - Constructor for class org.apache.datasketches.theta.JaccardSimilarity
+
 
+
JaccardSimilarity() - Constructor for class org.apache.datasketches.tuple.JaccardSimilarity
+
 
+
justification() - Method in annotation type org.apache.datasketches.common.SuppressFBWarnings
+
+
Optional explanation for the suppression.
+
+
+ + + +

K

+
+
KLL - org.apache.datasketches.common.Family
+
+
KLL quantiles sketch
+
+
KllDoublesSketch - Class in org.apache.datasketches.kll
+
+
This variation of the KllSketch implements primitive doubles.
+
+
KllDoublesSketchIterator - Class in org.apache.datasketches.kll
+
+
Iterator over KllDoublesSketch.
+
+
KllDoublesSketchSortedView - Class in org.apache.datasketches.kll
+
+
The SortedView of the KllDoublesSketch.
+
+
KllDoublesSketchSortedView(KllDoublesSketch) - Constructor for class org.apache.datasketches.kll.KllDoublesSketchSortedView
+
+
Constructs this Sorted View given the sketch
+
+
KllFloatsSketch - Class in org.apache.datasketches.kll
+
+
This variation of the KllSketch implements primitive floats.
+
+
KllFloatsSketchIterator - Class in org.apache.datasketches.kll
+
+
Iterator over KllFloatsSketch.
+
+
KllFloatsSketchSortedView - Class in org.apache.datasketches.kll
+
+
The SortedView of the KllFloatsSketch.
+
+
KllFloatsSketchSortedView(KllFloatsSketch) - Constructor for class org.apache.datasketches.kll.KllFloatsSketchSortedView
+
+
Constructs this Sorted View given the sketch
+
+
KllItemsSketch<T> - Class in org.apache.datasketches.kll
+
+
This variation of the KllSketch implements generic data types.
+
+
KllItemsSketchIterator<T> - Class in org.apache.datasketches.kll
+
+
Iterator over KllItemsSketch.
+
+
KllItemsSketchSortedView<T> - Class in org.apache.datasketches.kll
+
+
The SortedView of the KllItemsSketch.
+
+
KllSketch - Class in org.apache.datasketches.kll
+
+
This class is the root of the KLL sketch class hierarchy.
+
+
KllSketch.SketchStructure - Enum in org.apache.datasketches.kll
+
+
Used primarily to define the structure of the serialized sketch.
+
+
KllSketch.SketchType - Enum in org.apache.datasketches.kll
+
+
Used to define the variable type of the current instance of this class.
+
+
KllSketchIterator - Class in org.apache.datasketches.kll
+
+
The base implementation for the KLL sketch iterator hierarchy used for viewing the + non-ordered quantiles retained by a sketch.
+
+
+ + + +

L

+
+
le(Object, Object, Comparator<? super T>) - Static method in class org.apache.datasketches.common.Util
+
+
Is item1 Less-Than-Or-Equal-To item2
+
+
LE - org.apache.datasketches.quantilescommon.GenericInequalitySearch.Inequality
+
+
Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the highest adjacent pair of + values {A,B} such that A ≤ V < B.
+ Let low = index of the lowest value in the range.
+ Let high = index of the highest value in the range.
+
+
LE - org.apache.datasketches.quantilescommon.InequalitySearch
+
+
Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the highest adjacent pair of + values {A,B} such that A ≤ V < B.
+ Let low = index of the lowest value in the range.
+ Let high = index of the highest value in the range.
+
+
level - Variable in class org.apache.datasketches.kll.KllSketchIterator
+
 
+
levelPartId - Variable in class org.apache.datasketches.partitions.Partitioner.PartitionBoundsRow
+
 
+
levelPartId - Variable in class org.apache.datasketches.partitions.Partitioner.StackElement
+
 
+
levelsArr - Variable in class org.apache.datasketches.kll.KllSketchIterator
+
 
+
lg() - Method in enum org.apache.datasketches.common.ResizeFactor
+
+
Returns the Log-base 2 of the Resize Factor
+
+
log2(double) - Static method in class org.apache.datasketches.common.Util
+
+
The log2(value)
+
+
LOG2 - Static variable in class org.apache.datasketches.common.Util
+
+
The natural logarithm of 2.0.
+
+
logBaseOfX(double, double) - Static method in class org.apache.datasketches.common.Util
+
+
Returns the logbase(x).
+
+
LONG_MAX_VALUE_AS_DOUBLE - Static variable in class org.apache.datasketches.common.Util
+
+
Long.MAX_VALUE as a double.
+
+
LongsSketch - Class in org.apache.datasketches.frequencies
+
+
This sketch is useful for tracking approximate frequencies of long items with optional + associated counts (long item, long count) that are members of a multiset of + such items.
+
+
LongsSketch(int) - Constructor for class org.apache.datasketches.frequencies.LongsSketch
+
+
Construct this sketch with the parameter maxMapSize and the default initialMapSize (8).
+
+
LongsSketch.Row - Class in org.apache.datasketches.frequencies
+
+
Row class that defines the return values from a getFrequentItems query.
+
+
longToBytes(long, byte[]) - Static method in class org.apache.datasketches.common.Util
+
+
Returns a Little-Endian byte array extracted from the given long.
+
+
longToHexBytes(long) - Static method in class org.apache.datasketches.common.Util
+
+
Returns a string of spaced hex bytes in Big-Endian order.
+
+
lowerBound - Variable in class org.apache.datasketches.partitions.Partitioner.PartitionBoundsRow
+
 
+
LS - Static variable in class org.apache.datasketches.common.Util
+
+
The java line separator character as a String.
+
+
lt(Object, Object, Comparator<? super T>) - Static method in class org.apache.datasketches.common.Util
+
+
Is item1 Less-Than item2
+
+
LT - org.apache.datasketches.quantilescommon.GenericInequalitySearch.Inequality
+
+
Given a sorted array of increasing values arr[] and a key value v, + this criterion instructs the binary search algorithm to find the highest adjacent pair of + values {A,B} such that A < v ≤ B.
+ Let low = index of the lowest value in the range.
+ Let high = index of the highest value in the range.
+
+
LT - org.apache.datasketches.quantilescommon.InequalitySearch
+
+
Given a sorted array of increasing values arr[] and a key value v, + this criterion instructs the binary search algorithm to find the highest adjacent pair of + values {A,B} such that A < v ≤ B.
+ Let low = index of the lowest value in the range.
+ Let high = index of the highest value in the range.
+
+
+ + + +

M

+
+
Max - org.apache.datasketches.tuple.adouble.DoubleSummary.Mode
+
+
The aggregation mode is the maximum function.
+
+
Max - org.apache.datasketches.tuple.aninteger.IntegerSummary.Mode
+
+
The aggregation mode is the maximum function.
+
+
MAX_K - Static variable in class org.apache.datasketches.kll.KllSketch
+
+
The maximum K
+
+
MAX_LG_NOM_LONGS - Static variable in class org.apache.datasketches.thetacommon.ThetaUtil
+
+
The largest Log2 nom entries allowed: 26.
+
+
maxT(Object, Object, Comparator<? super T>) - Static method in class org.apache.datasketches.common.Util
+
+
Finds the maximum of two generic items
+
+
MEM_REQ_SVR_NULL_MSG - Static variable in interface org.apache.datasketches.quantilescommon.QuantilesAPI
+
 
+
memChecks(Memory) - Static method in class org.apache.datasketches.theta.Intersection
+
 
+
merge(ItemsSketch<T>) - Method in class org.apache.datasketches.frequencies.ItemsSketch
+
+
This function merges the other sketch into this one.
+
+
merge(LongsSketch) - Method in class org.apache.datasketches.frequencies.LongsSketch
+
+
This function merges the other sketch into this one.
+
+
merge(KllSketch) - Method in class org.apache.datasketches.kll.KllDoublesSketch
+
 
+
merge(KllSketch) - Method in class org.apache.datasketches.kll.KllFloatsSketch
+
 
+
merge(KllSketch) - Method in class org.apache.datasketches.kll.KllItemsSketch
+
 
+
merge(KllSketch) - Method in class org.apache.datasketches.kll.KllSketch
+
+
Merges another sketch into this one.
+
+
merge(ReqSketch) - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
MergingValidation - Class in org.apache.datasketches.cpc
+
+
This code is used both by unit tests, for short running tests, + and by the characterization repository for longer running, more exhaustive testing.
+
+
MergingValidation(int, int, int, int, int, PrintStream, PrintWriter) - Constructor for class org.apache.datasketches.cpc.MergingValidation
+
 
+
milliSecToString(long) - Static method in class org.apache.datasketches.common.Util
+
+
Returns the given time in milliseconds formatted as Hours:Min:Sec.mSec
+
+
Min - org.apache.datasketches.tuple.adouble.DoubleSummary.Mode
+
+
The aggregation mode is the minimum function.
+
+
Min - org.apache.datasketches.tuple.aninteger.IntegerSummary.Mode
+
+
The aggregation mode is the minimum function.
+
+
MIN_LG_ARR_LONGS - Static variable in class org.apache.datasketches.thetacommon.ThetaUtil
+
+
The smallest Log2 cache size allowed: 5.
+
+
MIN_LG_NOM_LONGS - Static variable in class org.apache.datasketches.thetacommon.ThetaUtil
+
+
The smallest Log2 nom entries allowed: 4.
+
+
minLgHashTableSize(int, double) - Static method in class org.apache.datasketches.thetacommon.HashOperations
+
+
Returns the smallest log hash table size given the count of items and the rebuild threshold.
+
+
minT(Object, Object, Comparator<? super T>) - Static method in class org.apache.datasketches.common.Util
+
+
Finds the minimum of two generic items
+
+
modulo(long[], int) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Returns the remainder from the modulo division of the 128-bit output of the murmurHash3 by the + divisor.
+
+
modulo(long, long, int) - Static method in class org.apache.datasketches.hash.MurmurHash3Adaptor
+
+
Returns the remainder from the modulo division of the 128-bit output of the murmurHash3 by the + divisor.
+
+
MurmurHash3 - Class in org.apache.datasketches.hash
+
+
+ The MurmurHash3 is a fast, non-cryptographic, 128-bit hash function that has + excellent avalanche and 2-way bit independence properties.
+
+
MurmurHash3Adaptor - Class in org.apache.datasketches.hash
+
+
A general purpose wrapper for the MurmurHash3.
+
+
+ + + +

N

+
+
nanoSecToString(long) - Static method in class org.apache.datasketches.common.Util
+
+
Returns the given time in nanoseconds formatted as Sec.mSec_uSec_nSec
+
+
newDirectInstance(int, WritableMemory, MemoryRequestServer) - Static method in class org.apache.datasketches.kll.KllDoublesSketch
+
+
Create a new direct updatable instance of this sketch with a given k.
+
+
newDirectInstance(int, WritableMemory, MemoryRequestServer) - Static method in class org.apache.datasketches.kll.KllFloatsSketch
+
+
Create a new direct updatable instance of this sketch with a given k.
+
+
newDirectInstance(WritableMemory, MemoryRequestServer) - Static method in class org.apache.datasketches.kll.KllDoublesSketch
+
+
Create a new direct updatable instance of this sketch with the default k.
+
+
newDirectInstance(WritableMemory, MemoryRequestServer) - Static method in class org.apache.datasketches.kll.KllFloatsSketch
+
+
Create a new direct updatable instance of this sketch with the default k.
+
+
newHeapInstance() - Static method in class org.apache.datasketches.kll.KllDoublesSketch
+
+
Create a new heap instance of this sketch with the default k = 200.
+
+
newHeapInstance() - Static method in class org.apache.datasketches.kll.KllFloatsSketch
+
+
Create a new heap instance of this sketch with the default k = 200.
+
+
newHeapInstance(int) - Static method in class org.apache.datasketches.kll.KllDoublesSketch
+
+
Create a new heap instance of this sketch with a given parameter k.
+
+
newHeapInstance(int) - Static method in class org.apache.datasketches.kll.KllFloatsSketch
+
+
Create a new heap instance of this sketch with a given parameter k.
+
+
newHeapInstance(int, Comparator<? super T>, ArrayOfItemsSerDe<T>) - Static method in class org.apache.datasketches.kll.KllItemsSketch
+
+
Create a new heap instance of this sketch with a given parameter k.
+
+
newHeapInstance(Comparator<? super T>, ArrayOfItemsSerDe<T>) - Static method in class org.apache.datasketches.kll.KllItemsSketch
+
+
Create a new heap instance of this sketch with the default k = 200.
+
+
newInstance(int) - Static method in class org.apache.datasketches.sampling.ReservoirItemsSketch
+
+
Construct a mergeable sampling sketch with up to k samples using the default resize + factor (8).
+
+
newInstance(int) - Static method in class org.apache.datasketches.sampling.ReservoirItemsUnion
+
+
Creates an empty Union with a maximum reservoir capacity of size k.
+
+
newInstance(int) - Static method in class org.apache.datasketches.sampling.ReservoirLongsSketch
+
+
Construct a mergeable reservoir sampling sketch with up to k samples using the default resize + factor (8).
+
+
newInstance(int) - Static method in class org.apache.datasketches.sampling.ReservoirLongsUnion
+
+
Creates an empty Union with a maximum reservoir capacity of size k.
+
+
newInstance(int) - Static method in class org.apache.datasketches.sampling.VarOptItemsSketch
+
+
Construct a varopt sampling sketch with up to k samples using the default resize factor (8).
+
+
newInstance(int) - Static method in class org.apache.datasketches.sampling.VarOptItemsUnion
+
+
Creates an empty Union with a maximum capacity of size k.
+
+
newInstance(int, ResizeFactor) - Static method in class org.apache.datasketches.sampling.ReservoirItemsSketch
+
+
Construct a mergeable sampling sketch with up to k samples using a specified resize factor.
+
+
newInstance(int, ResizeFactor) - Static method in class org.apache.datasketches.sampling.ReservoirLongsSketch
+
+
Construct a mergeable reservoir sampling sketch with up to k samples using the default resize + factor (8).
+
+
newInstance(int, ResizeFactor) - Static method in class org.apache.datasketches.sampling.VarOptItemsSketch
+
+
Construct a varopt sampling sketch with up to k samples using the specified resize factor.
+
+
newSummary() - Method in class org.apache.datasketches.tuple.adouble.DoubleSummaryFactory
+
 
+
newSummary() - Method in class org.apache.datasketches.tuple.aninteger.IntegerSummaryFactory
+
 
+
newSummary() - Method in class org.apache.datasketches.tuple.strings.ArrayOfStringsSummaryFactory
+
 
+
newSummary() - Method in interface org.apache.datasketches.tuple.SummaryFactory
+
 
+
newSummaryArray(S[], int) - Static method in class org.apache.datasketches.tuple.Util
+
 
+
next() - Method in class org.apache.datasketches.kll.KllSketchIterator
+
 
+
next() - Method in class org.apache.datasketches.quantiles.DoublesSketchIterator
+
 
+
next() - Method in class org.apache.datasketches.quantiles.ItemsSketchIterator
+
 
+
next() - Method in interface org.apache.datasketches.quantilescommon.QuantilesSketchIterator
+
+
Advances the index and checks if it is valid.
+
+
next() - Method in class org.apache.datasketches.quantilescommon.SortedViewIterator
+
+
Advances the index and checks if it is valid.
+
+
next() - Method in class org.apache.datasketches.req.ReqSketchIterator
+
 
+
next() - Method in class org.apache.datasketches.sampling.VarOptItemsSamples.VarOptItemsIterator
+
 
+
next() - Method in interface org.apache.datasketches.theta.HashIterator
+
+
Returns true at the next hash value in sequence.
+
+
next() - Method in interface org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketchIterator
+
+
Advancing the iterator and checking existence of the next entry + is combined here for efficiency.
+
+
next() - Method in class org.apache.datasketches.tuple.TupleSketchIterator
+
+
Advancing the iterator and checking existence of the next entry + is combined here for efficiency.
+
+
NO_FALSE_NEGATIVES - org.apache.datasketches.frequencies.ErrorType
+
+
No Type II error samples will be excluded from the sample set, + which means all Truly Positive samples will be included in the sample set.
+
+
NO_FALSE_POSITIVES - org.apache.datasketches.frequencies.ErrorType
+
+
No Type I error samples will be included in the sample set, + which means all Truly Negative samples will be excluded from the sample set.
+
+
normalCDF(double) - Static method in class org.apache.datasketches.common.BoundsOnBinomialProportions
+
+
Computes an approximation to normalCDF(x).
+
+
NOT_SINGLE_ITEM_MSG - Static variable in interface org.apache.datasketches.quantilescommon.QuantilesAPI
+
 
+
notB(Sketch) - Method in class org.apache.datasketches.theta.AnotB
+
+
This is part of a multistep, stateful AnotB operation and sets the given Theta sketch as the + second (or n+1th) argument B of A-AND-NOT-B.
+
+
notB(Sketch) - Method in class org.apache.datasketches.tuple.AnotB
+
+
This is part of a multistep, stateful AnotB operation and sets the given Theta sketch as the + second (or n+1th) argument B of A-AND-NOT-B.
+
+
notB(Sketch<S>) - Method in class org.apache.datasketches.tuple.AnotB
+
+
This is part of a multistep, stateful AnotB operation and sets the given Tuple sketch as the + second (or n+1th) argument B of A-AND-NOT-B.
+
+
numberOfLeadingOnes(long) - Static method in class org.apache.datasketches.common.Util
+
+
Returns the number of one bits preceding the highest-order ("leftmost") zero-bit in the + two's complement binary representation of the specified long value, or 64 if the value is equal + to minus one.
+
+
numberOfTrailingOnes(long) - Static method in class org.apache.datasketches.common.Util
+
+
Returns the number of one bits following the lowest-order ("rightmost") zero-bit in the + two's complement binary representation of the specified long value, or 64 if the value is equal + to minus one.
+
+
numDigits(int) - Static method in class org.apache.datasketches.common.Util
+
+
Computes the number of decimal digits of the number n
+
+
numLevels - Variable in class org.apache.datasketches.kll.KllSketchIterator
+
 
+
+ + + +

O

+
+
org.apache.datasketches - package org.apache.datasketches
+
+
This package is the parent package for all sketch families and common code areas.
+
+
org.apache.datasketches.common - package org.apache.datasketches.common
+
+
This package is for common classes that may be used across all the sketch families.
+
+
org.apache.datasketches.cpc - package org.apache.datasketches.cpc
+
+
Compressed Probabilistic Counting sketch family
+
+
org.apache.datasketches.fdt - package org.apache.datasketches.fdt
+
+
Frequent Distinct Tuples Sketch
+
+
org.apache.datasketches.frequencies - package org.apache.datasketches.frequencies
+
+
This package is dedicated to streaming algorithms that enable estimation of the + frequency of occurrence of items in a weighted multiset stream of items.
+
+
org.apache.datasketches.hash - package org.apache.datasketches.hash
+
+
The hash package contains a high-performing and extended Java implementations + of Austin Appleby's 128-bit MurmurHash3 hash function originally coded in C.
+
+
org.apache.datasketches.hll - package org.apache.datasketches.hll
+
+
The DataSketches™ HLL sketch family package
+
+
org.apache.datasketches.hllmap - package org.apache.datasketches.hllmap
+
+
The hllmap package contains a space efficient HLL mapping sketch of keys to approximate unique + count of identifiers.
+
+
org.apache.datasketches.kll - package org.apache.datasketches.kll
+
+
This package is for the implementations of the sketch algorithm developed by Zohar Karnin, Kevin Lang, + and Edo Liberty that is commonly referred to as the "KLL" sketch after the authors' last names.
+
+
org.apache.datasketches.partitions - package org.apache.datasketches.partitions
+
 
+
org.apache.datasketches.quantiles - package org.apache.datasketches.quantiles
+
+
The quantiles package contains stochastic streaming algorithms that enable single-pass + analysis of the distribution of a stream of quantiles.
+
+
org.apache.datasketches.quantilescommon - package org.apache.datasketches.quantilescommon
+
+
This package contains common tools and methods for the quantiles, kll and + req packages.
+
+
org.apache.datasketches.req - package org.apache.datasketches.req
+
+
This package is for the implementation of the Relative Error Quantiles sketch algorithm.
+
+
org.apache.datasketches.sampling - package org.apache.datasketches.sampling
+
+
This package is dedicated to streaming algorithms that enable fixed size, uniform sampling of + weighted and unweighted items from a stream.
+
+
org.apache.datasketches.theta - package org.apache.datasketches.theta
+
+
The theta package contains the basic sketch classes that are members of the + Theta Sketch Framework.
+
+
org.apache.datasketches.thetacommon - package org.apache.datasketches.thetacommon
+
+
This package contains common tools and methods for the theta, + tuple, tuple/* and fdt packages.
+
+
org.apache.datasketches.tuple - package org.apache.datasketches.tuple
+
+
The tuple package contains a number of sketches based on the same + fundamental algorithms of the Theta Sketch Framework and extend these + concepts for whole new families of sketches.
+
+
org.apache.datasketches.tuple.adouble - package org.apache.datasketches.tuple.adouble
+
+
This package is for a generic implementation of the Tuple sketch for single Double value.
+
+
org.apache.datasketches.tuple.aninteger - package org.apache.datasketches.tuple.aninteger
+
+
This package is for a generic implementation of the Tuple sketch for single Integer value.
+
+
org.apache.datasketches.tuple.arrayofdoubles - package org.apache.datasketches.tuple.arrayofdoubles
+
+
This package is for a concrete implementation of the Tuple sketch for an array of double values.
+
+
org.apache.datasketches.tuple.strings - package org.apache.datasketches.tuple.strings
+
+
This package is for a generic implementation of the Tuple sketch for single String value.
+
+
+ + + +

P

+
+
packBits(long, int, byte[], int, int) - Static method in class org.apache.datasketches.theta.BitPacking
+
 
+
part - Variable in class org.apache.datasketches.partitions.Partitioner.PartitionBoundsRow
+
 
+
part - Variable in class org.apache.datasketches.partitions.Partitioner.StackElement
+
 
+
partition(S) - Method in class org.apache.datasketches.partitions.Partitioner
+
+
This initiates the partitioning process
+
+
PartitionBoundaries - Interface in org.apache.datasketches.quantilescommon
+
+
This defines a set of results computed from the getParitionBoundaries() function and + encapsulates the basic methods needed to construct actual partitions based on generic items.
+
+
PartitionBoundsRow(Partitioner.StackElement<T>) - Constructor for class org.apache.datasketches.partitions.Partitioner.PartitionBoundsRow
+
 
+
Partitioner<T,​S extends QuantilesGenericAPI<T> & PartitioningFeature<T>> - Class in org.apache.datasketches.partitions
+
+
A partitioning process that can partition very large data sets into thousands + of partitions of approximately the same size.
+
+
Partitioner(long, int, SketchFillRequest<T, S>) - Constructor for class org.apache.datasketches.partitions.Partitioner
+
+
This constructor assumes a QuantileSearchCriteria of INCLUSIVE.
+
+
Partitioner(long, int, SketchFillRequest<T, S>, QuantileSearchCriteria) - Constructor for class org.apache.datasketches.partitions.Partitioner
+
+
This constructor includes the QuantileSearchCriteria criteria as a parameter.
+
+
Partitioner.PartitionBoundsRow<T> - Class in org.apache.datasketches.partitions
+
+
Defines a row for List of PartitionBounds.
+
+
Partitioner.StackElement<T> - Class in org.apache.datasketches.partitions
+
+
Holds data for a Stack element
+
+
PartitioningFeature<T> - Interface in org.apache.datasketches.quantilescommon
+
+
This enables the special functions for performing efficient partitioning of massive data.
+
+
PostProcessor - Class in org.apache.datasketches.fdt
+
+
This processes the contents of a FDT sketch to extract the + primary keys with the most frequent unique combinations of the non-primary dimensions.
+
+
PostProcessor(FdtSketch, Group, char) - Constructor for class org.apache.datasketches.fdt.PostProcessor
+
+
Construct with a populated FdtSketch
+
+
powerSeriesNextDouble(int, double, boolean, double) - Static method in class org.apache.datasketches.common.Util
+
+
Computes the next larger double in the power series + point = logBase( i / ppb ) given the current point in the series.
+
+
PREAMBLE_LONGS - Static variable in class org.apache.datasketches.tuple.Sketch
+
 
+
putDoubleBE(byte[], int, double) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Put the source double into the destination byte array starting at the given offset + in big endian order.
+
+
putDoubleLE(byte[], int, double) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Put the source double into the destination byte array starting at the given offset + in little endian order.
+
+
putFloatBE(byte[], int, float) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Put the source float into the destination byte array starting at the given offset + in big endian order.
+
+
putFloatLE(byte[], int, float) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Put the source float into the destination byte array starting at the given offset + in little endian order.
+
+
putIntBE(byte[], int, int) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Put the source int into the destination byte array starting at the given offset + in big endian order.
+
+
putIntLE(byte[], int, int) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Put the source int into the destination byte array starting at the given offset + in little endian order.
+
+
putLongBE(byte[], int, long) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Put the source long into the destination byte array starting at the given offset + in big endian order.
+
+
putLongLE(byte[], int, long) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Put the source long into the destination byte array starting at the given offset + in little endian order.
+
+
putMemory(WritableMemory) - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Puts the current sketch into the given Memory in compact form if there is sufficient space, + otherwise, it throws an error.
+
+
putMemory(WritableMemory, boolean) - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Puts the current sketch into the given Memory if there is sufficient space, otherwise, + throws an error.
+
+
putMemory(WritableMemory, ArrayOfItemsSerDe<T>) - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
+
Puts the current sketch into the given Memory if there is sufficient space.
+
+
putShortBE(byte[], int, short) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Put the source short into the destination byte array starting at the given offset + in big endian order.
+
+
putShortLE(byte[], int, short) - Static method in class org.apache.datasketches.common.ByteArrayUtil
+
+
Put the source short into the destination byte array starting at the given offset + in little endian order.
+
+
pwr2SeriesNext(int, long) - Static method in class org.apache.datasketches.common.Util
+
+
Computes the next larger integer point in the power series + point = 2( i / ppo ) given the current point in the series.
+
+
pwr2SeriesPrev(int, int) - Static method in class org.apache.datasketches.common.Util
+
+
Computes the previous, smaller integer point in the power series + point = 2( i / ppo ) given the current point in the series.
+
+
+ + + +

Q

+
+
QUANTILES - org.apache.datasketches.common.Family
+
+
The Quantiles family of sketches.
+
+
QuantilesAPI - Interface in org.apache.datasketches.quantilescommon
+
+
This is a stochastic streaming sketch that enables near-real time analysis of the + approximate distribution of items from a very large stream in a single pass, requiring only + that the items are comparable.
+
+
QuantilesDoublesAPI - Interface in org.apache.datasketches.quantilescommon
+
+
The Quantiles API for item type double.
+
+
QuantilesDoublesSketchIterator - Interface in org.apache.datasketches.quantilescommon
+
+
The quantiles sketch iterator for primitive type double.
+
+
QuantileSearchCriteria - Enum in org.apache.datasketches.quantilescommon
+
+
These search criteria are used by the KLL, REQ and Classic Quantiles sketches in the DataSketches library.
+
+
QuantilesFloatsAPI - Interface in org.apache.datasketches.quantilescommon
+
+
The Quantiles API for item type float.
+
+
QuantilesFloatsSketchIterator - Interface in org.apache.datasketches.quantilescommon
+
+
The quantiles sketch iterator for primitive type float.
+
+
QuantilesGenericAPI<T> - Interface in org.apache.datasketches.quantilescommon
+
+
The Quantiles API for item type generic.
+
+
QuantilesGenericSketchIterator<T> - Interface in org.apache.datasketches.quantilescommon
+
+
The quantiles sketch iterator for generic types.
+
+
QuantilesSketchIterator - Interface in org.apache.datasketches.quantilescommon
+
+
This is the base interface for the SketchIterator hierarchy used for viewing the + non-ordered quantiles retained by a sketch.
+
+
QuantilesUtil - Class in org.apache.datasketches.quantilescommon
+
+
Utilities for the quantiles sketches.
+
+
QuickMergingValidation - Class in org.apache.datasketches.cpc
+
+
This code is used both by unit tests, for short running tests, + and by the characterization repository for longer running, more exhaustive testing.
+
+
QuickMergingValidation(int, int, int, PrintStream, PrintWriter) - Constructor for class org.apache.datasketches.cpc.QuickMergingValidation
+
 
+
QuickSelect - Class in org.apache.datasketches.thetacommon
+
+
QuickSelect algorithm improved from Sedgewick.
+
+
QUICKSELECT - org.apache.datasketches.common.Family
+
+
The QuickSelect Sketch family is a member of the Theta Sketch Framework of sketches and + is the workhorse of the Theta Sketch Families and can be constructed for either on-heap or + off-heap operation.
+
+
QuickSelectSketch - org.apache.datasketches.tuple.SerializerDeserializer.SketchType
+
 
+
+ + + +

R

+
+
rand - Static variable in class org.apache.datasketches.quantiles.ItemsSketch
+
+
Setting the seed makes the results of the sketch deterministic if the input items are + received in exactly the same order.
+
+
rebuild() - Method in class org.apache.datasketches.theta.UpdateSketch
+
+
Rebuilds the hash table to remove dirty values or to reduce the size + to nominal entries.
+
+
REBUILD_THRESHOLD - Static variable in class org.apache.datasketches.thetacommon.ThetaUtil
+
+
The hash table rebuild threshold = 15.0/16.0.
+
+
RejectedDuplicate - org.apache.datasketches.theta.UpdateReturnState
+
+
The hash was rejected as a duplicate.
+
+
RejectedNullOrEmpty - org.apache.datasketches.theta.UpdateReturnState
+
+
The hash was rejected because it was null or empty.
+
+
RejectedOverTheta - org.apache.datasketches.theta.UpdateReturnState
+
+
The hash was rejected because the value was negative, zero or + greater than theta.
+
+
REQ - org.apache.datasketches.common.Family
+
+
Relative Error Quantiles Sketch
+
+
ReqDebug - Interface in org.apache.datasketches.req
+
+
The signaling interface that allows comprehensive analysis of the ReqSketch and ReqCompactor + while eliminating code clutter in the main classes.
+
+
ReqSketch - Class in org.apache.datasketches.req
+
+
This Relative Error Quantiles Sketch is the Java implementation based on the paper + "Relative Error Streaming Quantiles" by Graham Cormode, Zohar Karnin, Edo Liberty, + Justin Thaler, Pavel Veselý, and loosely derived from a Python prototype written by Pavel Veselý.
+
+
ReqSketchBuilder - Class in org.apache.datasketches.req
+
+
For building a new ReqSketch
+
+
ReqSketchBuilder() - Constructor for class org.apache.datasketches.req.ReqSketchBuilder
+
+
Constructor for the ReqSketchBuilder.
+
+
ReqSketchIterator - Class in org.apache.datasketches.req
+
+
Iterator over all retained items of the ReqSketch.
+
+
ReqSketchSortedView - Class in org.apache.datasketches.req
+
+
The SortedView of the ReqSketch.
+
+
ReqSketchSortedView(ReqSketch) - Constructor for class org.apache.datasketches.req.ReqSketchSortedView
+
+
Constructs this Sorted View given the sketch
+
+
RESERVOIR - org.apache.datasketches.common.Family
+
+
The Reservoir family of sketches.
+
+
RESERVOIR_UNION - org.apache.datasketches.common.Family
+
+
The reservoir sampling family of Union operations.
+
+
ReservoirItemsSketch<T> - Class in org.apache.datasketches.sampling
+
+
This sketch provides a reservoir sample over an input stream of items.
+
+
ReservoirItemsUnion<T> - Class in org.apache.datasketches.sampling
+
+
Class to union reservoir samples of generic items.
+
+
ReservoirLongsSketch - Class in org.apache.datasketches.sampling
+
+
This sketch provides a reservoir sample over an input stream of longs.
+
+
ReservoirLongsUnion - Class in org.apache.datasketches.sampling
+
+
Class to union reservoir samples of longs.
+
+
reset() - Method in class org.apache.datasketches.cpc.CpcSketch
+
+
Resets this sketch to empty but retains the original LgK and Seed.
+
+
reset() - Method in class org.apache.datasketches.frequencies.ItemsSketch
+
+
Resets this sketch to a virgin state.
+
+
reset() - Method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Resets this sketch to a virgin state.
+
+
reset() - Method in class org.apache.datasketches.hll.HllSketch
+
 
+
reset() - Method in class org.apache.datasketches.hll.Union
+
+
Resets to empty and retains the current lgK, but does not change the configured value of + lgMaxK.
+
+
reset() - Method in class org.apache.datasketches.kll.KllDoublesSketch
+
+
Resets this sketch to the empty state.
+
+
reset() - Method in class org.apache.datasketches.kll.KllFloatsSketch
+
+
Resets this sketch to the empty state.
+
+
reset() - Method in class org.apache.datasketches.kll.KllItemsSketch
+
 
+
reset() - Method in class org.apache.datasketches.quantiles.CompactDoublesSketch
+
 
+
reset() - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Resets this sketch to the empty state.
+
+
reset() - Method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Resets this Union to a virgin state.
+
+
reset() - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
reset() - Method in class org.apache.datasketches.quantiles.ItemsUnion
+
+
Resets this Union to a virgin state.
+
+
reset() - Method in interface org.apache.datasketches.quantilescommon.QuantilesAPI
+
+
Resets this sketch to the empty state.
+
+
reset() - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
reset() - Method in class org.apache.datasketches.sampling.ReservoirItemsSketch
+
+
Resets this sketch to the empty state, but retains the original value of k.
+
+
reset() - Method in class org.apache.datasketches.sampling.ReservoirLongsSketch
+
+
Resets this sketch to the empty state, but retains the original value of k.
+
+
reset() - Method in class org.apache.datasketches.sampling.VarOptItemsSketch
+
+
Resets this sketch to the empty state, but retains the original value of k.
+
+
reset() - Method in class org.apache.datasketches.sampling.VarOptItemsUnion
+
+
Resets this sketch to the empty state, but retains the original value of max k.
+
+
reset() - Method in class org.apache.datasketches.theta.Intersection
+
+
Resets this Intersection for stateful operations only.
+
+
reset() - Method in class org.apache.datasketches.theta.Union
+
+
Resets this Union.
+
+
reset() - Method in class org.apache.datasketches.theta.UpdateSketch
+
+
Resets this sketch back to a virgin empty state.
+
+
reset() - Method in class org.apache.datasketches.tuple.AnotB
+
+
Resets this operation back to the empty state.
+
+
reset() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesIntersection
+
+
Resets the internal set to the initial state, which represents the Universal Set
+
+
reset() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUnion
+
+
Resets the union to an empty state
+
+
reset() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch
+
+
Resets this sketch an empty state.
+
+
reset() - Method in class org.apache.datasketches.tuple.Intersection
+
+
Resets the internal set to the initial state, which represents the Universal Set
+
+
reset() - Method in class org.apache.datasketches.tuple.Union
+
+
Resets the internal set to the initial state, which represents an empty set.
+
+
reset() - Method in class org.apache.datasketches.tuple.UpdatableSketchBuilder
+
+
Resets the Nominal Entries, Resize Factor and Sampling Probability to their default values.
+
+
RESIZE_THRESHOLD - Static variable in class org.apache.datasketches.thetacommon.ThetaUtil
+
+
The resize threshold = 0.5; tuned for speed.
+
+
ResizeFactor - Enum in org.apache.datasketches.common
+
+
For the Families that accept this configuration parameter, it controls the size multiple that + affects how fast the internal cache grows, when more space is required.
+
+
rule - Variable in class org.apache.datasketches.partitions.Partitioner.PartitionBoundsRow
+
 
+
+ + + +

S

+
+
SampleSubsetSummary - Class in org.apache.datasketches.sampling
+
+
A simple object o capture the results of a subset sum query on a sampling sketch.
+
+
select(double[], int, int, int) - Static method in class org.apache.datasketches.thetacommon.QuickSelect
+
+
Gets the 0-based kth order statistic from the array.
+
+
select(long[], int, int, int) - Static method in class org.apache.datasketches.thetacommon.QuickSelect
+
+
Gets the 0-based kth order statistic from the array.
+
+
selectExcludingZeros(double[], int, int) - Static method in class org.apache.datasketches.thetacommon.QuickSelect
+
+
Gets the 1-based kth order statistic from the array excluding any zero values in the + array.
+
+
selectExcludingZeros(long[], int, int) - Static method in class org.apache.datasketches.thetacommon.QuickSelect
+
+
Gets the 1-based kth order statistic from the array excluding any zero values in the + array.
+
+
selectIncludingZeros(double[], int) - Static method in class org.apache.datasketches.thetacommon.QuickSelect
+
+
Gets the 1-based kth order statistic from the array including any zero values in the + array.
+
+
selectIncludingZeros(long[], int) - Static method in class org.apache.datasketches.thetacommon.QuickSelect
+
+
Gets the 1-based kth order statistic from the array including any zero values in the + array.
+
+
SerializerDeserializer - Class in org.apache.datasketches.tuple
+
+
Multipurpose serializer-deserializer for a collection of sketches defined by the enum.
+
+
SerializerDeserializer() - Constructor for class org.apache.datasketches.tuple.SerializerDeserializer
+
 
+
SerializerDeserializer.SketchType - Enum in org.apache.datasketches.tuple
+
+
Defines the sketch classes that this SerializerDeserializer can handle.
+
+
serializeToByteArray(Boolean) - Method in class org.apache.datasketches.common.ArrayOfBooleansSerDe
+
 
+
serializeToByteArray(Boolean[]) - Method in class org.apache.datasketches.common.ArrayOfBooleansSerDe
+
 
+
serializeToByteArray(Double) - Method in class org.apache.datasketches.common.ArrayOfDoublesSerDe
+
 
+
serializeToByteArray(Double[]) - Method in class org.apache.datasketches.common.ArrayOfDoublesSerDe
+
 
+
serializeToByteArray(Long) - Method in class org.apache.datasketches.common.ArrayOfLongsSerDe
+
 
+
serializeToByteArray(Long[]) - Method in class org.apache.datasketches.common.ArrayOfLongsSerDe
+
 
+
serializeToByteArray(Number) - Method in class org.apache.datasketches.common.ArrayOfNumbersSerDe
+
 
+
serializeToByteArray(Number[]) - Method in class org.apache.datasketches.common.ArrayOfNumbersSerDe
+
 
+
serializeToByteArray(String) - Method in class org.apache.datasketches.common.ArrayOfStringsSerDe
+
 
+
serializeToByteArray(String) - Method in class org.apache.datasketches.common.ArrayOfUtf16StringsSerDe
+
 
+
serializeToByteArray(String[]) - Method in class org.apache.datasketches.common.ArrayOfStringsSerDe
+
 
+
serializeToByteArray(String[]) - Method in class org.apache.datasketches.common.ArrayOfUtf16StringsSerDe
+
 
+
serializeToByteArray(T) - Method in class org.apache.datasketches.common.ArrayOfItemsSerDe
+
+
Serialize a single unserialized item to a byte array.
+
+
serializeToByteArray(T[]) - Method in class org.apache.datasketches.common.ArrayOfItemsSerDe
+
+
Serialize an array of unserialized items to a byte array of contiguous serialized items.
+
+
serializeToString() - Method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Returns a String representation of this sketch
+
+
setA(Sketch) - Method in class org.apache.datasketches.theta.AnotB
+
+
This is part of a multistep, stateful AnotB operation and sets the given Theta sketch as the + first argument A of A-AND-NOT-B.
+
+
setA(Sketch<S>) - Method in class org.apache.datasketches.tuple.AnotB
+
+
This is part of a multistep, stateful AnotB operation and sets the given Tuple sketch as the + first argument A of A-AND-NOT-B.
+
+
setClass(Class<?>) - Method in class org.apache.datasketches.sampling.VarOptItemsSamples
+
+
Specifies the class to use when copying the item array from the sketch.
+
+
setFamily(Family) - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Set the Family.
+
+
setHighRankAccuracy(boolean) - Method in class org.apache.datasketches.req.ReqSketchBuilder
+
+
This sets the parameter highRankAccuracy.
+
+
setK(int) - Method in class org.apache.datasketches.quantiles.DoublesSketchBuilder
+
+
Sets the parameter k that determines the accuracy and size of the sketch.
+
+
setK(int) - Method in class org.apache.datasketches.req.ReqSketchBuilder
+
+
This sets the parameter k.
+
+
setLocalLogNominalEntries(int) - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Alternative method of setting the Nominal Entries for a local concurrent sketch from the + log_base2 value.
+
+
setLocalNominalEntries(int) - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Sets the Nominal Entries for the concurrent local sketch.
+
+
setLogNominalEntries(int) - Method in class org.apache.datasketches.theta.SetOperationBuilder
+
+
Alternative method of setting the Nominal Entries for this set operation from the log_base2 value.
+
+
setLogNominalEntries(int) - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Alternative method of setting the Nominal Entries for this sketch from the log_base2 value.
+
+
setMaxConcurrencyError(double) - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Sets the Maximum Concurrency Error.
+
+
setMaxK(int) - Method in class org.apache.datasketches.quantiles.DoublesUnionBuilder
+
+
Sets the parameter masK that determines the maximum size of the sketch that + results from a union and its accuracy.
+
+
setMaxNumLocalThreads(int) - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Sets the Maximum Number of Local Threads.
+
+
setMemoryRequestServer(MemoryRequestServer) - Method in class org.apache.datasketches.theta.SetOperationBuilder
+
+
Set the MemoryRequestServer
+
+
setMemoryRequestServer(MemoryRequestServer) - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Set the MemoryRequestServer
+
+
setNominalEntries(int) - Method in class org.apache.datasketches.theta.SetOperationBuilder
+
+
Sets the Maximum Nominal Entries (max K) for this set operation.
+
+
setNominalEntries(int) - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Sets the Nominal Entries for this sketch.
+
+
setNominalEntries(int) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSetOperationBuilder
+
+
This is to set the nominal number of entries.
+
+
setNominalEntries(int) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder
+
+
This is to set the nominal number of entries.
+
+
setNominalEntries(int) - Method in class org.apache.datasketches.tuple.UpdatableSketchBuilder
+
+
This is to set the nominal number of entries.
+
+
setNumberOfValues(int) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSetOperationBuilder
+
+
This is to set the number of double values associated with each key
+
+
setNumberOfValues(int) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder
+
+
This is to set the number of double values associated with each key
+
+
setNumPoolThreads(int) - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Sets the number of pool threads used for background propagation in the concurrent sketches.
+
+
SetOperation - Class in org.apache.datasketches.theta
+
+
The parent API for all Set Operations
+
+
setOperationBuilder() - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
SetOperationBuilder - Class in org.apache.datasketches.theta
+
+
For building a new SetOperation.
+
+
SetOperationBuilder() - Constructor for class org.apache.datasketches.theta.SetOperationBuilder
+
+
Constructor for building a new SetOperation.
+
+
SetOperationCornerCases - Class in org.apache.datasketches.thetacommon
+
+
Simplifies and speeds up set operations by resolving specific corner cases.
+
+
SetOperationCornerCases() - Constructor for class org.apache.datasketches.thetacommon.SetOperationCornerCases
+
 
+
SetOperationCornerCases.AnotbAction - Enum in org.apache.datasketches.thetacommon
+
 
+
SetOperationCornerCases.CornerCase - Enum in org.apache.datasketches.thetacommon
+
 
+
SetOperationCornerCases.IntersectAction - Enum in org.apache.datasketches.thetacommon
+
 
+
SetOperationCornerCases.UnionAction - Enum in org.apache.datasketches.thetacommon
+
 
+
setP(float) - Method in class org.apache.datasketches.theta.SetOperationBuilder
+
+
Sets the upfront uniform sampling probability, p.
+
+
setP(float) - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Sets the upfront uniform sampling probability, p
+
+
setPropagateOrderedCompact(boolean) - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Sets the Propagate Ordered Compact flag to the given value.
+
+
setReqDebug(ReqDebug) - Method in class org.apache.datasketches.req.ReqSketchBuilder
+
+
This sets the parameter reqDebug.
+
+
setResizeFactor(ResizeFactor) - Method in class org.apache.datasketches.theta.SetOperationBuilder
+
+
Sets the cache Resize Factor
+
+
setResizeFactor(ResizeFactor) - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Sets the cache Resize Factor.
+
+
setResizeFactor(ResizeFactor) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder
+
+
This is to set the resize factor.
+
+
setResizeFactor(ResizeFactor) - Method in class org.apache.datasketches.tuple.UpdatableSketchBuilder
+
+
This is to set the resize factor.
+
+
setSamplingProbability(float) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder
+
+
This is to set sampling probability.
+
+
setSamplingProbability(float) - Method in class org.apache.datasketches.tuple.UpdatableSketchBuilder
+
+
This is to set sampling probability.
+
+
setSeed(long) - Method in class org.apache.datasketches.theta.SetOperationBuilder
+
+
Sets the long seed value that is require by the hashing function.
+
+
setSeed(long) - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Sets the long seed value that is required by the hashing function.
+
+
setSeed(long) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSetOperationBuilder
+
+
Sets the long seed value that is required by the hashing function.
+
+
setSeed(long) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder
+
+
Sets the long seed value that is required by the hashing function.
+
+
similarityTest(Sketch, Sketch, double) - Static method in class org.apache.datasketches.theta.JaccardSimilarity
+
+
Tests similarity of a measured Sketch against an expected Sketch.
+
+
similarityTest(Sketch<S>, Sketch, S, SummarySetOperations<S>, double) - Static method in class org.apache.datasketches.tuple.JaccardSimilarity
+
+
Tests similarity of a measured Sketch against an expected Sketch.
+
+
similarityTest(Sketch<S>, Sketch<S>, SummarySetOperations<S>, double) - Static method in class org.apache.datasketches.tuple.JaccardSimilarity
+
+
Tests similarity of a measured Sketch against an expected Sketch.
+
+
sizeOf(Boolean) - Method in class org.apache.datasketches.common.ArrayOfBooleansSerDe
+
 
+
sizeOf(Boolean[]) - Method in class org.apache.datasketches.common.ArrayOfBooleansSerDe
+
 
+
sizeOf(Double) - Method in class org.apache.datasketches.common.ArrayOfDoublesSerDe
+
 
+
sizeOf(Double[]) - Method in class org.apache.datasketches.common.ArrayOfDoublesSerDe
+
 
+
sizeOf(Long) - Method in class org.apache.datasketches.common.ArrayOfLongsSerDe
+
 
+
sizeOf(Long[]) - Method in class org.apache.datasketches.common.ArrayOfLongsSerDe
+
 
+
sizeOf(Number) - Method in class org.apache.datasketches.common.ArrayOfNumbersSerDe
+
 
+
sizeOf(Number[]) - Method in class org.apache.datasketches.common.ArrayOfNumbersSerDe
+
 
+
sizeOf(String) - Method in class org.apache.datasketches.common.ArrayOfStringsSerDe
+
 
+
sizeOf(String) - Method in class org.apache.datasketches.common.ArrayOfUtf16StringsSerDe
+
 
+
sizeOf(Memory, long, int) - Method in class org.apache.datasketches.common.ArrayOfBooleansSerDe
+
 
+
sizeOf(Memory, long, int) - Method in class org.apache.datasketches.common.ArrayOfDoublesSerDe
+
 
+
sizeOf(Memory, long, int) - Method in class org.apache.datasketches.common.ArrayOfItemsSerDe
+
+
Returns the serialized size in bytes of the number of contiguous serialized items in Memory.
+
+
sizeOf(Memory, long, int) - Method in class org.apache.datasketches.common.ArrayOfLongsSerDe
+
 
+
sizeOf(Memory, long, int) - Method in class org.apache.datasketches.common.ArrayOfNumbersSerDe
+
 
+
sizeOf(Memory, long, int) - Method in class org.apache.datasketches.common.ArrayOfStringsSerDe
+
 
+
sizeOf(Memory, long, int) - Method in class org.apache.datasketches.common.ArrayOfUtf16StringsSerDe
+
 
+
sizeOf(T) - Method in class org.apache.datasketches.common.ArrayOfItemsSerDe
+
+
Returns the serialized size in bytes of a single unserialized item.
+
+
sizeOf(T[]) - Method in class org.apache.datasketches.common.ArrayOfItemsSerDe
+
+
Returns the serialized size in bytes of the array of items.
+
+
Sketch - Class in org.apache.datasketches.theta
+
+
The top-level class for all theta sketches.
+
+
Sketch<S extends Summary> - Class in org.apache.datasketches.tuple
+
+
This is an equivalent to org.apache.datasketches.theta.Sketch with + addition of a user-defined Summary object associated with every unique entry + in the sketch.
+
+
SKETCH_A - org.apache.datasketches.thetacommon.SetOperationCornerCases.AnotbAction
+
 
+
SKETCH_A - org.apache.datasketches.thetacommon.SetOperationCornerCases.UnionAction
+
 
+
SKETCH_B - org.apache.datasketches.thetacommon.SetOperationCornerCases.UnionAction
+
 
+
Sketches - Class in org.apache.datasketches.theta
+
+
This class brings together the common sketch and set operation creation methods and + the public static methods into one place.
+
+
Sketches - Class in org.apache.datasketches.tuple
+
+
Convenient static methods to instantiate generic tuple sketches.
+
+
Sketches() - Constructor for class org.apache.datasketches.tuple.Sketches
+
 
+
SketchesArgumentException - Exception in org.apache.datasketches.common
+
+
Illegal Arguments Exception class for the library
+
+
SketchesArgumentException(String) - Constructor for exception org.apache.datasketches.common.SketchesArgumentException
+
+
Constructs a new runtime exception with the specified detail message.
+
+
SketchesException - Exception in org.apache.datasketches.common
+
+
Exception class for the library
+
+
SketchesException(String) - Constructor for exception org.apache.datasketches.common.SketchesException
+
+
Constructs a new runtime exception with the specified detail message.
+
+
SketchesException(String, Throwable) - Constructor for exception org.apache.datasketches.common.SketchesException
+
+
Constructs a new runtime exception with the specified detail message and cause.
+
+
SketchesReadOnlyException - Exception in org.apache.datasketches.common
+
+
Write operation attempted on a read-only class.
+
+
SketchesReadOnlyException() - Constructor for exception org.apache.datasketches.common.SketchesReadOnlyException
+
+
Constructs a new runtime exception with the message: + "Write operation attempted on a read-only class."
+
+
SketchesReadOnlyException(String) - Constructor for exception org.apache.datasketches.common.SketchesReadOnlyException
+
+
Constructs a new runtime exception with the specified detail message.
+
+
SketchesStateException - Exception in org.apache.datasketches.common
+
+
Illegal State Exception class for the library
+
+
SketchesStateException(String) - Constructor for exception org.apache.datasketches.common.SketchesStateException
+
+
Constructs a new runtime exception with the specified detail message.
+
+
SketchFillRequest<T,​S extends QuantilesGenericAPI<T> & PartitioningFeature<T>> - Interface in org.apache.datasketches.partitions
+
+
This is a callback request to the data source to fill a quantiles sketch, + which is returned to the caller.
+
+
sketchStateId(boolean, int, long) - Static method in class org.apache.datasketches.thetacommon.SetOperationCornerCases
+
 
+
SortedView - Interface in org.apache.datasketches.quantilescommon
+
+
This is the base interface for the Sorted View interface hierarchy and defines the methods that are type independent.
+
+
SortedViewIterator - Class in org.apache.datasketches.quantilescommon
+
+
This is the base interface for the SortedViewIterator hierarchy used with a SortedView obtained + from a quantile-type sketch.
+
+
StackElement(GenericPartitionBoundaries<T>, int, String) - Constructor for class org.apache.datasketches.partitions.Partitioner.StackElement
+
 
+
start() - Method in class org.apache.datasketches.cpc.CompressionCharacterization
+
 
+
start() - Method in class org.apache.datasketches.cpc.MergingValidation
+
 
+
start() - Method in class org.apache.datasketches.cpc.QuickMergingValidation
+
 
+
start() - Method in class org.apache.datasketches.cpc.StreamingValidation
+
 
+
startingSubMultiple(int, int, int) - Static method in class org.apache.datasketches.thetacommon.ThetaUtil
+
+
Gets the smallest allowed exponent of 2 that it is a sub-multiple of the target by zero, + one or more resize factors.
+
+
StreamingValidation - Class in org.apache.datasketches.cpc
+
+
This code is used both by unit tests, for short running tests, + and by the characterization repository for longer running, more exhaustive testing.
+
+
StreamingValidation(int, int, int, int, PrintStream, PrintWriter) - Constructor for class org.apache.datasketches.cpc.StreamingValidation
+
 
+
STRIDE_MASK - Static variable in class org.apache.datasketches.thetacommon.HashOperations
+
+
The stride mask for the Open Address, Double Hashing (OADH) hash table algorithm.
+
+
stringArrHash(String[]) - Static method in class org.apache.datasketches.tuple.Util
+
 
+
stringConcat(String[]) - Static method in class org.apache.datasketches.tuple.Util
+
+
Concatenate array of Strings to a single String.
+
+
stringHash(String) - Static method in class org.apache.datasketches.tuple.Util
+
 
+
stringToByteArray(String) - Static method in class org.apache.datasketches.tuple.Util
+
+
Converts a String to a UTF_8 byte array.
+
+
stringToFamily(String) - Static method in enum org.apache.datasketches.common.Family
+
+
Returns the Family given the family name
+
+
Sum - org.apache.datasketches.tuple.adouble.DoubleSummary.Mode
+
+
The aggregation mode is the summation function.
+
+
Sum - org.apache.datasketches.tuple.aninteger.IntegerSummary.Mode
+
+
The aggregation mode is the summation function.
+
+
Summary - Interface in org.apache.datasketches.tuple
+
+
Interface for user-defined Summary, which is associated with every hash in a tuple sketch
+
+
SummaryDeserializer<S extends Summary> - Interface in org.apache.datasketches.tuple
+
+
Interface for deserializing user-defined Summary
+
+
SummaryFactory<S extends Summary> - Interface in org.apache.datasketches.tuple
+
+
Interface for user-defined SummaryFactory
+
+
summaryFactory_ - Variable in class org.apache.datasketches.tuple.Sketch
+
 
+
SummarySetOperations<S extends Summary> - Interface in org.apache.datasketches.tuple
+
+
This is to provide methods of producing unions and intersections of two Summary objects.
+
+
SuppressFBWarnings - Annotation Type in org.apache.datasketches.common
+
+
Used to suppress SpotBug warnings.
+
+
+ + + +

T

+
+
TAB - Static variable in class org.apache.datasketches.common.Util
+
+
The tab character
+
+
tailRoundingFactor - Static variable in class org.apache.datasketches.quantilescommon.QuantilesUtil
+
 
+
TestUtil - Class in org.apache.datasketches.cpc
+
 
+
TestUtil() - Constructor for class org.apache.datasketches.cpc.TestUtil
+
 
+
TGT_IS_READ_ONLY_MSG - Static variable in interface org.apache.datasketches.quantilescommon.QuantilesAPI
+
 
+
TgtHllType - Enum in org.apache.datasketches.hll
+
+
Specifies the target type of HLL sketch to be created.
+
+
ThetaUtil - Class in org.apache.datasketches.thetacommon
+
+
Utility methods for the Theta Family of sketches
+
+
toByteArray() - Method in class org.apache.datasketches.cpc.CpcSketch
+
+
Return this sketch as a compressed byte array.
+
+
toByteArray() - Method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Returns a byte array representation of this sketch
+
+
toByteArray() - Method in class org.apache.datasketches.kll.KllDoublesSketch
+
 
+
toByteArray() - Method in class org.apache.datasketches.kll.KllFloatsSketch
+
 
+
toByteArray() - Method in class org.apache.datasketches.kll.KllItemsSketch
+
 
+
toByteArray() - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
toByteArray() - Method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Serialize this union to a byte array.
+
+
toByteArray() - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
Returns a byte array representation of this sketch.
+
+
toByteArray() - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
Returns a byte array representation of this sketch.
+
+
toByteArray() - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
toByteArray() - Method in class org.apache.datasketches.sampling.ReservoirLongsSketch
+
+
Returns a byte array representation of this sketch
+
+
toByteArray() - Method in class org.apache.datasketches.sampling.ReservoirLongsUnion
+
+
Returns a byte array representation of this union
+
+
toByteArray() - Method in class org.apache.datasketches.theta.Intersection
+
+
Serialize this intersection to a byte array form.
+
+
toByteArray() - Method in class org.apache.datasketches.theta.Sketch
+
+
Serialize this sketch to a byte array form.
+
+
toByteArray() - Method in class org.apache.datasketches.theta.Union
+
+
Returns a byte array image of this Union object
+
+
toByteArray() - Method in class org.apache.datasketches.tuple.adouble.DoubleSummary
+
 
+
toByteArray() - Method in class org.apache.datasketches.tuple.aninteger.IntegerSummary
+
 
+
toByteArray() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
 
+
toByteArray() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUnion
+
 
+
toByteArray() - Method in class org.apache.datasketches.tuple.CompactSketch
+
 
+
toByteArray() - Method in class org.apache.datasketches.tuple.Sketch
+
+
This is to serialize a sketch instance to a byte array.
+
+
toByteArray() - Method in class org.apache.datasketches.tuple.strings.ArrayOfStringsSummary
+
 
+
toByteArray() - Method in interface org.apache.datasketches.tuple.Summary
+
+
This is to serialize a Summary instance to a byte array.
+
+
toByteArray(boolean) - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Serialize this sketch in a byte array form.
+
+
toByteArray(boolean, ArrayOfItemsSerDe<T>) - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
+
Serialize this sketch to a byte array form.
+
+
toByteArray(ArrayOfItemsSerDe<? super T>) - Method in class org.apache.datasketches.sampling.ReservoirItemsSketch
+
+
Returns a byte array representation of this sketch.
+
+
toByteArray(ArrayOfItemsSerDe<? super T>) - Method in class org.apache.datasketches.sampling.VarOptItemsSketch
+
+
Returns a byte array representation of this sketch.
+
+
toByteArray(ArrayOfItemsSerDe<? super T>, Class<?>) - Method in class org.apache.datasketches.sampling.ReservoirItemsSketch
+
+
Returns a byte array representation of this sketch.
+
+
toByteArray(ArrayOfItemsSerDe<? super T>, Class<?>) - Method in class org.apache.datasketches.sampling.VarOptItemsSketch
+
+
Returns a byte array representation of this sketch.
+
+
toByteArray(ArrayOfItemsSerDe<T>) - Method in class org.apache.datasketches.frequencies.ItemsSketch
+
+
Returns a byte array representation of this sketch
+
+
toByteArray(ArrayOfItemsSerDe<T>) - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
+
Serialize this sketch to a byte array form.
+
+
toByteArray(ArrayOfItemsSerDe<T>) - Method in class org.apache.datasketches.quantiles.ItemsUnion
+
+
Serialize this union to a byte array.
+
+
toByteArray(ArrayOfItemsSerDe<T>) - Method in class org.apache.datasketches.sampling.ReservoirItemsUnion
+
+
Returns a byte array representation of this union
+
+
toByteArray(ArrayOfItemsSerDe<T>) - Method in class org.apache.datasketches.sampling.VarOptItemsUnion
+
+
Returns a byte array representation of this union
+
+
toByteArray(ArrayOfItemsSerDe<T>, Class<?>) - Method in class org.apache.datasketches.sampling.ReservoirItemsUnion
+
+
Returns a byte array representation of this union.
+
+
toByteArray(ArrayOfItemsSerDe<T>, Class<?>) - Method in class org.apache.datasketches.sampling.VarOptItemsUnion
+
+
Returns a byte array representation of this union.
+
+
toByteArrayCompressed() - Method in class org.apache.datasketches.theta.CompactSketch
+
 
+
toCompactByteArray() - Method in class org.apache.datasketches.hll.HllSketch
+
 
+
toCompactByteArray() - Method in class org.apache.datasketches.hll.Union
+
+
Gets the serialization of this union operator as a byte array in compact form, which is + designed to be heapified only.
+
+
toString() - Method in enum org.apache.datasketches.common.Family
+
 
+
toString() - Method in class org.apache.datasketches.cpc.CpcSketch
+
+
Return a human-readable string summary of this sketch
+
+
toString() - Method in class org.apache.datasketches.fdt.Group
+
 
+
toString() - Method in class org.apache.datasketches.frequencies.ItemsSketch.Row
+
 
+
toString() - Method in class org.apache.datasketches.frequencies.ItemsSketch
+
+
Returns a human readable summary of this sketch.
+
+
toString() - Method in class org.apache.datasketches.frequencies.LongsSketch.Row
+
 
+
toString() - Method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Returns a human readable summary of this sketch.
+
+
toString() - Method in class org.apache.datasketches.hllmap.UniqueCountMap
+
+
Returns a string with a human-readable summary of the UniqueCountMap and all the internal maps
+
+
toString() - Method in class org.apache.datasketches.kll.KllSketch
+
 
+
toString() - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
 
+
toString() - Method in class org.apache.datasketches.quantiles.DoublesSketchBuilder
+
+
Creates a human readable string that describes the current configuration of this builder.
+
+
toString() - Method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Returns summary information about the backing sketch.
+
+
toString() - Method in class org.apache.datasketches.quantiles.ItemsUnion
+
+
Returns summary information about the backing sketch.
+
+
toString() - Method in interface org.apache.datasketches.quantilescommon.QuantilesAPI
+
+
Returns a summary of the key parameters of the sketch.
+
+
toString() - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
toString() - Method in class org.apache.datasketches.req.ReqSketchBuilder
+
 
+
toString() - Method in class org.apache.datasketches.sampling.ReservoirItemsSketch
+
+
Returns a human-readable summary of the sketch, without items.
+
+
toString() - Method in class org.apache.datasketches.sampling.ReservoirItemsUnion
+
+
Returns a human-readable summary of the sketch, without items.
+
+
toString() - Method in class org.apache.datasketches.sampling.ReservoirLongsSketch
+
+
Returns a human-readable summary of the sketch, without items.
+
+
toString() - Method in class org.apache.datasketches.sampling.ReservoirLongsUnion
+
+
Returns a human-readable summary of the sketch, without items.
+
+
toString() - Method in class org.apache.datasketches.sampling.VarOptItemsSketch
+
+
Returns a human-readable summary of the sketch.
+
+
toString() - Method in class org.apache.datasketches.sampling.VarOptItemsUnion
+
+
Returns a human-readable summary of the sketch, without items.
+
+
toString() - Method in class org.apache.datasketches.theta.SetOperationBuilder
+
 
+
toString() - Method in class org.apache.datasketches.theta.Sketch
+
+
Returns a human readable summary of the sketch.
+
+
toString() - Method in class org.apache.datasketches.theta.UpdateSketchBuilder
+
 
+
toString() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
 
+
toString() - Method in class org.apache.datasketches.tuple.Sketch
+
 
+
toString(boolean) - Method in class org.apache.datasketches.cpc.CpcSketch
+
+
Return a human-readable string summary of this sketch
+
+
toString(boolean, boolean) - Method in class org.apache.datasketches.kll.KllDoublesSketch
+
 
+
toString(boolean, boolean) - Method in class org.apache.datasketches.kll.KllFloatsSketch
+
 
+
toString(boolean, boolean) - Method in class org.apache.datasketches.kll.KllItemsSketch
+
 
+
toString(boolean, boolean) - Method in class org.apache.datasketches.kll.KllSketch
+
+
Returns a summary of the sketch as a string.
+
+
toString(boolean, boolean) - Method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Returns summary information about this sketch.
+
+
toString(boolean, boolean) - Method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Returns summary information about the backing sketch.
+
+
toString(boolean, boolean) - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
+
Returns summary information about this sketch.
+
+
toString(boolean, boolean) - Method in class org.apache.datasketches.quantiles.ItemsUnion
+
+
Returns summary information about the backing sketch.
+
+
toString(boolean, boolean, boolean, boolean) - Method in class org.apache.datasketches.hll.HllSketch
+
 
+
toString(boolean, boolean, boolean, boolean) - Method in class org.apache.datasketches.hll.Union
+
 
+
toString(boolean, boolean, int, boolean) - Method in class org.apache.datasketches.theta.Sketch
+
+
Gets a human readable listing of contents and summary of the given sketch.
+
+
toString(byte[]) - Static method in class org.apache.datasketches.frequencies.ItemsSketch
+
+
Returns a human readable string of the preamble of a byte array image of a ItemsSketch.
+
+
toString(byte[]) - Static method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Returns a human readable string of the preamble of a byte array image of a LongsSketch.
+
+
toString(byte[]) - Static method in class org.apache.datasketches.hll.HllSketch
+
+
Returns a human readable string of the preamble of a byte array image of an HllSketch.
+
+
toString(byte[]) - Static method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Returns a human readable string of the preamble of a byte array image of a DoublesSketch.
+
+
toString(byte[]) - Static method in class org.apache.datasketches.quantiles.ItemsSketch
+
+
Returns a human readable string of the preamble of a byte array image of an ItemsSketch.
+
+
toString(byte[]) - Static method in class org.apache.datasketches.sampling.ReservoirItemsSketch
+
+
Returns a human readable string of the preamble of a byte array image of a ReservoirItemsSketch.
+
+
toString(byte[]) - Static method in class org.apache.datasketches.sampling.ReservoirLongsSketch
+
+
Returns a human readable string of the preamble of a byte array image of a ReservoirLongsSketch.
+
+
toString(byte[]) - Static method in class org.apache.datasketches.sampling.VarOptItemsSketch
+
+
Returns a human readable string of the preamble of a byte array image of a VarOptItemsSketch.
+
+
toString(byte[]) - Static method in class org.apache.datasketches.theta.Sketch
+
+
Returns a human readable string of the preamble of a byte array image of a Theta Sketch.
+
+
toString(byte[], boolean) - Static method in class org.apache.datasketches.cpc.CpcSketch
+
+
Returns a human readable string of the preamble of a byte array image of a CpcSketch.
+
+
toString(Boolean) - Method in class org.apache.datasketches.common.ArrayOfBooleansSerDe
+
 
+
toString(Double) - Method in class org.apache.datasketches.common.ArrayOfDoublesSerDe
+
 
+
toString(Long) - Method in class org.apache.datasketches.common.ArrayOfLongsSerDe
+
 
+
toString(Number) - Method in class org.apache.datasketches.common.ArrayOfNumbersSerDe
+
 
+
toString(String) - Method in class org.apache.datasketches.common.ArrayOfStringsSerDe
+
 
+
toString(String) - Method in class org.apache.datasketches.common.ArrayOfUtf16StringsSerDe
+
 
+
toString(Memory) - Static method in class org.apache.datasketches.frequencies.ItemsSketch
+
+
Returns a human readable string of the preamble of a Memory image of a ItemsSketch.
+
+
toString(Memory) - Static method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Returns a human readable string of the preamble of a Memory image of a LongsSketch.
+
+
toString(Memory) - Static method in class org.apache.datasketches.hll.HllSketch
+
+
Returns a human readable string of the preamble of a Memory image of an HllSketch.
+
+
toString(Memory) - Static method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Returns a human readable string of the preamble of a Memory image of a DoublesSketch.
+
+
toString(Memory) - Static method in class org.apache.datasketches.quantiles.ItemsSketch
+
+
Returns a human readable string of the preamble of a Memory image of an ItemsSketch.
+
+
toString(Memory) - Static method in class org.apache.datasketches.sampling.ReservoirItemsSketch
+
+
Returns a human readable string of the preamble of a Memory image of a ReservoirItemsSketch.
+
+
toString(Memory) - Static method in class org.apache.datasketches.sampling.ReservoirLongsSketch
+
+
Returns a human readable string of the preamble of a Memory image of a ReservoirLongsSketch.
+
+
toString(Memory) - Static method in class org.apache.datasketches.sampling.VarOptItemsSketch
+
+
Returns a human readable string of the preamble of a Memory image of a VarOptItemsSketch.
+
+
toString(Memory) - Static method in class org.apache.datasketches.theta.Sketch
+
+
Returns a human readable string of the preamble of a Memory image of a Theta Sketch.
+
+
toString(Memory, boolean) - Static method in class org.apache.datasketches.cpc.CpcSketch
+
+
Returns a human readable string of the preamble of a Memory image of a CpcSketch.
+
+
toString(T) - Method in class org.apache.datasketches.common.ArrayOfItemsSerDe
+
+
Returns a human readable string of an item.
+
+
totalN - Variable in class org.apache.datasketches.quantilescommon.SortedViewIterator
+
 
+
toUpdatableByteArray() - Method in class org.apache.datasketches.hll.HllSketch
+
 
+
toUpdatableByteArray() - Method in class org.apache.datasketches.hll.Union
+
 
+
trim() - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch
+
+
Rebuilds reducing the actual number of entries to the nominal number of entries if needed
+
+
TRIM_A - org.apache.datasketches.thetacommon.SetOperationCornerCases.AnotbAction
+
 
+
TRIM_A - org.apache.datasketches.thetacommon.SetOperationCornerCases.UnionAction
+
 
+
TRIM_B - org.apache.datasketches.thetacommon.SetOperationCornerCases.UnionAction
+
 
+
TUPLE - org.apache.datasketches.common.Family
+
+
The Tuple family of sketches is a large family of sketches that are extensions of the + Theta Sketch Framework.
+
+
TupleSketchIterator<S extends Summary> - Class in org.apache.datasketches.tuple
+
+
Iterator over a generic tuple sketch
+
+
+ + + +

U

+
+
union(Memory) - Method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Iterative union operation, which means this method can be repeatedly called.
+
+
union(Memory) - Method in class org.apache.datasketches.theta.Union
+
+
Perform a Union operation with this union and the given Memory image of any sketch of the + Theta Family.
+
+
union(Memory, ArrayOfItemsSerDe<T>) - Method in class org.apache.datasketches.quantiles.ItemsUnion
+
+
Iterative union operation, which means this method can be repeatedly called.
+
+
union(DoublesSketch) - Method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Iterative union operation, which means this method can be repeatedly called.
+
+
union(ItemsSketch<T>) - Method in class org.apache.datasketches.quantiles.ItemsUnion
+
+
Iterative union operation, which means this method can be repeatedly called.
+
+
union(Sketch) - Method in class org.apache.datasketches.theta.Union
+
+
Perform a Union operation with this union and the given on-heap sketch of the Theta Family.
+
+
union(Sketch, Sketch) - Method in class org.apache.datasketches.theta.Union
+
+
This implements a stateless, pair-wise union operation.
+
+
union(Sketch, Sketch, boolean, WritableMemory) - Method in class org.apache.datasketches.theta.Union
+
+
This implements a stateless, pair-wise union operation.
+
+
union(Sketch, S) - Method in class org.apache.datasketches.tuple.Union
+
+
Performs a stateful union of the internal set with the given thetaSketch by combining entries + using the hashes from the theta sketch and summary values from the given summary.
+
+
union(DoubleSummary, DoubleSummary) - Method in class org.apache.datasketches.tuple.adouble.DoubleSummarySetOperations
+
 
+
union(IntegerSummary, IntegerSummary) - Method in class org.apache.datasketches.tuple.aninteger.IntegerSummarySetOperations
+
 
+
union(ArrayOfDoublesSketch) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUnion
+
+
Updates the union by adding a set of entries from a given sketch, which can be on-heap or off-heap.
+
+
union(Sketch<S>) - Method in class org.apache.datasketches.tuple.Union
+
+
Performs a stateful union of the internal set with the given tupleSketch.
+
+
union(Sketch<S>, Sketch, S) - Method in class org.apache.datasketches.tuple.Union
+
+
Perform a stateless, pair-wise union operation between a tupleSketch and a thetaSketch.
+
+
union(Sketch<S>, Sketch<S>) - Method in class org.apache.datasketches.tuple.Union
+
+
Perform a stateless, pair-wise union operation between two tuple sketches.
+
+
union(ArrayOfStringsSummary, ArrayOfStringsSummary) - Method in class org.apache.datasketches.tuple.strings.ArrayOfStringsSummarySetOperations
+
 
+
union(S, S) - Method in interface org.apache.datasketches.tuple.SummarySetOperations
+
+
This is called by the union operator when both sketches have the same hash value.
+
+
Union - Class in org.apache.datasketches.hll
+
+
This performs union operations for all HllSketches.
+
+
Union - Class in org.apache.datasketches.theta
+
+
Compute the union of two or more theta sketches.
+
+
Union<S extends Summary> - Class in org.apache.datasketches.tuple
+
+
Compute the union of two or more generic tuple sketches or generic tuple sketches combined with + theta sketches.
+
+
Union() - Constructor for class org.apache.datasketches.hll.Union
+
+
Construct this Union operator with the default maximum log-base-2 of K.
+
+
Union() - Constructor for class org.apache.datasketches.theta.Union
+
 
+
Union(int) - Constructor for class org.apache.datasketches.hll.Union
+
+
Construct this Union operator with a given maximum log-base-2 of K.
+
+
Union(int, WritableMemory) - Constructor for class org.apache.datasketches.hll.Union
+
+
Construct this Union operator with a given maximum log-base-2 of K and the given + WritableMemory as the destination for this Union.
+
+
Union(int, SummarySetOperations<S>) - Constructor for class org.apache.datasketches.tuple.Union
+
+
Creates new Union instance.
+
+
Union(SummarySetOperations<S>) - Constructor for class org.apache.datasketches.tuple.Union
+
+
Creates new Union instance with instructions on how to process two summaries that + overlap.
+
+
UNION - org.apache.datasketches.common.Family
+
+
The Union family is an operation for the Theta Sketch Framework of sketches.
+
+
UniqueCountMap - Class in org.apache.datasketches.hllmap
+
+
This is a real-time, key-value HLL mapping sketch that tracks approximate unique counts of + identifiers (the values) associated with each key.
+
+
UniqueCountMap(int) - Constructor for class org.apache.datasketches.hllmap.UniqueCountMap
+
+
Constructs a UniqueCountMap with an initial capacity of one million entries.
+
+
UniqueCountMap(int, int) - Constructor for class org.apache.datasketches.hllmap.UniqueCountMap
+
+
Constructs a UniqueCountMap with a given initial number of entries.
+
+
unpackBits(long[], int, int, byte[], int, int) - Static method in class org.apache.datasketches.theta.BitPacking
+
 
+
UNSUPPORTED_MSG - Static variable in interface org.apache.datasketches.quantilescommon.QuantilesAPI
+
 
+
UPDATABLE - org.apache.datasketches.kll.KllSketch.SketchStructure
+
 
+
UpdatableSketch<U,​S extends UpdatableSummary<U>> - Class in org.apache.datasketches.tuple
+
+
An extension of QuickSelectSketch<S>, which can be updated with many types of keys.
+
+
UpdatableSketch(int, int, float, SummaryFactory<S>) - Constructor for class org.apache.datasketches.tuple.UpdatableSketch
+
+
This is to create a new instance of an UpdatableQuickSelectSketch.
+
+
UpdatableSketch(Memory, SummaryDeserializer<S>, SummaryFactory<S>) - Constructor for class org.apache.datasketches.tuple.UpdatableSketch
+
+
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.
+
+
+
UpdatableSketch(UpdatableSketch<U, S>) - Constructor for class org.apache.datasketches.tuple.UpdatableSketch
+
+
Copy Constructor
+
+
UpdatableSketchBuilder<U,​S extends UpdatableSummary<U>> - Class in org.apache.datasketches.tuple
+
+
For building a new generic tuple UpdatableSketch
+
+
UpdatableSketchBuilder(SummaryFactory<S>) - Constructor for class org.apache.datasketches.tuple.UpdatableSketchBuilder
+
+
Creates an instance of UpdatableSketchBuilder with default parameters
+
+
UpdatableSummary<U> - Interface in org.apache.datasketches.tuple
+
+
Interface for updating user-defined Summary
+
+
update(byte[]) - Method in class org.apache.datasketches.cpc.CpcSketch
+
+
Present the given byte array as a potential unique item.
+
+
update(byte[]) - Method in class org.apache.datasketches.theta.Union
+
+
Update this union with the given byte array item.
+
+
update(byte[]) - Method in class org.apache.datasketches.theta.UpdateSketch
+
+
Present this sketch with the given byte array.
+
+
update(byte[], byte[]) - Method in class org.apache.datasketches.hllmap.UniqueCountMap
+
+
Updates the map with a given key and identifier and returns the estimate of the number of + unique identifiers encountered so far for the given key.
+
+
update(byte[], double[]) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch
+
+
Updates this sketch with a byte[] key and double values.
+
+
update(byte[], U) - Method in class org.apache.datasketches.tuple.UpdatableSketch
+
+
Updates this sketch with a byte[] key and U value.
+
+
update(char[]) - Method in class org.apache.datasketches.cpc.CpcSketch
+
+
Present the given char array as a potential unique item.
+
+
update(char[]) - Method in class org.apache.datasketches.theta.Union
+
+
Update this union with the given char array item.
+
+
update(char[]) - Method in class org.apache.datasketches.theta.UpdateSketch
+
+
Present this sketch with the given char array.
+
+
update(double) - Method in class org.apache.datasketches.cpc.CpcSketch
+
+
Present the given double (or float) datum as a potential unique item.
+
+
update(double) - Method in class org.apache.datasketches.kll.KllDoublesSketch
+
 
+
update(double) - Method in class org.apache.datasketches.quantiles.CompactDoublesSketch
+
 
+
update(double) - Method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Update this union with the given double (or float) data Item.
+
+
update(double) - Method in class org.apache.datasketches.quantiles.UpdateDoublesSketch
+
+
Updates this sketch with the given double data item
+
+
update(double) - Method in interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI
+
+
Updates this sketch with the given item.
+
+
update(double) - Method in class org.apache.datasketches.theta.Union
+
+
Update this union with the given double (or float) data item.
+
+
update(double) - Method in class org.apache.datasketches.theta.UpdateSketch
+
+
Present this sketch with the given double (or float) datum.
+
+
update(double, double[]) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch
+
+
Updates this sketch with a double key and double values.
+
+
update(double, U) - Method in class org.apache.datasketches.tuple.UpdatableSketch
+
+
Updates this sketch with a double key and U value.
+
+
update(float) - Method in class org.apache.datasketches.kll.KllFloatsSketch
+
 
+
update(float) - Method in interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI
+
+
Updates this sketch with the given item.
+
+
update(float) - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
update(int[]) - Method in class org.apache.datasketches.cpc.CpcSketch
+
+
Present the given integer array as a potential unique item.
+
+
update(int[]) - Method in class org.apache.datasketches.theta.Union
+
+
Update this union with the given integer array item.
+
+
update(int[]) - Method in class org.apache.datasketches.theta.UpdateSketch
+
+
Present this sketch with the given integer array.
+
+
update(int[], double[]) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch
+
+
Updates this sketch with a int[] key and double values.
+
+
update(int[], U) - Method in class org.apache.datasketches.tuple.UpdatableSketch
+
+
Updates this sketch with a int[] key and U value.
+
+
update(long) - Method in class org.apache.datasketches.cpc.CpcSketch
+
+
Present the given long as a potential unique item.
+
+
update(long) - Method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Update this sketch with an item and a frequency count of one.
+
+
update(long) - Method in class org.apache.datasketches.sampling.ReservoirLongsSketch
+
+
Randomly decide whether or not to include an item in the sample set.
+
+
update(long) - Method in class org.apache.datasketches.sampling.ReservoirLongsUnion
+
+
Present this union with a long.
+
+
update(long) - Method in class org.apache.datasketches.theta.Union
+
+
Update this union with the given long data item.
+
+
update(long) - Method in class org.apache.datasketches.theta.UpdateSketch
+
+
Present this sketch with a long.
+
+
update(long[]) - Method in class org.apache.datasketches.cpc.CpcSketch
+
+
Present the given long array as a potential unique item.
+
+
update(long[]) - Method in class org.apache.datasketches.theta.Union
+
+
Update this union with the given long array item.
+
+
update(long[]) - Method in class org.apache.datasketches.theta.UpdateSketch
+
+
Present this sketch with the given long array.
+
+
update(long[], double[]) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch
+
+
Updates this sketch with a long[] key and double values.
+
+
update(long[], U) - Method in class org.apache.datasketches.tuple.UpdatableSketch
+
+
Updates this sketch with a long[] key and U value.
+
+
update(long, double[]) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch
+
+
Updates this sketch with a long key and double values.
+
+
update(long, int, ArrayList<T>) - Method in class org.apache.datasketches.sampling.ReservoirItemsUnion
+
+
Present this union with raw elements of a sketch.
+
+
update(long, long) - Method in class org.apache.datasketches.frequencies.LongsSketch
+
+
Update this sketch with a item and a positive frequency count (or weight).
+
+
update(long, Double) - Method in class org.apache.datasketches.tuple.adouble.DoubleSketch
+
 
+
update(long, Integer) - Method in class org.apache.datasketches.tuple.aninteger.IntegerSketch
+
 
+
update(long, U) - Method in class org.apache.datasketches.tuple.UpdatableSketch
+
+
Updates this sketch with a long key and U value.
+
+
update(Double) - Method in class org.apache.datasketches.tuple.adouble.DoubleSummary
+
 
+
update(Integer) - Method in class org.apache.datasketches.tuple.aninteger.IntegerSummary
+
 
+
update(String) - Method in class org.apache.datasketches.cpc.CpcSketch
+
+
Present the given String as a potential unique item.
+
+
update(String) - Method in class org.apache.datasketches.theta.Union
+
+
Update this union with the with the given String data item.
+
+
update(String) - Method in class org.apache.datasketches.theta.UpdateSketch
+
+
Present this sketch with the given String.
+
+
update(String[]) - Method in class org.apache.datasketches.fdt.FdtSketch
+
+
Update the sketch with the given string array tuple.
+
+
update(String[]) - Method in class org.apache.datasketches.tuple.strings.ArrayOfStringsSummary
+
 
+
update(String[], String[]) - Method in class org.apache.datasketches.tuple.strings.ArrayOfStringsSketch
+
+
Updates the sketch with String arrays for both key and value.
+
+
update(String, double[]) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch
+
+
Updates this sketch with a String key and double values.
+
+
update(String, Double) - Method in class org.apache.datasketches.tuple.adouble.DoubleSketch
+
 
+
update(String, Integer) - Method in class org.apache.datasketches.tuple.aninteger.IntegerSketch
+
 
+
update(String, U) - Method in class org.apache.datasketches.tuple.UpdatableSketch
+
+
Updates this sketch with a String key and U value.
+
+
update(CpcSketch) - Method in class org.apache.datasketches.cpc.CpcUnion
+
+
Update this union with a CpcSketch.
+
+
update(HllSketch) - Method in class org.apache.datasketches.hll.Union
+
+
Update this union operator with the given sketch.
+
+
update(Memory) - Method in class org.apache.datasketches.sampling.ReservoirLongsUnion
+
+
Union the given Memory image of the sketch.
+
+
update(Memory, ArrayOfItemsSerDe<T>) - Method in class org.apache.datasketches.sampling.ReservoirItemsUnion
+
+
Union the given Memory image of the sketch.
+
+
update(Memory, ArrayOfItemsSerDe<T>) - Method in class org.apache.datasketches.sampling.VarOptItemsUnion
+
+
Union the given Memory image of the sketch.
+
+
update(ReservoirItemsSketch<T>) - Method in class org.apache.datasketches.sampling.ReservoirItemsUnion
+
+
Union the given sketch.
+
+
update(ReservoirItemsSketch<T>) - Method in class org.apache.datasketches.sampling.VarOptItemsUnion
+
+
Union a reservoir sketch.
+
+
update(ReservoirLongsSketch) - Method in class org.apache.datasketches.sampling.ReservoirLongsUnion
+
+
Union the given sketch.
+
+
update(VarOptItemsSketch<T>) - Method in class org.apache.datasketches.sampling.VarOptItemsUnion
+
+
Union the given sketch.
+
+
update(ArrayOfDoublesSketch, ArrayOfDoublesSketch) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesAnotB
+
+
Perform A-and-not-B set operation on the two given sketches.
+
+
update(ArrayOfDoublesSketch, ArrayOfDoublesSketch) - Method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesAnotBImpl
+
 
+
update(T) - Method in class org.apache.datasketches.frequencies.ItemsSketch
+
+
Update this sketch with an item and a frequency count of one.
+
+
update(T) - Method in class org.apache.datasketches.kll.KllItemsSketch
+
 
+
update(T) - Method in class org.apache.datasketches.quantiles.ItemsSketch
+
 
+
update(T) - Method in class org.apache.datasketches.quantiles.ItemsUnion
+
+
Update this union with the given dataItem.
+
+
update(T) - Method in interface org.apache.datasketches.quantilescommon.QuantilesGenericAPI
+
+
Updates this sketch with the given item.
+
+
update(T) - Method in class org.apache.datasketches.sampling.ReservoirItemsSketch
+
+
Randomly decide whether or not to include an item in the sample set.
+
+
update(T) - Method in class org.apache.datasketches.sampling.ReservoirItemsUnion
+
+
Present this union with a single item to be added to the union.
+
+
update(T, double) - Method in class org.apache.datasketches.sampling.VarOptItemsSketch
+
+
Randomly decide whether or not to include an item in the sample set.
+
+
update(T, long) - Method in class org.apache.datasketches.frequencies.ItemsSketch
+
+
Update this sketch with an item and a positive frequency count.
+
+
update(U) - Method in interface org.apache.datasketches.tuple.UpdatableSummary
+
+
This is to provide a method of updating summaries.
+
+
UpdateDoublesSketch - Class in org.apache.datasketches.quantiles
+
 
+
UpdateReturnState - Enum in org.apache.datasketches.theta
+
+ +
+
UpdateSketch - Class in org.apache.datasketches.theta
+
+
The parent class for the Update Sketch families, such as QuickSelect and Alpha.
+
+
updateSketchBuilder() - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
UpdateSketchBuilder - Class in org.apache.datasketches.theta
+
+
For building a new UpdateSketch.
+
+
UpdateSketchBuilder() - Constructor for class org.apache.datasketches.theta.UpdateSketchBuilder
+
+
Constructor for building a new UpdateSketch.
+
+
upperBound - Variable in class org.apache.datasketches.partitions.Partitioner.PartitionBoundsRow
+
 
+
Util - Class in org.apache.datasketches.common
+
+
Common utility functions.
+
+
Util - Class in org.apache.datasketches.tuple
+
+
Common utility functions for Tuples
+
+
Util() - Constructor for class org.apache.datasketches.tuple.Util
+
 
+
+ + + +

V

+
+
validate() - Method in class org.apache.datasketches.cpc.CpcSketch
+
+
Convience function that this Sketch is valid.
+
+
validateFamily(byte, byte) - Static method in class org.apache.datasketches.tuple.SerializerDeserializer
+
+
Validates the preamble-Longs value given the family ID
+
+
validateItems(T[], Comparator<? super T>) - Static method in interface org.apache.datasketches.quantilescommon.GenericSortedView
+
+
Checks the sequential validity of the given array of generic items.
+
+
validateType(byte, SerializerDeserializer.SketchType) - Static method in class org.apache.datasketches.tuple.SerializerDeserializer
+
+
Validates the sketch type byte versus the expected value
+
+
value() - Method in annotation type org.apache.datasketches.common.SuppressFBWarnings
+
+
A list of comma-separated, quoted SpotBugs warnings that are to be suppressed in the associated + annotated element.
+
+
valueOf(String) - Static method in enum org.apache.datasketches.common.Family
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.apache.datasketches.common.ResizeFactor
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.apache.datasketches.frequencies.ErrorType
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.apache.datasketches.hll.TgtHllType
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.apache.datasketches.kll.KllSketch.SketchStructure
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.apache.datasketches.kll.KllSketch.SketchType
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.apache.datasketches.partitions.BoundsRule
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.apache.datasketches.quantilescommon.GenericInequalitySearch.Inequality
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.apache.datasketches.quantilescommon.InequalitySearch
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.apache.datasketches.quantilescommon.QuantileSearchCriteria
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.apache.datasketches.theta.UpdateReturnState
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.apache.datasketches.thetacommon.SetOperationCornerCases.AnotbAction
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.apache.datasketches.thetacommon.SetOperationCornerCases.IntersectAction
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.apache.datasketches.thetacommon.SetOperationCornerCases.UnionAction
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.apache.datasketches.tuple.adouble.DoubleSummary.Mode
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.apache.datasketches.tuple.aninteger.IntegerSummary.Mode
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum org.apache.datasketches.tuple.SerializerDeserializer.SketchType
+
+
Returns the enum constant of this type with the specified name.
+
+
values() - Static method in enum org.apache.datasketches.common.Family
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.apache.datasketches.common.ResizeFactor
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.apache.datasketches.frequencies.ErrorType
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.apache.datasketches.hll.TgtHllType
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.apache.datasketches.kll.KllSketch.SketchStructure
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.apache.datasketches.kll.KllSketch.SketchType
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.apache.datasketches.partitions.BoundsRule
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.apache.datasketches.quantilescommon.GenericInequalitySearch.Inequality
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.apache.datasketches.quantilescommon.InequalitySearch
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.apache.datasketches.quantilescommon.QuantileSearchCriteria
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.apache.datasketches.theta.UpdateReturnState
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.apache.datasketches.thetacommon.SetOperationCornerCases.AnotbAction
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.apache.datasketches.thetacommon.SetOperationCornerCases.IntersectAction
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.apache.datasketches.thetacommon.SetOperationCornerCases.UnionAction
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.apache.datasketches.tuple.adouble.DoubleSummary.Mode
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.apache.datasketches.tuple.aninteger.IntegerSummary.Mode
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum org.apache.datasketches.tuple.SerializerDeserializer.SketchType
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
VAROPT - org.apache.datasketches.common.Family
+
+
The VarOpt family of sketches.
+
+
VAROPT_UNION - org.apache.datasketches.common.Family
+
+
The VarOpt family of sketches.
+
+
VarOptItemsSamples<T> - Class in org.apache.datasketches.sampling
+
+
This class provides access to the samples contained in a VarOptItemsSketch.
+
+
VarOptItemsSamples.VarOptItemsIterator - Class in org.apache.datasketches.sampling
+
+
The standard iterator
+
+
VarOptItemsSamples.WeightedSample - Class in org.apache.datasketches.sampling
+
+
A convenience class to allow easy iterator access to a VarOpt sample.
+
+
VarOptItemsSketch<T> - Class in org.apache.datasketches.sampling
+
+
This sketch provides a variance optimal sample over an input stream of weighted items.
+
+
VarOptItemsUnion<T> - Class in org.apache.datasketches.sampling
+
+
Provides a unioning operation over varopt sketches.
+
+
viewCompactorDetail(String, boolean) - Method in class org.apache.datasketches.req.ReqSketch
+
 
+
+ + + +

W

+
+
weight - Variable in class org.apache.datasketches.kll.KllSketchIterator
+
 
+
weights() - Method in class org.apache.datasketches.sampling.VarOptItemsSamples
+
+
Returns a copy of the array of weights contained in the sketch.
+
+
weights(int) - Method in class org.apache.datasketches.sampling.VarOptItemsSamples
+
+
Returns a single weight from the samples contained in the sketch.
+
+
wrap(Memory) - Static method in class org.apache.datasketches.hll.HllSketch
+
+
Wraps the given read-only Memory that must be a image of a valid sketch, + which may be in compact or updatable form, and should have data.
+
+
wrap(Memory) - Static method in class org.apache.datasketches.kll.KllDoublesSketch
+
+
Wrap a sketch around the given read only compact source Memory containing sketch data + that originated from this sketch.
+
+
wrap(Memory) - Static method in class org.apache.datasketches.kll.KllFloatsSketch
+
+
Wrap a sketch around the given read only compact source Memory containing sketch data + that originated from this sketch.
+
+
wrap(Memory) - Static method in class org.apache.datasketches.quantiles.DoublesSketch
+
+
Wrap this sketch around the given Memory image of a DoublesSketch, compact or updatable.
+
+
wrap(Memory) - Static method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Returns a read-only Union object that wraps off-heap data of the given memory image of + a sketch.
+
+
wrap(Memory) - Static method in class org.apache.datasketches.theta.CompactSketch
+
+
Wrap takes the CompactSketch image in given Memory and refers to it directly.
+
+
wrap(Memory) - Static method in class org.apache.datasketches.theta.SetOperation
+
+
Wrap takes the SetOperation image in Memory and refers to it directly.
+
+
wrap(Memory) - Static method in class org.apache.datasketches.theta.Sketch
+
+
Wrap takes the sketch image in the given Memory and refers to it directly.
+
+
wrap(Memory) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
+
Wrap the given Memory as an ArrayOfDoublesSketch
+
+
wrap(Memory) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUnion
+
+
Wrap the given Memory as an ArrayOfDoublesUnion
+
+
wrap(Memory, long) - Static method in class org.apache.datasketches.theta.CompactSketch
+
+
Wrap takes the sketch image in the given Memory and refers to it directly.
+
+
wrap(Memory, long) - Static method in class org.apache.datasketches.theta.SetOperation
+
+
Wrap takes the SetOperation image in Memory and refers to it directly.
+
+
wrap(Memory, long) - Static method in class org.apache.datasketches.theta.Sketch
+
+
Wrap takes the sketch image in the given Memory and refers to it directly.
+
+
wrap(Memory, long) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
+
+
Wrap the given Memory and seed as a ArrayOfDoublesSketch
+
+
wrap(Memory, long) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUnion
+
+
Wrap the given Memory and seed as an ArrayOfDoublesUnion
+
+
wrap(Memory, Comparator<? super T>, ArrayOfItemsSerDe<T>) - Static method in class org.apache.datasketches.kll.KllItemsSketch
+
+
Constructs a thin wrapper on the heap around a Memory (or WritableMemory) already initialized with a + validated sketch image of a type T consistent with the given comparator and serDe.
+
+
wrap(WritableMemory) - Static method in class org.apache.datasketches.quantiles.DoublesUnion
+
+
Returns an updatable Union object that wraps off-heap data of the given memory image of + a sketch.
+
+
wrap(WritableMemory) - Static method in class org.apache.datasketches.quantiles.UpdateDoublesSketch
+
+
Wrap this sketch around the given non-compact Memory image of a DoublesSketch.
+
+
wrap(WritableMemory) - Static method in class org.apache.datasketches.theta.SetOperation
+
+
Wrap takes the SetOperation image in Memory and refers to it directly.
+
+
wrap(WritableMemory) - Static method in class org.apache.datasketches.theta.UpdateSketch
+
+
Wrap takes the sketch image in Memory and refers to it directly.
+
+
wrap(WritableMemory) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUnion
+
+
Wrap the given WritableMemory as an ArrayOfDoublesUnion
+
+
wrap(WritableMemory) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch
+
+
Wrap the given WritableMemory as an ArrayOfDoublesUpdatableSketch
+
+
wrap(WritableMemory, long) - Static method in class org.apache.datasketches.theta.SetOperation
+
+
Wrap takes the SetOperation image in Memory and refers to it directly.
+
+
wrap(WritableMemory, long) - Static method in class org.apache.datasketches.theta.UpdateSketch
+
+
Wrap takes the sketch image in Memory and refers to it directly.
+
+
wrap(WritableMemory, long) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUnion
+
+
Wrap the given WritableMemory and seed as an ArrayOfDoublesUnion
+
+
wrap(WritableMemory, long) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch
+
+
Wrap the given WritableMemory and seed as a ArrayOfDoublesUpdatableSketch
+
+
wrapCompactSketch(Memory) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
wrapCompactSketch(Memory, long) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
wrapIntersection(Memory) - Static method in class org.apache.datasketches.theta.Sketches
+
+
Convenience method, calls SetOperation.wrap(Memory) and casts the result to a Intersection
+
+
wrapIntersection(WritableMemory) - Static method in class org.apache.datasketches.theta.Sketches
+
+
Convenience method, calls SetOperation.wrap(Memory) and casts the result to a Intersection
+
+
wrapSetOperation(Memory) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
wrapSetOperation(Memory, long) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
wrapSetOperation(WritableMemory) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
wrapSetOperation(WritableMemory, long) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
wrapSketch(Memory) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
wrapSketch(Memory) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches
+
+
Wrap the given Memory as an ArrayOfDoublesSketch
+
+
wrapSketch(Memory, long) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
wrapSketch(Memory, long) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches
+
+
Wrap the given Memory and seed as a ArrayOfDoublesSketch
+
+
wrapUnion(Memory) - Static method in class org.apache.datasketches.theta.Sketches
+
+
Convenience method, calls SetOperation.wrap(Memory) and casts the result to a Union
+
+
wrapUnion(Memory) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches
+
+
Wrap the given Memory as an ArrayOfDoublesUnion
+
+
wrapUnion(Memory, long) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches
+
+
Wrap the given Memory and seed as an ArrayOfDoublesUnion
+
+
wrapUnion(WritableMemory) - Static method in class org.apache.datasketches.theta.Sketches
+
+
Convenience method, calls SetOperation.wrap(Memory) and casts the result to a Union
+
+
wrapUnion(WritableMemory) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches
+
+
Wrap the given Memory as an ArrayOfDoublesUnion
+
+
wrapUnion(WritableMemory, long) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches
+
+
Wrap the given Memory and seed as an ArrayOfDoublesUnion
+
+
wrapUpdatableSketch(WritableMemory) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches
+
+
Wrap the given WritableMemory as an ArrayOfDoublesUpdatableSketch
+
+
wrapUpdatableSketch(WritableMemory, long) - Static method in class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches
+
+
Wrap the given WritableMemory and seed as a ArrayOfDoublesUpdatableSketch
+
+
wrapUpdateSketch(WritableMemory) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
wrapUpdateSketch(WritableMemory, long) - Static method in class org.apache.datasketches.theta.Sketches
+
+ +
+
writableWrap(WritableMemory) - Static method in class org.apache.datasketches.hll.HllSketch
+
+
Wraps the given WritableMemory, which must be a image of a valid updatable sketch, + and may have data.
+
+
writableWrap(WritableMemory) - Static method in class org.apache.datasketches.hll.Union
+
+
Wraps the given WritableMemory, which must be a image of a valid updatable HLL_8 sketch, + and may have data.
+
+
writableWrap(WritableMemory, MemoryRequestServer) - Static method in class org.apache.datasketches.kll.KllDoublesSketch
+
+
Wrap a sketch around the given source Writable Memory containing sketch data + that originated from this sketch.
+
+
writableWrap(WritableMemory, MemoryRequestServer) - Static method in class org.apache.datasketches.kll.KllFloatsSketch
+
+
Wrap a sketch around the given source Writable Memory containing sketch data + that originated from this sketch.
+
+
+ + + +

X

+
+
X1 - org.apache.datasketches.common.ResizeFactor
+
+
Do not resize.
+
+
X2 - org.apache.datasketches.common.ResizeFactor
+
+
Resize factor is 2.
+
+
X4 - org.apache.datasketches.common.ResizeFactor
+
+
Resize factor is 4.
+
+
X8 - org.apache.datasketches.common.ResizeFactor
+
+
Resize factor is 8.
+
+
XxHash - Class in org.apache.datasketches.hash
+
+
The XxHash is a fast, non-cryptographic, 64-bit hash function that has + excellent avalanche and 2-way bit independence properties.
+
+
XxHash() - Constructor for class org.apache.datasketches.hash.XxHash
+
 
+
+ + + +

Z

+
+
zeroPad(String, int) - Static method in class org.apache.datasketches.common.Util
+
+
Prepend the given string with zeros.
+
+
+A B C D E F G H I J K L M N O P Q R S T U V W X Z 
All Classes All Packages
+
+ + + diff --git a/docs/5.0.2/index.html b/docs/5.0.2/index.html new file mode 100644 index 000000000..d4f168806 --- /dev/null +++ b/docs/5.0.2/index.html @@ -0,0 +1,310 @@ + + + + + +Overview (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

datasketches-java 5.0.2 API

+
+
+

Sketching Core Library

+

Overview

+ +

The Sketching Core Library provides a range of stochastic streaming algorithms and closely + related java technologies that are particularly useful when integrating this technology into + systems that must deal with massive data. +

+ +

This library is divided into packages that constitute distinct groups of functionality:

+ +Note: In general, if the requirements or promises of any method's contract are not fulfilled +(that is, if there is a bug in either the method or its caller), +then an unchecked exception will be thrown. +The precise type of such an unchecked exception does not form part of any method's contract.
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Packages 
PackageDescription
org.apache.datasketches +
This package is the parent package for all sketch families and common code areas.
+
org.apache.datasketches.common +
This package is for common classes that may be used across all the sketch families.
+
org.apache.datasketches.cpc +
Compressed Probabilistic Counting sketch family
+
org.apache.datasketches.fdt +
Frequent Distinct Tuples Sketch
+
org.apache.datasketches.frequencies +
This package is dedicated to streaming algorithms that enable estimation of the + frequency of occurrence of items in a weighted multiset stream of items.
+
org.apache.datasketches.hash +
The hash package contains a high-performing and extended Java implementations + of Austin Appleby's 128-bit MurmurHash3 hash function originally coded in C.
+
org.apache.datasketches.hll +
The DataSketches™ HLL sketch family package
+
org.apache.datasketches.hllmap +
The hllmap package contains a space efficient HLL mapping sketch of keys to approximate unique + count of identifiers.
+
org.apache.datasketches.kll +
This package is for the implementations of the sketch algorithm developed by Zohar Karnin, Kevin Lang, + and Edo Liberty that is commonly referred to as the "KLL" sketch after the authors' last names.
+
org.apache.datasketches.partitions 
org.apache.datasketches.quantiles +
The quantiles package contains stochastic streaming algorithms that enable single-pass + analysis of the distribution of a stream of quantiles.
+
org.apache.datasketches.quantilescommon +
This package contains common tools and methods for the quantiles, kll and + req packages.
+
org.apache.datasketches.req +
This package is for the implementation of the Relative Error Quantiles sketch algorithm.
+
org.apache.datasketches.sampling +
This package is dedicated to streaming algorithms that enable fixed size, uniform sampling of + weighted and unweighted items from a stream.
+
org.apache.datasketches.theta +
The theta package contains the basic sketch classes that are members of the + Theta Sketch Framework.
+
org.apache.datasketches.thetacommon +
This package contains common tools and methods for the theta, + tuple, tuple/* and fdt packages.
+
org.apache.datasketches.tuple +
The tuple package contains a number of sketches based on the same + fundamental algorithms of the Theta Sketch Framework and extend these + concepts for whole new families of sketches.
+
org.apache.datasketches.tuple.adouble +
This package is for a generic implementation of the Tuple sketch for single Double value.
+
org.apache.datasketches.tuple.aninteger +
This package is for a generic implementation of the Tuple sketch for single Integer value.
+
org.apache.datasketches.tuple.arrayofdoubles +
This package is for a concrete implementation of the Tuple sketch for an array of double values.
+
org.apache.datasketches.tuple.strings +
This package is for a generic implementation of the Tuple sketch for single String value.
+
+
+
+ + + diff --git a/docs/5.0.2/jquery-ui.overrides.css b/docs/5.0.2/jquery-ui.overrides.css new file mode 100644 index 000000000..facf852c2 --- /dev/null +++ b/docs/5.0.2/jquery-ui.overrides.css @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active, +a.ui-button:active, +.ui-button:active, +.ui-button.ui-state-active:hover { + /* Overrides the color of selection used in jQuery UI */ + background: #F8981D; + border: 1px solid #F8981D; +} diff --git a/docs/5.0.2/jquery/external/jquery/jquery.js b/docs/5.0.2/jquery/external/jquery/jquery.js new file mode 100644 index 000000000..50937333b --- /dev/null +++ b/docs/5.0.2/jquery/external/jquery/jquery.js @@ -0,0 +1,10872 @@ +/*! + * jQuery JavaScript Library v3.5.1 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2020-05-04T22:49Z + */ +( function( global, factory ) { + + "use strict"; + + if ( typeof module === "object" && typeof module.exports === "object" ) { + + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info. + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 +// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode +// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common +// enough that all such attempts are guarded in a try block. +"use strict"; + +var arr = []; + +var getProto = Object.getPrototypeOf; + +var slice = arr.slice; + +var flat = arr.flat ? function( array ) { + return arr.flat.call( array ); +} : function( array ) { + return arr.concat.apply( [], array ); +}; + + +var push = arr.push; + +var indexOf = arr.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var fnToString = hasOwn.toString; + +var ObjectFunctionString = fnToString.call( Object ); + +var support = {}; + +var isFunction = function isFunction( obj ) { + + // Support: Chrome <=57, Firefox <=52 + // In some browsers, typeof returns "function" for HTML elements + // (i.e., `typeof document.createElement( "object" ) === "function"`). + // We don't want to classify *any* DOM node as a function. + return typeof obj === "function" && typeof obj.nodeType !== "number"; + }; + + +var isWindow = function isWindow( obj ) { + return obj != null && obj === obj.window; + }; + + +var document = window.document; + + + + var preservedScriptAttributes = { + type: true, + src: true, + nonce: true, + noModule: true + }; + + function DOMEval( code, node, doc ) { + doc = doc || document; + + var i, val, + script = doc.createElement( "script" ); + + script.text = code; + if ( node ) { + for ( i in preservedScriptAttributes ) { + + // Support: Firefox 64+, Edge 18+ + // Some browsers don't support the "nonce" property on scripts. + // On the other hand, just using `getAttribute` is not enough as + // the `nonce` attribute is reset to an empty string whenever it + // becomes browsing-context connected. + // See https://github.com/whatwg/html/issues/2369 + // See https://html.spec.whatwg.org/#nonce-attributes + // The `node.getAttribute` check was added for the sake of + // `jQuery.globalEval` so that it can fake a nonce-containing node + // via an object. + val = node[ i ] || node.getAttribute && node.getAttribute( i ); + if ( val ) { + script.setAttribute( i, val ); + } + } + } + doc.head.appendChild( script ).parentNode.removeChild( script ); + } + + +function toType( obj ) { + if ( obj == null ) { + return obj + ""; + } + + // Support: Android <=2.3 only (functionish RegExp) + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; +} +/* global Symbol */ +// Defining this global in .eslintrc.json would create a danger of using the global +// unguarded in another place, it seems safer to define global only for this module + + + +var + version = "3.5.1", + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + + // The jQuery object is actually just the init constructor 'enhanced' + // Need init if jQuery is called (just allow error to be thrown if not included) + return new jQuery.fn.init( selector, context ); + }; + +jQuery.fn = jQuery.prototype = { + + // The current version of jQuery being used + jquery: version, + + constructor: jQuery, + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + + // Return all the elements in a clean array + if ( num == null ) { + return slice.call( this ); + } + + // Return just the one element from the set + return num < 0 ? this[ num + this.length ] : this[ num ]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + each: function( callback ) { + return jQuery.each( this, callback ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map( this, function( elem, i ) { + return callback.call( elem, i, elem ); + } ) ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + even: function() { + return this.pushStack( jQuery.grep( this, function( _elem, i ) { + return ( i + 1 ) % 2; + } ) ); + }, + + odd: function() { + return this.pushStack( jQuery.grep( this, function( _elem, i ) { + return i % 2; + } ) ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: arr.sort, + splice: arr.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[ 0 ] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // Skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !isFunction( target ) ) { + target = {}; + } + + // Extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + + // Only deal with non-null/undefined values + if ( ( options = arguments[ i ] ) != null ) { + + // Extend the base object + for ( name in options ) { + copy = options[ name ]; + + // Prevent Object.prototype pollution + // Prevent never-ending loop + if ( name === "__proto__" || target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = Array.isArray( copy ) ) ) ) { + src = target[ name ]; + + // Ensure proper type for the source value + if ( copyIsArray && !Array.isArray( src ) ) { + clone = []; + } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { + clone = {}; + } else { + clone = src; + } + copyIsArray = false; + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend( { + + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + isPlainObject: function( obj ) { + var proto, Ctor; + + // Detect obvious negatives + // Use toString instead of jQuery.type to catch host objects + if ( !obj || toString.call( obj ) !== "[object Object]" ) { + return false; + } + + proto = getProto( obj ); + + // Objects with no prototype (e.g., `Object.create( null )`) are plain + if ( !proto ) { + return true; + } + + // Objects with prototype are plain iff they were constructed by a global Object function + Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; + return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; + }, + + isEmptyObject: function( obj ) { + var name; + + for ( name in obj ) { + return false; + } + return true; + }, + + // Evaluates a script in a provided context; falls back to the global one + // if not specified. + globalEval: function( code, options, doc ) { + DOMEval( code, { nonce: options && options.nonce }, doc ); + }, + + each: function( obj, callback ) { + var length, i = 0; + + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } else { + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } + + return obj; + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArrayLike( Object( arr ) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + return arr == null ? -1 : indexOf.call( arr, elem, i ); + }, + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + for ( ; j < len; j++ ) { + first[ i++ ] = second[ j ]; + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var length, value, + i = 0, + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArrayLike( elems ) ) { + length = elems.length; + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return flat( ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +} ); + +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; +} + +// Populate the class2type map +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), +function( _i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +} ); + +function isArrayLike( obj ) { + + // Support: real iOS 8.2 only (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = !!obj && "length" in obj && obj.length, + type = toType( obj ); + + if ( isFunction( obj ) || isWindow( obj ) ) { + return false; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.3.5 + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://js.foundation/ + * + * Date: 2020-03-14 + */ +( function( window ) { +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + nonnativeSelectorCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // Instance methods + hasOwn = ( {} ).hasOwnProperty, + arr = [], + pop = arr.pop, + pushNative = arr.push, + push = arr.push, + slice = arr.slice, + + // Use a stripped-down indexOf as it's faster than native + // https://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { + var i = 0, + len = list.length; + for ( ; i < len; i++ ) { + if ( list[ i ] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + + "ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + + // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram + identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + + // "Attribute values must be CSS identifiers [capture 5] + // or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + + whitespace + "*\\]", + + pseudos = ":(" + identifier + ")(?:\\((" + + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + + "*" ), + rdescend = new RegExp( whitespace + "|>" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + identifier + ")" ), + "CLASS": new RegExp( "^\\.(" + identifier + ")" ), + "TAG": new RegExp( "^(" + identifier + "|[*])" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rhtml = /HTML$/i, + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + + // CSS escapes + // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), + funescape = function( escape, nonHex ) { + var high = "0x" + escape.slice( 1 ) - 0x10000; + + return nonHex ? + + // Strip the backslash prefix from a non-hex escape sequence + nonHex : + + // Replace a hexadecimal escape sequence with the encoded Unicode code point + // Support: IE <=11+ + // For values outside the Basic Multilingual Plane (BMP), manually construct a + // surrogate pair + high < 0 ? + String.fromCharCode( high + 0x10000 ) : + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // CSS string/identifier serialization + // https://drafts.csswg.org/cssom/#common-serializing-idioms + rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, + fcssescape = function( ch, asCodePoint ) { + if ( asCodePoint ) { + + // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER + if ( ch === "\0" ) { + return "\uFFFD"; + } + + // Control characters and (dependent upon position) numbers get escaped as code points + return ch.slice( 0, -1 ) + "\\" + + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; + } + + // Other potentially-special ASCII characters get backslash-escaped + return "\\" + ch; + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); + }, + + inDisabledFieldset = addCombinator( + function( elem ) { + return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; + }, + { dir: "parentNode", next: "legend" } + ); + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + ( arr = slice.call( preferredDoc.childNodes ) ), + preferredDoc.childNodes + ); + + // Support: Android<4.0 + // Detect silently failing push.apply + // eslint-disable-next-line no-unused-expressions + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + pushNative.apply( target, slice.call( els ) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + + // Can't trust NodeList.length + while ( ( target[ j++ ] = els[ i++ ] ) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var m, i, elem, nid, match, groups, newSelector, + newContext = context && context.ownerDocument, + + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; + + results = results || []; + + // Return early from calls with invalid selector or context + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + + return results; + } + + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { + setDocument( context ); + context = context || document; + + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { + + // ID selector + if ( ( m = match[ 1 ] ) ) { + + // Document context + if ( nodeType === 9 ) { + if ( ( elem = context.getElementById( m ) ) ) { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + + // Element context + } else { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( newContext && ( elem = newContext.getElementById( m ) ) && + contains( context, elem ) && + elem.id === m ) { + + results.push( elem ); + return results; + } + } + + // Type selector + } else if ( match[ 2 ] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Class selector + } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && + context.getElementsByClassName ) { + + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // Take advantage of querySelectorAll + if ( support.qsa && + !nonnativeSelectorCache[ selector + " " ] && + ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && + + // Support: IE 8 only + // Exclude object elements + ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { + + newSelector = selector; + newContext = context; + + // qSA considers elements outside a scoping root when evaluating child or + // descendant combinators, which is not what we want. + // In such cases, we work around the behavior by prefixing every selector in the + // list with an ID selector referencing the scope context. + // The technique has to be used as well when a leading combinator is used + // as such selectors are not recognized by querySelectorAll. + // Thanks to Andrew Dupont for this technique. + if ( nodeType === 1 && + ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; + + // We can use :scope instead of the ID hack if the browser + // supports it & if we're not changing the context. + if ( newContext !== context || !support.scope ) { + + // Capture the context ID, setting it first if necessary + if ( ( nid = context.getAttribute( "id" ) ) ) { + nid = nid.replace( rcssescape, fcssescape ); + } else { + context.setAttribute( "id", ( nid = expando ) ); + } + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + while ( i-- ) { + groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + + toSelector( groups[ i ] ); + } + newSelector = groups.join( "," ); + } + + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + nonnativeSelectorCache( selector, true ); + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {function(string, object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return ( cache[ key + " " ] = value ); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created element and returns a boolean result + */ +function assert( fn ) { + var el = document.createElement( "fieldset" ); + + try { + return !!fn( el ); + } catch ( e ) { + return false; + } finally { + + // Remove from its parent by default + if ( el.parentNode ) { + el.parentNode.removeChild( el ); + } + + // release memory in IE + el = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split( "|" ), + i = arr.length; + + while ( i-- ) { + Expr.attrHandle[ arr[ i ] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + a.sourceIndex - b.sourceIndex; + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( ( cur = cur.nextSibling ) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return ( name === "input" || name === "button" ) && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for :enabled/:disabled + * @param {Boolean} disabled true for :disabled; false for :enabled + */ +function createDisabledPseudo( disabled ) { + + // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable + return function( elem ) { + + // Only certain elements can match :enabled or :disabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled + if ( "form" in elem ) { + + // Check for inherited disabledness on relevant non-disabled elements: + // * listed form-associated elements in a disabled fieldset + // https://html.spec.whatwg.org/multipage/forms.html#category-listed + // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled + // * option elements in a disabled optgroup + // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled + // All such elements have a "form" property. + if ( elem.parentNode && elem.disabled === false ) { + + // Option elements defer to a parent optgroup if present + if ( "label" in elem ) { + if ( "label" in elem.parentNode ) { + return elem.parentNode.disabled === disabled; + } else { + return elem.disabled === disabled; + } + } + + // Support: IE 6 - 11 + // Use the isDisabled shortcut property to check for disabled fieldset ancestors + return elem.isDisabled === disabled || + + // Where there is no isDisabled, check manually + /* jshint -W018 */ + elem.isDisabled !== !disabled && + inDisabledFieldset( elem ) === disabled; + } + + return elem.disabled === disabled; + + // Try to winnow out elements that can't be disabled before trusting the disabled property. + // Some victims get caught in our net (label, legend, menu, track), but it shouldn't + // even exist on them, let alone have a boolean value. + } else if ( "label" in elem ) { + return elem.disabled === disabled; + } + + // Remaining elements are neither :enabled nor :disabled + return false; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction( function( argument ) { + argument = +argument; + return markFunction( function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ ( j = matchIndexes[ i ] ) ] ) { + seed[ j ] = !( matches[ j ] = seed[ j ] ); + } + } + } ); + } ); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== "undefined" && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + var namespace = elem.namespaceURI, + docElem = ( elem.ownerDocument || elem ).documentElement; + + // Support: IE <=8 + // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes + // https://bugs.jquery.com/ticket/4833 + return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, subWindow, + doc = node ? node.ownerDocument || node : preferredDoc; + + // Return early if doc is invalid or already selected + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Update global variables + document = doc; + docElem = document.documentElement; + documentIsHTML = !isXML( document ); + + // Support: IE 9 - 11+, Edge 12 - 18+ + // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( preferredDoc != document && + ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { + + // Support: IE 11, Edge + if ( subWindow.addEventListener ) { + subWindow.addEventListener( "unload", unloadHandler, false ); + + // Support: IE 9 - 10 only + } else if ( subWindow.attachEvent ) { + subWindow.attachEvent( "onunload", unloadHandler ); + } + } + + // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, + // Safari 4 - 5 only, Opera <=11.6 - 12.x only + // IE/Edge & older browsers don't support the :scope pseudo-class. + // Support: Safari 6.0 only + // Safari 6.0 supports :scope but it's an alias of :root there. + support.scope = assert( function( el ) { + docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); + return typeof el.querySelectorAll !== "undefined" && + !el.querySelectorAll( ":scope fieldset div" ).length; + } ); + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties + // (excepting IE8 booleans) + support.attributes = assert( function( el ) { + el.className = "i"; + return !el.getAttribute( "className" ); + } ); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert( function( el ) { + el.appendChild( document.createComment( "" ) ); + return !el.getElementsByTagName( "*" ).length; + } ); + + // Support: IE<9 + support.getElementsByClassName = rnative.test( document.getElementsByClassName ); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programmatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert( function( el ) { + docElem.appendChild( el ).id = expando; + return !document.getElementsByName || !document.getElementsByName( expando ).length; + } ); + + // ID filter and find + if ( support.getById ) { + Expr.filter[ "ID" ] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute( "id" ) === attrId; + }; + }; + Expr.find[ "ID" ] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var elem = context.getElementById( id ); + return elem ? [ elem ] : []; + } + }; + } else { + Expr.filter[ "ID" ] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== "undefined" && + elem.getAttributeNode( "id" ); + return node && node.value === attrId; + }; + }; + + // Support: IE 6 - 7 only + // getElementById is not reliable as a find shortcut + Expr.find[ "ID" ] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var node, i, elems, + elem = context.getElementById( id ); + + if ( elem ) { + + // Verify the id attribute + node = elem.getAttributeNode( "id" ); + if ( node && node.value === id ) { + return [ elem ]; + } + + // Fall back on getElementsByName + elems = context.getElementsByName( id ); + i = 0; + while ( ( elem = elems[ i++ ] ) ) { + node = elem.getAttributeNode( "id" ); + if ( node && node.value === id ) { + return [ elem ]; + } + } + } + + return []; + } + }; + } + + // Tag + Expr.find[ "TAG" ] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( tag ); + + // DocumentFragment nodes don't have gEBTN + } else if ( support.qsa ) { + return context.querySelectorAll( tag ); + } + } : + + function( tag, context ) { + var elem, + tmp = [], + i = 0, + + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( ( elem = results[ i++ ] ) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See https://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { + + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert( function( el ) { + + var input; + + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // https://bugs.jquery.com/ticket/12359 + docElem.appendChild( el ).innerHTML = "" + + ""; + + // Support: IE8, Opera 11-12.16 + // Nothing should be selected when empty strings follow ^= or $= or *= + // The test attribute must be unknown in Opera but "safe" for WinRT + // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !el.querySelectorAll( "[selected]" ).length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ + if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push( "~=" ); + } + + // Support: IE 11+, Edge 15 - 18+ + // IE 11/Edge don't find elements on a `[name='']` query in some cases. + // Adding a temporary attribute to the document before the selection works + // around the issue. + // Interestingly, IE 10 & older don't seem to have the issue. + input = document.createElement( "input" ); + input.setAttribute( "name", "" ); + el.appendChild( input ); + if ( !el.querySelectorAll( "[name='']" ).length ) { + rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + + whitespace + "*(?:''|\"\")" ); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !el.querySelectorAll( ":checked" ).length ) { + rbuggyQSA.push( ":checked" ); + } + + // Support: Safari 8+, iOS 8+ + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibling-combinator selector` fails + if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push( ".#.+[+~]" ); + } + + // Support: Firefox <=3.6 - 5 only + // Old Firefox doesn't throw on a badly-escaped identifier. + el.querySelectorAll( "\\\f" ); + rbuggyQSA.push( "[\\r\\n\\f]" ); + } ); + + assert( function( el ) { + el.innerHTML = "" + + ""; + + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = document.createElement( "input" ); + input.setAttribute( "type", "hidden" ); + el.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( el.querySelectorAll( "[name=d]" ).length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Support: IE9-11+ + // IE's :disabled selector does not pick up the children of disabled fieldsets + docElem.appendChild( el ).disabled = true; + if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Support: Opera 10 - 11 only + // Opera 10-11 does not throw on post-comma invalid pseudos + el.querySelectorAll( "*,:x" ); + rbuggyQSA.push( ",.*:" ); + } ); + } + + if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || + docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector ) ) ) ) { + + assert( function( el ) { + + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( el, "*" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( el, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + } ); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully self-exclusive + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + ) ); + } : + function( a, b ) { + if ( b ) { + while ( ( b = b.parentNode ) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { + + // Choose the first element that is related to our preferred document + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( a == document || a.ownerDocument == preferredDoc && + contains( preferredDoc, a ) ) { + return -1; + } + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( b == document || b.ownerDocument == preferredDoc && + contains( preferredDoc, b ) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + /* eslint-disable eqeqeq */ + return a == document ? -1 : + b == document ? 1 : + /* eslint-enable eqeqeq */ + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( ( cur = cur.parentNode ) ) { + ap.unshift( cur ); + } + cur = b; + while ( ( cur = cur.parentNode ) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[ i ] === bp[ i ] ) { + i++; + } + + return i ? + + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[ i ], bp[ i ] ) : + + // Otherwise nodes in our document sort first + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + /* eslint-disable eqeqeq */ + ap[ i ] == preferredDoc ? -1 : + bp[ i ] == preferredDoc ? 1 : + /* eslint-enable eqeqeq */ + 0; + }; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + setDocument( elem ); + + if ( support.matchesSelector && documentIsHTML && + !nonnativeSelectorCache[ expr + " " ] && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch ( e ) { + nonnativeSelectorCache( expr, true ); + } + } + + return Sizzle( expr, document, null, [ elem ] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + + // Set document vars if needed + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( ( context.ownerDocument || context ) != document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + + // Set document vars if needed + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( ( elem.ownerDocument || elem ) != document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + ( val = elem.getAttributeNode( name ) ) && val.specified ? + val.value : + null; +}; + +Sizzle.escape = function( sel ) { + return ( sel + "" ).replace( rcssescape, fcssescape ); +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( ( elem = results[ i++ ] ) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/jquery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + + // If no nodeType, this is expected to be an array + while ( ( node = elem[ i++ ] ) ) { + + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + + // Use textContent for elements + // innerText usage removed for consistency of new lines (jQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[ 1 ] = match[ 1 ].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[ 3 ] = ( match[ 3 ] || match[ 4 ] || + match[ 5 ] || "" ).replace( runescape, funescape ); + + if ( match[ 2 ] === "~=" ) { + match[ 3 ] = " " + match[ 3 ] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[ 1 ] = match[ 1 ].toLowerCase(); + + if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { + + // nth-* requires argument + if ( !match[ 3 ] ) { + Sizzle.error( match[ 0 ] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[ 4 ] = +( match[ 4 ] ? + match[ 5 ] + ( match[ 6 ] || 1 ) : + 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); + match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); + + // other types prohibit arguments + } else if ( match[ 3 ] ) { + Sizzle.error( match[ 0 ] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[ 6 ] && match[ 2 ]; + + if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[ 3 ] ) { + match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + + // Get excess from tokenize (recursively) + ( excess = tokenize( unquoted, true ) ) && + + // advance to the next closing parenthesis + ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { + + // excess is a negative index + match[ 0 ] = match[ 0 ].slice( 0, excess ); + match[ 2 ] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { + return true; + } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + ( pattern = new RegExp( "(^|" + whitespace + + ")" + className + "(" + whitespace + "|$)" ) ) && classCache( + className, function( elem ) { + return pattern.test( + typeof elem.className === "string" && elem.className || + typeof elem.getAttribute !== "undefined" && + elem.getAttribute( "class" ) || + "" + ); + } ); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + /* eslint-disable max-len */ + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + /* eslint-enable max-len */ + + }; + }, + + "CHILD": function( type, what, _argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, _context, xml ) { + var cache, uniqueCache, outerCache, node, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType, + diff = false; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( ( node = node[ dir ] ) ) { + if ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) { + + return false; + } + } + + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + + // Seek `elem` from a previously-cached index + + // ...in a gzip-friendly way + node = parent; + outerCache = node[ expando ] || ( node[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + ( outerCache[ node.uniqueID ] = {} ); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex && cache[ 2 ]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( ( node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + ( diff = nodeIndex = 0 ) || start.pop() ) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + } else { + + // Use previously-cached element index if available + if ( useCache ) { + + // ...in a gzip-friendly way + node = elem; + outerCache = node[ expando ] || ( node[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + ( outerCache[ node.uniqueID ] = {} ); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex; + } + + // xml :nth-child(...) + // or :nth-last-child(...) or :nth(-last)?-of-type(...) + if ( diff === false ) { + + // Use the same loop as above to seek `elem` from the start + while ( ( node = ++nodeIndex && node && node[ dir ] || + ( diff = nodeIndex = 0 ) || start.pop() ) ) { + + if ( ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) && + ++diff ) { + + // Cache the index of each encountered element + if ( useCache ) { + outerCache = node[ expando ] || + ( node[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + ( outerCache[ node.uniqueID ] = {} ); + + uniqueCache[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction( function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf( seed, matched[ i ] ); + seed[ idx ] = !( matches[ idx ] = matched[ i ] ); + } + } ) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + + // Potentially complex pseudos + "not": markFunction( function( selector ) { + + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction( function( seed, matches, _context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( ( elem = unmatched[ i ] ) ) { + seed[ i ] = !( matches[ i ] = elem ); + } + } + } ) : + function( elem, _context, xml ) { + input[ 0 ] = elem; + matcher( input, null, xml, results ); + + // Don't keep the element (issue #299) + input[ 0 ] = null; + return !results.pop(); + }; + } ), + + "has": markFunction( function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + } ), + + "contains": markFunction( function( text ) { + text = text.replace( runescape, funescape ); + return function( elem ) { + return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; + }; + } ), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + + // lang value must be a valid identifier + if ( !ridentifier.test( lang || "" ) ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( ( elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); + return false; + }; + } ), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && + ( !document.hasFocus || document.hasFocus() ) && + !!( elem.type || elem.href || ~elem.tabIndex ); + }, + + // Boolean properties + "enabled": createDisabledPseudo( false ), + "disabled": createDisabledPseudo( true ), + + "checked": function( elem ) { + + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return ( nodeName === "input" && !!elem.checked ) || + ( nodeName === "option" && !!elem.selected ); + }, + + "selected": function( elem ) { + + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + // eslint-disable-next-line no-unused-expressions + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos[ "empty" ]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( ( attr = elem.getAttribute( "type" ) ) == null || + attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo( function() { + return [ 0 ]; + } ), + + "last": createPositionalPseudo( function( _matchIndexes, length ) { + return [ length - 1 ]; + } ), + + "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + } ), + + "even": createPositionalPseudo( function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ), + + "odd": createPositionalPseudo( function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ), + + "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { + var i = argument < 0 ? + argument + length : + argument > length ? + length : + argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ), + + "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ) + } +}; + +Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || ( match = rcomma.exec( soFar ) ) ) { + if ( match ) { + + // Don't consume trailing commas as valid + soFar = soFar.slice( match[ 0 ].length ) || soFar; + } + groups.push( ( tokens = [] ) ); + } + + matched = false; + + // Combinators + if ( ( match = rcombinators.exec( soFar ) ) ) { + matched = match.shift(); + tokens.push( { + value: matched, + + // Cast descendant combinators to space + type: match[ 0 ].replace( rtrim, " " ) + } ); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || + ( match = preFilters[ type ]( match ) ) ) ) { + matched = match.shift(); + tokens.push( { + value: matched, + type: type, + matches: match + } ); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +}; + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[ i ].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + skip = combinator.next, + key = skip || dir, + checkNonElements = base && key === "parentNode", + doneName = done++; + + return combinator.first ? + + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( ( elem = elem[ dir ] ) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + return false; + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, uniqueCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching + if ( xml ) { + while ( ( elem = elem[ dir ] ) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( ( elem = elem[ dir ] ) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || ( elem[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ elem.uniqueID ] || + ( outerCache[ elem.uniqueID ] = {} ); + + if ( skip && skip === elem.nodeName.toLowerCase() ) { + elem = elem[ dir ] || elem; + } else if ( ( oldCache = uniqueCache[ key ] ) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return ( newCache[ 2 ] = oldCache[ 2 ] ); + } else { + + // Reuse newcache so results back-propagate to previous elements + uniqueCache[ key ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { + return true; + } + } + } + } + } + return false; + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[ i ]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[ 0 ]; +} + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[ i ], results ); + } + return results; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( ( elem = unmatched[ i ] ) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction( function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( + selector || "*", + context.nodeType ? [ context ] : context, + [] + ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( ( elem = temp[ i ] ) ) { + matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( ( elem = matcherOut[ i ] ) ) { + + // Restore matcherIn since elem is not yet a final match + temp.push( ( matcherIn[ i ] = elem ) ); + } + } + postFinder( null, ( matcherOut = [] ), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( ( elem = matcherOut[ i ] ) && + ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { + + seed[ temp ] = !( results[ temp ] = elem ); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + } ); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[ 0 ].type ], + implicitRelative = leadingRelative || Expr.relative[ " " ], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + ( checkContext = context ).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + + // Avoid hanging onto element (issue #299) + checkContext = null; + return ret; + } ]; + + for ( ; i < len; i++ ) { + if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { + matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; + } else { + matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[ j ].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens + .slice( 0, i - 1 ) + .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), + + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), + len = elems.length; + + if ( outermost ) { + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + outermostContext = context == document || context || outermost; + } + + // Add elements passing elementMatchers directly to results + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id + for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( !context && elem.ownerDocument != document ) { + setDocument( elem ); + xml = !documentIsHTML; + } + while ( ( matcher = elementMatchers[ j++ ] ) ) { + if ( matcher( elem, context || document, xml ) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + + // They will have gone through all possible matchers + if ( ( elem = !matcher && elem ) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // `i` is now the count of elements visited above, and adding it to `matchedCount` + // makes the latter nonnegative. + matchedCount += i; + + // Apply set filters to unmatched elements + // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` + // equals `i`), unless we didn't visit _any_ elements in the above loop because we have + // no element matchers and no seed. + // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that + // case, which will result in a "00" `matchedCount` that differs from `i` but is also + // numerically zero. + if ( bySet && i !== matchedCount ) { + j = 0; + while ( ( matcher = setMatchers[ j++ ] ) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !( unmatched[ i ] || setMatched[ i ] ) ) { + setMatched[ i ] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + + // Generate a function of recursive functions that can be used to check each element + if ( !match ) { + match = tokenize( selector ); + } + i = match.length; + while ( i-- ) { + cached = matcherFromTokens( match[ i ] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( + selector, + matcherFromGroupMatchers( elementMatchers, setMatchers ) + ); + + // Save selector and tokenization + cached.selector = selector; + } + return cached; +}; + +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { + var i, tokens, token, type, find, + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( ( selector = compiled.selector || selector ) ); + + results = results || []; + + // Try to minimize operations if there is only one selector in the list and no seed + // (the latter of which guarantees us context) + if ( match.length === 1 ) { + + // Reduce context if the leading compound selector is an ID + tokens = match[ 0 ] = match[ 0 ].slice( 0 ); + if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && + context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { + + context = ( Expr.find[ "ID" ]( token.matches[ 0 ] + .replace( runescape, funescape ), context ) || [] )[ 0 ]; + if ( !context ) { + return results; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[ i ]; + + // Abort if we hit a combinator + if ( Expr.relative[ ( type = token.type ) ] ) { + break; + } + if ( ( find = Expr.find[ type ] ) ) { + + // Search, expanding context for leading sibling combinators + if ( ( seed = find( + token.matches[ 0 ].replace( runescape, funescape ), + rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || + context + ) ) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + + // Compile and execute a filtering function if one is not provided + // Provide `match` to avoid retokenization if we modified the selector above + ( compiled || compile( selector, match ) )( + seed, + context, + !documentIsHTML, + results, + !context || rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +}; + +// One-time assignments + +// Sort stability +support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; + +// Support: Chrome 14-35+ +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert( function( el ) { + + // Should return 1, but returns 4 (following) + return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; +} ); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert( function( el ) { + el.innerHTML = ""; + return el.firstChild.getAttribute( "href" ) === "#"; +} ) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + } ); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert( function( el ) { + el.innerHTML = ""; + el.firstChild.setAttribute( "value", "" ); + return el.firstChild.getAttribute( "value" ) === ""; +} ) ) { + addHandle( "value", function( elem, _name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + } ); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert( function( el ) { + return el.getAttribute( "disabled" ) == null; +} ) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + ( val = elem.getAttributeNode( name ) ) && val.specified ? + val.value : + null; + } + } ); +} + +return Sizzle; + +} )( window ); + + + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; + +// Deprecated +jQuery.expr[ ":" ] = jQuery.expr.pseudos; +jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; +jQuery.escapeSelector = Sizzle.escape; + + + + +var dir = function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; +}; + + +var siblings = function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; +}; + + +var rneedsContext = jQuery.expr.match.needsContext; + + + +function nodeName( elem, name ) { + + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + +}; +var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); + + + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + return !!qualifier.call( elem, i, elem ) !== not; + } ); + } + + // Single element + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + } ); + } + + // Arraylike of elements (jQuery, arguments, Array) + if ( typeof qualifier !== "string" ) { + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) > -1 ) !== not; + } ); + } + + // Filtered directly for both simple and complex selectors + return jQuery.filter( qualifier, elements, not ); +} + +jQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + if ( elems.length === 1 && elem.nodeType === 1 ) { + return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; + } + + return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + } ) ); +}; + +jQuery.fn.extend( { + find: function( selector ) { + var i, ret, + len = this.length, + self = this; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter( function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + } ) ); + } + + ret = this.pushStack( [] ); + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + return len > 1 ? jQuery.uniqueSort( ret ) : ret; + }, + filter: function( selector ) { + return this.pushStack( winnow( this, selector || [], false ) ); + }, + not: function( selector ) { + return this.pushStack( winnow( this, selector || [], true ) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + } +} ); + + +// Initialize a jQuery object + + +// A central reference to the root jQuery(document) +var rootjQuery, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + // Shortcut simple #id case for speed + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, + + init = jQuery.fn.init = function( selector, context, root ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Method init() accepts an alternate rootjQuery + // so migrate can support jQuery.sub (gh-2101) + root = root || rootjQuery; + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector[ 0 ] === "<" && + selector[ selector.length - 1 ] === ">" && + selector.length >= 3 ) { + + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && ( match[ 1 ] || !context ) ) { + + // HANDLE: $(html) -> $(array) + if ( match[ 1 ] ) { + context = context instanceof jQuery ? context[ 0 ] : context; + + // Option to run scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + jQuery.merge( this, jQuery.parseHTML( + match[ 1 ], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + + // Properties of context are called as methods if possible + if ( isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[ 2 ] ); + + if ( elem ) { + + // Inject the element directly into the jQuery object + this[ 0 ] = elem; + this.length = 1; + } + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || root ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this[ 0 ] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( isFunction( selector ) ) { + return root.ready !== undefined ? + root.ready( selector ) : + + // Execute immediately if ready is not present + selector( jQuery ); + } + + return jQuery.makeArray( selector, this ); + }; + +// Give the init function the jQuery prototype for later instantiation +init.prototype = jQuery.fn; + +// Initialize central reference +rootjQuery = jQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + + // Methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend( { + has: function( target ) { + var targets = jQuery( target, this ), + l = targets.length; + + return this.filter( function() { + var i = 0; + for ( ; i < l; i++ ) { + if ( jQuery.contains( this, targets[ i ] ) ) { + return true; + } + } + } ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + targets = typeof selectors !== "string" && jQuery( selectors ); + + // Positional selectors never match, since there's no _selection_ context + if ( !rneedsContext.test( selectors ) ) { + for ( ; i < l; i++ ) { + for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { + + // Always skip document fragments + if ( cur.nodeType < 11 && ( targets ? + targets.index( cur ) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector( cur, selectors ) ) ) { + + matched.push( cur ); + break; + } + } + } + } + + return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); + }, + + // Determine the position of an element within the set + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; + } + + // Index in selector + if ( typeof elem === "string" ) { + return indexOf.call( jQuery( elem ), this[ 0 ] ); + } + + // Locate the position of the desired element + return indexOf.call( this, + + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[ 0 ] : elem + ); + }, + + add: function( selector, context ) { + return this.pushStack( + jQuery.uniqueSort( + jQuery.merge( this.get(), jQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter( selector ) + ); + } +} ); + +function sibling( cur, dir ) { + while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} + return cur; +} + +jQuery.each( { + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, _i, until ) { + return dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, _i, until ) { + return dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, _i, until ) { + return dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return siblings( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return siblings( elem.firstChild ); + }, + contents: function( elem ) { + if ( elem.contentDocument != null && + + // Support: IE 11+ + // elements with no `data` attribute has an object + // `contentDocument` with a `null` prototype. + getProto( elem.contentDocument ) ) { + + return elem.contentDocument; + } + + // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only + // Treat the template element as a regular one in browsers that + // don't support it. + if ( nodeName( elem, "template" ) ) { + elem = elem.content || elem; + } + + return jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var matched = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + matched = jQuery.filter( selector, matched ); + } + + if ( this.length > 1 ) { + + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + jQuery.uniqueSort( matched ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + matched.reverse(); + } + } + + return this.pushStack( matched ); + }; +} ); +var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); + + + +// Convert String-formatted options into Object-formatted ones +function createOptions( options ) { + var object = {}; + jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { + object[ flag ] = true; + } ); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + createOptions( options ) : + jQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + + // Last fire value for non-forgettable lists + memory, + + // Flag to know if list was already fired + fired, + + // Flag to prevent firing + locked, + + // Actual callback list + list = [], + + // Queue of execution data for repeatable lists + queue = [], + + // Index of currently firing callback (modified by add/remove as needed) + firingIndex = -1, + + // Fire callbacks + fire = function() { + + // Enforce single-firing + locked = locked || options.once; + + // Execute callbacks for all pending executions, + // respecting firingIndex overrides and runtime changes + fired = firing = true; + for ( ; queue.length; firingIndex = -1 ) { + memory = queue.shift(); + while ( ++firingIndex < list.length ) { + + // Run callback and check for early termination + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && + options.stopOnFalse ) { + + // Jump to end and forget the data so .add doesn't re-fire + firingIndex = list.length; + memory = false; + } + } + } + + // Forget the data if we're done with it + if ( !options.memory ) { + memory = false; + } + + firing = false; + + // Clean up if we're done firing for good + if ( locked ) { + + // Keep an empty list if we have data for future add calls + if ( memory ) { + list = []; + + // Otherwise, this object is spent + } else { + list = ""; + } + } + }, + + // Actual Callbacks object + self = { + + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + + // If we have memory from a past run, we should fire after adding + if ( memory && !firing ) { + firingIndex = list.length - 1; + queue.push( memory ); + } + + ( function add( args ) { + jQuery.each( args, function( _, arg ) { + if ( isFunction( arg ) ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && toType( arg ) !== "string" ) { + + // Inspect recursively + add( arg ); + } + } ); + } )( arguments ); + + if ( memory && !firing ) { + fire(); + } + } + return this; + }, + + // Remove a callback from the list + remove: function() { + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + + // Handle firing indexes + if ( index <= firingIndex ) { + firingIndex--; + } + } + } ); + return this; + }, + + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? + jQuery.inArray( fn, list ) > -1 : + list.length > 0; + }, + + // Remove all callbacks from the list + empty: function() { + if ( list ) { + list = []; + } + return this; + }, + + // Disable .fire and .add + // Abort any current/pending executions + // Clear all callbacks and values + disable: function() { + locked = queue = []; + list = memory = ""; + return this; + }, + disabled: function() { + return !list; + }, + + // Disable .fire + // Also disable .add unless we have memory (since it would have no effect) + // Abort any pending executions + lock: function() { + locked = queue = []; + if ( !memory && !firing ) { + list = memory = ""; + } + return this; + }, + locked: function() { + return !!locked; + }, + + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( !locked ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + queue.push( args ); + if ( !firing ) { + fire(); + } + } + return this; + }, + + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +function Identity( v ) { + return v; +} +function Thrower( ex ) { + throw ex; +} + +function adoptValue( value, resolve, reject, noValue ) { + var method; + + try { + + // Check for promise aspect first to privilege synchronous behavior + if ( value && isFunction( ( method = value.promise ) ) ) { + method.call( value ).done( resolve ).fail( reject ); + + // Other thenables + } else if ( value && isFunction( ( method = value.then ) ) ) { + method.call( value, resolve, reject ); + + // Other non-thenables + } else { + + // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: + // * false: [ value ].slice( 0 ) => resolve( value ) + // * true: [ value ].slice( 1 ) => resolve() + resolve.apply( undefined, [ value ].slice( noValue ) ); + } + + // For Promises/A+, convert exceptions into rejections + // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in + // Deferred#then to conditionally suppress rejection. + } catch ( value ) { + + // Support: Android 4.0 only + // Strict mode functions invoked without .call/.apply get global-object context + reject.apply( undefined, [ value ] ); + } +} + +jQuery.extend( { + + Deferred: function( func ) { + var tuples = [ + + // action, add listener, callbacks, + // ... .then handlers, argument index, [final state] + [ "notify", "progress", jQuery.Callbacks( "memory" ), + jQuery.Callbacks( "memory" ), 2 ], + [ "resolve", "done", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 0, "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 1, "rejected" ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + "catch": function( fn ) { + return promise.then( null, fn ); + }, + + // Keep pipe for back-compat + pipe: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + + return jQuery.Deferred( function( newDefer ) { + jQuery.each( tuples, function( _i, tuple ) { + + // Map tuples (progress, done, fail) to arguments (done, fail, progress) + var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; + + // deferred.progress(function() { bind to newDefer or newDefer.notify }) + // deferred.done(function() { bind to newDefer or newDefer.resolve }) + // deferred.fail(function() { bind to newDefer or newDefer.reject }) + deferred[ tuple[ 1 ] ]( function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && isFunction( returned.promise ) ) { + returned.promise() + .progress( newDefer.notify ) + .done( newDefer.resolve ) + .fail( newDefer.reject ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this, + fn ? [ returned ] : arguments + ); + } + } ); + } ); + fns = null; + } ).promise(); + }, + then: function( onFulfilled, onRejected, onProgress ) { + var maxDepth = 0; + function resolve( depth, deferred, handler, special ) { + return function() { + var that = this, + args = arguments, + mightThrow = function() { + var returned, then; + + // Support: Promises/A+ section 2.3.3.3.3 + // https://promisesaplus.com/#point-59 + // Ignore double-resolution attempts + if ( depth < maxDepth ) { + return; + } + + returned = handler.apply( that, args ); + + // Support: Promises/A+ section 2.3.1 + // https://promisesaplus.com/#point-48 + if ( returned === deferred.promise() ) { + throw new TypeError( "Thenable self-resolution" ); + } + + // Support: Promises/A+ sections 2.3.3.1, 3.5 + // https://promisesaplus.com/#point-54 + // https://promisesaplus.com/#point-75 + // Retrieve `then` only once + then = returned && + + // Support: Promises/A+ section 2.3.4 + // https://promisesaplus.com/#point-64 + // Only check objects and functions for thenability + ( typeof returned === "object" || + typeof returned === "function" ) && + returned.then; + + // Handle a returned thenable + if ( isFunction( then ) ) { + + // Special processors (notify) just wait for resolution + if ( special ) { + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ) + ); + + // Normal processors (resolve) also hook into progress + } else { + + // ...and disregard older resolution values + maxDepth++; + + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ), + resolve( maxDepth, deferred, Identity, + deferred.notifyWith ) + ); + } + + // Handle all other returned values + } else { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Identity ) { + that = undefined; + args = [ returned ]; + } + + // Process the value(s) + // Default process is resolve + ( special || deferred.resolveWith )( that, args ); + } + }, + + // Only normal processors (resolve) catch and reject exceptions + process = special ? + mightThrow : + function() { + try { + mightThrow(); + } catch ( e ) { + + if ( jQuery.Deferred.exceptionHook ) { + jQuery.Deferred.exceptionHook( e, + process.stackTrace ); + } + + // Support: Promises/A+ section 2.3.3.3.4.1 + // https://promisesaplus.com/#point-61 + // Ignore post-resolution exceptions + if ( depth + 1 >= maxDepth ) { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Thrower ) { + that = undefined; + args = [ e ]; + } + + deferred.rejectWith( that, args ); + } + } + }; + + // Support: Promises/A+ section 2.3.3.3.1 + // https://promisesaplus.com/#point-57 + // Re-resolve promises immediately to dodge false rejection from + // subsequent errors + if ( depth ) { + process(); + } else { + + // Call an optional hook to record the stack, in case of exception + // since it's otherwise lost when execution goes async + if ( jQuery.Deferred.getStackHook ) { + process.stackTrace = jQuery.Deferred.getStackHook(); + } + window.setTimeout( process ); + } + }; + } + + return jQuery.Deferred( function( newDefer ) { + + // progress_handlers.add( ... ) + tuples[ 0 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onProgress ) ? + onProgress : + Identity, + newDefer.notifyWith + ) + ); + + // fulfilled_handlers.add( ... ) + tuples[ 1 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onFulfilled ) ? + onFulfilled : + Identity + ) + ); + + // rejected_handlers.add( ... ) + tuples[ 2 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onRejected ) ? + onRejected : + Thrower + ) + ); + } ).promise(); + }, + + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 5 ]; + + // promise.progress = list.add + // promise.done = list.add + // promise.fail = list.add + promise[ tuple[ 1 ] ] = list.add; + + // Handle state + if ( stateString ) { + list.add( + function() { + + // state = "resolved" (i.e., fulfilled) + // state = "rejected" + state = stateString; + }, + + // rejected_callbacks.disable + // fulfilled_callbacks.disable + tuples[ 3 - i ][ 2 ].disable, + + // rejected_handlers.disable + // fulfilled_handlers.disable + tuples[ 3 - i ][ 3 ].disable, + + // progress_callbacks.lock + tuples[ 0 ][ 2 ].lock, + + // progress_handlers.lock + tuples[ 0 ][ 3 ].lock + ); + } + + // progress_handlers.fire + // fulfilled_handlers.fire + // rejected_handlers.fire + list.add( tuple[ 3 ].fire ); + + // deferred.notify = function() { deferred.notifyWith(...) } + // deferred.resolve = function() { deferred.resolveWith(...) } + // deferred.reject = function() { deferred.rejectWith(...) } + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); + return this; + }; + + // deferred.notifyWith = list.fireWith + // deferred.resolveWith = list.fireWith + // deferred.rejectWith = list.fireWith + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( singleValue ) { + var + + // count of uncompleted subordinates + remaining = arguments.length, + + // count of unprocessed arguments + i = remaining, + + // subordinate fulfillment data + resolveContexts = Array( i ), + resolveValues = slice.call( arguments ), + + // the master Deferred + master = jQuery.Deferred(), + + // subordinate callback factory + updateFunc = function( i ) { + return function( value ) { + resolveContexts[ i ] = this; + resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( !( --remaining ) ) { + master.resolveWith( resolveContexts, resolveValues ); + } + }; + }; + + // Single- and empty arguments are adopted like Promise.resolve + if ( remaining <= 1 ) { + adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, + !remaining ); + + // Use .then() to unwrap secondary thenables (cf. gh-3000) + if ( master.state() === "pending" || + isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { + + return master.then(); + } + } + + // Multiple arguments are aggregated like Promise.all array elements + while ( i-- ) { + adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); + } + + return master.promise(); + } +} ); + + +// These usually indicate a programmer mistake during development, +// warn about them ASAP rather than swallowing them by default. +var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; + +jQuery.Deferred.exceptionHook = function( error, stack ) { + + // Support: IE 8 - 9 only + // Console exists when dev tools are open, which can happen at any time + if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { + window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); + } +}; + + + + +jQuery.readyException = function( error ) { + window.setTimeout( function() { + throw error; + } ); +}; + + + + +// The deferred used on DOM ready +var readyList = jQuery.Deferred(); + +jQuery.fn.ready = function( fn ) { + + readyList + .then( fn ) + + // Wrap jQuery.readyException in a function so that the lookup + // happens at the time of error handling instead of callback + // registration. + .catch( function( error ) { + jQuery.readyException( error ); + } ); + + return this; +}; + +jQuery.extend( { + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + } +} ); + +jQuery.ready.then = readyList.then; + +// The ready event handler and self cleanup method +function completed() { + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); + jQuery.ready(); +} + +// Catch cases where $(document).ready() is called +// after the browser event has already occurred. +// Support: IE <=9 - 10 only +// Older IE sometimes signals "interactive" too soon +if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { + + // Handle it asynchronously to allow scripts the opportunity to delay ready + window.setTimeout( jQuery.ready ); + +} else { + + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed ); +} + + + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + len = elems.length, + bulk = key == null; + + // Sets many values + if ( toType( key ) === "object" ) { + chainable = true; + for ( i in key ) { + access( elems, fn, i, key[ i ], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, _key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < len; i++ ) { + fn( + elems[ i ], key, raw ? + value : + value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); + } + } + } + + if ( chainable ) { + return elems; + } + + // Gets + if ( bulk ) { + return fn.call( elems ); + } + + return len ? fn( elems[ 0 ], key ) : emptyGet; +}; + + +// Matches dashed string for camelizing +var rmsPrefix = /^-ms-/, + rdashAlpha = /-([a-z])/g; + +// Used by camelCase as callback to replace() +function fcamelCase( _all, letter ) { + return letter.toUpperCase(); +} + +// Convert dashed to camelCase; used by the css and data modules +// Support: IE <=9 - 11, Edge 12 - 15 +// Microsoft forgot to hump their vendor prefix (#9572) +function camelCase( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); +} +var acceptData = function( owner ) { + + // Accepts only: + // - Node + // - Node.ELEMENT_NODE + // - Node.DOCUMENT_NODE + // - Object + // - Any + return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); +}; + + + + +function Data() { + this.expando = jQuery.expando + Data.uid++; +} + +Data.uid = 1; + +Data.prototype = { + + cache: function( owner ) { + + // Check if the owner object already has a cache + var value = owner[ this.expando ]; + + // If not, create one + if ( !value ) { + value = {}; + + // We can accept data for non-element nodes in modern browsers, + // but we should not, see #8335. + // Always return an empty object. + if ( acceptData( owner ) ) { + + // If it is a node unlikely to be stringify-ed or looped over + // use plain assignment + if ( owner.nodeType ) { + owner[ this.expando ] = value; + + // Otherwise secure it in a non-enumerable property + // configurable must be true to allow the property to be + // deleted when data is removed + } else { + Object.defineProperty( owner, this.expando, { + value: value, + configurable: true + } ); + } + } + } + + return value; + }, + set: function( owner, data, value ) { + var prop, + cache = this.cache( owner ); + + // Handle: [ owner, key, value ] args + // Always use camelCase key (gh-2257) + if ( typeof data === "string" ) { + cache[ camelCase( data ) ] = value; + + // Handle: [ owner, { properties } ] args + } else { + + // Copy the properties one-by-one to the cache object + for ( prop in data ) { + cache[ camelCase( prop ) ] = data[ prop ]; + } + } + return cache; + }, + get: function( owner, key ) { + return key === undefined ? + this.cache( owner ) : + + // Always use camelCase key (gh-2257) + owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; + }, + access: function( owner, key, value ) { + + // In cases where either: + // + // 1. No key was specified + // 2. A string key was specified, but no value provided + // + // Take the "read" path and allow the get method to determine + // which value to return, respectively either: + // + // 1. The entire cache object + // 2. The data stored at the key + // + if ( key === undefined || + ( ( key && typeof key === "string" ) && value === undefined ) ) { + + return this.get( owner, key ); + } + + // When the key is not a string, or both a key and value + // are specified, set or extend (existing objects) with either: + // + // 1. An object of properties + // 2. A key and value + // + this.set( owner, key, value ); + + // Since the "set" path can have two possible entry points + // return the expected data based on which path was taken[*] + return value !== undefined ? value : key; + }, + remove: function( owner, key ) { + var i, + cache = owner[ this.expando ]; + + if ( cache === undefined ) { + return; + } + + if ( key !== undefined ) { + + // Support array or space separated string of keys + if ( Array.isArray( key ) ) { + + // If key is an array of keys... + // We always set camelCase keys, so remove that. + key = key.map( camelCase ); + } else { + key = camelCase( key ); + + // If a key with the spaces exists, use it. + // Otherwise, create an array by matching non-whitespace + key = key in cache ? + [ key ] : + ( key.match( rnothtmlwhite ) || [] ); + } + + i = key.length; + + while ( i-- ) { + delete cache[ key[ i ] ]; + } + } + + // Remove the expando if there's no more data + if ( key === undefined || jQuery.isEmptyObject( cache ) ) { + + // Support: Chrome <=35 - 45 + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) + if ( owner.nodeType ) { + owner[ this.expando ] = undefined; + } else { + delete owner[ this.expando ]; + } + } + }, + hasData: function( owner ) { + var cache = owner[ this.expando ]; + return cache !== undefined && !jQuery.isEmptyObject( cache ); + } +}; +var dataPriv = new Data(); + +var dataUser = new Data(); + + + +// Implementation Summary +// +// 1. Enforce API surface and semantic compatibility with 1.9.x branch +// 2. Improve the module's maintainability by reducing the storage +// paths to a single mechanism. +// 3. Use the same single mechanism to support "private" and "user" data. +// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) +// 5. Avoid exposing implementation details on user objects (eg. expando properties) +// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /[A-Z]/g; + +function getData( data ) { + if ( data === "true" ) { + return true; + } + + if ( data === "false" ) { + return false; + } + + if ( data === "null" ) { + return null; + } + + // Only convert to a number if it doesn't change the string + if ( data === +data + "" ) { + return +data; + } + + if ( rbrace.test( data ) ) { + return JSON.parse( data ); + } + + return data; +} + +function dataAttr( elem, key, data ) { + var name; + + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = getData( data ); + } catch ( e ) {} + + // Make sure we set the data so it isn't changed later + dataUser.set( elem, key, data ); + } else { + data = undefined; + } + } + return data; +} + +jQuery.extend( { + hasData: function( elem ) { + return dataUser.hasData( elem ) || dataPriv.hasData( elem ); + }, + + data: function( elem, name, data ) { + return dataUser.access( elem, name, data ); + }, + + removeData: function( elem, name ) { + dataUser.remove( elem, name ); + }, + + // TODO: Now that all calls to _data and _removeData have been replaced + // with direct calls to dataPriv methods, these can be deprecated. + _data: function( elem, name, data ) { + return dataPriv.access( elem, name, data ); + }, + + _removeData: function( elem, name ) { + dataPriv.remove( elem, name ); + } +} ); + +jQuery.fn.extend( { + data: function( key, value ) { + var i, name, data, + elem = this[ 0 ], + attrs = elem && elem.attributes; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = dataUser.get( elem ); + + if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE 11 only + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = camelCase( name.slice( 5 ) ); + dataAttr( elem, name, data[ name ] ); + } + } + } + dataPriv.set( elem, "hasDataAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each( function() { + dataUser.set( this, key ); + } ); + } + + return access( this, function( value ) { + var data; + + // The calling jQuery object (element matches) is not empty + // (and therefore has an element appears at this[ 0 ]) and the + // `value` parameter was not undefined. An empty jQuery object + // will result in `undefined` for elem = this[ 0 ] which will + // throw an exception if an attempt to read a data cache is made. + if ( elem && value === undefined ) { + + // Attempt to get data from the cache + // The key will always be camelCased in Data + data = dataUser.get( elem, key ); + if ( data !== undefined ) { + return data; + } + + // Attempt to "discover" the data in + // HTML5 custom data-* attrs + data = dataAttr( elem, key ); + if ( data !== undefined ) { + return data; + } + + // We tried really hard, but the data doesn't exist. + return; + } + + // Set the data... + this.each( function() { + + // We always store the camelCased key + dataUser.set( this, key, value ); + } ); + }, null, value, arguments.length > 1, null, true ); + }, + + removeData: function( key ) { + return this.each( function() { + dataUser.remove( this, key ); + } ); + } +} ); + + +jQuery.extend( { + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = dataPriv.get( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || Array.isArray( data ) ) { + queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // Clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // Not public - generate a queueHooks object, or return the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { + empty: jQuery.Callbacks( "once memory" ).add( function() { + dataPriv.remove( elem, [ type + "queue", key ] ); + } ) + } ); + } +} ); + +jQuery.fn.extend( { + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[ 0 ], type ); + } + + return data === undefined ? + this : + this.each( function() { + var queue = jQuery.queue( this, type, data ); + + // Ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + } ); + }, + dequeue: function( type ) { + return this.each( function() { + jQuery.dequeue( this, type ); + } ); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +} ); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var documentElement = document.documentElement; + + + + var isAttached = function( elem ) { + return jQuery.contains( elem.ownerDocument, elem ); + }, + composed = { composed: true }; + + // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only + // Check attachment across shadow DOM boundaries when possible (gh-3504) + // Support: iOS 10.0-10.2 only + // Early iOS 10 versions support `attachShadow` but not `getRootNode`, + // leading to errors. We need to check for `getRootNode`. + if ( documentElement.getRootNode ) { + isAttached = function( elem ) { + return jQuery.contains( elem.ownerDocument, elem ) || + elem.getRootNode( composed ) === elem.ownerDocument; + }; + } +var isHiddenWithinTree = function( elem, el ) { + + // isHiddenWithinTree might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + + // Inline style trumps all + return elem.style.display === "none" || + elem.style.display === "" && + + // Otherwise, check computed style + // Support: Firefox <=43 - 45 + // Disconnected elements can have computed display: none, so first confirm that elem is + // in the document. + isAttached( elem ) && + + jQuery.css( elem, "display" ) === "none"; + }; + + + +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, scale, + maxIterations = 20, + currentValue = tween ? + function() { + return tween.cur(); + } : + function() { + return jQuery.css( elem, prop, "" ); + }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = elem.nodeType && + ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Support: Firefox <=54 + // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) + initial = initial / 2; + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + while ( maxIterations-- ) { + + // Evaluate and update our best guess (doubling guesses that zero out). + // Finish if the scale equals or crosses 1 (making the old*new product non-positive). + jQuery.style( elem, prop, initialInUnit + unit ); + if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { + maxIterations = 0; + } + initialInUnit = initialInUnit / scale; + + } + + initialInUnit = initialInUnit * 2; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} + + +var defaultDisplayMap = {}; + +function getDefaultDisplay( elem ) { + var temp, + doc = elem.ownerDocument, + nodeName = elem.nodeName, + display = defaultDisplayMap[ nodeName ]; + + if ( display ) { + return display; + } + + temp = doc.body.appendChild( doc.createElement( nodeName ) ); + display = jQuery.css( temp, "display" ); + + temp.parentNode.removeChild( temp ); + + if ( display === "none" ) { + display = "block"; + } + defaultDisplayMap[ nodeName ] = display; + + return display; +} + +function showHide( elements, show ) { + var display, elem, + values = [], + index = 0, + length = elements.length; + + // Determine new display value for elements that need to change + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + + display = elem.style.display; + if ( show ) { + + // Since we force visibility upon cascade-hidden elements, an immediate (and slow) + // check is required in this first loop unless we have a nonempty display value (either + // inline or about-to-be-restored) + if ( display === "none" ) { + values[ index ] = dataPriv.get( elem, "display" ) || null; + if ( !values[ index ] ) { + elem.style.display = ""; + } + } + if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { + values[ index ] = getDefaultDisplay( elem ); + } + } else { + if ( display !== "none" ) { + values[ index ] = "none"; + + // Remember what we're overwriting + dataPriv.set( elem, "display", display ); + } + } + } + + // Set the display of the elements in a second loop to avoid constant reflow + for ( index = 0; index < length; index++ ) { + if ( values[ index ] != null ) { + elements[ index ].style.display = values[ index ]; + } + } + + return elements; +} + +jQuery.fn.extend( { + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state ) { + if ( typeof state === "boolean" ) { + return state ? this.show() : this.hide(); + } + + return this.each( function() { + if ( isHiddenWithinTree( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + } ); + } +} ); +var rcheckableType = ( /^(?:checkbox|radio)$/i ); + +var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); + +var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); + + + +( function() { + var fragment = document.createDocumentFragment(), + div = fragment.appendChild( document.createElement( "div" ) ), + input = document.createElement( "input" ); + + // Support: Android 4.0 - 4.3 only + // Check state lost if the name is set (#11217) + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Android <=4.1 only + // Older WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE <=11 only + // Make sure textarea (and checkbox) defaultValue is properly cloned + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; + + // Support: IE <=9 only + // IE <=9 replaces "; + support.option = !!div.lastChild; +} )(); + + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { + + // XHTML parsers do not magically insert elements in the + // same way that tag soup parsers do. So we cannot shorten + // this by omitting or other required elements. + thead: [ 1, "", "
" ], + col: [ 2, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + + _default: [ 0, "", "" ] +}; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// Support: IE <=9 only +if ( !support.option ) { + wrapMap.optgroup = wrapMap.option = [ 1, "" ]; +} + + +function getAll( context, tag ) { + + // Support: IE <=9 - 11 only + // Use typeof to avoid zero-argument method invocation on host objects (#15151) + var ret; + + if ( typeof context.getElementsByTagName !== "undefined" ) { + ret = context.getElementsByTagName( tag || "*" ); + + } else if ( typeof context.querySelectorAll !== "undefined" ) { + ret = context.querySelectorAll( tag || "*" ); + + } else { + ret = []; + } + + if ( tag === undefined || tag && nodeName( context, tag ) ) { + return jQuery.merge( [ context ], ret ); + } + + return ret; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + dataPriv.set( + elems[ i ], + "globalEval", + !refElements || dataPriv.get( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/; + +function buildFragment( elems, context, scripts, selection, ignored ) { + var elem, tmp, tag, wrap, attached, j, + fragment = context.createDocumentFragment(), + nodes = [], + i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( toType( elem ) === "object" ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; + + // Descend through wrappers to the right content + j = wrap[ 0 ]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, tmp.childNodes ); + + // Remember the top-level container + tmp = fragment.firstChild; + + // Ensure the created nodes are orphaned (#12392) + tmp.textContent = ""; + } + } + } + + // Remove wrapper from fragment + fragment.textContent = ""; + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + continue; + } + + attached = isAttached( elem ); + + // Append to fragment + tmp = getAll( fragment.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( attached ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + return fragment; +} + + +var + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +// Support: IE <=9 - 11+ +// focus() and blur() are asynchronous, except when they are no-op. +// So expect focus to be synchronous when the element is already active, +// and blur to be synchronous when the element is not already active. +// (focus and blur are always synchronous in other supported browsers, +// this just defines when we can count on it). +function expectSync( elem, type ) { + return ( elem === safeActiveElement() ) === ( type === "focus" ); +} + +// Support: IE <=9 only +// Accessing document.activeElement can throw unexpectedly +// https://bugs.jquery.com/ticket/13393 +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); + } + return elem; + } + + if ( data == null && fn == null ) { + + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return elem; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + + var handleObjIn, eventHandle, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.get( elem ); + + // Only attach events to objects that accept data + if ( !acceptData( elem ) ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Ensure that invalid selectors throw exceptions at attach time + // Evaluate against documentElement in case elem is a non-element node (e.g., document) + if ( selector ) { + jQuery.find.matchesSelector( documentElement, selector ); + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !( events = elemData.events ) ) { + events = elemData.events = Object.create( null ); + } + if ( !( eventHandle = elemData.handle ) ) { + eventHandle = elemData.handle = function( e ) { + + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? + jQuery.event.dispatch.apply( elem, arguments ) : undefined; + }; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend( { + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join( "." ) + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !( handlers = events[ type ] ) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener if the special events handler returns false + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var j, origCount, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); + + if ( !elemData || !( events = elemData.events ) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove data and the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + dataPriv.remove( elem, "handle events" ); + } + }, + + dispatch: function( nativeEvent ) { + + var i, j, ret, matched, handleObj, handlerQueue, + args = new Array( arguments.length ), + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( nativeEvent ), + + handlers = ( + dataPriv.get( this, "events" ) || Object.create( null ) + )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[ 0 ] = event; + + for ( i = 1; i < arguments.length; i++ ) { + args[ i ] = arguments[ i ]; + } + + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { + + // If the event is namespaced, then each handler is only invoked if it is + // specially universal or its namespaces are a superset of the event's. + if ( !event.rnamespace || handleObj.namespace === false || + event.rnamespace.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( ( event.result = ret ) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, handleObj, sel, matchedHandlers, matchedSelectors, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Find delegate handlers + if ( delegateCount && + + // Support: IE <=9 + // Black-hole SVG instance trees (trac-13180) + cur.nodeType && + + // Support: Firefox <=42 + // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) + // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click + // Support: IE 11 only + // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) + !( event.type === "click" && event.button >= 1 ) ) { + + for ( ; cur !== this; cur = cur.parentNode || this ) { + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { + matchedHandlers = []; + matchedSelectors = {}; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matchedSelectors[ sel ] === undefined ) { + matchedSelectors[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) > -1 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matchedSelectors[ sel ] ) { + matchedHandlers.push( handleObj ); + } + } + if ( matchedHandlers.length ) { + handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); + } + } + } + } + + // Add the remaining (directly-bound) handlers + cur = this; + if ( delegateCount < handlers.length ) { + handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); + } + + return handlerQueue; + }, + + addProp: function( name, hook ) { + Object.defineProperty( jQuery.Event.prototype, name, { + enumerable: true, + configurable: true, + + get: isFunction( hook ) ? + function() { + if ( this.originalEvent ) { + return hook( this.originalEvent ); + } + } : + function() { + if ( this.originalEvent ) { + return this.originalEvent[ name ]; + } + }, + + set: function( value ) { + Object.defineProperty( this, name, { + enumerable: true, + configurable: true, + writable: true, + value: value + } ); + } + } ); + }, + + fix: function( originalEvent ) { + return originalEvent[ jQuery.expando ] ? + originalEvent : + new jQuery.Event( originalEvent ); + }, + + special: { + load: { + + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + click: { + + // Utilize native event to ensure correct state for checkable inputs + setup: function( data ) { + + // For mutual compressibility with _default, replace `this` access with a local var. + // `|| data` is dead code meant only to preserve the variable through minification. + var el = this || data; + + // Claim the first handler + if ( rcheckableType.test( el.type ) && + el.click && nodeName( el, "input" ) ) { + + // dataPriv.set( el, "click", ... ) + leverageNative( el, "click", returnTrue ); + } + + // Return false to allow normal processing in the caller + return false; + }, + trigger: function( data ) { + + // For mutual compressibility with _default, replace `this` access with a local var. + // `|| data` is dead code meant only to preserve the variable through minification. + var el = this || data; + + // Force setup before triggering a click + if ( rcheckableType.test( el.type ) && + el.click && nodeName( el, "input" ) ) { + + leverageNative( el, "click" ); + } + + // Return non-false to allow normal event-path propagation + return true; + }, + + // For cross-browser consistency, suppress native .click() on links + // Also prevent it if we're currently inside a leveraged native-event stack + _default: function( event ) { + var target = event.target; + return rcheckableType.test( target.type ) && + target.click && nodeName( target, "input" ) && + dataPriv.get( target, "click" ) || + nodeName( target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + } +}; + +// Ensure the presence of an event listener that handles manually-triggered +// synthetic events by interrupting progress until reinvoked in response to +// *native* events that it fires directly, ensuring that state changes have +// already occurred before other listeners are invoked. +function leverageNative( el, type, expectSync ) { + + // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add + if ( !expectSync ) { + if ( dataPriv.get( el, type ) === undefined ) { + jQuery.event.add( el, type, returnTrue ); + } + return; + } + + // Register the controller as a special universal handler for all event namespaces + dataPriv.set( el, type, false ); + jQuery.event.add( el, type, { + namespace: false, + handler: function( event ) { + var notAsync, result, + saved = dataPriv.get( this, type ); + + if ( ( event.isTrigger & 1 ) && this[ type ] ) { + + // Interrupt processing of the outer synthetic .trigger()ed event + // Saved data should be false in such cases, but might be a leftover capture object + // from an async native handler (gh-4350) + if ( !saved.length ) { + + // Store arguments for use when handling the inner native event + // There will always be at least one argument (an event object), so this array + // will not be confused with a leftover capture object. + saved = slice.call( arguments ); + dataPriv.set( this, type, saved ); + + // Trigger the native event and capture its result + // Support: IE <=9 - 11+ + // focus() and blur() are asynchronous + notAsync = expectSync( this, type ); + this[ type ](); + result = dataPriv.get( this, type ); + if ( saved !== result || notAsync ) { + dataPriv.set( this, type, false ); + } else { + result = {}; + } + if ( saved !== result ) { + + // Cancel the outer synthetic event + event.stopImmediatePropagation(); + event.preventDefault(); + return result.value; + } + + // If this is an inner synthetic event for an event with a bubbling surrogate + // (focus or blur), assume that the surrogate already propagated from triggering the + // native event and prevent that from happening again here. + // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the + // bubbling surrogate propagates *after* the non-bubbling base), but that seems + // less bad than duplication. + } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { + event.stopPropagation(); + } + + // If this is a native event triggered above, everything is now in order + // Fire an inner synthetic event with the original arguments + } else if ( saved.length ) { + + // ...and capture the result + dataPriv.set( this, type, { + value: jQuery.event.trigger( + + // Support: IE <=9 - 11+ + // Extend with the prototype to reset the above stopImmediatePropagation() + jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), + saved.slice( 1 ), + this + ) + } ); + + // Abort handling of the native event + event.stopImmediatePropagation(); + } + } + } ); +} + +jQuery.removeEvent = function( elem, type, handle ) { + + // This "if" is needed for plain objects + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle ); + } +}; + +jQuery.Event = function( src, props ) { + + // Allow instantiation without the 'new' keyword + if ( !( this instanceof jQuery.Event ) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + + // Support: Android <=2.3 only + src.returnValue === false ? + returnTrue : + returnFalse; + + // Create target properties + // Support: Safari <=6 - 7 only + // Target should not be a text node (#504, #13143) + this.target = ( src.target && src.target.nodeType === 3 ) ? + src.target.parentNode : + src.target; + + this.currentTarget = src.currentTarget; + this.relatedTarget = src.relatedTarget; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || Date.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + constructor: jQuery.Event, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + isSimulated: false, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + + if ( e && !this.isSimulated ) { + e.preventDefault(); + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopPropagation(); + } + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Includes all common event props including KeyEvent and MouseEvent specific props +jQuery.each( { + altKey: true, + bubbles: true, + cancelable: true, + changedTouches: true, + ctrlKey: true, + detail: true, + eventPhase: true, + metaKey: true, + pageX: true, + pageY: true, + shiftKey: true, + view: true, + "char": true, + code: true, + charCode: true, + key: true, + keyCode: true, + button: true, + buttons: true, + clientX: true, + clientY: true, + offsetX: true, + offsetY: true, + pointerId: true, + pointerType: true, + screenX: true, + screenY: true, + targetTouches: true, + toElement: true, + touches: true, + + which: function( event ) { + var button = event.button; + + // Add which for key events + if ( event.which == null && rkeyEvent.test( event.type ) ) { + return event.charCode != null ? event.charCode : event.keyCode; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { + if ( button & 1 ) { + return 1; + } + + if ( button & 2 ) { + return 3; + } + + if ( button & 4 ) { + return 2; + } + + return 0; + } + + return event.which; + } +}, jQuery.event.addProp ); + +jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { + jQuery.event.special[ type ] = { + + // Utilize native event if possible so blur/focus sequence is correct + setup: function() { + + // Claim the first handler + // dataPriv.set( this, "focus", ... ) + // dataPriv.set( this, "blur", ... ) + leverageNative( this, type, expectSync ); + + // Return false to allow normal processing in the caller + return false; + }, + trigger: function() { + + // Force setup before trigger + leverageNative( this, type ); + + // Return non-false to allow normal event-path propagation + return true; + }, + + delegateType: delegateType + }; +} ); + +// Create mouseenter/leave events using mouseover/out and event-time checks +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mouseenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +} ); + +jQuery.fn.extend( { + + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); + }, + one: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each( function() { + jQuery.event.remove( this, types, fn, selector ); + } ); + } +} ); + + +var + + // Support: IE <=10 - 11, Edge 12 - 13 only + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /\s*$/g; + +// Prefer a tbody over its parent table for containing new rows +function manipulationTarget( elem, content ) { + if ( nodeName( elem, "table" ) && + nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { + + return jQuery( elem ).children( "tbody" )[ 0 ] || elem; + } + + return elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { + elem.type = elem.type.slice( 5 ); + } else { + elem.removeAttribute( "type" ); + } + + return elem; +} + +function cloneCopyEvent( src, dest ) { + var i, l, type, pdataOld, udataOld, udataCur, events; + + if ( dest.nodeType !== 1 ) { + return; + } + + // 1. Copy private data: events, handlers, etc. + if ( dataPriv.hasData( src ) ) { + pdataOld = dataPriv.get( src ); + events = pdataOld.events; + + if ( events ) { + dataPriv.remove( dest, "handle events" ); + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + } + + // 2. Copy user data + if ( dataUser.hasData( src ) ) { + udataOld = dataUser.access( src ); + udataCur = jQuery.extend( {}, udataOld ); + + dataUser.set( dest, udataCur ); + } +} + +// Fix IE bugs, see support tests +function fixInput( src, dest ) { + var nodeName = dest.nodeName.toLowerCase(); + + // Fails to persist the checked state of a cloned checkbox or radio button. + if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + dest.checked = src.checked; + + // Fails to return the selected option to the default selected state when cloning options + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +function domManip( collection, args, callback, ignored ) { + + // Flatten any nested arrays + args = flat( args ); + + var fragment, first, scripts, hasScripts, node, doc, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + valueIsFunction = isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( valueIsFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( valueIsFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + domManip( self, args, callback, ignored ); + } ); + } + + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( collection[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !dataPriv.access( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { + + if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { + + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl && !node.noModule ) { + jQuery._evalUrl( node.src, { + nonce: node.nonce || node.getAttribute( "nonce" ) + }, doc ); + } + } else { + DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); + } + } + } + } + } + } + + return collection; +} + +function remove( elem, selector, keepData ) { + var node, + nodes = selector ? jQuery.filter( selector, elem ) : elem, + i = 0; + + for ( ; ( node = nodes[ i ] ) != null; i++ ) { + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); + } + + if ( node.parentNode ) { + if ( keepData && isAttached( node ) ) { + setGlobalEval( getAll( node, "script" ) ); + } + node.parentNode.removeChild( node ); + } + } + + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html; + }, + + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var i, l, srcElements, destElements, + clone = elem.cloneNode( true ), + inPage = isAttached( elem ); + + // Fix IE cloning issues + if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && + !jQuery.isXMLDoc( elem ) ) { + + // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + fixInput( srcElements[ i ], destElements[ i ] ); + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + cloneCopyEvent( srcElements[ i ], destElements[ i ] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + // Return the cloned set + return clone; + }, + + cleanData: function( elems ) { + var data, elem, type, + special = jQuery.event.special, + i = 0; + + for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { + if ( acceptData( elem ) ) { + if ( ( data = elem[ dataPriv.expando ] ) ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataPriv.expando ] = undefined; + } + if ( elem[ dataUser.expando ] ) { + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataUser.expando ] = undefined; + } + } + } + } +} ); + +jQuery.fn.extend( { + detach: function( selector ) { + return remove( this, selector, true ); + }, + + remove: function( selector ) { + return remove( this, selector ); + }, + + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().each( function() { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.textContent = value; + } + } ); + }, null, value, arguments.length ); + }, + + append: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + } ); + }, + + prepend: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + } ); + }, + + before: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + } ); + }, + + after: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + } ); + }, + + empty: function() { + var elem, + i = 0; + + for ( ; ( elem = this[ i ] ) != null; i++ ) { + if ( elem.nodeType === 1 ) { + + // Prevent memory leaks + jQuery.cleanData( getAll( elem, false ) ); + + // Remove any remaining nodes + elem.textContent = ""; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + } ); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined && elem.nodeType === 1 ) { + return elem.innerHTML; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { + + value = jQuery.htmlPrefilter( value ); + + try { + for ( ; i < l; i++ ) { + elem = this[ i ] || {}; + + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch ( e ) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var ignored = []; + + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; + + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); + } + } + + // Force callback invocation + }, ignored ); + } +} ); + +jQuery.each( { + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1, + i = 0; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); + + // Support: Android <=4.0 only, PhantomJS 1 only + // .get() because push.apply(_, arraylike) throws on ancient WebKit + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +} ); +var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); + +var getStyles = function( elem ) { + + // Support: IE <=11 only, Firefox <=30 (#15098, #14150) + // IE throws on elements created in popups + // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" + var view = elem.ownerDocument.defaultView; + + if ( !view || !view.opener ) { + view = window; + } + + return view.getComputedStyle( elem ); + }; + +var swap = function( elem, options, callback ) { + var ret, name, + old = {}; + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.call( elem ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; +}; + + +var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); + + + +( function() { + + // Executing both pixelPosition & boxSizingReliable tests require only one layout + // so they're executed at the same time to save the second computation. + function computeStyleTests() { + + // This is a singleton, we need to execute it only once + if ( !div ) { + return; + } + + container.style.cssText = "position:absolute;left:-11111px;width:60px;" + + "margin-top:1px;padding:0;border:0"; + div.style.cssText = + "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + + "margin:auto;border:1px;padding:1px;" + + "width:60%;top:1%"; + documentElement.appendChild( container ).appendChild( div ); + + var divStyle = window.getComputedStyle( div ); + pixelPositionVal = divStyle.top !== "1%"; + + // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 + reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; + + // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 + // Some styles come back with percentage values, even though they shouldn't + div.style.right = "60%"; + pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; + + // Support: IE 9 - 11 only + // Detect misreporting of content dimensions for box-sizing:border-box elements + boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; + + // Support: IE 9 only + // Detect overflow:scroll screwiness (gh-3699) + // Support: Chrome <=64 + // Don't get tricked when zoom affects offsetWidth (gh-4029) + div.style.position = "absolute"; + scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; + + documentElement.removeChild( container ); + + // Nullify the div so it wouldn't be stored in the memory and + // it will also be a sign that checks already performed + div = null; + } + + function roundPixelMeasures( measure ) { + return Math.round( parseFloat( measure ) ); + } + + var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, + reliableTrDimensionsVal, reliableMarginLeftVal, + container = document.createElement( "div" ), + div = document.createElement( "div" ); + + // Finish early in limited (non-browser) environments + if ( !div.style ) { + return; + } + + // Support: IE <=9 - 11 only + // Style of cloned element affects source element cloned (#8908) + div.style.backgroundClip = "content-box"; + div.cloneNode( true ).style.backgroundClip = ""; + support.clearCloneStyle = div.style.backgroundClip === "content-box"; + + jQuery.extend( support, { + boxSizingReliable: function() { + computeStyleTests(); + return boxSizingReliableVal; + }, + pixelBoxStyles: function() { + computeStyleTests(); + return pixelBoxStylesVal; + }, + pixelPosition: function() { + computeStyleTests(); + return pixelPositionVal; + }, + reliableMarginLeft: function() { + computeStyleTests(); + return reliableMarginLeftVal; + }, + scrollboxSize: function() { + computeStyleTests(); + return scrollboxSizeVal; + }, + + // Support: IE 9 - 11+, Edge 15 - 18+ + // IE/Edge misreport `getComputedStyle` of table rows with width/height + // set in CSS while `offset*` properties report correct values. + // Behavior in IE 9 is more subtle than in newer versions & it passes + // some versions of this test; make sure not to make it pass there! + reliableTrDimensions: function() { + var table, tr, trChild, trStyle; + if ( reliableTrDimensionsVal == null ) { + table = document.createElement( "table" ); + tr = document.createElement( "tr" ); + trChild = document.createElement( "div" ); + + table.style.cssText = "position:absolute;left:-11111px"; + tr.style.height = "1px"; + trChild.style.height = "9px"; + + documentElement + .appendChild( table ) + .appendChild( tr ) + .appendChild( trChild ); + + trStyle = window.getComputedStyle( tr ); + reliableTrDimensionsVal = parseInt( trStyle.height ) > 3; + + documentElement.removeChild( table ); + } + return reliableTrDimensionsVal; + } + } ); +} )(); + + +function curCSS( elem, name, computed ) { + var width, minWidth, maxWidth, ret, + + // Support: Firefox 51+ + // Retrieving style before computed somehow + // fixes an issue with getting wrong values + // on detached elements + style = elem.style; + + computed = computed || getStyles( elem ); + + // getPropertyValue is needed for: + // .css('filter') (IE 9 only, #12537) + // .css('--customProperty) (#3144) + if ( computed ) { + ret = computed.getPropertyValue( name ) || computed[ name ]; + + if ( ret === "" && !isAttached( elem ) ) { + ret = jQuery.style( elem, name ); + } + + // A tribute to the "awesome hack by Dean Edwards" + // Android Browser returns percentage for some values, + // but width seems to be reliably pixels. + // This is against the CSSOM draft spec: + // https://drafts.csswg.org/cssom/#resolved-values + if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { + + // Remember the original values + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + // Put in the new values to get a computed value out + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + // Revert the changed values + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } + } + + return ret !== undefined ? + + // Support: IE <=9 - 11 only + // IE returns zIndex value as an integer. + ret + "" : + ret; +} + + +function addGetHookIf( conditionFn, hookFn ) { + + // Define the hook, we'll check on the first run if it's really needed. + return { + get: function() { + if ( conditionFn() ) { + + // Hook not needed (or it's not possible to use it due + // to missing dependency), remove it. + delete this.get; + return; + } + + // Hook needed; redefine it so that the support test is not executed again. + return ( this.get = hookFn ).apply( this, arguments ); + } + }; +} + + +var cssPrefixes = [ "Webkit", "Moz", "ms" ], + emptyStyle = document.createElement( "div" ).style, + vendorProps = {}; + +// Return a vendor-prefixed property or undefined +function vendorPropName( name ) { + + // Check for vendor prefixed names + var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), + i = cssPrefixes.length; + + while ( i-- ) { + name = cssPrefixes[ i ] + capName; + if ( name in emptyStyle ) { + return name; + } + } +} + +// Return a potentially-mapped jQuery.cssProps or vendor prefixed property +function finalPropName( name ) { + var final = jQuery.cssProps[ name ] || vendorProps[ name ]; + + if ( final ) { + return final; + } + if ( name in emptyStyle ) { + return name; + } + return vendorProps[ name ] = vendorPropName( name ) || name; +} + + +var + + // Swappable if display is none or starts with table + // except "table", "table-cell", or "table-caption" + // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, + rcustomProp = /^--/, + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: "0", + fontWeight: "400" + }; + +function setPositiveNumber( _elem, value, subtract ) { + + // Any relative (+/-) values have already been + // normalized at this point + var matches = rcssNum.exec( value ); + return matches ? + + // Guard against undefined "subtract", e.g., when used as in cssHooks + Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : + value; +} + +function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { + var i = dimension === "width" ? 1 : 0, + extra = 0, + delta = 0; + + // Adjustment may not be necessary + if ( box === ( isBorderBox ? "border" : "content" ) ) { + return 0; + } + + for ( ; i < 4; i += 2 ) { + + // Both box models exclude margin + if ( box === "margin" ) { + delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); + } + + // If we get here with a content-box, we're seeking "padding" or "border" or "margin" + if ( !isBorderBox ) { + + // Add padding + delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + + // For "border" or "margin", add border + if ( box !== "padding" ) { + delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + + // But still keep track of it otherwise + } else { + extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + + // If we get here with a border-box (content + padding + border), we're seeking "content" or + // "padding" or "margin" + } else { + + // For "content", subtract padding + if ( box === "content" ) { + delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + } + + // For "content" or "padding", subtract border + if ( box !== "margin" ) { + delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } + } + + // Account for positive content-box scroll gutter when requested by providing computedVal + if ( !isBorderBox && computedVal >= 0 ) { + + // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border + // Assuming integer scroll gutter, subtract the rest and round down + delta += Math.max( 0, Math.ceil( + elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - + computedVal - + delta - + extra - + 0.5 + + // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter + // Use an explicit zero to avoid NaN (gh-3964) + ) ) || 0; + } + + return delta; +} + +function getWidthOrHeight( elem, dimension, extra ) { + + // Start with computed style + var styles = getStyles( elem ), + + // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). + // Fake content-box until we know it's needed to know the true value. + boxSizingNeeded = !support.boxSizingReliable() || extra, + isBorderBox = boxSizingNeeded && + jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + valueIsBorderBox = isBorderBox, + + val = curCSS( elem, dimension, styles ), + offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); + + // Support: Firefox <=54 + // Return a confounding non-pixel value or feign ignorance, as appropriate. + if ( rnumnonpx.test( val ) ) { + if ( !extra ) { + return val; + } + val = "auto"; + } + + + // Support: IE 9 - 11 only + // Use offsetWidth/offsetHeight for when box sizing is unreliable. + // In those cases, the computed value can be trusted to be border-box. + if ( ( !support.boxSizingReliable() && isBorderBox || + + // Support: IE 10 - 11+, Edge 15 - 18+ + // IE/Edge misreport `getComputedStyle` of table rows with width/height + // set in CSS while `offset*` properties report correct values. + // Interestingly, in some cases IE 9 doesn't suffer from this issue. + !support.reliableTrDimensions() && nodeName( elem, "tr" ) || + + // Fall back to offsetWidth/offsetHeight when value is "auto" + // This happens for inline elements with no explicit setting (gh-3571) + val === "auto" || + + // Support: Android <=4.1 - 4.3 only + // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) + !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && + + // Make sure the element is visible & connected + elem.getClientRects().length ) { + + isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; + + // Where available, offsetWidth/offsetHeight approximate border box dimensions. + // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the + // retrieved value as a content box dimension. + valueIsBorderBox = offsetProp in elem; + if ( valueIsBorderBox ) { + val = elem[ offsetProp ]; + } + } + + // Normalize "" and auto + val = parseFloat( val ) || 0; + + // Adjust for the element's box model + return ( val + + boxModelAdjustment( + elem, + dimension, + extra || ( isBorderBox ? "border" : "content" ), + valueIsBorderBox, + styles, + + // Provide the current computed size to request scroll gutter calculation (gh-3589) + val + ) + ) + "px"; +} + +jQuery.extend( { + + // Add in style property hooks for overriding the default + // behavior of getting and setting a style property + cssHooks: { + opacity: { + get: function( elem, computed ) { + if ( computed ) { + + // We should always get a number back from opacity + var ret = curCSS( elem, "opacity" ); + return ret === "" ? "1" : ret; + } + } + } + }, + + // Don't automatically add "px" to these possibly-unitless properties + cssNumber: { + "animationIterationCount": true, + "columnCount": true, + "fillOpacity": true, + "flexGrow": true, + "flexShrink": true, + "fontWeight": true, + "gridArea": true, + "gridColumn": true, + "gridColumnEnd": true, + "gridColumnStart": true, + "gridRow": true, + "gridRowEnd": true, + "gridRowStart": true, + "lineHeight": true, + "opacity": true, + "order": true, + "orphans": true, + "widows": true, + "zIndex": true, + "zoom": true + }, + + // Add in properties whose names you wish to fix before + // setting or getting the value + cssProps: {}, + + // Get and set the style property on a DOM Node + style: function( elem, name, value, extra ) { + + // Don't set styles on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { + return; + } + + // Make sure that we're working with the right name + var ret, type, hooks, + origName = camelCase( name ), + isCustomProp = rcustomProp.test( name ), + style = elem.style; + + // Make sure that we're working with the right name. We don't + // want to query the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Gets hook for the prefixed version, then unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // Check if we're setting a value + if ( value !== undefined ) { + type = typeof value; + + // Convert "+=" or "-=" to relative numbers (#7345) + if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { + value = adjustCSS( elem, name, ret ); + + // Fixes bug #9237 + type = "number"; + } + + // Make sure that null and NaN values aren't set (#7116) + if ( value == null || value !== value ) { + return; + } + + // If a number was passed in, add the unit (except for certain CSS properties) + // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append + // "px" to a few hardcoded values. + if ( type === "number" && !isCustomProp ) { + value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); + } + + // background-* props affect original clone's values + if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { + style[ name ] = "inherit"; + } + + // If a hook was provided, use that value, otherwise just set the specified value + if ( !hooks || !( "set" in hooks ) || + ( value = hooks.set( elem, value, extra ) ) !== undefined ) { + + if ( isCustomProp ) { + style.setProperty( name, value ); + } else { + style[ name ] = value; + } + } + + } else { + + // If a hook was provided get the non-computed value from there + if ( hooks && "get" in hooks && + ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { + + return ret; + } + + // Otherwise just get the value from the style object + return style[ name ]; + } + }, + + css: function( elem, name, extra, styles ) { + var val, num, hooks, + origName = camelCase( name ), + isCustomProp = rcustomProp.test( name ); + + // Make sure that we're working with the right name. We don't + // want to modify the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Try prefixed name followed by the unprefixed name + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // If a hook was provided get the computed value from there + if ( hooks && "get" in hooks ) { + val = hooks.get( elem, true, extra ); + } + + // Otherwise, if a way to get the computed value exists, use that + if ( val === undefined ) { + val = curCSS( elem, name, styles ); + } + + // Convert "normal" to computed value + if ( val === "normal" && name in cssNormalTransform ) { + val = cssNormalTransform[ name ]; + } + + // Make numeric if forced or a qualifier was provided and val looks numeric + if ( extra === "" || extra ) { + num = parseFloat( val ); + return extra === true || isFinite( num ) ? num || 0 : val; + } + + return val; + } +} ); + +jQuery.each( [ "height", "width" ], function( _i, dimension ) { + jQuery.cssHooks[ dimension ] = { + get: function( elem, computed, extra ) { + if ( computed ) { + + // Certain elements can have dimension info if we invisibly show them + // but it must have a current display style that would benefit + return rdisplayswap.test( jQuery.css( elem, "display" ) ) && + + // Support: Safari 8+ + // Table columns in Safari have non-zero offsetWidth & zero + // getBoundingClientRect().width unless display is changed. + // Support: IE <=11 only + // Running getBoundingClientRect on a disconnected node + // in IE throws an error. + ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? + swap( elem, cssShow, function() { + return getWidthOrHeight( elem, dimension, extra ); + } ) : + getWidthOrHeight( elem, dimension, extra ); + } + }, + + set: function( elem, value, extra ) { + var matches, + styles = getStyles( elem ), + + // Only read styles.position if the test has a chance to fail + // to avoid forcing a reflow. + scrollboxSizeBuggy = !support.scrollboxSize() && + styles.position === "absolute", + + // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) + boxSizingNeeded = scrollboxSizeBuggy || extra, + isBorderBox = boxSizingNeeded && + jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + subtract = extra ? + boxModelAdjustment( + elem, + dimension, + extra, + isBorderBox, + styles + ) : + 0; + + // Account for unreliable border-box dimensions by comparing offset* to computed and + // faking a content-box to get border and padding (gh-3699) + if ( isBorderBox && scrollboxSizeBuggy ) { + subtract -= Math.ceil( + elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - + parseFloat( styles[ dimension ] ) - + boxModelAdjustment( elem, dimension, "border", false, styles ) - + 0.5 + ); + } + + // Convert to pixels if value adjustment is needed + if ( subtract && ( matches = rcssNum.exec( value ) ) && + ( matches[ 3 ] || "px" ) !== "px" ) { + + elem.style[ dimension ] = value; + value = jQuery.css( elem, dimension ); + } + + return setPositiveNumber( elem, value, subtract ); + } + }; +} ); + +jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, + function( elem, computed ) { + if ( computed ) { + return ( parseFloat( curCSS( elem, "marginLeft" ) ) || + elem.getBoundingClientRect().left - + swap( elem, { marginLeft: 0 }, function() { + return elem.getBoundingClientRect().left; + } ) + ) + "px"; + } + } +); + +// These hooks are used by animate to expand properties +jQuery.each( { + margin: "", + padding: "", + border: "Width" +}, function( prefix, suffix ) { + jQuery.cssHooks[ prefix + suffix ] = { + expand: function( value ) { + var i = 0, + expanded = {}, + + // Assumes a single number if not a string + parts = typeof value === "string" ? value.split( " " ) : [ value ]; + + for ( ; i < 4; i++ ) { + expanded[ prefix + cssExpand[ i ] + suffix ] = + parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; + } + + return expanded; + } + }; + + if ( prefix !== "margin" ) { + jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; + } +} ); + +jQuery.fn.extend( { + css: function( name, value ) { + return access( this, function( elem, name, value ) { + var styles, len, + map = {}, + i = 0; + + if ( Array.isArray( name ) ) { + styles = getStyles( elem ); + len = name.length; + + for ( ; i < len; i++ ) { + map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); + } + + return map; + } + + return value !== undefined ? + jQuery.style( elem, name, value ) : + jQuery.css( elem, name ); + }, name, value, arguments.length > 1 ); + } +} ); + + +function Tween( elem, options, prop, end, easing ) { + return new Tween.prototype.init( elem, options, prop, end, easing ); +} +jQuery.Tween = Tween; + +Tween.prototype = { + constructor: Tween, + init: function( elem, options, prop, end, easing, unit ) { + this.elem = elem; + this.prop = prop; + this.easing = easing || jQuery.easing._default; + this.options = options; + this.start = this.now = this.cur(); + this.end = end; + this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + }, + cur: function() { + var hooks = Tween.propHooks[ this.prop ]; + + return hooks && hooks.get ? + hooks.get( this ) : + Tween.propHooks._default.get( this ); + }, + run: function( percent ) { + var eased, + hooks = Tween.propHooks[ this.prop ]; + + if ( this.options.duration ) { + this.pos = eased = jQuery.easing[ this.easing ]( + percent, this.options.duration * percent, 0, 1, this.options.duration + ); + } else { + this.pos = eased = percent; + } + this.now = ( this.end - this.start ) * eased + this.start; + + if ( this.options.step ) { + this.options.step.call( this.elem, this.now, this ); + } + + if ( hooks && hooks.set ) { + hooks.set( this ); + } else { + Tween.propHooks._default.set( this ); + } + return this; + } +}; + +Tween.prototype.init.prototype = Tween.prototype; + +Tween.propHooks = { + _default: { + get: function( tween ) { + var result; + + // Use a property on the element directly when it is not a DOM element, + // or when there is no matching style property that exists. + if ( tween.elem.nodeType !== 1 || + tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { + return tween.elem[ tween.prop ]; + } + + // Passing an empty string as a 3rd parameter to .css will automatically + // attempt a parseFloat and fallback to a string if the parse fails. + // Simple values such as "10px" are parsed to Float; + // complex values such as "rotate(1rad)" are returned as-is. + result = jQuery.css( tween.elem, tween.prop, "" ); + + // Empty strings, null, undefined and "auto" are converted to 0. + return !result || result === "auto" ? 0 : result; + }, + set: function( tween ) { + + // Use step hook for back compat. + // Use cssHook if its there. + // Use .style if available and use plain properties where available. + if ( jQuery.fx.step[ tween.prop ] ) { + jQuery.fx.step[ tween.prop ]( tween ); + } else if ( tween.elem.nodeType === 1 && ( + jQuery.cssHooks[ tween.prop ] || + tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { + jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); + } else { + tween.elem[ tween.prop ] = tween.now; + } + } + } +}; + +// Support: IE <=9 only +// Panic based approach to setting things on disconnected nodes +Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { + set: function( tween ) { + if ( tween.elem.nodeType && tween.elem.parentNode ) { + tween.elem[ tween.prop ] = tween.now; + } + } +}; + +jQuery.easing = { + linear: function( p ) { + return p; + }, + swing: function( p ) { + return 0.5 - Math.cos( p * Math.PI ) / 2; + }, + _default: "swing" +}; + +jQuery.fx = Tween.prototype.init; + +// Back compat <1.8 extension point +jQuery.fx.step = {}; + + + + +var + fxNow, inProgress, + rfxtypes = /^(?:toggle|show|hide)$/, + rrun = /queueHooks$/; + +function schedule() { + if ( inProgress ) { + if ( document.hidden === false && window.requestAnimationFrame ) { + window.requestAnimationFrame( schedule ); + } else { + window.setTimeout( schedule, jQuery.fx.interval ); + } + + jQuery.fx.tick(); + } +} + +// Animations created synchronously will run synchronously +function createFxNow() { + window.setTimeout( function() { + fxNow = undefined; + } ); + return ( fxNow = Date.now() ); +} + +// Generate parameters to create a standard animation +function genFx( type, includeWidth ) { + var which, + i = 0, + attrs = { height: type }; + + // If we include width, step value is 1 to do all cssExpand values, + // otherwise step value is 2 to skip over Left and Right + includeWidth = includeWidth ? 1 : 0; + for ( ; i < 4; i += 2 - includeWidth ) { + which = cssExpand[ i ]; + attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; + } + + if ( includeWidth ) { + attrs.opacity = attrs.width = type; + } + + return attrs; +} + +function createTween( value, prop, animation ) { + var tween, + collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), + index = 0, + length = collection.length; + for ( ; index < length; index++ ) { + if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { + + // We're done with this property + return tween; + } + } +} + +function defaultPrefilter( elem, props, opts ) { + var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, + isBox = "width" in props || "height" in props, + anim = this, + orig = {}, + style = elem.style, + hidden = elem.nodeType && isHiddenWithinTree( elem ), + dataShow = dataPriv.get( elem, "fxshow" ); + + // Queue-skipping animations hijack the fx hooks + if ( !opts.queue ) { + hooks = jQuery._queueHooks( elem, "fx" ); + if ( hooks.unqueued == null ) { + hooks.unqueued = 0; + oldfire = hooks.empty.fire; + hooks.empty.fire = function() { + if ( !hooks.unqueued ) { + oldfire(); + } + }; + } + hooks.unqueued++; + + anim.always( function() { + + // Ensure the complete handler is called before this completes + anim.always( function() { + hooks.unqueued--; + if ( !jQuery.queue( elem, "fx" ).length ) { + hooks.empty.fire(); + } + } ); + } ); + } + + // Detect show/hide animations + for ( prop in props ) { + value = props[ prop ]; + if ( rfxtypes.test( value ) ) { + delete props[ prop ]; + toggle = toggle || value === "toggle"; + if ( value === ( hidden ? "hide" : "show" ) ) { + + // Pretend to be hidden if this is a "show" and + // there is still data from a stopped show/hide + if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { + hidden = true; + + // Ignore all other no-op show/hide data + } else { + continue; + } + } + orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); + } + } + + // Bail out if this is a no-op like .hide().hide() + propTween = !jQuery.isEmptyObject( props ); + if ( !propTween && jQuery.isEmptyObject( orig ) ) { + return; + } + + // Restrict "overflow" and "display" styles during box animations + if ( isBox && elem.nodeType === 1 ) { + + // Support: IE <=9 - 11, Edge 12 - 15 + // Record all 3 overflow attributes because IE does not infer the shorthand + // from identically-valued overflowX and overflowY and Edge just mirrors + // the overflowX value there. + opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; + + // Identify a display type, preferring old show/hide data over the CSS cascade + restoreDisplay = dataShow && dataShow.display; + if ( restoreDisplay == null ) { + restoreDisplay = dataPriv.get( elem, "display" ); + } + display = jQuery.css( elem, "display" ); + if ( display === "none" ) { + if ( restoreDisplay ) { + display = restoreDisplay; + } else { + + // Get nonempty value(s) by temporarily forcing visibility + showHide( [ elem ], true ); + restoreDisplay = elem.style.display || restoreDisplay; + display = jQuery.css( elem, "display" ); + showHide( [ elem ] ); + } + } + + // Animate inline elements as inline-block + if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { + if ( jQuery.css( elem, "float" ) === "none" ) { + + // Restore the original display value at the end of pure show/hide animations + if ( !propTween ) { + anim.done( function() { + style.display = restoreDisplay; + } ); + if ( restoreDisplay == null ) { + display = style.display; + restoreDisplay = display === "none" ? "" : display; + } + } + style.display = "inline-block"; + } + } + } + + if ( opts.overflow ) { + style.overflow = "hidden"; + anim.always( function() { + style.overflow = opts.overflow[ 0 ]; + style.overflowX = opts.overflow[ 1 ]; + style.overflowY = opts.overflow[ 2 ]; + } ); + } + + // Implement show/hide animations + propTween = false; + for ( prop in orig ) { + + // General show/hide setup for this element animation + if ( !propTween ) { + if ( dataShow ) { + if ( "hidden" in dataShow ) { + hidden = dataShow.hidden; + } + } else { + dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); + } + + // Store hidden/visible for toggle so `.stop().toggle()` "reverses" + if ( toggle ) { + dataShow.hidden = !hidden; + } + + // Show elements before animating them + if ( hidden ) { + showHide( [ elem ], true ); + } + + /* eslint-disable no-loop-func */ + + anim.done( function() { + + /* eslint-enable no-loop-func */ + + // The final step of a "hide" animation is actually hiding the element + if ( !hidden ) { + showHide( [ elem ] ); + } + dataPriv.remove( elem, "fxshow" ); + for ( prop in orig ) { + jQuery.style( elem, prop, orig[ prop ] ); + } + } ); + } + + // Per-property setup + propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); + if ( !( prop in dataShow ) ) { + dataShow[ prop ] = propTween.start; + if ( hidden ) { + propTween.end = propTween.start; + propTween.start = 0; + } + } + } +} + +function propFilter( props, specialEasing ) { + var index, name, easing, value, hooks; + + // camelCase, specialEasing and expand cssHook pass + for ( index in props ) { + name = camelCase( index ); + easing = specialEasing[ name ]; + value = props[ index ]; + if ( Array.isArray( value ) ) { + easing = value[ 1 ]; + value = props[ index ] = value[ 0 ]; + } + + if ( index !== name ) { + props[ name ] = value; + delete props[ index ]; + } + + hooks = jQuery.cssHooks[ name ]; + if ( hooks && "expand" in hooks ) { + value = hooks.expand( value ); + delete props[ name ]; + + // Not quite $.extend, this won't overwrite existing keys. + // Reusing 'index' because we have the correct "name" + for ( index in value ) { + if ( !( index in props ) ) { + props[ index ] = value[ index ]; + specialEasing[ index ] = easing; + } + } + } else { + specialEasing[ name ] = easing; + } + } +} + +function Animation( elem, properties, options ) { + var result, + stopped, + index = 0, + length = Animation.prefilters.length, + deferred = jQuery.Deferred().always( function() { + + // Don't match elem in the :animated selector + delete tick.elem; + } ), + tick = function() { + if ( stopped ) { + return false; + } + var currentTime = fxNow || createFxNow(), + remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), + + // Support: Android 2.3 only + // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) + temp = remaining / animation.duration || 0, + percent = 1 - temp, + index = 0, + length = animation.tweens.length; + + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( percent ); + } + + deferred.notifyWith( elem, [ animation, percent, remaining ] ); + + // If there's more to do, yield + if ( percent < 1 && length ) { + return remaining; + } + + // If this was an empty animation, synthesize a final progress notification + if ( !length ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + } + + // Resolve the animation and report its conclusion + deferred.resolveWith( elem, [ animation ] ); + return false; + }, + animation = deferred.promise( { + elem: elem, + props: jQuery.extend( {}, properties ), + opts: jQuery.extend( true, { + specialEasing: {}, + easing: jQuery.easing._default + }, options ), + originalProperties: properties, + originalOptions: options, + startTime: fxNow || createFxNow(), + duration: options.duration, + tweens: [], + createTween: function( prop, end ) { + var tween = jQuery.Tween( elem, animation.opts, prop, end, + animation.opts.specialEasing[ prop ] || animation.opts.easing ); + animation.tweens.push( tween ); + return tween; + }, + stop: function( gotoEnd ) { + var index = 0, + + // If we are going to the end, we want to run all the tweens + // otherwise we skip this part + length = gotoEnd ? animation.tweens.length : 0; + if ( stopped ) { + return this; + } + stopped = true; + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( 1 ); + } + + // Resolve when we played the last frame; otherwise, reject + if ( gotoEnd ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + deferred.resolveWith( elem, [ animation, gotoEnd ] ); + } else { + deferred.rejectWith( elem, [ animation, gotoEnd ] ); + } + return this; + } + } ), + props = animation.props; + + propFilter( props, animation.opts.specialEasing ); + + for ( ; index < length; index++ ) { + result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); + if ( result ) { + if ( isFunction( result.stop ) ) { + jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = + result.stop.bind( result ); + } + return result; + } + } + + jQuery.map( props, createTween, animation ); + + if ( isFunction( animation.opts.start ) ) { + animation.opts.start.call( elem, animation ); + } + + // Attach callbacks from options + animation + .progress( animation.opts.progress ) + .done( animation.opts.done, animation.opts.complete ) + .fail( animation.opts.fail ) + .always( animation.opts.always ); + + jQuery.fx.timer( + jQuery.extend( tick, { + elem: elem, + anim: animation, + queue: animation.opts.queue + } ) + ); + + return animation; +} + +jQuery.Animation = jQuery.extend( Animation, { + + tweeners: { + "*": [ function( prop, value ) { + var tween = this.createTween( prop, value ); + adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); + return tween; + } ] + }, + + tweener: function( props, callback ) { + if ( isFunction( props ) ) { + callback = props; + props = [ "*" ]; + } else { + props = props.match( rnothtmlwhite ); + } + + var prop, + index = 0, + length = props.length; + + for ( ; index < length; index++ ) { + prop = props[ index ]; + Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; + Animation.tweeners[ prop ].unshift( callback ); + } + }, + + prefilters: [ defaultPrefilter ], + + prefilter: function( callback, prepend ) { + if ( prepend ) { + Animation.prefilters.unshift( callback ); + } else { + Animation.prefilters.push( callback ); + } + } +} ); + +jQuery.speed = function( speed, easing, fn ) { + var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { + complete: fn || !fn && easing || + isFunction( speed ) && speed, + duration: speed, + easing: fn && easing || easing && !isFunction( easing ) && easing + }; + + // Go to the end state if fx are off + if ( jQuery.fx.off ) { + opt.duration = 0; + + } else { + if ( typeof opt.duration !== "number" ) { + if ( opt.duration in jQuery.fx.speeds ) { + opt.duration = jQuery.fx.speeds[ opt.duration ]; + + } else { + opt.duration = jQuery.fx.speeds._default; + } + } + } + + // Normalize opt.queue - true/undefined/null -> "fx" + if ( opt.queue == null || opt.queue === true ) { + opt.queue = "fx"; + } + + // Queueing + opt.old = opt.complete; + + opt.complete = function() { + if ( isFunction( opt.old ) ) { + opt.old.call( this ); + } + + if ( opt.queue ) { + jQuery.dequeue( this, opt.queue ); + } + }; + + return opt; +}; + +jQuery.fn.extend( { + fadeTo: function( speed, to, easing, callback ) { + + // Show any hidden elements after setting opacity to 0 + return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() + + // Animate to the value specified + .end().animate( { opacity: to }, speed, easing, callback ); + }, + animate: function( prop, speed, easing, callback ) { + var empty = jQuery.isEmptyObject( prop ), + optall = jQuery.speed( speed, easing, callback ), + doAnimation = function() { + + // Operate on a copy of prop so per-property easing won't be lost + var anim = Animation( this, jQuery.extend( {}, prop ), optall ); + + // Empty animations, or finishing resolves immediately + if ( empty || dataPriv.get( this, "finish" ) ) { + anim.stop( true ); + } + }; + doAnimation.finish = doAnimation; + + return empty || optall.queue === false ? + this.each( doAnimation ) : + this.queue( optall.queue, doAnimation ); + }, + stop: function( type, clearQueue, gotoEnd ) { + var stopQueue = function( hooks ) { + var stop = hooks.stop; + delete hooks.stop; + stop( gotoEnd ); + }; + + if ( typeof type !== "string" ) { + gotoEnd = clearQueue; + clearQueue = type; + type = undefined; + } + if ( clearQueue ) { + this.queue( type || "fx", [] ); + } + + return this.each( function() { + var dequeue = true, + index = type != null && type + "queueHooks", + timers = jQuery.timers, + data = dataPriv.get( this ); + + if ( index ) { + if ( data[ index ] && data[ index ].stop ) { + stopQueue( data[ index ] ); + } + } else { + for ( index in data ) { + if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { + stopQueue( data[ index ] ); + } + } + } + + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && + ( type == null || timers[ index ].queue === type ) ) { + + timers[ index ].anim.stop( gotoEnd ); + dequeue = false; + timers.splice( index, 1 ); + } + } + + // Start the next in the queue if the last step wasn't forced. + // Timers currently will call their complete callbacks, which + // will dequeue but only if they were gotoEnd. + if ( dequeue || !gotoEnd ) { + jQuery.dequeue( this, type ); + } + } ); + }, + finish: function( type ) { + if ( type !== false ) { + type = type || "fx"; + } + return this.each( function() { + var index, + data = dataPriv.get( this ), + queue = data[ type + "queue" ], + hooks = data[ type + "queueHooks" ], + timers = jQuery.timers, + length = queue ? queue.length : 0; + + // Enable finishing flag on private data + data.finish = true; + + // Empty the queue first + jQuery.queue( this, type, [] ); + + if ( hooks && hooks.stop ) { + hooks.stop.call( this, true ); + } + + // Look for any active animations, and finish them + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && timers[ index ].queue === type ) { + timers[ index ].anim.stop( true ); + timers.splice( index, 1 ); + } + } + + // Look for any animations in the old queue and finish them + for ( index = 0; index < length; index++ ) { + if ( queue[ index ] && queue[ index ].finish ) { + queue[ index ].finish.call( this ); + } + } + + // Turn off finishing flag + delete data.finish; + } ); + } +} ); + +jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { + var cssFn = jQuery.fn[ name ]; + jQuery.fn[ name ] = function( speed, easing, callback ) { + return speed == null || typeof speed === "boolean" ? + cssFn.apply( this, arguments ) : + this.animate( genFx( name, true ), speed, easing, callback ); + }; +} ); + +// Generate shortcuts for custom animations +jQuery.each( { + slideDown: genFx( "show" ), + slideUp: genFx( "hide" ), + slideToggle: genFx( "toggle" ), + fadeIn: { opacity: "show" }, + fadeOut: { opacity: "hide" }, + fadeToggle: { opacity: "toggle" } +}, function( name, props ) { + jQuery.fn[ name ] = function( speed, easing, callback ) { + return this.animate( props, speed, easing, callback ); + }; +} ); + +jQuery.timers = []; +jQuery.fx.tick = function() { + var timer, + i = 0, + timers = jQuery.timers; + + fxNow = Date.now(); + + for ( ; i < timers.length; i++ ) { + timer = timers[ i ]; + + // Run the timer and safely remove it when done (allowing for external removal) + if ( !timer() && timers[ i ] === timer ) { + timers.splice( i--, 1 ); + } + } + + if ( !timers.length ) { + jQuery.fx.stop(); + } + fxNow = undefined; +}; + +jQuery.fx.timer = function( timer ) { + jQuery.timers.push( timer ); + jQuery.fx.start(); +}; + +jQuery.fx.interval = 13; +jQuery.fx.start = function() { + if ( inProgress ) { + return; + } + + inProgress = true; + schedule(); +}; + +jQuery.fx.stop = function() { + inProgress = null; +}; + +jQuery.fx.speeds = { + slow: 600, + fast: 200, + + // Default speed + _default: 400 +}; + + +// Based off of the plugin by Clint Helfers, with permission. +// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ +jQuery.fn.delay = function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = window.setTimeout( next, time ); + hooks.stop = function() { + window.clearTimeout( timeout ); + }; + } ); +}; + + +( function() { + var input = document.createElement( "input" ), + select = document.createElement( "select" ), + opt = select.appendChild( document.createElement( "option" ) ); + + input.type = "checkbox"; + + // Support: Android <=4.3 only + // Default value for a checkbox should be "on" + support.checkOn = input.value !== ""; + + // Support: IE <=11 only + // Must access selectedIndex to make default options select + support.optSelected = opt.selected; + + // Support: IE <=11 only + // An input loses its value after becoming a radio + input = document.createElement( "input" ); + input.value = "t"; + input.type = "radio"; + support.radioValue = input.value === "t"; +} )(); + + +var boolHook, + attrHandle = jQuery.expr.attrHandle; + +jQuery.fn.extend( { + attr: function( name, value ) { + return access( this, jQuery.attr, name, value, arguments.length > 1 ); + }, + + removeAttr: function( name ) { + return this.each( function() { + jQuery.removeAttr( this, name ); + } ); + } +} ); + +jQuery.extend( { + attr: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set attributes on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === "undefined" ) { + return jQuery.prop( elem, name, value ); + } + + // Attribute hooks are determined by the lowercase version + // Grab necessary hook if one is defined + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + hooks = jQuery.attrHooks[ name.toLowerCase() ] || + ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); + } + + if ( value !== undefined ) { + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return; + } + + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + elem.setAttribute( name, value + "" ); + return value; + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + ret = jQuery.find.attr( elem, name ); + + // Non-existent attributes return null, we normalize to undefined + return ret == null ? undefined : ret; + }, + + attrHooks: { + type: { + set: function( elem, value ) { + if ( !support.radioValue && value === "radio" && + nodeName( elem, "input" ) ) { + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + } + }, + + removeAttr: function( elem, value ) { + var name, + i = 0, + + // Attribute names can contain non-HTML whitespace characters + // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 + attrNames = value && value.match( rnothtmlwhite ); + + if ( attrNames && elem.nodeType === 1 ) { + while ( ( name = attrNames[ i++ ] ) ) { + elem.removeAttribute( name ); + } + } + } +} ); + +// Hooks for boolean attributes +boolHook = { + set: function( elem, value, name ) { + if ( value === false ) { + + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + elem.setAttribute( name, name ); + } + return name; + } +}; + +jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { + var getter = attrHandle[ name ] || jQuery.find.attr; + + attrHandle[ name ] = function( elem, name, isXML ) { + var ret, handle, + lowercaseName = name.toLowerCase(); + + if ( !isXML ) { + + // Avoid an infinite loop by temporarily removing this function from the getter + handle = attrHandle[ lowercaseName ]; + attrHandle[ lowercaseName ] = ret; + ret = getter( elem, name, isXML ) != null ? + lowercaseName : + null; + attrHandle[ lowercaseName ] = handle; + } + return ret; + }; +} ); + + + + +var rfocusable = /^(?:input|select|textarea|button)$/i, + rclickable = /^(?:a|area)$/i; + +jQuery.fn.extend( { + prop: function( name, value ) { + return access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + return this.each( function() { + delete this[ jQuery.propFix[ name ] || name ]; + } ); + } +} ); + +jQuery.extend( { + prop: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set properties on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + return ( elem[ name ] = value ); + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + return elem[ name ]; + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + + // Support: IE <=9 - 11 only + // elem.tabIndex doesn't always return the + // correct value when it hasn't been explicitly set + // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + // Use proper attribute retrieval(#12072) + var tabindex = jQuery.find.attr( elem, "tabindex" ); + + if ( tabindex ) { + return parseInt( tabindex, 10 ); + } + + if ( + rfocusable.test( elem.nodeName ) || + rclickable.test( elem.nodeName ) && + elem.href + ) { + return 0; + } + + return -1; + } + } + }, + + propFix: { + "for": "htmlFor", + "class": "className" + } +} ); + +// Support: IE <=11 only +// Accessing the selectedIndex property +// forces the browser to respect setting selected +// on the option +// The getter ensures a default option is selected +// when in an optgroup +// eslint rule "no-unused-expressions" is disabled for this code +// since it considers such accessions noop +if ( !support.optSelected ) { + jQuery.propHooks.selected = { + get: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent && parent.parentNode ) { + parent.parentNode.selectedIndex; + } + return null; + }, + set: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + }; +} + +jQuery.each( [ + "tabIndex", + "readOnly", + "maxLength", + "cellSpacing", + "cellPadding", + "rowSpan", + "colSpan", + "useMap", + "frameBorder", + "contentEditable" +], function() { + jQuery.propFix[ this.toLowerCase() ] = this; +} ); + + + + + // Strip and collapse whitespace according to HTML spec + // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace + function stripAndCollapse( value ) { + var tokens = value.match( rnothtmlwhite ) || []; + return tokens.join( " " ); + } + + +function getClass( elem ) { + return elem.getAttribute && elem.getAttribute( "class" ) || ""; +} + +function classesToArray( value ) { + if ( Array.isArray( value ) ) { + return value; + } + if ( typeof value === "string" ) { + return value.match( rnothtmlwhite ) || []; + } + return []; +} + +jQuery.fn.extend( { + addClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + classes = classesToArray( value ); + + if ( classes.length ) { + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + if ( cur.indexOf( " " + clazz + " " ) < 0 ) { + cur += clazz + " "; + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + if ( !arguments.length ) { + return this.attr( "class", "" ); + } + + classes = classesToArray( value ); + + if ( classes.length ) { + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + + // This expression is here for better compressibility (see addClass) + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + + // Remove *all* instances + while ( cur.indexOf( " " + clazz + " " ) > -1 ) { + cur = cur.replace( " " + clazz + " ", " " ); + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isValidValue = type === "string" || Array.isArray( value ); + + if ( typeof stateVal === "boolean" && isValidValue ) { + return stateVal ? this.addClass( value ) : this.removeClass( value ); + } + + if ( isFunction( value ) ) { + return this.each( function( i ) { + jQuery( this ).toggleClass( + value.call( this, i, getClass( this ), stateVal ), + stateVal + ); + } ); + } + + return this.each( function() { + var className, i, self, classNames; + + if ( isValidValue ) { + + // Toggle individual class names + i = 0; + self = jQuery( this ); + classNames = classesToArray( value ); + + while ( ( className = classNames[ i++ ] ) ) { + + // Check each className given, space separated list + if ( self.hasClass( className ) ) { + self.removeClass( className ); + } else { + self.addClass( className ); + } + } + + // Toggle whole class name + } else if ( value === undefined || type === "boolean" ) { + className = getClass( this ); + if ( className ) { + + // Store className if set + dataPriv.set( this, "__className__", className ); + } + + // If the element has a class name or if we're passed `false`, + // then remove the whole classname (if there was one, the above saved it). + // Otherwise bring back whatever was previously saved (if anything), + // falling back to the empty string if nothing was stored. + if ( this.setAttribute ) { + this.setAttribute( "class", + className || value === false ? + "" : + dataPriv.get( this, "__className__" ) || "" + ); + } + } + } ); + }, + + hasClass: function( selector ) { + var className, elem, + i = 0; + + className = " " + selector + " "; + while ( ( elem = this[ i++ ] ) ) { + if ( elem.nodeType === 1 && + ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { + return true; + } + } + + return false; + } +} ); + + + + +var rreturn = /\r/g; + +jQuery.fn.extend( { + val: function( value ) { + var hooks, ret, valueIsFunction, + elem = this[ 0 ]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.type ] || + jQuery.valHooks[ elem.nodeName.toLowerCase() ]; + + if ( hooks && + "get" in hooks && + ( ret = hooks.get( elem, "value" ) ) !== undefined + ) { + return ret; + } + + ret = elem.value; + + // Handle most common string cases + if ( typeof ret === "string" ) { + return ret.replace( rreturn, "" ); + } + + // Handle cases where value is null/undef or number + return ret == null ? "" : ret; + } + + return; + } + + valueIsFunction = isFunction( value ); + + return this.each( function( i ) { + var val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( valueIsFunction ) { + val = value.call( this, i, jQuery( this ).val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + + } else if ( typeof val === "number" ) { + val += ""; + + } else if ( Array.isArray( val ) ) { + val = jQuery.map( val, function( value ) { + return value == null ? "" : value + ""; + } ); + } + + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + } ); + } +} ); + +jQuery.extend( { + valHooks: { + option: { + get: function( elem ) { + + var val = jQuery.find.attr( elem, "value" ); + return val != null ? + val : + + // Support: IE <=10 - 11 only + // option.text throws exceptions (#14686, #14858) + // Strip and collapse whitespace + // https://html.spec.whatwg.org/#strip-and-collapse-whitespace + stripAndCollapse( jQuery.text( elem ) ); + } + }, + select: { + get: function( elem ) { + var value, option, i, + options = elem.options, + index = elem.selectedIndex, + one = elem.type === "select-one", + values = one ? null : [], + max = one ? index + 1 : options.length; + + if ( index < 0 ) { + i = max; + + } else { + i = one ? index : 0; + } + + // Loop through all the selected options + for ( ; i < max; i++ ) { + option = options[ i ]; + + // Support: IE <=9 only + // IE8-9 doesn't update selected after form reset (#2551) + if ( ( option.selected || i === index ) && + + // Don't return options that are disabled or in a disabled optgroup + !option.disabled && + ( !option.parentNode.disabled || + !nodeName( option.parentNode, "optgroup" ) ) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + }, + + set: function( elem, value ) { + var optionSet, option, + options = elem.options, + values = jQuery.makeArray( value ), + i = options.length; + + while ( i-- ) { + option = options[ i ]; + + /* eslint-disable no-cond-assign */ + + if ( option.selected = + jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 + ) { + optionSet = true; + } + + /* eslint-enable no-cond-assign */ + } + + // Force browsers to behave consistently when non-matching value is set + if ( !optionSet ) { + elem.selectedIndex = -1; + } + return values; + } + } + } +} ); + +// Radios and checkboxes getter/setter +jQuery.each( [ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + set: function( elem, value ) { + if ( Array.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); + } + } + }; + if ( !support.checkOn ) { + jQuery.valHooks[ this ].get = function( elem ) { + return elem.getAttribute( "value" ) === null ? "on" : elem.value; + }; + } +} ); + + + + +// Return jQuery for attributes-only inclusion + + +support.focusin = "onfocusin" in window; + + +var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + stopPropagationCallback = function( e ) { + e.stopPropagation(); + }; + +jQuery.extend( jQuery.event, { + + trigger: function( event, data, elem, onlyHandlers ) { + + var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, + eventPath = [ elem || document ], + type = hasOwn.call( event, "type" ) ? event.type : event, + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; + + cur = lastElement = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "." ) > -1 ) { + + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split( "." ); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf( ":" ) < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) + event.isTrigger = onlyHandlers ? 2 : 3; + event.namespace = namespaces.join( "." ); + event.rnamespace = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === ( elem.ownerDocument || document ) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { + lastElement = cur; + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( + dataPriv.get( cur, "events" ) || Object.create( null ) + )[ event.type ] && + dataPriv.get( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && handle.apply && acceptData( cur ) ) { + event.result = handle.apply( cur, data ); + if ( event.result === false ) { + event.preventDefault(); + } + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( ( !special._default || + special._default.apply( eventPath.pop(), data ) === false ) && + acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name as the event. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + + if ( event.isPropagationStopped() ) { + lastElement.addEventListener( type, stopPropagationCallback ); + } + + elem[ type ](); + + if ( event.isPropagationStopped() ) { + lastElement.removeEventListener( type, stopPropagationCallback ); + } + + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + // Piggyback on a donor event to simulate a different one + // Used only for `focus(in | out)` events + simulate: function( type, elem, event ) { + var e = jQuery.extend( + new jQuery.Event(), + event, + { + type: type, + isSimulated: true + } + ); + + jQuery.event.trigger( e, null, elem ); + } + +} ); + +jQuery.fn.extend( { + + trigger: function( type, data ) { + return this.each( function() { + jQuery.event.trigger( type, data, this ); + } ); + }, + triggerHandler: function( type, data ) { + var elem = this[ 0 ]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + } +} ); + + +// Support: Firefox <=44 +// Firefox doesn't have focus(in | out) events +// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 +// +// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 +// focus(in | out) events fire after focus & blur events, +// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order +// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 +if ( !support.focusin ) { + jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler on the document while someone wants focusin/focusout + var handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + + // Handle: regular nodes (via `this.ownerDocument`), window + // (via `this.document`) & document (via `this`). + var doc = this.ownerDocument || this.document || this, + attaches = dataPriv.access( doc, fix ); + + if ( !attaches ) { + doc.addEventListener( orig, handler, true ); + } + dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); + }, + teardown: function() { + var doc = this.ownerDocument || this.document || this, + attaches = dataPriv.access( doc, fix ) - 1; + + if ( !attaches ) { + doc.removeEventListener( orig, handler, true ); + dataPriv.remove( doc, fix ); + + } else { + dataPriv.access( doc, fix, attaches ); + } + } + }; + } ); +} +var location = window.location; + +var nonce = { guid: Date.now() }; + +var rquery = ( /\?/ ); + + + +// Cross-browser xml parsing +jQuery.parseXML = function( data ) { + var xml; + if ( !data || typeof data !== "string" ) { + return null; + } + + // Support: IE 9 - 11 only + // IE throws on parseFromString with invalid input. + try { + xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); + } catch ( e ) { + xml = undefined; + } + + if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; +}; + + +var + rbracket = /\[\]$/, + rCRLF = /\r?\n/g, + rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, + rsubmittable = /^(?:input|select|textarea|keygen)/i; + +function buildParams( prefix, obj, traditional, add ) { + var name; + + if ( Array.isArray( obj ) ) { + + // Serialize array item. + jQuery.each( obj, function( i, v ) { + if ( traditional || rbracket.test( prefix ) ) { + + // Treat each array item as a scalar. + add( prefix, v ); + + } else { + + // Item is non-scalar (array or object), encode its numeric index. + buildParams( + prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", + v, + traditional, + add + ); + } + } ); + + } else if ( !traditional && toType( obj ) === "object" ) { + + // Serialize object item. + for ( name in obj ) { + buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); + } + + } else { + + // Serialize scalar item. + add( prefix, obj ); + } +} + +// Serialize an array of form elements or a set of +// key/values into a query string +jQuery.param = function( a, traditional ) { + var prefix, + s = [], + add = function( key, valueOrFunction ) { + + // If value is a function, invoke it and use its return value + var value = isFunction( valueOrFunction ) ? + valueOrFunction() : + valueOrFunction; + + s[ s.length ] = encodeURIComponent( key ) + "=" + + encodeURIComponent( value == null ? "" : value ); + }; + + if ( a == null ) { + return ""; + } + + // If an array was passed in, assume that it is an array of form elements. + if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { + + // Serialize the form elements + jQuery.each( a, function() { + add( this.name, this.value ); + } ); + + } else { + + // If traditional, encode the "old" way (the way 1.3.2 or older + // did it), otherwise encode params recursively. + for ( prefix in a ) { + buildParams( prefix, a[ prefix ], traditional, add ); + } + } + + // Return the resulting serialization + return s.join( "&" ); +}; + +jQuery.fn.extend( { + serialize: function() { + return jQuery.param( this.serializeArray() ); + }, + serializeArray: function() { + return this.map( function() { + + // Can add propHook for "elements" to filter or add form elements + var elements = jQuery.prop( this, "elements" ); + return elements ? jQuery.makeArray( elements ) : this; + } ) + .filter( function() { + var type = this.type; + + // Use .is( ":disabled" ) so that fieldset[disabled] works + return this.name && !jQuery( this ).is( ":disabled" ) && + rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && + ( this.checked || !rcheckableType.test( type ) ); + } ) + .map( function( _i, elem ) { + var val = jQuery( this ).val(); + + if ( val == null ) { + return null; + } + + if ( Array.isArray( val ) ) { + return jQuery.map( val, function( val ) { + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ); + } + + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ).get(); + } +} ); + + +var + r20 = /%20/g, + rhash = /#.*$/, + rantiCache = /([?&])_=[^&]*/, + rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, + + // #7653, #8125, #8152: local protocol detection + rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, + rnoContent = /^(?:GET|HEAD)$/, + rprotocol = /^\/\//, + + /* Prefilters + * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) + * 2) These are called: + * - BEFORE asking for a transport + * - AFTER param serialization (s.data is a string if s.processData is true) + * 3) key is the dataType + * 4) the catchall symbol "*" can be used + * 5) execution will start with transport dataType and THEN continue down to "*" if needed + */ + prefilters = {}, + + /* Transports bindings + * 1) key is the dataType + * 2) the catchall symbol "*" can be used + * 3) selection will start with transport dataType and THEN go to "*" if needed + */ + transports = {}, + + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression + allTypes = "*/".concat( "*" ), + + // Anchor tag for parsing the document origin + originAnchor = document.createElement( "a" ); + originAnchor.href = location.href; + +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport +function addToPrefiltersOrTransports( structure ) { + + // dataTypeExpression is optional and defaults to "*" + return function( dataTypeExpression, func ) { + + if ( typeof dataTypeExpression !== "string" ) { + func = dataTypeExpression; + dataTypeExpression = "*"; + } + + var dataType, + i = 0, + dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; + + if ( isFunction( func ) ) { + + // For each dataType in the dataTypeExpression + while ( ( dataType = dataTypes[ i++ ] ) ) { + + // Prepend if requested + if ( dataType[ 0 ] === "+" ) { + dataType = dataType.slice( 1 ) || "*"; + ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); + + // Otherwise append + } else { + ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); + } + } + } + }; +} + +// Base inspection function for prefilters and transports +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { + + var inspected = {}, + seekingTransport = ( structure === transports ); + + function inspect( dataType ) { + var selected; + inspected[ dataType ] = true; + jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { + var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); + if ( typeof dataTypeOrTransport === "string" && + !seekingTransport && !inspected[ dataTypeOrTransport ] ) { + + options.dataTypes.unshift( dataTypeOrTransport ); + inspect( dataTypeOrTransport ); + return false; + } else if ( seekingTransport ) { + return !( selected = dataTypeOrTransport ); + } + } ); + return selected; + } + + return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); +} + +// A special extend for ajax options +// that takes "flat" options (not to be deep extended) +// Fixes #9887 +function ajaxExtend( target, src ) { + var key, deep, + flatOptions = jQuery.ajaxSettings.flatOptions || {}; + + for ( key in src ) { + if ( src[ key ] !== undefined ) { + ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; + } + } + if ( deep ) { + jQuery.extend( true, target, deep ); + } + + return target; +} + +/* Handles responses to an ajax request: + * - finds the right dataType (mediates between content-type and expected dataType) + * - returns the corresponding response + */ +function ajaxHandleResponses( s, jqXHR, responses ) { + + var ct, type, finalDataType, firstDataType, + contents = s.contents, + dataTypes = s.dataTypes; + + // Remove auto dataType and get content-type in the process + while ( dataTypes[ 0 ] === "*" ) { + dataTypes.shift(); + if ( ct === undefined ) { + ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); + } + } + + // Check if we're dealing with a known content-type + if ( ct ) { + for ( type in contents ) { + if ( contents[ type ] && contents[ type ].test( ct ) ) { + dataTypes.unshift( type ); + break; + } + } + } + + // Check to see if we have a response for the expected dataType + if ( dataTypes[ 0 ] in responses ) { + finalDataType = dataTypes[ 0 ]; + } else { + + // Try convertible dataTypes + for ( type in responses ) { + if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { + finalDataType = type; + break; + } + if ( !firstDataType ) { + firstDataType = type; + } + } + + // Or just use first one + finalDataType = finalDataType || firstDataType; + } + + // If we found a dataType + // We add the dataType to the list if needed + // and return the corresponding response + if ( finalDataType ) { + if ( finalDataType !== dataTypes[ 0 ] ) { + dataTypes.unshift( finalDataType ); + } + return responses[ finalDataType ]; + } +} + +/* Chain conversions given the request and the original response + * Also sets the responseXXX fields on the jqXHR instance + */ +function ajaxConvert( s, response, jqXHR, isSuccess ) { + var conv2, current, conv, tmp, prev, + converters = {}, + + // Work with a copy of dataTypes in case we need to modify it for conversion + dataTypes = s.dataTypes.slice(); + + // Create converters map with lowercased keys + if ( dataTypes[ 1 ] ) { + for ( conv in s.converters ) { + converters[ conv.toLowerCase() ] = s.converters[ conv ]; + } + } + + current = dataTypes.shift(); + + // Convert to each sequential dataType + while ( current ) { + + if ( s.responseFields[ current ] ) { + jqXHR[ s.responseFields[ current ] ] = response; + } + + // Apply the dataFilter if provided + if ( !prev && isSuccess && s.dataFilter ) { + response = s.dataFilter( response, s.dataType ); + } + + prev = current; + current = dataTypes.shift(); + + if ( current ) { + + // There's only work to do if current dataType is non-auto + if ( current === "*" ) { + + current = prev; + + // Convert response if prev dataType is non-auto and differs from current + } else if ( prev !== "*" && prev !== current ) { + + // Seek a direct converter + conv = converters[ prev + " " + current ] || converters[ "* " + current ]; + + // If none found, seek a pair + if ( !conv ) { + for ( conv2 in converters ) { + + // If conv2 outputs current + tmp = conv2.split( " " ); + if ( tmp[ 1 ] === current ) { + + // If prev can be converted to accepted input + conv = converters[ prev + " " + tmp[ 0 ] ] || + converters[ "* " + tmp[ 0 ] ]; + if ( conv ) { + + // Condense equivalence converters + if ( conv === true ) { + conv = converters[ conv2 ]; + + // Otherwise, insert the intermediate dataType + } else if ( converters[ conv2 ] !== true ) { + current = tmp[ 0 ]; + dataTypes.unshift( tmp[ 1 ] ); + } + break; + } + } + } + } + + // Apply converter (if not an equivalence) + if ( conv !== true ) { + + // Unless errors are allowed to bubble, catch and return them + if ( conv && s.throws ) { + response = conv( response ); + } else { + try { + response = conv( response ); + } catch ( e ) { + return { + state: "parsererror", + error: conv ? e : "No conversion from " + prev + " to " + current + }; + } + } + } + } + } + } + + return { state: "success", data: response }; +} + +jQuery.extend( { + + // Counter for holding the number of active queries + active: 0, + + // Last-Modified header cache for next request + lastModified: {}, + etag: {}, + + ajaxSettings: { + url: location.href, + type: "GET", + isLocal: rlocalProtocol.test( location.protocol ), + global: true, + processData: true, + async: true, + contentType: "application/x-www-form-urlencoded; charset=UTF-8", + + /* + timeout: 0, + data: null, + dataType: null, + username: null, + password: null, + cache: null, + throws: false, + traditional: false, + headers: {}, + */ + + accepts: { + "*": allTypes, + text: "text/plain", + html: "text/html", + xml: "application/xml, text/xml", + json: "application/json, text/javascript" + }, + + contents: { + xml: /\bxml\b/, + html: /\bhtml/, + json: /\bjson\b/ + }, + + responseFields: { + xml: "responseXML", + text: "responseText", + json: "responseJSON" + }, + + // Data converters + // Keys separate source (or catchall "*") and destination types with a single space + converters: { + + // Convert anything to text + "* text": String, + + // Text to html (true = no transformation) + "text html": true, + + // Evaluate text as a json expression + "text json": JSON.parse, + + // Parse text as xml + "text xml": jQuery.parseXML + }, + + // For options that shouldn't be deep extended: + // you can add your own custom options here if + // and when you create one that shouldn't be + // deep extended (see ajaxExtend) + flatOptions: { + url: true, + context: true + } + }, + + // Creates a full fledged settings object into target + // with both ajaxSettings and settings fields. + // If target is omitted, writes into ajaxSettings. + ajaxSetup: function( target, settings ) { + return settings ? + + // Building a settings object + ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : + + // Extending ajaxSettings + ajaxExtend( jQuery.ajaxSettings, target ); + }, + + ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), + ajaxTransport: addToPrefiltersOrTransports( transports ), + + // Main method + ajax: function( url, options ) { + + // If url is an object, simulate pre-1.5 signature + if ( typeof url === "object" ) { + options = url; + url = undefined; + } + + // Force options to be an object + options = options || {}; + + var transport, + + // URL without anti-cache param + cacheURL, + + // Response headers + responseHeadersString, + responseHeaders, + + // timeout handle + timeoutTimer, + + // Url cleanup var + urlAnchor, + + // Request state (becomes false upon send and true upon completion) + completed, + + // To know if global events are to be dispatched + fireGlobals, + + // Loop variable + i, + + // uncached part of the url + uncached, + + // Create the final options object + s = jQuery.ajaxSetup( {}, options ), + + // Callbacks context + callbackContext = s.context || s, + + // Context for global events is callbackContext if it is a DOM node or jQuery collection + globalEventContext = s.context && + ( callbackContext.nodeType || callbackContext.jquery ) ? + jQuery( callbackContext ) : + jQuery.event, + + // Deferreds + deferred = jQuery.Deferred(), + completeDeferred = jQuery.Callbacks( "once memory" ), + + // Status-dependent callbacks + statusCode = s.statusCode || {}, + + // Headers (they are sent all at once) + requestHeaders = {}, + requestHeadersNames = {}, + + // Default abort message + strAbort = "canceled", + + // Fake xhr + jqXHR = { + readyState: 0, + + // Builds headers hashtable if needed + getResponseHeader: function( key ) { + var match; + if ( completed ) { + if ( !responseHeaders ) { + responseHeaders = {}; + while ( ( match = rheaders.exec( responseHeadersString ) ) ) { + responseHeaders[ match[ 1 ].toLowerCase() + " " ] = + ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) + .concat( match[ 2 ] ); + } + } + match = responseHeaders[ key.toLowerCase() + " " ]; + } + return match == null ? null : match.join( ", " ); + }, + + // Raw string + getAllResponseHeaders: function() { + return completed ? responseHeadersString : null; + }, + + // Caches the header + setRequestHeader: function( name, value ) { + if ( completed == null ) { + name = requestHeadersNames[ name.toLowerCase() ] = + requestHeadersNames[ name.toLowerCase() ] || name; + requestHeaders[ name ] = value; + } + return this; + }, + + // Overrides response content-type header + overrideMimeType: function( type ) { + if ( completed == null ) { + s.mimeType = type; + } + return this; + }, + + // Status-dependent callbacks + statusCode: function( map ) { + var code; + if ( map ) { + if ( completed ) { + + // Execute the appropriate callbacks + jqXHR.always( map[ jqXHR.status ] ); + } else { + + // Lazy-add the new callbacks in a way that preserves old ones + for ( code in map ) { + statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; + } + } + } + return this; + }, + + // Cancel the request + abort: function( statusText ) { + var finalText = statusText || strAbort; + if ( transport ) { + transport.abort( finalText ); + } + done( 0, finalText ); + return this; + } + }; + + // Attach deferreds + deferred.promise( jqXHR ); + + // Add protocol if not provided (prefilters might expect it) + // Handle falsy url in the settings object (#10093: consistency with old signature) + // We also use the url parameter if available + s.url = ( ( url || s.url || location.href ) + "" ) + .replace( rprotocol, location.protocol + "//" ); + + // Alias method option to type as per ticket #12004 + s.type = options.method || options.type || s.method || s.type; + + // Extract dataTypes list + s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; + + // A cross-domain request is in order when the origin doesn't match the current origin. + if ( s.crossDomain == null ) { + urlAnchor = document.createElement( "a" ); + + // Support: IE <=8 - 11, Edge 12 - 15 + // IE throws exception on accessing the href property if url is malformed, + // e.g. http://example.com:80x/ + try { + urlAnchor.href = s.url; + + // Support: IE <=8 - 11 only + // Anchor's host property isn't correctly set when s.url is relative + urlAnchor.href = urlAnchor.href; + s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== + urlAnchor.protocol + "//" + urlAnchor.host; + } catch ( e ) { + + // If there is an error parsing the URL, assume it is crossDomain, + // it can be rejected by the transport if it is invalid + s.crossDomain = true; + } + } + + // Convert data if not already a string + if ( s.data && s.processData && typeof s.data !== "string" ) { + s.data = jQuery.param( s.data, s.traditional ); + } + + // Apply prefilters + inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); + + // If request was aborted inside a prefilter, stop there + if ( completed ) { + return jqXHR; + } + + // We can fire global events as of now if asked to + // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) + fireGlobals = jQuery.event && s.global; + + // Watch for a new set of requests + if ( fireGlobals && jQuery.active++ === 0 ) { + jQuery.event.trigger( "ajaxStart" ); + } + + // Uppercase the type + s.type = s.type.toUpperCase(); + + // Determine if request has content + s.hasContent = !rnoContent.test( s.type ); + + // Save the URL in case we're toying with the If-Modified-Since + // and/or If-None-Match header later on + // Remove hash to simplify url manipulation + cacheURL = s.url.replace( rhash, "" ); + + // More options handling for requests with no content + if ( !s.hasContent ) { + + // Remember the hash so we can put it back + uncached = s.url.slice( cacheURL.length ); + + // If data is available and should be processed, append data to url + if ( s.data && ( s.processData || typeof s.data === "string" ) ) { + cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; + + // #9682: remove data so that it's not used in an eventual retry + delete s.data; + } + + // Add or update anti-cache param if needed + if ( s.cache === false ) { + cacheURL = cacheURL.replace( rantiCache, "$1" ); + uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + + uncached; + } + + // Put hash and anti-cache on the URL that will be requested (gh-1732) + s.url = cacheURL + uncached; + + // Change '%20' to '+' if this is encoded form body content (gh-2658) + } else if ( s.data && s.processData && + ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { + s.data = s.data.replace( r20, "+" ); + } + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + if ( jQuery.lastModified[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); + } + if ( jQuery.etag[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); + } + } + + // Set the correct header, if data is being sent + if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { + jqXHR.setRequestHeader( "Content-Type", s.contentType ); + } + + // Set the Accepts header for the server, depending on the dataType + jqXHR.setRequestHeader( + "Accept", + s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? + s.accepts[ s.dataTypes[ 0 ] ] + + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : + s.accepts[ "*" ] + ); + + // Check for headers option + for ( i in s.headers ) { + jqXHR.setRequestHeader( i, s.headers[ i ] ); + } + + // Allow custom headers/mimetypes and early abort + if ( s.beforeSend && + ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { + + // Abort if not done already and return + return jqXHR.abort(); + } + + // Aborting is no longer a cancellation + strAbort = "abort"; + + // Install callbacks on deferreds + completeDeferred.add( s.complete ); + jqXHR.done( s.success ); + jqXHR.fail( s.error ); + + // Get transport + transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); + + // If no transport, we auto-abort + if ( !transport ) { + done( -1, "No Transport" ); + } else { + jqXHR.readyState = 1; + + // Send global event + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); + } + + // If request was aborted inside ajaxSend, stop there + if ( completed ) { + return jqXHR; + } + + // Timeout + if ( s.async && s.timeout > 0 ) { + timeoutTimer = window.setTimeout( function() { + jqXHR.abort( "timeout" ); + }, s.timeout ); + } + + try { + completed = false; + transport.send( requestHeaders, done ); + } catch ( e ) { + + // Rethrow post-completion exceptions + if ( completed ) { + throw e; + } + + // Propagate others as results + done( -1, e ); + } + } + + // Callback for when everything is done + function done( status, nativeStatusText, responses, headers ) { + var isSuccess, success, error, response, modified, + statusText = nativeStatusText; + + // Ignore repeat invocations + if ( completed ) { + return; + } + + completed = true; + + // Clear timeout if it exists + if ( timeoutTimer ) { + window.clearTimeout( timeoutTimer ); + } + + // Dereference transport for early garbage collection + // (no matter how long the jqXHR object will be used) + transport = undefined; + + // Cache response headers + responseHeadersString = headers || ""; + + // Set readyState + jqXHR.readyState = status > 0 ? 4 : 0; + + // Determine if successful + isSuccess = status >= 200 && status < 300 || status === 304; + + // Get response data + if ( responses ) { + response = ajaxHandleResponses( s, jqXHR, responses ); + } + + // Use a noop converter for missing script + if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) { + s.converters[ "text script" ] = function() {}; + } + + // Convert no matter what (that way responseXXX fields are always set) + response = ajaxConvert( s, response, jqXHR, isSuccess ); + + // If successful, handle type chaining + if ( isSuccess ) { + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + modified = jqXHR.getResponseHeader( "Last-Modified" ); + if ( modified ) { + jQuery.lastModified[ cacheURL ] = modified; + } + modified = jqXHR.getResponseHeader( "etag" ); + if ( modified ) { + jQuery.etag[ cacheURL ] = modified; + } + } + + // if no content + if ( status === 204 || s.type === "HEAD" ) { + statusText = "nocontent"; + + // if not modified + } else if ( status === 304 ) { + statusText = "notmodified"; + + // If we have data, let's convert it + } else { + statusText = response.state; + success = response.data; + error = response.error; + isSuccess = !error; + } + } else { + + // Extract error from statusText and normalize for non-aborts + error = statusText; + if ( status || !statusText ) { + statusText = "error"; + if ( status < 0 ) { + status = 0; + } + } + } + + // Set data for the fake xhr object + jqXHR.status = status; + jqXHR.statusText = ( nativeStatusText || statusText ) + ""; + + // Success/Error + if ( isSuccess ) { + deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); + } else { + deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); + } + + // Status-dependent callbacks + jqXHR.statusCode( statusCode ); + statusCode = undefined; + + if ( fireGlobals ) { + globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", + [ jqXHR, s, isSuccess ? success : error ] ); + } + + // Complete + completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); + + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); + + // Handle the global AJAX counter + if ( !( --jQuery.active ) ) { + jQuery.event.trigger( "ajaxStop" ); + } + } + } + + return jqXHR; + }, + + getJSON: function( url, data, callback ) { + return jQuery.get( url, data, callback, "json" ); + }, + + getScript: function( url, callback ) { + return jQuery.get( url, undefined, callback, "script" ); + } +} ); + +jQuery.each( [ "get", "post" ], function( _i, method ) { + jQuery[ method ] = function( url, data, callback, type ) { + + // Shift arguments if data argument was omitted + if ( isFunction( data ) ) { + type = type || callback; + callback = data; + data = undefined; + } + + // The url can be an options object (which then must have .url) + return jQuery.ajax( jQuery.extend( { + url: url, + type: method, + dataType: type, + data: data, + success: callback + }, jQuery.isPlainObject( url ) && url ) ); + }; +} ); + +jQuery.ajaxPrefilter( function( s ) { + var i; + for ( i in s.headers ) { + if ( i.toLowerCase() === "content-type" ) { + s.contentType = s.headers[ i ] || ""; + } + } +} ); + + +jQuery._evalUrl = function( url, options, doc ) { + return jQuery.ajax( { + url: url, + + // Make this explicit, since user can override this through ajaxSetup (#11264) + type: "GET", + dataType: "script", + cache: true, + async: false, + global: false, + + // Only evaluate the response if it is successful (gh-4126) + // dataFilter is not invoked for failure responses, so using it instead + // of the default converter is kludgy but it works. + converters: { + "text script": function() {} + }, + dataFilter: function( response ) { + jQuery.globalEval( response, options, doc ); + } + } ); +}; + + +jQuery.fn.extend( { + wrapAll: function( html ) { + var wrap; + + if ( this[ 0 ] ) { + if ( isFunction( html ) ) { + html = html.call( this[ 0 ] ); + } + + // The elements to wrap the target around + wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); + + if ( this[ 0 ].parentNode ) { + wrap.insertBefore( this[ 0 ] ); + } + + wrap.map( function() { + var elem = this; + + while ( elem.firstElementChild ) { + elem = elem.firstElementChild; + } + + return elem; + } ).append( this ); + } + + return this; + }, + + wrapInner: function( html ) { + if ( isFunction( html ) ) { + return this.each( function( i ) { + jQuery( this ).wrapInner( html.call( this, i ) ); + } ); + } + + return this.each( function() { + var self = jQuery( this ), + contents = self.contents(); + + if ( contents.length ) { + contents.wrapAll( html ); + + } else { + self.append( html ); + } + } ); + }, + + wrap: function( html ) { + var htmlIsFunction = isFunction( html ); + + return this.each( function( i ) { + jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); + } ); + }, + + unwrap: function( selector ) { + this.parent( selector ).not( "body" ).each( function() { + jQuery( this ).replaceWith( this.childNodes ); + } ); + return this; + } +} ); + + +jQuery.expr.pseudos.hidden = function( elem ) { + return !jQuery.expr.pseudos.visible( elem ); +}; +jQuery.expr.pseudos.visible = function( elem ) { + return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); +}; + + + + +jQuery.ajaxSettings.xhr = function() { + try { + return new window.XMLHttpRequest(); + } catch ( e ) {} +}; + +var xhrSuccessStatus = { + + // File protocol always yields status code 0, assume 200 + 0: 200, + + // Support: IE <=9 only + // #1450: sometimes IE returns 1223 when it should be 204 + 1223: 204 + }, + xhrSupported = jQuery.ajaxSettings.xhr(); + +support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); +support.ajax = xhrSupported = !!xhrSupported; + +jQuery.ajaxTransport( function( options ) { + var callback, errorCallback; + + // Cross domain only allowed if supported through XMLHttpRequest + if ( support.cors || xhrSupported && !options.crossDomain ) { + return { + send: function( headers, complete ) { + var i, + xhr = options.xhr(); + + xhr.open( + options.type, + options.url, + options.async, + options.username, + options.password + ); + + // Apply custom fields if provided + if ( options.xhrFields ) { + for ( i in options.xhrFields ) { + xhr[ i ] = options.xhrFields[ i ]; + } + } + + // Override mime type if needed + if ( options.mimeType && xhr.overrideMimeType ) { + xhr.overrideMimeType( options.mimeType ); + } + + // X-Requested-With header + // For cross-domain requests, seeing as conditions for a preflight are + // akin to a jigsaw puzzle, we simply never set it to be sure. + // (it can always be set on a per-request basis or even using ajaxSetup) + // For same-domain requests, won't change header if already provided. + if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { + headers[ "X-Requested-With" ] = "XMLHttpRequest"; + } + + // Set headers + for ( i in headers ) { + xhr.setRequestHeader( i, headers[ i ] ); + } + + // Callback + callback = function( type ) { + return function() { + if ( callback ) { + callback = errorCallback = xhr.onload = + xhr.onerror = xhr.onabort = xhr.ontimeout = + xhr.onreadystatechange = null; + + if ( type === "abort" ) { + xhr.abort(); + } else if ( type === "error" ) { + + // Support: IE <=9 only + // On a manual native abort, IE9 throws + // errors on any property access that is not readyState + if ( typeof xhr.status !== "number" ) { + complete( 0, "error" ); + } else { + complete( + + // File: protocol always yields status 0; see #8605, #14207 + xhr.status, + xhr.statusText + ); + } + } else { + complete( + xhrSuccessStatus[ xhr.status ] || xhr.status, + xhr.statusText, + + // Support: IE <=9 only + // IE9 has no XHR2 but throws on binary (trac-11426) + // For XHR2 non-text, let the caller handle it (gh-2498) + ( xhr.responseType || "text" ) !== "text" || + typeof xhr.responseText !== "string" ? + { binary: xhr.response } : + { text: xhr.responseText }, + xhr.getAllResponseHeaders() + ); + } + } + }; + }; + + // Listen to events + xhr.onload = callback(); + errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); + + // Support: IE 9 only + // Use onreadystatechange to replace onabort + // to handle uncaught aborts + if ( xhr.onabort !== undefined ) { + xhr.onabort = errorCallback; + } else { + xhr.onreadystatechange = function() { + + // Check readyState before timeout as it changes + if ( xhr.readyState === 4 ) { + + // Allow onerror to be called first, + // but that will not handle a native abort + // Also, save errorCallback to a variable + // as xhr.onerror cannot be accessed + window.setTimeout( function() { + if ( callback ) { + errorCallback(); + } + } ); + } + }; + } + + // Create the abort callback + callback = callback( "abort" ); + + try { + + // Do send the request (this may raise an exception) + xhr.send( options.hasContent && options.data || null ); + } catch ( e ) { + + // #14683: Only rethrow if this hasn't been notified as an error yet + if ( callback ) { + throw e; + } + } + }, + + abort: function() { + if ( callback ) { + callback(); + } + } + }; + } +} ); + + + + +// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) +jQuery.ajaxPrefilter( function( s ) { + if ( s.crossDomain ) { + s.contents.script = false; + } +} ); + +// Install script dataType +jQuery.ajaxSetup( { + accepts: { + script: "text/javascript, application/javascript, " + + "application/ecmascript, application/x-ecmascript" + }, + contents: { + script: /\b(?:java|ecma)script\b/ + }, + converters: { + "text script": function( text ) { + jQuery.globalEval( text ); + return text; + } + } +} ); + +// Handle cache's special case and crossDomain +jQuery.ajaxPrefilter( "script", function( s ) { + if ( s.cache === undefined ) { + s.cache = false; + } + if ( s.crossDomain ) { + s.type = "GET"; + } +} ); + +// Bind script tag hack transport +jQuery.ajaxTransport( "script", function( s ) { + + // This transport only deals with cross domain or forced-by-attrs requests + if ( s.crossDomain || s.scriptAttrs ) { + var script, callback; + return { + send: function( _, complete ) { + script = jQuery( "\r\n"; + +// inject VBScript +document.write(IEBinaryToArray_ByteStr_Script); + +global.JSZipUtils._getBinaryFromXHR = function (xhr) { + var binary = xhr.responseBody; + var byteMapping = {}; + for ( var i = 0; i < 256; i++ ) { + for ( var j = 0; j < 256; j++ ) { + byteMapping[ String.fromCharCode( i + (j << 8) ) ] = + String.fromCharCode(i) + String.fromCharCode(j); + } + } + var rawBytes = IEBinaryToArray_ByteStr(binary); + var lastChr = IEBinaryToArray_ByteStr_Last(binary); + return rawBytes.replace(/[\s\S]/g, function( match ) { + return byteMapping[match]; + }) + lastChr; +}; + +// enforcing Stuk's coding style +// vim: set shiftwidth=4 softtabstop=4: + +},{}]},{},[1]) +; diff --git a/docs/5.0.2/jquery/jszip-utils/dist/jszip-utils-ie.min.js b/docs/5.0.2/jquery/jszip-utils/dist/jszip-utils-ie.min.js new file mode 100644 index 000000000..93d8bc8ef --- /dev/null +++ b/docs/5.0.2/jquery/jszip-utils/dist/jszip-utils-ie.min.js @@ -0,0 +1,10 @@ +/*! + +JSZipUtils - A collection of cross-browser utilities to go along with JSZip. + + +(c) 2014 Stuart Knightley, David Duponchel +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. + +*/ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g\r\n";document.write(b),a.JSZipUtils._getBinaryFromXHR=function(a){for(var b=a.responseBody,c={},d=0;256>d;d++)for(var e=0;256>e;e++)c[String.fromCharCode(d+(e<<8))]=String.fromCharCode(d)+String.fromCharCode(e);var f=IEBinaryToArray_ByteStr(b),g=IEBinaryToArray_ByteStr_Last(b);return f.replace(/[\s\S]/g,function(a){return c[a]})+g}},{}]},{},[1]); diff --git a/docs/5.0.2/jquery/jszip-utils/dist/jszip-utils.js b/docs/5.0.2/jquery/jszip-utils/dist/jszip-utils.js new file mode 100644 index 000000000..775895ec9 --- /dev/null +++ b/docs/5.0.2/jquery/jszip-utils/dist/jszip-utils.js @@ -0,0 +1,118 @@ +/*! + +JSZipUtils - A collection of cross-browser utilities to go along with JSZip. + + +(c) 2014 Stuart Knightley, David Duponchel +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. + +*/ +!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.JSZipUtils=e():"undefined"!=typeof global?global.JSZipUtils=e():"undefined"!=typeof self&&(self.JSZipUtils=e())}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o + +(c) 2014 Stuart Knightley, David Duponchel +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. + +*/ +!function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define(a):"undefined"!=typeof window?window.JSZipUtils=a():"undefined"!=typeof global?global.JSZipUtils=a():"undefined"!=typeof self&&(self.JSZipUtils=a())}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g + +(c) 2009-2016 Stuart Knightley +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown. + +JSZip uses the library pako released under the MIT license : +https://github.com/nodeca/pako/blob/master/LICENSE +*/ + +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.JSZip = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = remainingBytes > 1 ? (((chr2 & 15) << 2) | (chr3 >> 6)) : 64; + enc4 = remainingBytes > 2 ? (chr3 & 63) : 64; + + output.push(_keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4)); + + } + + return output.join(""); +}; + +// public method for decoding +exports.decode = function(input) { + var chr1, chr2, chr3; + var enc1, enc2, enc3, enc4; + var i = 0, resultIndex = 0; + + var dataUrlPrefix = "data:"; + + if (input.substr(0, dataUrlPrefix.length) === dataUrlPrefix) { + // This is a common error: people give a data url + // (data:image/png;base64,iVBOR...) with a {base64: true} and + // wonders why things don't work. + // We can detect that the string input looks like a data url but we + // *can't* be sure it is one: removing everything up to the comma would + // be too dangerous. + throw new Error("Invalid base64 input, it looks like a data url."); + } + + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + + var totalLength = input.length * 3 / 4; + if(input.charAt(input.length - 1) === _keyStr.charAt(64)) { + totalLength--; + } + if(input.charAt(input.length - 2) === _keyStr.charAt(64)) { + totalLength--; + } + if (totalLength % 1 !== 0) { + // totalLength is not an integer, the length does not match a valid + // base64 content. That can happen if: + // - the input is not a base64 content + // - the input is *almost* a base64 content, with a extra chars at the + // beginning or at the end + // - the input uses a base64 variant (base64url for example) + throw new Error("Invalid base64 input, bad content length."); + } + var output; + if (support.uint8array) { + output = new Uint8Array(totalLength|0); + } else { + output = new Array(totalLength|0); + } + + while (i < input.length) { + + enc1 = _keyStr.indexOf(input.charAt(i++)); + enc2 = _keyStr.indexOf(input.charAt(i++)); + enc3 = _keyStr.indexOf(input.charAt(i++)); + enc4 = _keyStr.indexOf(input.charAt(i++)); + + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + + output[resultIndex++] = chr1; + + if (enc3 !== 64) { + output[resultIndex++] = chr2; + } + if (enc4 !== 64) { + output[resultIndex++] = chr3; + } + + } + + return output; +}; + +},{"./support":30,"./utils":32}],2:[function(require,module,exports){ +'use strict'; + +var external = require("./external"); +var DataWorker = require('./stream/DataWorker'); +var Crc32Probe = require('./stream/Crc32Probe'); +var DataLengthProbe = require('./stream/DataLengthProbe'); + +/** + * Represent a compressed object, with everything needed to decompress it. + * @constructor + * @param {number} compressedSize the size of the data compressed. + * @param {number} uncompressedSize the size of the data after decompression. + * @param {number} crc32 the crc32 of the decompressed file. + * @param {object} compression the type of compression, see lib/compressions.js. + * @param {String|ArrayBuffer|Uint8Array|Buffer} data the compressed data. + */ +function CompressedObject(compressedSize, uncompressedSize, crc32, compression, data) { + this.compressedSize = compressedSize; + this.uncompressedSize = uncompressedSize; + this.crc32 = crc32; + this.compression = compression; + this.compressedContent = data; +} + +CompressedObject.prototype = { + /** + * Create a worker to get the uncompressed content. + * @return {GenericWorker} the worker. + */ + getContentWorker: function () { + var worker = new DataWorker(external.Promise.resolve(this.compressedContent)) + .pipe(this.compression.uncompressWorker()) + .pipe(new DataLengthProbe("data_length")); + + var that = this; + worker.on("end", function () { + if (this.streamInfo['data_length'] !== that.uncompressedSize) { + throw new Error("Bug : uncompressed data size mismatch"); + } + }); + return worker; + }, + /** + * Create a worker to get the compressed content. + * @return {GenericWorker} the worker. + */ + getCompressedWorker: function () { + return new DataWorker(external.Promise.resolve(this.compressedContent)) + .withStreamInfo("compressedSize", this.compressedSize) + .withStreamInfo("uncompressedSize", this.uncompressedSize) + .withStreamInfo("crc32", this.crc32) + .withStreamInfo("compression", this.compression) + ; + } +}; + +/** + * Chain the given worker with other workers to compress the content with the + * given compression. + * @param {GenericWorker} uncompressedWorker the worker to pipe. + * @param {Object} compression the compression object. + * @param {Object} compressionOptions the options to use when compressing. + * @return {GenericWorker} the new worker compressing the content. + */ +CompressedObject.createWorkerFrom = function (uncompressedWorker, compression, compressionOptions) { + return uncompressedWorker + .pipe(new Crc32Probe()) + .pipe(new DataLengthProbe("uncompressedSize")) + .pipe(compression.compressWorker(compressionOptions)) + .pipe(new DataLengthProbe("compressedSize")) + .withStreamInfo("compression", compression); +}; + +module.exports = CompressedObject; + +},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(require,module,exports){ +'use strict'; + +var GenericWorker = require("./stream/GenericWorker"); + +exports.STORE = { + magic: "\x00\x00", + compressWorker : function (compressionOptions) { + return new GenericWorker("STORE compression"); + }, + uncompressWorker : function () { + return new GenericWorker("STORE decompression"); + } +}; +exports.DEFLATE = require('./flate'); + +},{"./flate":7,"./stream/GenericWorker":28}],4:[function(require,module,exports){ +'use strict'; + +var utils = require('./utils'); + +/** + * The following functions come from pako, from pako/lib/zlib/crc32.js + * released under the MIT license, see pako https://github.com/nodeca/pako/ + */ + +// Use ordinary array, since untyped makes no boost here +function makeTable() { + var c, table = []; + + for(var n =0; n < 256; n++){ + c = n; + for(var k =0; k < 8; k++){ + c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); + } + table[n] = c; + } + + return table; +} + +// Create table on load. Just 255 signed longs. Not a problem. +var crcTable = makeTable(); + + +function crc32(crc, buf, len, pos) { + var t = crcTable, end = pos + len; + + crc = crc ^ (-1); + + for (var i = pos; i < end; i++ ) { + crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; + } + + return (crc ^ (-1)); // >>> 0; +} + +// That's all for the pako functions. + +/** + * Compute the crc32 of a string. + * This is almost the same as the function crc32, but for strings. Using the + * same function for the two use cases leads to horrible performances. + * @param {Number} crc the starting value of the crc. + * @param {String} str the string to use. + * @param {Number} len the length of the string. + * @param {Number} pos the starting position for the crc32 computation. + * @return {Number} the computed crc32. + */ +function crc32str(crc, str, len, pos) { + var t = crcTable, end = pos + len; + + crc = crc ^ (-1); + + for (var i = pos; i < end; i++ ) { + crc = (crc >>> 8) ^ t[(crc ^ str.charCodeAt(i)) & 0xFF]; + } + + return (crc ^ (-1)); // >>> 0; +} + +module.exports = function crc32wrapper(input, crc) { + if (typeof input === "undefined" || !input.length) { + return 0; + } + + var isArray = utils.getTypeOf(input) !== "string"; + + if(isArray) { + return crc32(crc|0, input, input.length, 0); + } else { + return crc32str(crc|0, input, input.length, 0); + } +}; + +},{"./utils":32}],5:[function(require,module,exports){ +'use strict'; +exports.base64 = false; +exports.binary = false; +exports.dir = false; +exports.createFolders = true; +exports.date = null; +exports.compression = null; +exports.compressionOptions = null; +exports.comment = null; +exports.unixPermissions = null; +exports.dosPermissions = null; + +},{}],6:[function(require,module,exports){ +/* global Promise */ +'use strict'; + +// load the global object first: +// - it should be better integrated in the system (unhandledRejection in node) +// - the environment may have a custom Promise implementation (see zone.js) +var ES6Promise = null; +if (typeof Promise !== "undefined") { + ES6Promise = Promise; +} else { + ES6Promise = require("lie"); +} + +/** + * Let the user use/change some implementations. + */ +module.exports = { + Promise: ES6Promise +}; + +},{"lie":37}],7:[function(require,module,exports){ +'use strict'; +var USE_TYPEDARRAY = (typeof Uint8Array !== 'undefined') && (typeof Uint16Array !== 'undefined') && (typeof Uint32Array !== 'undefined'); + +var pako = require("pako"); +var utils = require("./utils"); +var GenericWorker = require("./stream/GenericWorker"); + +var ARRAY_TYPE = USE_TYPEDARRAY ? "uint8array" : "array"; + +exports.magic = "\x08\x00"; + +/** + * Create a worker that uses pako to inflate/deflate. + * @constructor + * @param {String} action the name of the pako function to call : either "Deflate" or "Inflate". + * @param {Object} options the options to use when (de)compressing. + */ +function FlateWorker(action, options) { + GenericWorker.call(this, "FlateWorker/" + action); + + this._pako = null; + this._pakoAction = action; + this._pakoOptions = options; + // the `meta` object from the last chunk received + // this allow this worker to pass around metadata + this.meta = {}; +} + +utils.inherits(FlateWorker, GenericWorker); + +/** + * @see GenericWorker.processChunk + */ +FlateWorker.prototype.processChunk = function (chunk) { + this.meta = chunk.meta; + if (this._pako === null) { + this._createPako(); + } + this._pako.push(utils.transformTo(ARRAY_TYPE, chunk.data), false); +}; + +/** + * @see GenericWorker.flush + */ +FlateWorker.prototype.flush = function () { + GenericWorker.prototype.flush.call(this); + if (this._pako === null) { + this._createPako(); + } + this._pako.push([], true); +}; +/** + * @see GenericWorker.cleanUp + */ +FlateWorker.prototype.cleanUp = function () { + GenericWorker.prototype.cleanUp.call(this); + this._pako = null; +}; + +/** + * Create the _pako object. + * TODO: lazy-loading this object isn't the best solution but it's the + * quickest. The best solution is to lazy-load the worker list. See also the + * issue #446. + */ +FlateWorker.prototype._createPako = function () { + this._pako = new pako[this._pakoAction]({ + raw: true, + level: this._pakoOptions.level || -1 // default compression + }); + var self = this; + this._pako.onData = function(data) { + self.push({ + data : data, + meta : self.meta + }); + }; +}; + +exports.compressWorker = function (compressionOptions) { + return new FlateWorker("Deflate", compressionOptions); +}; +exports.uncompressWorker = function () { + return new FlateWorker("Inflate", {}); +}; + +},{"./stream/GenericWorker":28,"./utils":32,"pako":38}],8:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); +var GenericWorker = require('../stream/GenericWorker'); +var utf8 = require('../utf8'); +var crc32 = require('../crc32'); +var signature = require('../signature'); + +/** + * Transform an integer into a string in hexadecimal. + * @private + * @param {number} dec the number to convert. + * @param {number} bytes the number of bytes to generate. + * @returns {string} the result. + */ +var decToHex = function(dec, bytes) { + var hex = "", i; + for (i = 0; i < bytes; i++) { + hex += String.fromCharCode(dec & 0xff); + dec = dec >>> 8; + } + return hex; +}; + +/** + * Generate the UNIX part of the external file attributes. + * @param {Object} unixPermissions the unix permissions or null. + * @param {Boolean} isDir true if the entry is a directory, false otherwise. + * @return {Number} a 32 bit integer. + * + * adapted from http://unix.stackexchange.com/questions/14705/the-zip-formats-external-file-attribute : + * + * TTTTsstrwxrwxrwx0000000000ADVSHR + * ^^^^____________________________ file type, see zipinfo.c (UNX_*) + * ^^^_________________________ setuid, setgid, sticky + * ^^^^^^^^^________________ permissions + * ^^^^^^^^^^______ not used ? + * ^^^^^^ DOS attribute bits : Archive, Directory, Volume label, System file, Hidden, Read only + */ +var generateUnixExternalFileAttr = function (unixPermissions, isDir) { + + var result = unixPermissions; + if (!unixPermissions) { + // I can't use octal values in strict mode, hence the hexa. + // 040775 => 0x41fd + // 0100664 => 0x81b4 + result = isDir ? 0x41fd : 0x81b4; + } + return (result & 0xFFFF) << 16; +}; + +/** + * Generate the DOS part of the external file attributes. + * @param {Object} dosPermissions the dos permissions or null. + * @param {Boolean} isDir true if the entry is a directory, false otherwise. + * @return {Number} a 32 bit integer. + * + * Bit 0 Read-Only + * Bit 1 Hidden + * Bit 2 System + * Bit 3 Volume Label + * Bit 4 Directory + * Bit 5 Archive + */ +var generateDosExternalFileAttr = function (dosPermissions, isDir) { + + // the dir flag is already set for compatibility + return (dosPermissions || 0) & 0x3F; +}; + +/** + * Generate the various parts used in the construction of the final zip file. + * @param {Object} streamInfo the hash with information about the compressed file. + * @param {Boolean} streamedContent is the content streamed ? + * @param {Boolean} streamingEnded is the stream finished ? + * @param {number} offset the current offset from the start of the zip file. + * @param {String} platform let's pretend we are this platform (change platform dependents fields) + * @param {Function} encodeFileName the function to encode the file name / comment. + * @return {Object} the zip parts. + */ +var generateZipParts = function(streamInfo, streamedContent, streamingEnded, offset, platform, encodeFileName) { + var file = streamInfo['file'], + compression = streamInfo['compression'], + useCustomEncoding = encodeFileName !== utf8.utf8encode, + encodedFileName = utils.transformTo("string", encodeFileName(file.name)), + utfEncodedFileName = utils.transformTo("string", utf8.utf8encode(file.name)), + comment = file.comment, + encodedComment = utils.transformTo("string", encodeFileName(comment)), + utfEncodedComment = utils.transformTo("string", utf8.utf8encode(comment)), + useUTF8ForFileName = utfEncodedFileName.length !== file.name.length, + useUTF8ForComment = utfEncodedComment.length !== comment.length, + dosTime, + dosDate, + extraFields = "", + unicodePathExtraField = "", + unicodeCommentExtraField = "", + dir = file.dir, + date = file.date; + + + var dataInfo = { + crc32 : 0, + compressedSize : 0, + uncompressedSize : 0 + }; + + // if the content is streamed, the sizes/crc32 are only available AFTER + // the end of the stream. + if (!streamedContent || streamingEnded) { + dataInfo.crc32 = streamInfo['crc32']; + dataInfo.compressedSize = streamInfo['compressedSize']; + dataInfo.uncompressedSize = streamInfo['uncompressedSize']; + } + + var bitflag = 0; + if (streamedContent) { + // Bit 3: the sizes/crc32 are set to zero in the local header. + // The correct values are put in the data descriptor immediately + // following the compressed data. + bitflag |= 0x0008; + } + if (!useCustomEncoding && (useUTF8ForFileName || useUTF8ForComment)) { + // Bit 11: Language encoding flag (EFS). + bitflag |= 0x0800; + } + + + var extFileAttr = 0; + var versionMadeBy = 0; + if (dir) { + // dos or unix, we set the dos dir flag + extFileAttr |= 0x00010; + } + if(platform === "UNIX") { + versionMadeBy = 0x031E; // UNIX, version 3.0 + extFileAttr |= generateUnixExternalFileAttr(file.unixPermissions, dir); + } else { // DOS or other, fallback to DOS + versionMadeBy = 0x0014; // DOS, version 2.0 + extFileAttr |= generateDosExternalFileAttr(file.dosPermissions, dir); + } + + // date + // @see http://www.delorie.com/djgpp/doc/rbinter/it/52/13.html + // @see http://www.delorie.com/djgpp/doc/rbinter/it/65/16.html + // @see http://www.delorie.com/djgpp/doc/rbinter/it/66/16.html + + dosTime = date.getUTCHours(); + dosTime = dosTime << 6; + dosTime = dosTime | date.getUTCMinutes(); + dosTime = dosTime << 5; + dosTime = dosTime | date.getUTCSeconds() / 2; + + dosDate = date.getUTCFullYear() - 1980; + dosDate = dosDate << 4; + dosDate = dosDate | (date.getUTCMonth() + 1); + dosDate = dosDate << 5; + dosDate = dosDate | date.getUTCDate(); + + if (useUTF8ForFileName) { + // set the unicode path extra field. unzip needs at least one extra + // field to correctly handle unicode path, so using the path is as good + // as any other information. This could improve the situation with + // other archive managers too. + // This field is usually used without the utf8 flag, with a non + // unicode path in the header (winrar, winzip). This helps (a bit) + // with the messy Windows' default compressed folders feature but + // breaks on p7zip which doesn't seek the unicode path extra field. + // So for now, UTF-8 everywhere ! + unicodePathExtraField = + // Version + decToHex(1, 1) + + // NameCRC32 + decToHex(crc32(encodedFileName), 4) + + // UnicodeName + utfEncodedFileName; + + extraFields += + // Info-ZIP Unicode Path Extra Field + "\x75\x70" + + // size + decToHex(unicodePathExtraField.length, 2) + + // content + unicodePathExtraField; + } + + if(useUTF8ForComment) { + + unicodeCommentExtraField = + // Version + decToHex(1, 1) + + // CommentCRC32 + decToHex(crc32(encodedComment), 4) + + // UnicodeName + utfEncodedComment; + + extraFields += + // Info-ZIP Unicode Path Extra Field + "\x75\x63" + + // size + decToHex(unicodeCommentExtraField.length, 2) + + // content + unicodeCommentExtraField; + } + + var header = ""; + + // version needed to extract + header += "\x0A\x00"; + // general purpose bit flag + header += decToHex(bitflag, 2); + // compression method + header += compression.magic; + // last mod file time + header += decToHex(dosTime, 2); + // last mod file date + header += decToHex(dosDate, 2); + // crc-32 + header += decToHex(dataInfo.crc32, 4); + // compressed size + header += decToHex(dataInfo.compressedSize, 4); + // uncompressed size + header += decToHex(dataInfo.uncompressedSize, 4); + // file name length + header += decToHex(encodedFileName.length, 2); + // extra field length + header += decToHex(extraFields.length, 2); + + + var fileRecord = signature.LOCAL_FILE_HEADER + header + encodedFileName + extraFields; + + var dirRecord = signature.CENTRAL_FILE_HEADER + + // version made by (00: DOS) + decToHex(versionMadeBy, 2) + + // file header (common to file and central directory) + header + + // file comment length + decToHex(encodedComment.length, 2) + + // disk number start + "\x00\x00" + + // internal file attributes TODO + "\x00\x00" + + // external file attributes + decToHex(extFileAttr, 4) + + // relative offset of local header + decToHex(offset, 4) + + // file name + encodedFileName + + // extra field + extraFields + + // file comment + encodedComment; + + return { + fileRecord: fileRecord, + dirRecord: dirRecord + }; +}; + +/** + * Generate the EOCD record. + * @param {Number} entriesCount the number of entries in the zip file. + * @param {Number} centralDirLength the length (in bytes) of the central dir. + * @param {Number} localDirLength the length (in bytes) of the local dir. + * @param {String} comment the zip file comment as a binary string. + * @param {Function} encodeFileName the function to encode the comment. + * @return {String} the EOCD record. + */ +var generateCentralDirectoryEnd = function (entriesCount, centralDirLength, localDirLength, comment, encodeFileName) { + var dirEnd = ""; + var encodedComment = utils.transformTo("string", encodeFileName(comment)); + + // end of central dir signature + dirEnd = signature.CENTRAL_DIRECTORY_END + + // number of this disk + "\x00\x00" + + // number of the disk with the start of the central directory + "\x00\x00" + + // total number of entries in the central directory on this disk + decToHex(entriesCount, 2) + + // total number of entries in the central directory + decToHex(entriesCount, 2) + + // size of the central directory 4 bytes + decToHex(centralDirLength, 4) + + // offset of start of central directory with respect to the starting disk number + decToHex(localDirLength, 4) + + // .ZIP file comment length + decToHex(encodedComment.length, 2) + + // .ZIP file comment + encodedComment; + + return dirEnd; +}; + +/** + * Generate data descriptors for a file entry. + * @param {Object} streamInfo the hash generated by a worker, containing information + * on the file entry. + * @return {String} the data descriptors. + */ +var generateDataDescriptors = function (streamInfo) { + var descriptor = ""; + descriptor = signature.DATA_DESCRIPTOR + + // crc-32 4 bytes + decToHex(streamInfo['crc32'], 4) + + // compressed size 4 bytes + decToHex(streamInfo['compressedSize'], 4) + + // uncompressed size 4 bytes + decToHex(streamInfo['uncompressedSize'], 4); + + return descriptor; +}; + + +/** + * A worker to concatenate other workers to create a zip file. + * @param {Boolean} streamFiles `true` to stream the content of the files, + * `false` to accumulate it. + * @param {String} comment the comment to use. + * @param {String} platform the platform to use, "UNIX" or "DOS". + * @param {Function} encodeFileName the function to encode file names and comments. + */ +function ZipFileWorker(streamFiles, comment, platform, encodeFileName) { + GenericWorker.call(this, "ZipFileWorker"); + // The number of bytes written so far. This doesn't count accumulated chunks. + this.bytesWritten = 0; + // The comment of the zip file + this.zipComment = comment; + // The platform "generating" the zip file. + this.zipPlatform = platform; + // the function to encode file names and comments. + this.encodeFileName = encodeFileName; + // Should we stream the content of the files ? + this.streamFiles = streamFiles; + // If `streamFiles` is false, we will need to accumulate the content of the + // files to calculate sizes / crc32 (and write them *before* the content). + // This boolean indicates if we are accumulating chunks (it will change a lot + // during the lifetime of this worker). + this.accumulate = false; + // The buffer receiving chunks when accumulating content. + this.contentBuffer = []; + // The list of generated directory records. + this.dirRecords = []; + // The offset (in bytes) from the beginning of the zip file for the current source. + this.currentSourceOffset = 0; + // The total number of entries in this zip file. + this.entriesCount = 0; + // the name of the file currently being added, null when handling the end of the zip file. + // Used for the emitted metadata. + this.currentFile = null; + + + + this._sources = []; +} +utils.inherits(ZipFileWorker, GenericWorker); + +/** + * @see GenericWorker.push + */ +ZipFileWorker.prototype.push = function (chunk) { + + var currentFilePercent = chunk.meta.percent || 0; + var entriesCount = this.entriesCount; + var remainingFiles = this._sources.length; + + if(this.accumulate) { + this.contentBuffer.push(chunk); + } else { + this.bytesWritten += chunk.data.length; + + GenericWorker.prototype.push.call(this, { + data : chunk.data, + meta : { + currentFile : this.currentFile, + percent : entriesCount ? (currentFilePercent + 100 * (entriesCount - remainingFiles - 1)) / entriesCount : 100 + } + }); + } +}; + +/** + * The worker started a new source (an other worker). + * @param {Object} streamInfo the streamInfo object from the new source. + */ +ZipFileWorker.prototype.openedSource = function (streamInfo) { + this.currentSourceOffset = this.bytesWritten; + this.currentFile = streamInfo['file'].name; + + var streamedContent = this.streamFiles && !streamInfo['file'].dir; + + // don't stream folders (because they don't have any content) + if(streamedContent) { + var record = generateZipParts(streamInfo, streamedContent, false, this.currentSourceOffset, this.zipPlatform, this.encodeFileName); + this.push({ + data : record.fileRecord, + meta : {percent:0} + }); + } else { + // we need to wait for the whole file before pushing anything + this.accumulate = true; + } +}; + +/** + * The worker finished a source (an other worker). + * @param {Object} streamInfo the streamInfo object from the finished source. + */ +ZipFileWorker.prototype.closedSource = function (streamInfo) { + this.accumulate = false; + var streamedContent = this.streamFiles && !streamInfo['file'].dir; + var record = generateZipParts(streamInfo, streamedContent, true, this.currentSourceOffset, this.zipPlatform, this.encodeFileName); + + this.dirRecords.push(record.dirRecord); + if(streamedContent) { + // after the streamed file, we put data descriptors + this.push({ + data : generateDataDescriptors(streamInfo), + meta : {percent:100} + }); + } else { + // the content wasn't streamed, we need to push everything now + // first the file record, then the content + this.push({ + data : record.fileRecord, + meta : {percent:0} + }); + while(this.contentBuffer.length) { + this.push(this.contentBuffer.shift()); + } + } + this.currentFile = null; +}; + +/** + * @see GenericWorker.flush + */ +ZipFileWorker.prototype.flush = function () { + + var localDirLength = this.bytesWritten; + for(var i = 0; i < this.dirRecords.length; i++) { + this.push({ + data : this.dirRecords[i], + meta : {percent:100} + }); + } + var centralDirLength = this.bytesWritten - localDirLength; + + var dirEnd = generateCentralDirectoryEnd(this.dirRecords.length, centralDirLength, localDirLength, this.zipComment, this.encodeFileName); + + this.push({ + data : dirEnd, + meta : {percent:100} + }); +}; + +/** + * Prepare the next source to be read. + */ +ZipFileWorker.prototype.prepareNextSource = function () { + this.previous = this._sources.shift(); + this.openedSource(this.previous.streamInfo); + if (this.isPaused) { + this.previous.pause(); + } else { + this.previous.resume(); + } +}; + +/** + * @see GenericWorker.registerPrevious + */ +ZipFileWorker.prototype.registerPrevious = function (previous) { + this._sources.push(previous); + var self = this; + + previous.on('data', function (chunk) { + self.processChunk(chunk); + }); + previous.on('end', function () { + self.closedSource(self.previous.streamInfo); + if(self._sources.length) { + self.prepareNextSource(); + } else { + self.end(); + } + }); + previous.on('error', function (e) { + self.error(e); + }); + return this; +}; + +/** + * @see GenericWorker.resume + */ +ZipFileWorker.prototype.resume = function () { + if(!GenericWorker.prototype.resume.call(this)) { + return false; + } + + if (!this.previous && this._sources.length) { + this.prepareNextSource(); + return true; + } + if (!this.previous && !this._sources.length && !this.generatedError) { + this.end(); + return true; + } +}; + +/** + * @see GenericWorker.error + */ +ZipFileWorker.prototype.error = function (e) { + var sources = this._sources; + if(!GenericWorker.prototype.error.call(this, e)) { + return false; + } + for(var i = 0; i < sources.length; i++) { + try { + sources[i].error(e); + } catch(e) { + // the `error` exploded, nothing to do + } + } + return true; +}; + +/** + * @see GenericWorker.lock + */ +ZipFileWorker.prototype.lock = function () { + GenericWorker.prototype.lock.call(this); + var sources = this._sources; + for(var i = 0; i < sources.length; i++) { + sources[i].lock(); + } +}; + +module.exports = ZipFileWorker; + +},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(require,module,exports){ +'use strict'; + +var compressions = require('../compressions'); +var ZipFileWorker = require('./ZipFileWorker'); + +/** + * Find the compression to use. + * @param {String} fileCompression the compression defined at the file level, if any. + * @param {String} zipCompression the compression defined at the load() level. + * @return {Object} the compression object to use. + */ +var getCompression = function (fileCompression, zipCompression) { + + var compressionName = fileCompression || zipCompression; + var compression = compressions[compressionName]; + if (!compression) { + throw new Error(compressionName + " is not a valid compression method !"); + } + return compression; +}; + +/** + * Create a worker to generate a zip file. + * @param {JSZip} zip the JSZip instance at the right root level. + * @param {Object} options to generate the zip file. + * @param {String} comment the comment to use. + */ +exports.generateWorker = function (zip, options, comment) { + + var zipFileWorker = new ZipFileWorker(options.streamFiles, comment, options.platform, options.encodeFileName); + var entriesCount = 0; + try { + + zip.forEach(function (relativePath, file) { + entriesCount++; + var compression = getCompression(file.options.compression, options.compression); + var compressionOptions = file.options.compressionOptions || options.compressionOptions || {}; + var dir = file.dir, date = file.date; + + file._compressWorker(compression, compressionOptions) + .withStreamInfo("file", { + name : relativePath, + dir : dir, + date : date, + comment : file.comment || "", + unixPermissions : file.unixPermissions, + dosPermissions : file.dosPermissions + }) + .pipe(zipFileWorker); + }); + zipFileWorker.entriesCount = entriesCount; + } catch (e) { + zipFileWorker.error(e); + } + + return zipFileWorker; +}; + +},{"../compressions":3,"./ZipFileWorker":8}],10:[function(require,module,exports){ +'use strict'; + +/** + * Representation a of zip file in js + * @constructor + */ +function JSZip() { + // if this constructor is used without `new`, it adds `new` before itself: + if(!(this instanceof JSZip)) { + return new JSZip(); + } + + if(arguments.length) { + throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide."); + } + + // object containing the files : + // { + // "folder/" : {...}, + // "folder/data.txt" : {...} + // } + // NOTE: we use a null prototype because we do not + // want filenames like "toString" coming from a zip file + // to overwrite methods and attributes in a normal Object. + this.files = Object.create(null); + + this.comment = null; + + // Where we are in the hierarchy + this.root = ""; + this.clone = function() { + var newObj = new JSZip(); + for (var i in this) { + if (typeof this[i] !== "function") { + newObj[i] = this[i]; + } + } + return newObj; + }; +} +JSZip.prototype = require('./object'); +JSZip.prototype.loadAsync = require('./load'); +JSZip.support = require('./support'); +JSZip.defaults = require('./defaults'); + +// TODO find a better way to handle this version, +// a require('package.json').version doesn't work with webpack, see #327 +JSZip.version = "3.7.1"; + +JSZip.loadAsync = function (content, options) { + return new JSZip().loadAsync(content, options); +}; + +JSZip.external = require("./external"); +module.exports = JSZip; + +},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(require,module,exports){ +'use strict'; +var utils = require('./utils'); +var external = require("./external"); +var utf8 = require('./utf8'); +var ZipEntries = require('./zipEntries'); +var Crc32Probe = require('./stream/Crc32Probe'); +var nodejsUtils = require("./nodejsUtils"); + +/** + * Check the CRC32 of an entry. + * @param {ZipEntry} zipEntry the zip entry to check. + * @return {Promise} the result. + */ +function checkEntryCRC32(zipEntry) { + return new external.Promise(function (resolve, reject) { + var worker = zipEntry.decompressed.getContentWorker().pipe(new Crc32Probe()); + worker.on("error", function (e) { + reject(e); + }) + .on("end", function () { + if (worker.streamInfo.crc32 !== zipEntry.decompressed.crc32) { + reject(new Error("Corrupted zip : CRC32 mismatch")); + } else { + resolve(); + } + }) + .resume(); + }); +} + +module.exports = function (data, options) { + var zip = this; + options = utils.extend(options || {}, { + base64: false, + checkCRC32: false, + optimizedBinaryString: false, + createFolders: false, + decodeFileName: utf8.utf8decode + }); + + if (nodejsUtils.isNode && nodejsUtils.isStream(data)) { + return external.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")); + } + + return utils.prepareContent("the loaded zip file", data, true, options.optimizedBinaryString, options.base64) + .then(function (data) { + var zipEntries = new ZipEntries(options); + zipEntries.load(data); + return zipEntries; + }).then(function checkCRC32(zipEntries) { + var promises = [external.Promise.resolve(zipEntries)]; + var files = zipEntries.files; + if (options.checkCRC32) { + for (var i = 0; i < files.length; i++) { + promises.push(checkEntryCRC32(files[i])); + } + } + return external.Promise.all(promises); + }).then(function addFiles(results) { + var zipEntries = results.shift(); + var files = zipEntries.files; + for (var i = 0; i < files.length; i++) { + var input = files[i]; + zip.file(input.fileNameStr, input.decompressed, { + binary: true, + optimizedBinaryString: true, + date: input.date, + dir: input.dir, + comment: input.fileCommentStr.length ? input.fileCommentStr : null, + unixPermissions: input.unixPermissions, + dosPermissions: input.dosPermissions, + createFolders: options.createFolders + }); + } + if (zipEntries.zipComment.length) { + zip.comment = zipEntries.zipComment; + } + + return zip; + }); +}; + +},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(require,module,exports){ +"use strict"; + +var utils = require('../utils'); +var GenericWorker = require('../stream/GenericWorker'); + +/** + * A worker that use a nodejs stream as source. + * @constructor + * @param {String} filename the name of the file entry for this stream. + * @param {Readable} stream the nodejs stream. + */ +function NodejsStreamInputAdapter(filename, stream) { + GenericWorker.call(this, "Nodejs stream input adapter for " + filename); + this._upstreamEnded = false; + this._bindStream(stream); +} + +utils.inherits(NodejsStreamInputAdapter, GenericWorker); + +/** + * Prepare the stream and bind the callbacks on it. + * Do this ASAP on node 0.10 ! A lazy binding doesn't always work. + * @param {Stream} stream the nodejs stream to use. + */ +NodejsStreamInputAdapter.prototype._bindStream = function (stream) { + var self = this; + this._stream = stream; + stream.pause(); + stream + .on("data", function (chunk) { + self.push({ + data: chunk, + meta : { + percent : 0 + } + }); + }) + .on("error", function (e) { + if(self.isPaused) { + this.generatedError = e; + } else { + self.error(e); + } + }) + .on("end", function () { + if(self.isPaused) { + self._upstreamEnded = true; + } else { + self.end(); + } + }); +}; +NodejsStreamInputAdapter.prototype.pause = function () { + if(!GenericWorker.prototype.pause.call(this)) { + return false; + } + this._stream.pause(); + return true; +}; +NodejsStreamInputAdapter.prototype.resume = function () { + if(!GenericWorker.prototype.resume.call(this)) { + return false; + } + + if(this._upstreamEnded) { + this.end(); + } else { + this._stream.resume(); + } + + return true; +}; + +module.exports = NodejsStreamInputAdapter; + +},{"../stream/GenericWorker":28,"../utils":32}],13:[function(require,module,exports){ +'use strict'; + +var Readable = require('readable-stream').Readable; + +var utils = require('../utils'); +utils.inherits(NodejsStreamOutputAdapter, Readable); + +/** +* A nodejs stream using a worker as source. +* @see the SourceWrapper in http://nodejs.org/api/stream.html +* @constructor +* @param {StreamHelper} helper the helper wrapping the worker +* @param {Object} options the nodejs stream options +* @param {Function} updateCb the update callback. +*/ +function NodejsStreamOutputAdapter(helper, options, updateCb) { + Readable.call(this, options); + this._helper = helper; + + var self = this; + helper.on("data", function (data, meta) { + if (!self.push(data)) { + self._helper.pause(); + } + if(updateCb) { + updateCb(meta); + } + }) + .on("error", function(e) { + self.emit('error', e); + }) + .on("end", function () { + self.push(null); + }); +} + + +NodejsStreamOutputAdapter.prototype._read = function() { + this._helper.resume(); +}; + +module.exports = NodejsStreamOutputAdapter; + +},{"../utils":32,"readable-stream":16}],14:[function(require,module,exports){ +'use strict'; + +module.exports = { + /** + * True if this is running in Nodejs, will be undefined in a browser. + * In a browser, browserify won't include this file and the whole module + * will be resolved an empty object. + */ + isNode : typeof Buffer !== "undefined", + /** + * Create a new nodejs Buffer from an existing content. + * @param {Object} data the data to pass to the constructor. + * @param {String} encoding the encoding to use. + * @return {Buffer} a new Buffer. + */ + newBufferFrom: function(data, encoding) { + if (Buffer.from && Buffer.from !== Uint8Array.from) { + return Buffer.from(data, encoding); + } else { + if (typeof data === "number") { + // Safeguard for old Node.js versions. On newer versions, + // Buffer.from(number) / Buffer(number, encoding) already throw. + throw new Error("The \"data\" argument must not be a number"); + } + return new Buffer(data, encoding); + } + }, + /** + * Create a new nodejs Buffer with the specified size. + * @param {Integer} size the size of the buffer. + * @return {Buffer} a new Buffer. + */ + allocBuffer: function (size) { + if (Buffer.alloc) { + return Buffer.alloc(size); + } else { + var buf = new Buffer(size); + buf.fill(0); + return buf; + } + }, + /** + * Find out if an object is a Buffer. + * @param {Object} b the object to test. + * @return {Boolean} true if the object is a Buffer, false otherwise. + */ + isBuffer : function(b){ + return Buffer.isBuffer(b); + }, + + isStream : function (obj) { + return obj && + typeof obj.on === "function" && + typeof obj.pause === "function" && + typeof obj.resume === "function"; + } +}; + +},{}],15:[function(require,module,exports){ +'use strict'; +var utf8 = require('./utf8'); +var utils = require('./utils'); +var GenericWorker = require('./stream/GenericWorker'); +var StreamHelper = require('./stream/StreamHelper'); +var defaults = require('./defaults'); +var CompressedObject = require('./compressedObject'); +var ZipObject = require('./zipObject'); +var generate = require("./generate"); +var nodejsUtils = require("./nodejsUtils"); +var NodejsStreamInputAdapter = require("./nodejs/NodejsStreamInputAdapter"); + + +/** + * Add a file in the current folder. + * @private + * @param {string} name the name of the file + * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data of the file + * @param {Object} originalOptions the options of the file + * @return {Object} the new file. + */ +var fileAdd = function(name, data, originalOptions) { + // be sure sub folders exist + var dataType = utils.getTypeOf(data), + parent; + + + /* + * Correct options. + */ + + var o = utils.extend(originalOptions || {}, defaults); + o.date = o.date || new Date(); + if (o.compression !== null) { + o.compression = o.compression.toUpperCase(); + } + + if (typeof o.unixPermissions === "string") { + o.unixPermissions = parseInt(o.unixPermissions, 8); + } + + // UNX_IFDIR 0040000 see zipinfo.c + if (o.unixPermissions && (o.unixPermissions & 0x4000)) { + o.dir = true; + } + // Bit 4 Directory + if (o.dosPermissions && (o.dosPermissions & 0x0010)) { + o.dir = true; + } + + if (o.dir) { + name = forceTrailingSlash(name); + } + if (o.createFolders && (parent = parentFolder(name))) { + folderAdd.call(this, parent, true); + } + + var isUnicodeString = dataType === "string" && o.binary === false && o.base64 === false; + if (!originalOptions || typeof originalOptions.binary === "undefined") { + o.binary = !isUnicodeString; + } + + + var isCompressedEmpty = (data instanceof CompressedObject) && data.uncompressedSize === 0; + + if (isCompressedEmpty || o.dir || !data || data.length === 0) { + o.base64 = false; + o.binary = true; + data = ""; + o.compression = "STORE"; + dataType = "string"; + } + + /* + * Convert content to fit. + */ + + var zipObjectContent = null; + if (data instanceof CompressedObject || data instanceof GenericWorker) { + zipObjectContent = data; + } else if (nodejsUtils.isNode && nodejsUtils.isStream(data)) { + zipObjectContent = new NodejsStreamInputAdapter(name, data); + } else { + zipObjectContent = utils.prepareContent(name, data, o.binary, o.optimizedBinaryString, o.base64); + } + + var object = new ZipObject(name, zipObjectContent, o); + this.files[name] = object; + /* + TODO: we can't throw an exception because we have async promises + (we can have a promise of a Date() for example) but returning a + promise is useless because file(name, data) returns the JSZip + object for chaining. Should we break that to allow the user + to catch the error ? + + return external.Promise.resolve(zipObjectContent) + .then(function () { + return object; + }); + */ +}; + +/** + * Find the parent folder of the path. + * @private + * @param {string} path the path to use + * @return {string} the parent folder, or "" + */ +var parentFolder = function (path) { + if (path.slice(-1) === '/') { + path = path.substring(0, path.length - 1); + } + var lastSlash = path.lastIndexOf('/'); + return (lastSlash > 0) ? path.substring(0, lastSlash) : ""; +}; + +/** + * Returns the path with a slash at the end. + * @private + * @param {String} path the path to check. + * @return {String} the path with a trailing slash. + */ +var forceTrailingSlash = function(path) { + // Check the name ends with a / + if (path.slice(-1) !== "/") { + path += "/"; // IE doesn't like substr(-1) + } + return path; +}; + +/** + * Add a (sub) folder in the current folder. + * @private + * @param {string} name the folder's name + * @param {boolean=} [createFolders] If true, automatically create sub + * folders. Defaults to false. + * @return {Object} the new folder. + */ +var folderAdd = function(name, createFolders) { + createFolders = (typeof createFolders !== 'undefined') ? createFolders : defaults.createFolders; + + name = forceTrailingSlash(name); + + // Does this folder already exist? + if (!this.files[name]) { + fileAdd.call(this, name, null, { + dir: true, + createFolders: createFolders + }); + } + return this.files[name]; +}; + +/** +* Cross-window, cross-Node-context regular expression detection +* @param {Object} object Anything +* @return {Boolean} true if the object is a regular expression, +* false otherwise +*/ +function isRegExp(object) { + return Object.prototype.toString.call(object) === "[object RegExp]"; +} + +// return the actual prototype of JSZip +var out = { + /** + * @see loadAsync + */ + load: function() { + throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide."); + }, + + + /** + * Call a callback function for each entry at this folder level. + * @param {Function} cb the callback function: + * function (relativePath, file) {...} + * It takes 2 arguments : the relative path and the file. + */ + forEach: function(cb) { + var filename, relativePath, file; + /* jshint ignore:start */ + // ignore warning about unwanted properties because this.files is a null prototype object + for (filename in this.files) { + file = this.files[filename]; + relativePath = filename.slice(this.root.length, filename.length); + if (relativePath && filename.slice(0, this.root.length) === this.root) { // the file is in the current root + cb(relativePath, file); // TODO reverse the parameters ? need to be clean AND consistent with the filter search fn... + } + } + /* jshint ignore:end */ + }, + + /** + * Filter nested files/folders with the specified function. + * @param {Function} search the predicate to use : + * function (relativePath, file) {...} + * It takes 2 arguments : the relative path and the file. + * @return {Array} An array of matching elements. + */ + filter: function(search) { + var result = []; + this.forEach(function (relativePath, entry) { + if (search(relativePath, entry)) { // the file matches the function + result.push(entry); + } + + }); + return result; + }, + + /** + * Add a file to the zip file, or search a file. + * @param {string|RegExp} name The name of the file to add (if data is defined), + * the name of the file to find (if no data) or a regex to match files. + * @param {String|ArrayBuffer|Uint8Array|Buffer} data The file data, either raw or base64 encoded + * @param {Object} o File options + * @return {JSZip|Object|Array} this JSZip object (when adding a file), + * a file (when searching by string) or an array of files (when searching by regex). + */ + file: function(name, data, o) { + if (arguments.length === 1) { + if (isRegExp(name)) { + var regexp = name; + return this.filter(function(relativePath, file) { + return !file.dir && regexp.test(relativePath); + }); + } + else { // text + var obj = this.files[this.root + name]; + if (obj && !obj.dir) { + return obj; + } else { + return null; + } + } + } + else { // more than one argument : we have data ! + name = this.root + name; + fileAdd.call(this, name, data, o); + } + return this; + }, + + /** + * Add a directory to the zip file, or search. + * @param {String|RegExp} arg The name of the directory to add, or a regex to search folders. + * @return {JSZip} an object with the new directory as the root, or an array containing matching folders. + */ + folder: function(arg) { + if (!arg) { + return this; + } + + if (isRegExp(arg)) { + return this.filter(function(relativePath, file) { + return file.dir && arg.test(relativePath); + }); + } + + // else, name is a new folder + var name = this.root + arg; + var newFolder = folderAdd.call(this, name); + + // Allow chaining by returning a new object with this folder as the root + var ret = this.clone(); + ret.root = newFolder.name; + return ret; + }, + + /** + * Delete a file, or a directory and all sub-files, from the zip + * @param {string} name the name of the file to delete + * @return {JSZip} this JSZip object + */ + remove: function(name) { + name = this.root + name; + var file = this.files[name]; + if (!file) { + // Look for any folders + if (name.slice(-1) !== "/") { + name += "/"; + } + file = this.files[name]; + } + + if (file && !file.dir) { + // file + delete this.files[name]; + } else { + // maybe a folder, delete recursively + var kids = this.filter(function(relativePath, file) { + return file.name.slice(0, name.length) === name; + }); + for (var i = 0; i < kids.length; i++) { + delete this.files[kids[i].name]; + } + } + + return this; + }, + + /** + * Generate the complete zip file + * @param {Object} options the options to generate the zip file : + * - compression, "STORE" by default. + * - type, "base64" by default. Values are : string, base64, uint8array, arraybuffer, blob. + * @return {String|Uint8Array|ArrayBuffer|Buffer|Blob} the zip file + */ + generate: function(options) { + throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide."); + }, + + /** + * Generate the complete zip file as an internal stream. + * @param {Object} options the options to generate the zip file : + * - compression, "STORE" by default. + * - type, "base64" by default. Values are : string, base64, uint8array, arraybuffer, blob. + * @return {StreamHelper} the streamed zip file. + */ + generateInternalStream: function(options) { + var worker, opts = {}; + try { + opts = utils.extend(options || {}, { + streamFiles: false, + compression: "STORE", + compressionOptions : null, + type: "", + platform: "DOS", + comment: null, + mimeType: 'application/zip', + encodeFileName: utf8.utf8encode + }); + + opts.type = opts.type.toLowerCase(); + opts.compression = opts.compression.toUpperCase(); + + // "binarystring" is preferred but the internals use "string". + if(opts.type === "binarystring") { + opts.type = "string"; + } + + if (!opts.type) { + throw new Error("No output type specified."); + } + + utils.checkSupport(opts.type); + + // accept nodejs `process.platform` + if( + opts.platform === 'darwin' || + opts.platform === 'freebsd' || + opts.platform === 'linux' || + opts.platform === 'sunos' + ) { + opts.platform = "UNIX"; + } + if (opts.platform === 'win32') { + opts.platform = "DOS"; + } + + var comment = opts.comment || this.comment || ""; + worker = generate.generateWorker(this, opts, comment); + } catch (e) { + worker = new GenericWorker("error"); + worker.error(e); + } + return new StreamHelper(worker, opts.type || "string", opts.mimeType); + }, + /** + * Generate the complete zip file asynchronously. + * @see generateInternalStream + */ + generateAsync: function(options, onUpdate) { + return this.generateInternalStream(options).accumulate(onUpdate); + }, + /** + * Generate the complete zip file asynchronously. + * @see generateInternalStream + */ + generateNodeStream: function(options, onUpdate) { + options = options || {}; + if (!options.type) { + options.type = "nodebuffer"; + } + return this.generateInternalStream(options).toNodejsStream(onUpdate); + } +}; +module.exports = out; + +},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(require,module,exports){ +/* + * This file is used by module bundlers (browserify/webpack/etc) when + * including a stream implementation. We use "readable-stream" to get a + * consistent behavior between nodejs versions but bundlers often have a shim + * for "stream". Using this shim greatly improve the compatibility and greatly + * reduce the final size of the bundle (only one stream implementation, not + * two). + */ +module.exports = require("stream"); + +},{"stream":undefined}],17:[function(require,module,exports){ +'use strict'; +var DataReader = require('./DataReader'); +var utils = require('../utils'); + +function ArrayReader(data) { + DataReader.call(this, data); + for(var i = 0; i < this.data.length; i++) { + data[i] = data[i] & 0xFF; + } +} +utils.inherits(ArrayReader, DataReader); +/** + * @see DataReader.byteAt + */ +ArrayReader.prototype.byteAt = function(i) { + return this.data[this.zero + i]; +}; +/** + * @see DataReader.lastIndexOfSignature + */ +ArrayReader.prototype.lastIndexOfSignature = function(sig) { + var sig0 = sig.charCodeAt(0), + sig1 = sig.charCodeAt(1), + sig2 = sig.charCodeAt(2), + sig3 = sig.charCodeAt(3); + for (var i = this.length - 4; i >= 0; --i) { + if (this.data[i] === sig0 && this.data[i + 1] === sig1 && this.data[i + 2] === sig2 && this.data[i + 3] === sig3) { + return i - this.zero; + } + } + + return -1; +}; +/** + * @see DataReader.readAndCheckSignature + */ +ArrayReader.prototype.readAndCheckSignature = function (sig) { + var sig0 = sig.charCodeAt(0), + sig1 = sig.charCodeAt(1), + sig2 = sig.charCodeAt(2), + sig3 = sig.charCodeAt(3), + data = this.readData(4); + return sig0 === data[0] && sig1 === data[1] && sig2 === data[2] && sig3 === data[3]; +}; +/** + * @see DataReader.readData + */ +ArrayReader.prototype.readData = function(size) { + this.checkOffset(size); + if(size === 0) { + return []; + } + var result = this.data.slice(this.zero + this.index, this.zero + this.index + size); + this.index += size; + return result; +}; +module.exports = ArrayReader; + +},{"../utils":32,"./DataReader":18}],18:[function(require,module,exports){ +'use strict'; +var utils = require('../utils'); + +function DataReader(data) { + this.data = data; // type : see implementation + this.length = data.length; + this.index = 0; + this.zero = 0; +} +DataReader.prototype = { + /** + * Check that the offset will not go too far. + * @param {string} offset the additional offset to check. + * @throws {Error} an Error if the offset is out of bounds. + */ + checkOffset: function(offset) { + this.checkIndex(this.index + offset); + }, + /** + * Check that the specified index will not be too far. + * @param {string} newIndex the index to check. + * @throws {Error} an Error if the index is out of bounds. + */ + checkIndex: function(newIndex) { + if (this.length < this.zero + newIndex || newIndex < 0) { + throw new Error("End of data reached (data length = " + this.length + ", asked index = " + (newIndex) + "). Corrupted zip ?"); + } + }, + /** + * Change the index. + * @param {number} newIndex The new index. + * @throws {Error} if the new index is out of the data. + */ + setIndex: function(newIndex) { + this.checkIndex(newIndex); + this.index = newIndex; + }, + /** + * Skip the next n bytes. + * @param {number} n the number of bytes to skip. + * @throws {Error} if the new index is out of the data. + */ + skip: function(n) { + this.setIndex(this.index + n); + }, + /** + * Get the byte at the specified index. + * @param {number} i the index to use. + * @return {number} a byte. + */ + byteAt: function(i) { + // see implementations + }, + /** + * Get the next number with a given byte size. + * @param {number} size the number of bytes to read. + * @return {number} the corresponding number. + */ + readInt: function(size) { + var result = 0, + i; + this.checkOffset(size); + for (i = this.index + size - 1; i >= this.index; i--) { + result = (result << 8) + this.byteAt(i); + } + this.index += size; + return result; + }, + /** + * Get the next string with a given byte size. + * @param {number} size the number of bytes to read. + * @return {string} the corresponding string. + */ + readString: function(size) { + return utils.transformTo("string", this.readData(size)); + }, + /** + * Get raw data without conversion, bytes. + * @param {number} size the number of bytes to read. + * @return {Object} the raw data, implementation specific. + */ + readData: function(size) { + // see implementations + }, + /** + * Find the last occurrence of a zip signature (4 bytes). + * @param {string} sig the signature to find. + * @return {number} the index of the last occurrence, -1 if not found. + */ + lastIndexOfSignature: function(sig) { + // see implementations + }, + /** + * Read the signature (4 bytes) at the current position and compare it with sig. + * @param {string} sig the expected signature + * @return {boolean} true if the signature matches, false otherwise. + */ + readAndCheckSignature: function(sig) { + // see implementations + }, + /** + * Get the next date. + * @return {Date} the date. + */ + readDate: function() { + var dostime = this.readInt(4); + return new Date(Date.UTC( + ((dostime >> 25) & 0x7f) + 1980, // year + ((dostime >> 21) & 0x0f) - 1, // month + (dostime >> 16) & 0x1f, // day + (dostime >> 11) & 0x1f, // hour + (dostime >> 5) & 0x3f, // minute + (dostime & 0x1f) << 1)); // second + } +}; +module.exports = DataReader; + +},{"../utils":32}],19:[function(require,module,exports){ +'use strict'; +var Uint8ArrayReader = require('./Uint8ArrayReader'); +var utils = require('../utils'); + +function NodeBufferReader(data) { + Uint8ArrayReader.call(this, data); +} +utils.inherits(NodeBufferReader, Uint8ArrayReader); + +/** + * @see DataReader.readData + */ +NodeBufferReader.prototype.readData = function(size) { + this.checkOffset(size); + var result = this.data.slice(this.zero + this.index, this.zero + this.index + size); + this.index += size; + return result; +}; +module.exports = NodeBufferReader; + +},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(require,module,exports){ +'use strict'; +var DataReader = require('./DataReader'); +var utils = require('../utils'); + +function StringReader(data) { + DataReader.call(this, data); +} +utils.inherits(StringReader, DataReader); +/** + * @see DataReader.byteAt + */ +StringReader.prototype.byteAt = function(i) { + return this.data.charCodeAt(this.zero + i); +}; +/** + * @see DataReader.lastIndexOfSignature + */ +StringReader.prototype.lastIndexOfSignature = function(sig) { + return this.data.lastIndexOf(sig) - this.zero; +}; +/** + * @see DataReader.readAndCheckSignature + */ +StringReader.prototype.readAndCheckSignature = function (sig) { + var data = this.readData(4); + return sig === data; +}; +/** + * @see DataReader.readData + */ +StringReader.prototype.readData = function(size) { + this.checkOffset(size); + // this will work because the constructor applied the "& 0xff" mask. + var result = this.data.slice(this.zero + this.index, this.zero + this.index + size); + this.index += size; + return result; +}; +module.exports = StringReader; + +},{"../utils":32,"./DataReader":18}],21:[function(require,module,exports){ +'use strict'; +var ArrayReader = require('./ArrayReader'); +var utils = require('../utils'); + +function Uint8ArrayReader(data) { + ArrayReader.call(this, data); +} +utils.inherits(Uint8ArrayReader, ArrayReader); +/** + * @see DataReader.readData + */ +Uint8ArrayReader.prototype.readData = function(size) { + this.checkOffset(size); + if(size === 0) { + // in IE10, when using subarray(idx, idx), we get the array [0x00] instead of []. + return new Uint8Array(0); + } + var result = this.data.subarray(this.zero + this.index, this.zero + this.index + size); + this.index += size; + return result; +}; +module.exports = Uint8ArrayReader; + +},{"../utils":32,"./ArrayReader":17}],22:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); +var support = require('../support'); +var ArrayReader = require('./ArrayReader'); +var StringReader = require('./StringReader'); +var NodeBufferReader = require('./NodeBufferReader'); +var Uint8ArrayReader = require('./Uint8ArrayReader'); + +/** + * Create a reader adapted to the data. + * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data to read. + * @return {DataReader} the data reader. + */ +module.exports = function (data) { + var type = utils.getTypeOf(data); + utils.checkSupport(type); + if (type === "string" && !support.uint8array) { + return new StringReader(data); + } + if (type === "nodebuffer") { + return new NodeBufferReader(data); + } + if (support.uint8array) { + return new Uint8ArrayReader(utils.transformTo("uint8array", data)); + } + return new ArrayReader(utils.transformTo("array", data)); +}; + +},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(require,module,exports){ +'use strict'; +exports.LOCAL_FILE_HEADER = "PK\x03\x04"; +exports.CENTRAL_FILE_HEADER = "PK\x01\x02"; +exports.CENTRAL_DIRECTORY_END = "PK\x05\x06"; +exports.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x06\x07"; +exports.ZIP64_CENTRAL_DIRECTORY_END = "PK\x06\x06"; +exports.DATA_DESCRIPTOR = "PK\x07\x08"; + +},{}],24:[function(require,module,exports){ +'use strict'; + +var GenericWorker = require('./GenericWorker'); +var utils = require('../utils'); + +/** + * A worker which convert chunks to a specified type. + * @constructor + * @param {String} destType the destination type. + */ +function ConvertWorker(destType) { + GenericWorker.call(this, "ConvertWorker to " + destType); + this.destType = destType; +} +utils.inherits(ConvertWorker, GenericWorker); + +/** + * @see GenericWorker.processChunk + */ +ConvertWorker.prototype.processChunk = function (chunk) { + this.push({ + data : utils.transformTo(this.destType, chunk.data), + meta : chunk.meta + }); +}; +module.exports = ConvertWorker; + +},{"../utils":32,"./GenericWorker":28}],25:[function(require,module,exports){ +'use strict'; + +var GenericWorker = require('./GenericWorker'); +var crc32 = require('../crc32'); +var utils = require('../utils'); + +/** + * A worker which calculate the crc32 of the data flowing through. + * @constructor + */ +function Crc32Probe() { + GenericWorker.call(this, "Crc32Probe"); + this.withStreamInfo("crc32", 0); +} +utils.inherits(Crc32Probe, GenericWorker); + +/** + * @see GenericWorker.processChunk + */ +Crc32Probe.prototype.processChunk = function (chunk) { + this.streamInfo.crc32 = crc32(chunk.data, this.streamInfo.crc32 || 0); + this.push(chunk); +}; +module.exports = Crc32Probe; + +},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); +var GenericWorker = require('./GenericWorker'); + +/** + * A worker which calculate the total length of the data flowing through. + * @constructor + * @param {String} propName the name used to expose the length + */ +function DataLengthProbe(propName) { + GenericWorker.call(this, "DataLengthProbe for " + propName); + this.propName = propName; + this.withStreamInfo(propName, 0); +} +utils.inherits(DataLengthProbe, GenericWorker); + +/** + * @see GenericWorker.processChunk + */ +DataLengthProbe.prototype.processChunk = function (chunk) { + if(chunk) { + var length = this.streamInfo[this.propName] || 0; + this.streamInfo[this.propName] = length + chunk.data.length; + } + GenericWorker.prototype.processChunk.call(this, chunk); +}; +module.exports = DataLengthProbe; + + +},{"../utils":32,"./GenericWorker":28}],27:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); +var GenericWorker = require('./GenericWorker'); + +// the size of the generated chunks +// TODO expose this as a public variable +var DEFAULT_BLOCK_SIZE = 16 * 1024; + +/** + * A worker that reads a content and emits chunks. + * @constructor + * @param {Promise} dataP the promise of the data to split + */ +function DataWorker(dataP) { + GenericWorker.call(this, "DataWorker"); + var self = this; + this.dataIsReady = false; + this.index = 0; + this.max = 0; + this.data = null; + this.type = ""; + + this._tickScheduled = false; + + dataP.then(function (data) { + self.dataIsReady = true; + self.data = data; + self.max = data && data.length || 0; + self.type = utils.getTypeOf(data); + if(!self.isPaused) { + self._tickAndRepeat(); + } + }, function (e) { + self.error(e); + }); +} + +utils.inherits(DataWorker, GenericWorker); + +/** + * @see GenericWorker.cleanUp + */ +DataWorker.prototype.cleanUp = function () { + GenericWorker.prototype.cleanUp.call(this); + this.data = null; +}; + +/** + * @see GenericWorker.resume + */ +DataWorker.prototype.resume = function () { + if(!GenericWorker.prototype.resume.call(this)) { + return false; + } + + if (!this._tickScheduled && this.dataIsReady) { + this._tickScheduled = true; + utils.delay(this._tickAndRepeat, [], this); + } + return true; +}; + +/** + * Trigger a tick a schedule an other call to this function. + */ +DataWorker.prototype._tickAndRepeat = function() { + this._tickScheduled = false; + if(this.isPaused || this.isFinished) { + return; + } + this._tick(); + if(!this.isFinished) { + utils.delay(this._tickAndRepeat, [], this); + this._tickScheduled = true; + } +}; + +/** + * Read and push a chunk. + */ +DataWorker.prototype._tick = function() { + + if(this.isPaused || this.isFinished) { + return false; + } + + var size = DEFAULT_BLOCK_SIZE; + var data = null, nextIndex = Math.min(this.max, this.index + size); + if (this.index >= this.max) { + // EOF + return this.end(); + } else { + switch(this.type) { + case "string": + data = this.data.substring(this.index, nextIndex); + break; + case "uint8array": + data = this.data.subarray(this.index, nextIndex); + break; + case "array": + case "nodebuffer": + data = this.data.slice(this.index, nextIndex); + break; + } + this.index = nextIndex; + return this.push({ + data : data, + meta : { + percent : this.max ? this.index / this.max * 100 : 0 + } + }); + } +}; + +module.exports = DataWorker; + +},{"../utils":32,"./GenericWorker":28}],28:[function(require,module,exports){ +'use strict'; + +/** + * A worker that does nothing but passing chunks to the next one. This is like + * a nodejs stream but with some differences. On the good side : + * - it works on IE 6-9 without any issue / polyfill + * - it weights less than the full dependencies bundled with browserify + * - it forwards errors (no need to declare an error handler EVERYWHERE) + * + * A chunk is an object with 2 attributes : `meta` and `data`. The former is an + * object containing anything (`percent` for example), see each worker for more + * details. The latter is the real data (String, Uint8Array, etc). + * + * @constructor + * @param {String} name the name of the stream (mainly used for debugging purposes) + */ +function GenericWorker(name) { + // the name of the worker + this.name = name || "default"; + // an object containing metadata about the workers chain + this.streamInfo = {}; + // an error which happened when the worker was paused + this.generatedError = null; + // an object containing metadata to be merged by this worker into the general metadata + this.extraStreamInfo = {}; + // true if the stream is paused (and should not do anything), false otherwise + this.isPaused = true; + // true if the stream is finished (and should not do anything), false otherwise + this.isFinished = false; + // true if the stream is locked to prevent further structure updates (pipe), false otherwise + this.isLocked = false; + // the event listeners + this._listeners = { + 'data':[], + 'end':[], + 'error':[] + }; + // the previous worker, if any + this.previous = null; +} + +GenericWorker.prototype = { + /** + * Push a chunk to the next workers. + * @param {Object} chunk the chunk to push + */ + push : function (chunk) { + this.emit("data", chunk); + }, + /** + * End the stream. + * @return {Boolean} true if this call ended the worker, false otherwise. + */ + end : function () { + if (this.isFinished) { + return false; + } + + this.flush(); + try { + this.emit("end"); + this.cleanUp(); + this.isFinished = true; + } catch (e) { + this.emit("error", e); + } + return true; + }, + /** + * End the stream with an error. + * @param {Error} e the error which caused the premature end. + * @return {Boolean} true if this call ended the worker with an error, false otherwise. + */ + error : function (e) { + if (this.isFinished) { + return false; + } + + if(this.isPaused) { + this.generatedError = e; + } else { + this.isFinished = true; + + this.emit("error", e); + + // in the workers chain exploded in the middle of the chain, + // the error event will go downward but we also need to notify + // workers upward that there has been an error. + if(this.previous) { + this.previous.error(e); + } + + this.cleanUp(); + } + return true; + }, + /** + * Add a callback on an event. + * @param {String} name the name of the event (data, end, error) + * @param {Function} listener the function to call when the event is triggered + * @return {GenericWorker} the current object for chainability + */ + on : function (name, listener) { + this._listeners[name].push(listener); + return this; + }, + /** + * Clean any references when a worker is ending. + */ + cleanUp : function () { + this.streamInfo = this.generatedError = this.extraStreamInfo = null; + this._listeners = []; + }, + /** + * Trigger an event. This will call registered callback with the provided arg. + * @param {String} name the name of the event (data, end, error) + * @param {Object} arg the argument to call the callback with. + */ + emit : function (name, arg) { + if (this._listeners[name]) { + for(var i = 0; i < this._listeners[name].length; i++) { + this._listeners[name][i].call(this, arg); + } + } + }, + /** + * Chain a worker with an other. + * @param {Worker} next the worker receiving events from the current one. + * @return {worker} the next worker for chainability + */ + pipe : function (next) { + return next.registerPrevious(this); + }, + /** + * Same as `pipe` in the other direction. + * Using an API with `pipe(next)` is very easy. + * Implementing the API with the point of view of the next one registering + * a source is easier, see the ZipFileWorker. + * @param {Worker} previous the previous worker, sending events to this one + * @return {Worker} the current worker for chainability + */ + registerPrevious : function (previous) { + if (this.isLocked) { + throw new Error("The stream '" + this + "' has already been used."); + } + + // sharing the streamInfo... + this.streamInfo = previous.streamInfo; + // ... and adding our own bits + this.mergeStreamInfo(); + this.previous = previous; + var self = this; + previous.on('data', function (chunk) { + self.processChunk(chunk); + }); + previous.on('end', function () { + self.end(); + }); + previous.on('error', function (e) { + self.error(e); + }); + return this; + }, + /** + * Pause the stream so it doesn't send events anymore. + * @return {Boolean} true if this call paused the worker, false otherwise. + */ + pause : function () { + if(this.isPaused || this.isFinished) { + return false; + } + this.isPaused = true; + + if(this.previous) { + this.previous.pause(); + } + return true; + }, + /** + * Resume a paused stream. + * @return {Boolean} true if this call resumed the worker, false otherwise. + */ + resume : function () { + if(!this.isPaused || this.isFinished) { + return false; + } + this.isPaused = false; + + // if true, the worker tried to resume but failed + var withError = false; + if(this.generatedError) { + this.error(this.generatedError); + withError = true; + } + if(this.previous) { + this.previous.resume(); + } + + return !withError; + }, + /** + * Flush any remaining bytes as the stream is ending. + */ + flush : function () {}, + /** + * Process a chunk. This is usually the method overridden. + * @param {Object} chunk the chunk to process. + */ + processChunk : function(chunk) { + this.push(chunk); + }, + /** + * Add a key/value to be added in the workers chain streamInfo once activated. + * @param {String} key the key to use + * @param {Object} value the associated value + * @return {Worker} the current worker for chainability + */ + withStreamInfo : function (key, value) { + this.extraStreamInfo[key] = value; + this.mergeStreamInfo(); + return this; + }, + /** + * Merge this worker's streamInfo into the chain's streamInfo. + */ + mergeStreamInfo : function () { + for(var key in this.extraStreamInfo) { + if (!this.extraStreamInfo.hasOwnProperty(key)) { + continue; + } + this.streamInfo[key] = this.extraStreamInfo[key]; + } + }, + + /** + * Lock the stream to prevent further updates on the workers chain. + * After calling this method, all calls to pipe will fail. + */ + lock: function () { + if (this.isLocked) { + throw new Error("The stream '" + this + "' has already been used."); + } + this.isLocked = true; + if (this.previous) { + this.previous.lock(); + } + }, + + /** + * + * Pretty print the workers chain. + */ + toString : function () { + var me = "Worker " + this.name; + if (this.previous) { + return this.previous + " -> " + me; + } else { + return me; + } + } +}; + +module.exports = GenericWorker; + +},{}],29:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); +var ConvertWorker = require('./ConvertWorker'); +var GenericWorker = require('./GenericWorker'); +var base64 = require('../base64'); +var support = require("../support"); +var external = require("../external"); + +var NodejsStreamOutputAdapter = null; +if (support.nodestream) { + try { + NodejsStreamOutputAdapter = require('../nodejs/NodejsStreamOutputAdapter'); + } catch(e) {} +} + +/** + * Apply the final transformation of the data. If the user wants a Blob for + * example, it's easier to work with an U8intArray and finally do the + * ArrayBuffer/Blob conversion. + * @param {String} type the name of the final type + * @param {String|Uint8Array|Buffer} content the content to transform + * @param {String} mimeType the mime type of the content, if applicable. + * @return {String|Uint8Array|ArrayBuffer|Buffer|Blob} the content in the right format. + */ +function transformZipOutput(type, content, mimeType) { + switch(type) { + case "blob" : + return utils.newBlob(utils.transformTo("arraybuffer", content), mimeType); + case "base64" : + return base64.encode(content); + default : + return utils.transformTo(type, content); + } +} + +/** + * Concatenate an array of data of the given type. + * @param {String} type the type of the data in the given array. + * @param {Array} dataArray the array containing the data chunks to concatenate + * @return {String|Uint8Array|Buffer} the concatenated data + * @throws Error if the asked type is unsupported + */ +function concat (type, dataArray) { + var i, index = 0, res = null, totalLength = 0; + for(i = 0; i < dataArray.length; i++) { + totalLength += dataArray[i].length; + } + switch(type) { + case "string": + return dataArray.join(""); + case "array": + return Array.prototype.concat.apply([], dataArray); + case "uint8array": + res = new Uint8Array(totalLength); + for(i = 0; i < dataArray.length; i++) { + res.set(dataArray[i], index); + index += dataArray[i].length; + } + return res; + case "nodebuffer": + return Buffer.concat(dataArray); + default: + throw new Error("concat : unsupported type '" + type + "'"); + } +} + +/** + * Listen a StreamHelper, accumulate its content and concatenate it into a + * complete block. + * @param {StreamHelper} helper the helper to use. + * @param {Function} updateCallback a callback called on each update. Called + * with one arg : + * - the metadata linked to the update received. + * @return Promise the promise for the accumulation. + */ +function accumulate(helper, updateCallback) { + return new external.Promise(function (resolve, reject){ + var dataArray = []; + var chunkType = helper._internalType, + resultType = helper._outputType, + mimeType = helper._mimeType; + helper + .on('data', function (data, meta) { + dataArray.push(data); + if(updateCallback) { + updateCallback(meta); + } + }) + .on('error', function(err) { + dataArray = []; + reject(err); + }) + .on('end', function (){ + try { + var result = transformZipOutput(resultType, concat(chunkType, dataArray), mimeType); + resolve(result); + } catch (e) { + reject(e); + } + dataArray = []; + }) + .resume(); + }); +} + +/** + * An helper to easily use workers outside of JSZip. + * @constructor + * @param {Worker} worker the worker to wrap + * @param {String} outputType the type of data expected by the use + * @param {String} mimeType the mime type of the content, if applicable. + */ +function StreamHelper(worker, outputType, mimeType) { + var internalType = outputType; + switch(outputType) { + case "blob": + case "arraybuffer": + internalType = "uint8array"; + break; + case "base64": + internalType = "string"; + break; + } + + try { + // the type used internally + this._internalType = internalType; + // the type used to output results + this._outputType = outputType; + // the mime type + this._mimeType = mimeType; + utils.checkSupport(internalType); + this._worker = worker.pipe(new ConvertWorker(internalType)); + // the last workers can be rewired without issues but we need to + // prevent any updates on previous workers. + worker.lock(); + } catch(e) { + this._worker = new GenericWorker("error"); + this._worker.error(e); + } +} + +StreamHelper.prototype = { + /** + * Listen a StreamHelper, accumulate its content and concatenate it into a + * complete block. + * @param {Function} updateCb the update callback. + * @return Promise the promise for the accumulation. + */ + accumulate : function (updateCb) { + return accumulate(this, updateCb); + }, + /** + * Add a listener on an event triggered on a stream. + * @param {String} evt the name of the event + * @param {Function} fn the listener + * @return {StreamHelper} the current helper. + */ + on : function (evt, fn) { + var self = this; + + if(evt === "data") { + this._worker.on(evt, function (chunk) { + fn.call(self, chunk.data, chunk.meta); + }); + } else { + this._worker.on(evt, function () { + utils.delay(fn, arguments, self); + }); + } + return this; + }, + /** + * Resume the flow of chunks. + * @return {StreamHelper} the current helper. + */ + resume : function () { + utils.delay(this._worker.resume, [], this._worker); + return this; + }, + /** + * Pause the flow of chunks. + * @return {StreamHelper} the current helper. + */ + pause : function () { + this._worker.pause(); + return this; + }, + /** + * Return a nodejs stream for this helper. + * @param {Function} updateCb the update callback. + * @return {NodejsStreamOutputAdapter} the nodejs stream. + */ + toNodejsStream : function (updateCb) { + utils.checkSupport("nodestream"); + if (this._outputType !== "nodebuffer") { + // an object stream containing blob/arraybuffer/uint8array/string + // is strange and I don't know if it would be useful. + // I you find this comment and have a good usecase, please open a + // bug report ! + throw new Error(this._outputType + " is not supported by this method"); + } + + return new NodejsStreamOutputAdapter(this, { + objectMode : this._outputType !== "nodebuffer" + }, updateCb); + } +}; + + +module.exports = StreamHelper; + +},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(require,module,exports){ +'use strict'; + +exports.base64 = true; +exports.array = true; +exports.string = true; +exports.arraybuffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined"; +exports.nodebuffer = typeof Buffer !== "undefined"; +// contains true if JSZip can read/generate Uint8Array, false otherwise. +exports.uint8array = typeof Uint8Array !== "undefined"; + +if (typeof ArrayBuffer === "undefined") { + exports.blob = false; +} +else { + var buffer = new ArrayBuffer(0); + try { + exports.blob = new Blob([buffer], { + type: "application/zip" + }).size === 0; + } + catch (e) { + try { + var Builder = self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder; + var builder = new Builder(); + builder.append(buffer); + exports.blob = builder.getBlob('application/zip').size === 0; + } + catch (e) { + exports.blob = false; + } + } +} + +try { + exports.nodestream = !!require('readable-stream').Readable; +} catch(e) { + exports.nodestream = false; +} + +},{"readable-stream":16}],31:[function(require,module,exports){ +'use strict'; + +var utils = require('./utils'); +var support = require('./support'); +var nodejsUtils = require('./nodejsUtils'); +var GenericWorker = require('./stream/GenericWorker'); + +/** + * The following functions come from pako, from pako/lib/utils/strings + * released under the MIT license, see pako https://github.com/nodeca/pako/ + */ + +// Table with utf8 lengths (calculated by first byte of sequence) +// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS, +// because max possible codepoint is 0x10ffff +var _utf8len = new Array(256); +for (var i=0; i<256; i++) { + _utf8len[i] = (i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1); +} +_utf8len[254]=_utf8len[254]=1; // Invalid sequence start + +// convert string to array (typed, when possible) +var string2buf = function (str) { + var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; + + // count binary size + for (m_pos = 0; m_pos < str_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) { + c2 = str.charCodeAt(m_pos+1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4; + } + + // allocate buffer + if (support.uint8array) { + buf = new Uint8Array(buf_len); + } else { + buf = new Array(buf_len); + } + + // convert + for (i=0, m_pos = 0; i < buf_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) { + c2 = str.charCodeAt(m_pos+1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + if (c < 0x80) { + /* one byte */ + buf[i++] = c; + } else if (c < 0x800) { + /* two bytes */ + buf[i++] = 0xC0 | (c >>> 6); + buf[i++] = 0x80 | (c & 0x3f); + } else if (c < 0x10000) { + /* three bytes */ + buf[i++] = 0xE0 | (c >>> 12); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } else { + /* four bytes */ + buf[i++] = 0xf0 | (c >>> 18); + buf[i++] = 0x80 | (c >>> 12 & 0x3f); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } + } + + return buf; +}; + +// Calculate max possible position in utf8 buffer, +// that will not break sequence. If that's not possible +// - (very small limits) return max size as is. +// +// buf[] - utf8 bytes array +// max - length limit (mandatory); +var utf8border = function(buf, max) { + var pos; + + max = max || buf.length; + if (max > buf.length) { max = buf.length; } + + // go back from last position, until start of sequence found + pos = max-1; + while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; } + + // Fuckup - very small and broken sequence, + // return max, because we should return something anyway. + if (pos < 0) { return max; } + + // If we came to start of buffer - that means vuffer is too small, + // return max too. + if (pos === 0) { return max; } + + return (pos + _utf8len[buf[pos]] > max) ? pos : max; +}; + +// convert array to string +var buf2string = function (buf) { + var str, i, out, c, c_len; + var len = buf.length; + + // Reserve max possible length (2 words per char) + // NB: by unknown reasons, Array is significantly faster for + // String.fromCharCode.apply than Uint16Array. + var utf16buf = new Array(len*2); + + for (out=0, i=0; i 4) { utf16buf[out++] = 0xfffd; i += c_len-1; continue; } + + // apply mask on first byte + c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07; + // join the rest + while (c_len > 1 && i < len) { + c = (c << 6) | (buf[i++] & 0x3f); + c_len--; + } + + // terminated by end of string? + if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; } + + if (c < 0x10000) { + utf16buf[out++] = c; + } else { + c -= 0x10000; + utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff); + utf16buf[out++] = 0xdc00 | (c & 0x3ff); + } + } + + // shrinkBuf(utf16buf, out) + if (utf16buf.length !== out) { + if(utf16buf.subarray) { + utf16buf = utf16buf.subarray(0, out); + } else { + utf16buf.length = out; + } + } + + // return String.fromCharCode.apply(null, utf16buf); + return utils.applyFromCharCode(utf16buf); +}; + + +// That's all for the pako functions. + + +/** + * Transform a javascript string into an array (typed if possible) of bytes, + * UTF-8 encoded. + * @param {String} str the string to encode + * @return {Array|Uint8Array|Buffer} the UTF-8 encoded string. + */ +exports.utf8encode = function utf8encode(str) { + if (support.nodebuffer) { + return nodejsUtils.newBufferFrom(str, "utf-8"); + } + + return string2buf(str); +}; + + +/** + * Transform a bytes array (or a representation) representing an UTF-8 encoded + * string into a javascript string. + * @param {Array|Uint8Array|Buffer} buf the data de decode + * @return {String} the decoded string. + */ +exports.utf8decode = function utf8decode(buf) { + if (support.nodebuffer) { + return utils.transformTo("nodebuffer", buf).toString("utf-8"); + } + + buf = utils.transformTo(support.uint8array ? "uint8array" : "array", buf); + + return buf2string(buf); +}; + +/** + * A worker to decode utf8 encoded binary chunks into string chunks. + * @constructor + */ +function Utf8DecodeWorker() { + GenericWorker.call(this, "utf-8 decode"); + // the last bytes if a chunk didn't end with a complete codepoint. + this.leftOver = null; +} +utils.inherits(Utf8DecodeWorker, GenericWorker); + +/** + * @see GenericWorker.processChunk + */ +Utf8DecodeWorker.prototype.processChunk = function (chunk) { + + var data = utils.transformTo(support.uint8array ? "uint8array" : "array", chunk.data); + + // 1st step, re-use what's left of the previous chunk + if (this.leftOver && this.leftOver.length) { + if(support.uint8array) { + var previousData = data; + data = new Uint8Array(previousData.length + this.leftOver.length); + data.set(this.leftOver, 0); + data.set(previousData, this.leftOver.length); + } else { + data = this.leftOver.concat(data); + } + this.leftOver = null; + } + + var nextBoundary = utf8border(data); + var usableData = data; + if (nextBoundary !== data.length) { + if (support.uint8array) { + usableData = data.subarray(0, nextBoundary); + this.leftOver = data.subarray(nextBoundary, data.length); + } else { + usableData = data.slice(0, nextBoundary); + this.leftOver = data.slice(nextBoundary, data.length); + } + } + + this.push({ + data : exports.utf8decode(usableData), + meta : chunk.meta + }); +}; + +/** + * @see GenericWorker.flush + */ +Utf8DecodeWorker.prototype.flush = function () { + if(this.leftOver && this.leftOver.length) { + this.push({ + data : exports.utf8decode(this.leftOver), + meta : {} + }); + this.leftOver = null; + } +}; +exports.Utf8DecodeWorker = Utf8DecodeWorker; + +/** + * A worker to endcode string chunks into utf8 encoded binary chunks. + * @constructor + */ +function Utf8EncodeWorker() { + GenericWorker.call(this, "utf-8 encode"); +} +utils.inherits(Utf8EncodeWorker, GenericWorker); + +/** + * @see GenericWorker.processChunk + */ +Utf8EncodeWorker.prototype.processChunk = function (chunk) { + this.push({ + data : exports.utf8encode(chunk.data), + meta : chunk.meta + }); +}; +exports.Utf8EncodeWorker = Utf8EncodeWorker; + +},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(require,module,exports){ +'use strict'; + +var support = require('./support'); +var base64 = require('./base64'); +var nodejsUtils = require('./nodejsUtils'); +var setImmediate = require('set-immediate-shim'); +var external = require("./external"); + + +/** + * Convert a string that pass as a "binary string": it should represent a byte + * array but may have > 255 char codes. Be sure to take only the first byte + * and returns the byte array. + * @param {String} str the string to transform. + * @return {Array|Uint8Array} the string in a binary format. + */ +function string2binary(str) { + var result = null; + if (support.uint8array) { + result = new Uint8Array(str.length); + } else { + result = new Array(str.length); + } + return stringToArrayLike(str, result); +} + +/** + * Create a new blob with the given content and the given type. + * @param {String|ArrayBuffer} part the content to put in the blob. DO NOT use + * an Uint8Array because the stock browser of android 4 won't accept it (it + * will be silently converted to a string, "[object Uint8Array]"). + * + * Use only ONE part to build the blob to avoid a memory leak in IE11 / Edge: + * when a large amount of Array is used to create the Blob, the amount of + * memory consumed is nearly 100 times the original data amount. + * + * @param {String} type the mime type of the blob. + * @return {Blob} the created blob. + */ +exports.newBlob = function(part, type) { + exports.checkSupport("blob"); + + try { + // Blob constructor + return new Blob([part], { + type: type + }); + } + catch (e) { + + try { + // deprecated, browser only, old way + var Builder = self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder; + var builder = new Builder(); + builder.append(part); + return builder.getBlob(type); + } + catch (e) { + + // well, fuck ?! + throw new Error("Bug : can't construct the Blob."); + } + } + + +}; +/** + * The identity function. + * @param {Object} input the input. + * @return {Object} the same input. + */ +function identity(input) { + return input; +} + +/** + * Fill in an array with a string. + * @param {String} str the string to use. + * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to fill in (will be mutated). + * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated array. + */ +function stringToArrayLike(str, array) { + for (var i = 0; i < str.length; ++i) { + array[i] = str.charCodeAt(i) & 0xFF; + } + return array; +} + +/** + * An helper for the function arrayLikeToString. + * This contains static information and functions that + * can be optimized by the browser JIT compiler. + */ +var arrayToStringHelper = { + /** + * Transform an array of int into a string, chunk by chunk. + * See the performances notes on arrayLikeToString. + * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform. + * @param {String} type the type of the array. + * @param {Integer} chunk the chunk size. + * @return {String} the resulting string. + * @throws Error if the chunk is too big for the stack. + */ + stringifyByChunk: function(array, type, chunk) { + var result = [], k = 0, len = array.length; + // shortcut + if (len <= chunk) { + return String.fromCharCode.apply(null, array); + } + while (k < len) { + if (type === "array" || type === "nodebuffer") { + result.push(String.fromCharCode.apply(null, array.slice(k, Math.min(k + chunk, len)))); + } + else { + result.push(String.fromCharCode.apply(null, array.subarray(k, Math.min(k + chunk, len)))); + } + k += chunk; + } + return result.join(""); + }, + /** + * Call String.fromCharCode on every item in the array. + * This is the naive implementation, which generate A LOT of intermediate string. + * This should be used when everything else fail. + * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform. + * @return {String} the result. + */ + stringifyByChar: function(array){ + var resultStr = ""; + for(var i = 0; i < array.length; i++) { + resultStr += String.fromCharCode(array[i]); + } + return resultStr; + }, + applyCanBeUsed : { + /** + * true if the browser accepts to use String.fromCharCode on Uint8Array + */ + uint8array : (function () { + try { + return support.uint8array && String.fromCharCode.apply(null, new Uint8Array(1)).length === 1; + } catch (e) { + return false; + } + })(), + /** + * true if the browser accepts to use String.fromCharCode on nodejs Buffer. + */ + nodebuffer : (function () { + try { + return support.nodebuffer && String.fromCharCode.apply(null, nodejsUtils.allocBuffer(1)).length === 1; + } catch (e) { + return false; + } + })() + } +}; + +/** + * Transform an array-like object to a string. + * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform. + * @return {String} the result. + */ +function arrayLikeToString(array) { + // Performances notes : + // -------------------- + // String.fromCharCode.apply(null, array) is the fastest, see + // see http://jsperf.com/converting-a-uint8array-to-a-string/2 + // but the stack is limited (and we can get huge arrays !). + // + // result += String.fromCharCode(array[i]); generate too many strings ! + // + // This code is inspired by http://jsperf.com/arraybuffer-to-string-apply-performance/2 + // TODO : we now have workers that split the work. Do we still need that ? + var chunk = 65536, + type = exports.getTypeOf(array), + canUseApply = true; + if (type === "uint8array") { + canUseApply = arrayToStringHelper.applyCanBeUsed.uint8array; + } else if (type === "nodebuffer") { + canUseApply = arrayToStringHelper.applyCanBeUsed.nodebuffer; + } + + if (canUseApply) { + while (chunk > 1) { + try { + return arrayToStringHelper.stringifyByChunk(array, type, chunk); + } catch (e) { + chunk = Math.floor(chunk / 2); + } + } + } + + // no apply or chunk error : slow and painful algorithm + // default browser on android 4.* + return arrayToStringHelper.stringifyByChar(array); +} + +exports.applyFromCharCode = arrayLikeToString; + + +/** + * Copy the data from an array-like to an other array-like. + * @param {Array|ArrayBuffer|Uint8Array|Buffer} arrayFrom the origin array. + * @param {Array|ArrayBuffer|Uint8Array|Buffer} arrayTo the destination array which will be mutated. + * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated destination array. + */ +function arrayLikeToArrayLike(arrayFrom, arrayTo) { + for (var i = 0; i < arrayFrom.length; i++) { + arrayTo[i] = arrayFrom[i]; + } + return arrayTo; +} + +// a matrix containing functions to transform everything into everything. +var transform = {}; + +// string to ? +transform["string"] = { + "string": identity, + "array": function(input) { + return stringToArrayLike(input, new Array(input.length)); + }, + "arraybuffer": function(input) { + return transform["string"]["uint8array"](input).buffer; + }, + "uint8array": function(input) { + return stringToArrayLike(input, new Uint8Array(input.length)); + }, + "nodebuffer": function(input) { + return stringToArrayLike(input, nodejsUtils.allocBuffer(input.length)); + } +}; + +// array to ? +transform["array"] = { + "string": arrayLikeToString, + "array": identity, + "arraybuffer": function(input) { + return (new Uint8Array(input)).buffer; + }, + "uint8array": function(input) { + return new Uint8Array(input); + }, + "nodebuffer": function(input) { + return nodejsUtils.newBufferFrom(input); + } +}; + +// arraybuffer to ? +transform["arraybuffer"] = { + "string": function(input) { + return arrayLikeToString(new Uint8Array(input)); + }, + "array": function(input) { + return arrayLikeToArrayLike(new Uint8Array(input), new Array(input.byteLength)); + }, + "arraybuffer": identity, + "uint8array": function(input) { + return new Uint8Array(input); + }, + "nodebuffer": function(input) { + return nodejsUtils.newBufferFrom(new Uint8Array(input)); + } +}; + +// uint8array to ? +transform["uint8array"] = { + "string": arrayLikeToString, + "array": function(input) { + return arrayLikeToArrayLike(input, new Array(input.length)); + }, + "arraybuffer": function(input) { + return input.buffer; + }, + "uint8array": identity, + "nodebuffer": function(input) { + return nodejsUtils.newBufferFrom(input); + } +}; + +// nodebuffer to ? +transform["nodebuffer"] = { + "string": arrayLikeToString, + "array": function(input) { + return arrayLikeToArrayLike(input, new Array(input.length)); + }, + "arraybuffer": function(input) { + return transform["nodebuffer"]["uint8array"](input).buffer; + }, + "uint8array": function(input) { + return arrayLikeToArrayLike(input, new Uint8Array(input.length)); + }, + "nodebuffer": identity +}; + +/** + * Transform an input into any type. + * The supported output type are : string, array, uint8array, arraybuffer, nodebuffer. + * If no output type is specified, the unmodified input will be returned. + * @param {String} outputType the output type. + * @param {String|Array|ArrayBuffer|Uint8Array|Buffer} input the input to convert. + * @throws {Error} an Error if the browser doesn't support the requested output type. + */ +exports.transformTo = function(outputType, input) { + if (!input) { + // undefined, null, etc + // an empty string won't harm. + input = ""; + } + if (!outputType) { + return input; + } + exports.checkSupport(outputType); + var inputType = exports.getTypeOf(input); + var result = transform[inputType][outputType](input); + return result; +}; + +/** + * Return the type of the input. + * The type will be in a format valid for JSZip.utils.transformTo : string, array, uint8array, arraybuffer. + * @param {Object} input the input to identify. + * @return {String} the (lowercase) type of the input. + */ +exports.getTypeOf = function(input) { + if (typeof input === "string") { + return "string"; + } + if (Object.prototype.toString.call(input) === "[object Array]") { + return "array"; + } + if (support.nodebuffer && nodejsUtils.isBuffer(input)) { + return "nodebuffer"; + } + if (support.uint8array && input instanceof Uint8Array) { + return "uint8array"; + } + if (support.arraybuffer && input instanceof ArrayBuffer) { + return "arraybuffer"; + } +}; + +/** + * Throw an exception if the type is not supported. + * @param {String} type the type to check. + * @throws {Error} an Error if the browser doesn't support the requested type. + */ +exports.checkSupport = function(type) { + var supported = support[type.toLowerCase()]; + if (!supported) { + throw new Error(type + " is not supported by this platform"); + } +}; + +exports.MAX_VALUE_16BITS = 65535; +exports.MAX_VALUE_32BITS = -1; // well, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" is parsed as -1 + +/** + * Prettify a string read as binary. + * @param {string} str the string to prettify. + * @return {string} a pretty string. + */ +exports.pretty = function(str) { + var res = '', + code, i; + for (i = 0; i < (str || "").length; i++) { + code = str.charCodeAt(i); + res += '\\x' + (code < 16 ? "0" : "") + code.toString(16).toUpperCase(); + } + return res; +}; + +/** + * Defer the call of a function. + * @param {Function} callback the function to call asynchronously. + * @param {Array} args the arguments to give to the callback. + */ +exports.delay = function(callback, args, self) { + setImmediate(function () { + callback.apply(self || null, args || []); + }); +}; + +/** + * Extends a prototype with an other, without calling a constructor with + * side effects. Inspired by nodejs' `utils.inherits` + * @param {Function} ctor the constructor to augment + * @param {Function} superCtor the parent constructor to use + */ +exports.inherits = function (ctor, superCtor) { + var Obj = function() {}; + Obj.prototype = superCtor.prototype; + ctor.prototype = new Obj(); +}; + +/** + * Merge the objects passed as parameters into a new one. + * @private + * @param {...Object} var_args All objects to merge. + * @return {Object} a new object with the data of the others. + */ +exports.extend = function() { + var result = {}, i, attr; + for (i = 0; i < arguments.length; i++) { // arguments is not enumerable in some browsers + for (attr in arguments[i]) { + if (arguments[i].hasOwnProperty(attr) && typeof result[attr] === "undefined") { + result[attr] = arguments[i][attr]; + } + } + } + return result; +}; + +/** + * Transform arbitrary content into a Promise. + * @param {String} name a name for the content being processed. + * @param {Object} inputData the content to process. + * @param {Boolean} isBinary true if the content is not an unicode string + * @param {Boolean} isOptimizedBinaryString true if the string content only has one byte per character. + * @param {Boolean} isBase64 true if the string content is encoded with base64. + * @return {Promise} a promise in a format usable by JSZip. + */ +exports.prepareContent = function(name, inputData, isBinary, isOptimizedBinaryString, isBase64) { + + // if inputData is already a promise, this flatten it. + var promise = external.Promise.resolve(inputData).then(function(data) { + + + var isBlob = support.blob && (data instanceof Blob || ['[object File]', '[object Blob]'].indexOf(Object.prototype.toString.call(data)) !== -1); + + if (isBlob && typeof FileReader !== "undefined") { + return new external.Promise(function (resolve, reject) { + var reader = new FileReader(); + + reader.onload = function(e) { + resolve(e.target.result); + }; + reader.onerror = function(e) { + reject(e.target.error); + }; + reader.readAsArrayBuffer(data); + }); + } else { + return data; + } + }); + + return promise.then(function(data) { + var dataType = exports.getTypeOf(data); + + if (!dataType) { + return external.Promise.reject( + new Error("Can't read the data of '" + name + "'. Is it " + + "in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?") + ); + } + // special case : it's way easier to work with Uint8Array than with ArrayBuffer + if (dataType === "arraybuffer") { + data = exports.transformTo("uint8array", data); + } else if (dataType === "string") { + if (isBase64) { + data = base64.decode(data); + } + else if (isBinary) { + // optimizedBinaryString === true means that the file has already been filtered with a 0xFF mask + if (isOptimizedBinaryString !== true) { + // this is a string, not in a base64 format. + // Be sure that this is a correct "binary string" + data = string2binary(data); + } + } + } + return data; + }); +}; + +},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,"set-immediate-shim":54}],33:[function(require,module,exports){ +'use strict'; +var readerFor = require('./reader/readerFor'); +var utils = require('./utils'); +var sig = require('./signature'); +var ZipEntry = require('./zipEntry'); +var utf8 = require('./utf8'); +var support = require('./support'); +// class ZipEntries {{{ +/** + * All the entries in the zip file. + * @constructor + * @param {Object} loadOptions Options for loading the stream. + */ +function ZipEntries(loadOptions) { + this.files = []; + this.loadOptions = loadOptions; +} +ZipEntries.prototype = { + /** + * Check that the reader is on the specified signature. + * @param {string} expectedSignature the expected signature. + * @throws {Error} if it is an other signature. + */ + checkSignature: function(expectedSignature) { + if (!this.reader.readAndCheckSignature(expectedSignature)) { + this.reader.index -= 4; + var signature = this.reader.readString(4); + throw new Error("Corrupted zip or bug: unexpected signature " + "(" + utils.pretty(signature) + ", expected " + utils.pretty(expectedSignature) + ")"); + } + }, + /** + * Check if the given signature is at the given index. + * @param {number} askedIndex the index to check. + * @param {string} expectedSignature the signature to expect. + * @return {boolean} true if the signature is here, false otherwise. + */ + isSignature: function(askedIndex, expectedSignature) { + var currentIndex = this.reader.index; + this.reader.setIndex(askedIndex); + var signature = this.reader.readString(4); + var result = signature === expectedSignature; + this.reader.setIndex(currentIndex); + return result; + }, + /** + * Read the end of the central directory. + */ + readBlockEndOfCentral: function() { + this.diskNumber = this.reader.readInt(2); + this.diskWithCentralDirStart = this.reader.readInt(2); + this.centralDirRecordsOnThisDisk = this.reader.readInt(2); + this.centralDirRecords = this.reader.readInt(2); + this.centralDirSize = this.reader.readInt(4); + this.centralDirOffset = this.reader.readInt(4); + + this.zipCommentLength = this.reader.readInt(2); + // warning : the encoding depends of the system locale + // On a linux machine with LANG=en_US.utf8, this field is utf8 encoded. + // On a windows machine, this field is encoded with the localized windows code page. + var zipComment = this.reader.readData(this.zipCommentLength); + var decodeParamType = support.uint8array ? "uint8array" : "array"; + // To get consistent behavior with the generation part, we will assume that + // this is utf8 encoded unless specified otherwise. + var decodeContent = utils.transformTo(decodeParamType, zipComment); + this.zipComment = this.loadOptions.decodeFileName(decodeContent); + }, + /** + * Read the end of the Zip 64 central directory. + * Not merged with the method readEndOfCentral : + * The end of central can coexist with its Zip64 brother, + * I don't want to read the wrong number of bytes ! + */ + readBlockZip64EndOfCentral: function() { + this.zip64EndOfCentralSize = this.reader.readInt(8); + this.reader.skip(4); + // this.versionMadeBy = this.reader.readString(2); + // this.versionNeeded = this.reader.readInt(2); + this.diskNumber = this.reader.readInt(4); + this.diskWithCentralDirStart = this.reader.readInt(4); + this.centralDirRecordsOnThisDisk = this.reader.readInt(8); + this.centralDirRecords = this.reader.readInt(8); + this.centralDirSize = this.reader.readInt(8); + this.centralDirOffset = this.reader.readInt(8); + + this.zip64ExtensibleData = {}; + var extraDataSize = this.zip64EndOfCentralSize - 44, + index = 0, + extraFieldId, + extraFieldLength, + extraFieldValue; + while (index < extraDataSize) { + extraFieldId = this.reader.readInt(2); + extraFieldLength = this.reader.readInt(4); + extraFieldValue = this.reader.readData(extraFieldLength); + this.zip64ExtensibleData[extraFieldId] = { + id: extraFieldId, + length: extraFieldLength, + value: extraFieldValue + }; + } + }, + /** + * Read the end of the Zip 64 central directory locator. + */ + readBlockZip64EndOfCentralLocator: function() { + this.diskWithZip64CentralDirStart = this.reader.readInt(4); + this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8); + this.disksCount = this.reader.readInt(4); + if (this.disksCount > 1) { + throw new Error("Multi-volumes zip are not supported"); + } + }, + /** + * Read the local files, based on the offset read in the central part. + */ + readLocalFiles: function() { + var i, file; + for (i = 0; i < this.files.length; i++) { + file = this.files[i]; + this.reader.setIndex(file.localHeaderOffset); + this.checkSignature(sig.LOCAL_FILE_HEADER); + file.readLocalPart(this.reader); + file.handleUTF8(); + file.processAttributes(); + } + }, + /** + * Read the central directory. + */ + readCentralDir: function() { + var file; + + this.reader.setIndex(this.centralDirOffset); + while (this.reader.readAndCheckSignature(sig.CENTRAL_FILE_HEADER)) { + file = new ZipEntry({ + zip64: this.zip64 + }, this.loadOptions); + file.readCentralPart(this.reader); + this.files.push(file); + } + + if (this.centralDirRecords !== this.files.length) { + if (this.centralDirRecords !== 0 && this.files.length === 0) { + // We expected some records but couldn't find ANY. + // This is really suspicious, as if something went wrong. + throw new Error("Corrupted zip or bug: expected " + this.centralDirRecords + " records in central dir, got " + this.files.length); + } else { + // We found some records but not all. + // Something is wrong but we got something for the user: no error here. + // console.warn("expected", this.centralDirRecords, "records in central dir, got", this.files.length); + } + } + }, + /** + * Read the end of central directory. + */ + readEndOfCentral: function() { + var offset = this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END); + if (offset < 0) { + // Check if the content is a truncated zip or complete garbage. + // A "LOCAL_FILE_HEADER" is not required at the beginning (auto + // extractible zip for example) but it can give a good hint. + // If an ajax request was used without responseType, we will also + // get unreadable data. + var isGarbage = !this.isSignature(0, sig.LOCAL_FILE_HEADER); + + if (isGarbage) { + throw new Error("Can't find end of central directory : is this a zip file ? " + + "If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"); + } else { + throw new Error("Corrupted zip: can't find end of central directory"); + } + + } + this.reader.setIndex(offset); + var endOfCentralDirOffset = offset; + this.checkSignature(sig.CENTRAL_DIRECTORY_END); + this.readBlockEndOfCentral(); + + + /* extract from the zip spec : + 4) If one of the fields in the end of central directory + record is too small to hold required data, the field + should be set to -1 (0xFFFF or 0xFFFFFFFF) and the + ZIP64 format record should be created. + 5) The end of central directory record and the + Zip64 end of central directory locator record must + reside on the same disk when splitting or spanning + an archive. + */ + if (this.diskNumber === utils.MAX_VALUE_16BITS || this.diskWithCentralDirStart === utils.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === utils.MAX_VALUE_16BITS || this.centralDirRecords === utils.MAX_VALUE_16BITS || this.centralDirSize === utils.MAX_VALUE_32BITS || this.centralDirOffset === utils.MAX_VALUE_32BITS) { + this.zip64 = true; + + /* + Warning : the zip64 extension is supported, but ONLY if the 64bits integer read from + the zip file can fit into a 32bits integer. This cannot be solved : JavaScript represents + all numbers as 64-bit double precision IEEE 754 floating point numbers. + So, we have 53bits for integers and bitwise operations treat everything as 32bits. + see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/Bitwise_Operators + and http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf section 8.5 + */ + + // should look for a zip64 EOCD locator + offset = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR); + if (offset < 0) { + throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator"); + } + this.reader.setIndex(offset); + this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR); + this.readBlockZip64EndOfCentralLocator(); + + // now the zip64 EOCD record + if (!this.isSignature(this.relativeOffsetEndOfZip64CentralDir, sig.ZIP64_CENTRAL_DIRECTORY_END)) { + // console.warn("ZIP64 end of central directory not where expected."); + this.relativeOffsetEndOfZip64CentralDir = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_END); + if (this.relativeOffsetEndOfZip64CentralDir < 0) { + throw new Error("Corrupted zip: can't find the ZIP64 end of central directory"); + } + } + this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir); + this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_END); + this.readBlockZip64EndOfCentral(); + } + + var expectedEndOfCentralDirOffset = this.centralDirOffset + this.centralDirSize; + if (this.zip64) { + expectedEndOfCentralDirOffset += 20; // end of central dir 64 locator + expectedEndOfCentralDirOffset += 12 /* should not include the leading 12 bytes */ + this.zip64EndOfCentralSize; + } + + var extraBytes = endOfCentralDirOffset - expectedEndOfCentralDirOffset; + + if (extraBytes > 0) { + // console.warn(extraBytes, "extra bytes at beginning or within zipfile"); + if (this.isSignature(endOfCentralDirOffset, sig.CENTRAL_FILE_HEADER)) { + // The offsets seem wrong, but we have something at the specified offset. + // So… we keep it. + } else { + // the offset is wrong, update the "zero" of the reader + // this happens if data has been prepended (crx files for example) + this.reader.zero = extraBytes; + } + } else if (extraBytes < 0) { + throw new Error("Corrupted zip: missing " + Math.abs(extraBytes) + " bytes."); + } + }, + prepareReader: function(data) { + this.reader = readerFor(data); + }, + /** + * Read a zip file and create ZipEntries. + * @param {String|ArrayBuffer|Uint8Array|Buffer} data the binary string representing a zip file. + */ + load: function(data) { + this.prepareReader(data); + this.readEndOfCentral(); + this.readCentralDir(); + this.readLocalFiles(); + } +}; +// }}} end of ZipEntries +module.exports = ZipEntries; + +},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(require,module,exports){ +'use strict'; +var readerFor = require('./reader/readerFor'); +var utils = require('./utils'); +var CompressedObject = require('./compressedObject'); +var crc32fn = require('./crc32'); +var utf8 = require('./utf8'); +var compressions = require('./compressions'); +var support = require('./support'); + +var MADE_BY_DOS = 0x00; +var MADE_BY_UNIX = 0x03; + +/** + * Find a compression registered in JSZip. + * @param {string} compressionMethod the method magic to find. + * @return {Object|null} the JSZip compression object, null if none found. + */ +var findCompression = function(compressionMethod) { + for (var method in compressions) { + if (!compressions.hasOwnProperty(method)) { + continue; + } + if (compressions[method].magic === compressionMethod) { + return compressions[method]; + } + } + return null; +}; + +// class ZipEntry {{{ +/** + * An entry in the zip file. + * @constructor + * @param {Object} options Options of the current file. + * @param {Object} loadOptions Options for loading the stream. + */ +function ZipEntry(options, loadOptions) { + this.options = options; + this.loadOptions = loadOptions; +} +ZipEntry.prototype = { + /** + * say if the file is encrypted. + * @return {boolean} true if the file is encrypted, false otherwise. + */ + isEncrypted: function() { + // bit 1 is set + return (this.bitFlag & 0x0001) === 0x0001; + }, + /** + * say if the file has utf-8 filename/comment. + * @return {boolean} true if the filename/comment is in utf-8, false otherwise. + */ + useUTF8: function() { + // bit 11 is set + return (this.bitFlag & 0x0800) === 0x0800; + }, + /** + * Read the local part of a zip file and add the info in this object. + * @param {DataReader} reader the reader to use. + */ + readLocalPart: function(reader) { + var compression, localExtraFieldsLength; + + // we already know everything from the central dir ! + // If the central dir data are false, we are doomed. + // On the bright side, the local part is scary : zip64, data descriptors, both, etc. + // The less data we get here, the more reliable this should be. + // Let's skip the whole header and dash to the data ! + reader.skip(22); + // in some zip created on windows, the filename stored in the central dir contains \ instead of /. + // Strangely, the filename here is OK. + // I would love to treat these zip files as corrupted (see http://www.info-zip.org/FAQ.html#backslashes + // or APPNOTE#4.4.17.1, "All slashes MUST be forward slashes '/'") but there are a lot of bad zip generators... + // Search "unzip mismatching "local" filename continuing with "central" filename version" on + // the internet. + // + // I think I see the logic here : the central directory is used to display + // content and the local directory is used to extract the files. Mixing / and \ + // may be used to display \ to windows users and use / when extracting the files. + // Unfortunately, this lead also to some issues : http://seclists.org/fulldisclosure/2009/Sep/394 + this.fileNameLength = reader.readInt(2); + localExtraFieldsLength = reader.readInt(2); // can't be sure this will be the same as the central dir + // the fileName is stored as binary data, the handleUTF8 method will take care of the encoding. + this.fileName = reader.readData(this.fileNameLength); + reader.skip(localExtraFieldsLength); + + if (this.compressedSize === -1 || this.uncompressedSize === -1) { + throw new Error("Bug or corrupted zip : didn't get enough information from the central directory " + "(compressedSize === -1 || uncompressedSize === -1)"); + } + + compression = findCompression(this.compressionMethod); + if (compression === null) { // no compression found + throw new Error("Corrupted zip : compression " + utils.pretty(this.compressionMethod) + " unknown (inner file : " + utils.transformTo("string", this.fileName) + ")"); + } + this.decompressed = new CompressedObject(this.compressedSize, this.uncompressedSize, this.crc32, compression, reader.readData(this.compressedSize)); + }, + + /** + * Read the central part of a zip file and add the info in this object. + * @param {DataReader} reader the reader to use. + */ + readCentralPart: function(reader) { + this.versionMadeBy = reader.readInt(2); + reader.skip(2); + // this.versionNeeded = reader.readInt(2); + this.bitFlag = reader.readInt(2); + this.compressionMethod = reader.readString(2); + this.date = reader.readDate(); + this.crc32 = reader.readInt(4); + this.compressedSize = reader.readInt(4); + this.uncompressedSize = reader.readInt(4); + var fileNameLength = reader.readInt(2); + this.extraFieldsLength = reader.readInt(2); + this.fileCommentLength = reader.readInt(2); + this.diskNumberStart = reader.readInt(2); + this.internalFileAttributes = reader.readInt(2); + this.externalFileAttributes = reader.readInt(4); + this.localHeaderOffset = reader.readInt(4); + + if (this.isEncrypted()) { + throw new Error("Encrypted zip are not supported"); + } + + // will be read in the local part, see the comments there + reader.skip(fileNameLength); + this.readExtraFields(reader); + this.parseZIP64ExtraField(reader); + this.fileComment = reader.readData(this.fileCommentLength); + }, + + /** + * Parse the external file attributes and get the unix/dos permissions. + */ + processAttributes: function () { + this.unixPermissions = null; + this.dosPermissions = null; + var madeBy = this.versionMadeBy >> 8; + + // Check if we have the DOS directory flag set. + // We look for it in the DOS and UNIX permissions + // but some unknown platform could set it as a compatibility flag. + this.dir = this.externalFileAttributes & 0x0010 ? true : false; + + if(madeBy === MADE_BY_DOS) { + // first 6 bits (0 to 5) + this.dosPermissions = this.externalFileAttributes & 0x3F; + } + + if(madeBy === MADE_BY_UNIX) { + this.unixPermissions = (this.externalFileAttributes >> 16) & 0xFFFF; + // the octal permissions are in (this.unixPermissions & 0x01FF).toString(8); + } + + // fail safe : if the name ends with a / it probably means a folder + if (!this.dir && this.fileNameStr.slice(-1) === '/') { + this.dir = true; + } + }, + + /** + * Parse the ZIP64 extra field and merge the info in the current ZipEntry. + * @param {DataReader} reader the reader to use. + */ + parseZIP64ExtraField: function(reader) { + + if (!this.extraFields[0x0001]) { + return; + } + + // should be something, preparing the extra reader + var extraReader = readerFor(this.extraFields[0x0001].value); + + // I really hope that these 64bits integer can fit in 32 bits integer, because js + // won't let us have more. + if (this.uncompressedSize === utils.MAX_VALUE_32BITS) { + this.uncompressedSize = extraReader.readInt(8); + } + if (this.compressedSize === utils.MAX_VALUE_32BITS) { + this.compressedSize = extraReader.readInt(8); + } + if (this.localHeaderOffset === utils.MAX_VALUE_32BITS) { + this.localHeaderOffset = extraReader.readInt(8); + } + if (this.diskNumberStart === utils.MAX_VALUE_32BITS) { + this.diskNumberStart = extraReader.readInt(4); + } + }, + /** + * Read the central part of a zip file and add the info in this object. + * @param {DataReader} reader the reader to use. + */ + readExtraFields: function(reader) { + var end = reader.index + this.extraFieldsLength, + extraFieldId, + extraFieldLength, + extraFieldValue; + + if (!this.extraFields) { + this.extraFields = {}; + } + + while (reader.index + 4 < end) { + extraFieldId = reader.readInt(2); + extraFieldLength = reader.readInt(2); + extraFieldValue = reader.readData(extraFieldLength); + + this.extraFields[extraFieldId] = { + id: extraFieldId, + length: extraFieldLength, + value: extraFieldValue + }; + } + + reader.setIndex(end); + }, + /** + * Apply an UTF8 transformation if needed. + */ + handleUTF8: function() { + var decodeParamType = support.uint8array ? "uint8array" : "array"; + if (this.useUTF8()) { + this.fileNameStr = utf8.utf8decode(this.fileName); + this.fileCommentStr = utf8.utf8decode(this.fileComment); + } else { + var upath = this.findExtraFieldUnicodePath(); + if (upath !== null) { + this.fileNameStr = upath; + } else { + // ASCII text or unsupported code page + var fileNameByteArray = utils.transformTo(decodeParamType, this.fileName); + this.fileNameStr = this.loadOptions.decodeFileName(fileNameByteArray); + } + + var ucomment = this.findExtraFieldUnicodeComment(); + if (ucomment !== null) { + this.fileCommentStr = ucomment; + } else { + // ASCII text or unsupported code page + var commentByteArray = utils.transformTo(decodeParamType, this.fileComment); + this.fileCommentStr = this.loadOptions.decodeFileName(commentByteArray); + } + } + }, + + /** + * Find the unicode path declared in the extra field, if any. + * @return {String} the unicode path, null otherwise. + */ + findExtraFieldUnicodePath: function() { + var upathField = this.extraFields[0x7075]; + if (upathField) { + var extraReader = readerFor(upathField.value); + + // wrong version + if (extraReader.readInt(1) !== 1) { + return null; + } + + // the crc of the filename changed, this field is out of date. + if (crc32fn(this.fileName) !== extraReader.readInt(4)) { + return null; + } + + return utf8.utf8decode(extraReader.readData(upathField.length - 5)); + } + return null; + }, + + /** + * Find the unicode comment declared in the extra field, if any. + * @return {String} the unicode comment, null otherwise. + */ + findExtraFieldUnicodeComment: function() { + var ucommentField = this.extraFields[0x6375]; + if (ucommentField) { + var extraReader = readerFor(ucommentField.value); + + // wrong version + if (extraReader.readInt(1) !== 1) { + return null; + } + + // the crc of the comment changed, this field is out of date. + if (crc32fn(this.fileComment) !== extraReader.readInt(4)) { + return null; + } + + return utf8.utf8decode(extraReader.readData(ucommentField.length - 5)); + } + return null; + } +}; +module.exports = ZipEntry; + +},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(require,module,exports){ +'use strict'; + +var StreamHelper = require('./stream/StreamHelper'); +var DataWorker = require('./stream/DataWorker'); +var utf8 = require('./utf8'); +var CompressedObject = require('./compressedObject'); +var GenericWorker = require('./stream/GenericWorker'); + +/** + * A simple object representing a file in the zip file. + * @constructor + * @param {string} name the name of the file + * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data + * @param {Object} options the options of the file + */ +var ZipObject = function(name, data, options) { + this.name = name; + this.dir = options.dir; + this.date = options.date; + this.comment = options.comment; + this.unixPermissions = options.unixPermissions; + this.dosPermissions = options.dosPermissions; + + this._data = data; + this._dataBinary = options.binary; + // keep only the compression + this.options = { + compression : options.compression, + compressionOptions : options.compressionOptions + }; +}; + +ZipObject.prototype = { + /** + * Create an internal stream for the content of this object. + * @param {String} type the type of each chunk. + * @return StreamHelper the stream. + */ + internalStream: function (type) { + var result = null, outputType = "string"; + try { + if (!type) { + throw new Error("No output type specified."); + } + outputType = type.toLowerCase(); + var askUnicodeString = outputType === "string" || outputType === "text"; + if (outputType === "binarystring" || outputType === "text") { + outputType = "string"; + } + result = this._decompressWorker(); + + var isUnicodeString = !this._dataBinary; + + if (isUnicodeString && !askUnicodeString) { + result = result.pipe(new utf8.Utf8EncodeWorker()); + } + if (!isUnicodeString && askUnicodeString) { + result = result.pipe(new utf8.Utf8DecodeWorker()); + } + } catch (e) { + result = new GenericWorker("error"); + result.error(e); + } + + return new StreamHelper(result, outputType, ""); + }, + + /** + * Prepare the content in the asked type. + * @param {String} type the type of the result. + * @param {Function} onUpdate a function to call on each internal update. + * @return Promise the promise of the result. + */ + async: function (type, onUpdate) { + return this.internalStream(type).accumulate(onUpdate); + }, + + /** + * Prepare the content as a nodejs stream. + * @param {String} type the type of each chunk. + * @param {Function} onUpdate a function to call on each internal update. + * @return Stream the stream. + */ + nodeStream: function (type, onUpdate) { + return this.internalStream(type || "nodebuffer").toNodejsStream(onUpdate); + }, + + /** + * Return a worker for the compressed content. + * @private + * @param {Object} compression the compression object to use. + * @param {Object} compressionOptions the options to use when compressing. + * @return Worker the worker. + */ + _compressWorker: function (compression, compressionOptions) { + if ( + this._data instanceof CompressedObject && + this._data.compression.magic === compression.magic + ) { + return this._data.getCompressedWorker(); + } else { + var result = this._decompressWorker(); + if(!this._dataBinary) { + result = result.pipe(new utf8.Utf8EncodeWorker()); + } + return CompressedObject.createWorkerFrom(result, compression, compressionOptions); + } + }, + /** + * Return a worker for the decompressed content. + * @private + * @return Worker the worker. + */ + _decompressWorker : function () { + if (this._data instanceof CompressedObject) { + return this._data.getContentWorker(); + } else if (this._data instanceof GenericWorker) { + return this._data; + } else { + return new DataWorker(this._data); + } + } +}; + +var removedMethods = ["asText", "asBinary", "asNodeBuffer", "asUint8Array", "asArrayBuffer"]; +var removedFn = function () { + throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide."); +}; + +for(var i = 0; i < removedMethods.length; i++) { + ZipObject.prototype[removedMethods[i]] = removedFn; +} +module.exports = ZipObject; + +},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(require,module,exports){ +(function (global){ +'use strict'; +var Mutation = global.MutationObserver || global.WebKitMutationObserver; + +var scheduleDrain; + +{ + if (Mutation) { + var called = 0; + var observer = new Mutation(nextTick); + var element = global.document.createTextNode(''); + observer.observe(element, { + characterData: true + }); + scheduleDrain = function () { + element.data = (called = ++called % 2); + }; + } else if (!global.setImmediate && typeof global.MessageChannel !== 'undefined') { + var channel = new global.MessageChannel(); + channel.port1.onmessage = nextTick; + scheduleDrain = function () { + channel.port2.postMessage(0); + }; + } else if ('document' in global && 'onreadystatechange' in global.document.createElement('script')) { + scheduleDrain = function () { + + // Create a + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfBooleansSerDe

+
+
+ +
+
    +
  • +
    +
    public class ArrayOfBooleansSerDe
    +extends ArrayOfItemsSerDe<Boolean>
    +
    Methods of serializing and deserializing arrays of Boolean as a bit array.
    +
    +
    Author:
    +
    Jon Malkin
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ArrayOfBooleansSerDe

        +
        public ArrayOfBooleansSerDe()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        computeBytesNeeded

        +
        public static int computeBytesNeeded​(int arrayLength)
        +
        Computes number of bytes needed for packed bit encoding of the array of booleans. Rounds + partial bytes up to return a whole number of bytes.
        +
        +
        Parameters:
        +
        arrayLength - Number of items in the array to serialize
        +
        Returns:
        +
        Number of bytes needed to encode the array
        +
        +
      • +
      + + + +
        +
      • +

        serializeToByteArray

        +
        public byte[] serializeToByteArray​(Boolean item)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Serialize a single unserialized item to a byte array.
        +
        +
        Specified by:
        +
        serializeToByteArray in class ArrayOfItemsSerDe<Boolean>
        +
        Parameters:
        +
        item - the item to be serialized
        +
        Returns:
        +
        serialized representation of the given item
        +
        +
      • +
      + + + +
        +
      • +

        serializeToByteArray

        +
        public byte[] serializeToByteArray​(Boolean[] items)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Serialize an array of unserialized items to a byte array of contiguous serialized items.
        +
        +
        Specified by:
        +
        serializeToByteArray in class ArrayOfItemsSerDe<Boolean>
        +
        Parameters:
        +
        items - array of items to be serialized
        +
        Returns:
        +
        contiguous, serialized representation of the given array of unserialized items
        +
        +
      • +
      + + + +
        +
      • +

        deserializeFromMemory

        +
        @Deprecated
        +public Boolean[] deserializeFromMemory​(org.apache.datasketches.memory.Memory mem,
        +                                       int numItems)
        +
        Deprecated.
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Deserialize a contiguous sequence of serialized items from a given Memory.
        +
        +
        Specified by:
        +
        deserializeFromMemory in class ArrayOfItemsSerDe<Boolean>
        +
        Parameters:
        +
        mem - Memory containing a contiguous sequence of serialized items
        +
        numItems - number of items in the contiguous serialized sequence.
        +
        Returns:
        +
        array of deserialized items
        +
        +
      • +
      + + + +
        +
      • +

        deserializeFromMemory

        +
        public Boolean[] deserializeFromMemory​(org.apache.datasketches.memory.Memory mem,
        +                                       long offsetBytes,
        +                                       int numItems)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Deserialize a contiguous sequence of serialized items from a given Memory.
        +
        +
        Specified by:
        +
        deserializeFromMemory in class ArrayOfItemsSerDe<Boolean>
        +
        Parameters:
        +
        mem - Memory containing a contiguous sequence of serialized items
        +
        offsetBytes - the starting offset in the given Memory.
        +
        numItems - number of items in the contiguous serialized sequence.
        +
        Returns:
        +
        array of deserialized items
        +
        +
      • +
      + + + +
        +
      • +

        sizeOf

        +
        public int sizeOf​(Boolean item)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns the serialized size in bytes of a single unserialized item.
        +
        +
        Specified by:
        +
        sizeOf in class ArrayOfItemsSerDe<Boolean>
        +
        Parameters:
        +
        item - a specific item
        +
        Returns:
        +
        the serialized size in bytes of a single unserialized item.
        +
        +
      • +
      + + + +
        +
      • +

        sizeOf

        +
        public int sizeOf​(Boolean[] items)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns the serialized size in bytes of the array of items.
        +
        +
        Overrides:
        +
        sizeOf in class ArrayOfItemsSerDe<Boolean>
        +
        Parameters:
        +
        items - an array of items.
        +
        Returns:
        +
        the serialized size in bytes of the array of items.
        +
        +
      • +
      + + + +
        +
      • +

        sizeOf

        +
        public int sizeOf​(org.apache.datasketches.memory.Memory mem,
        +                  long offsetBytes,
        +                  int numItems)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns the serialized size in bytes of the number of contiguous serialized items in Memory. + The capacity of the given Memory can be much larger that the required size of the items.
        +
        +
        Specified by:
        +
        sizeOf in class ArrayOfItemsSerDe<Boolean>
        +
        Parameters:
        +
        mem - the given Memory.
        +
        offsetBytes - the starting offset in the given Memory.
        +
        numItems - the number of serialized items contained in the Memory
        +
        Returns:
        +
        the serialized size in bytes of the given number of items.
        +
        +
      • +
      + + + + + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/common/ArrayOfDoublesSerDe.html b/docs/5.0.2/org/apache/datasketches/common/ArrayOfDoublesSerDe.html new file mode 100644 index 000000000..c01dfc64d --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/ArrayOfDoublesSerDe.html @@ -0,0 +1,553 @@ + + + + + +ArrayOfDoublesSerDe (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfDoublesSerDe

+
+
+ +
+
    +
  • +
    +
    public class ArrayOfDoublesSerDe
    +extends ArrayOfItemsSerDe<Double>
    +
    Methods of serializing and deserializing arrays of Double.
    +
    +
    Author:
    +
    Alexander Saydakov
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ArrayOfDoublesSerDe

        +
        public ArrayOfDoublesSerDe()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        serializeToByteArray

        +
        public byte[] serializeToByteArray​(Double item)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Serialize a single unserialized item to a byte array.
        +
        +
        Specified by:
        +
        serializeToByteArray in class ArrayOfItemsSerDe<Double>
        +
        Parameters:
        +
        item - the item to be serialized
        +
        Returns:
        +
        serialized representation of the given item
        +
        +
      • +
      + + + +
        +
      • +

        serializeToByteArray

        +
        public byte[] serializeToByteArray​(Double[] items)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Serialize an array of unserialized items to a byte array of contiguous serialized items.
        +
        +
        Specified by:
        +
        serializeToByteArray in class ArrayOfItemsSerDe<Double>
        +
        Parameters:
        +
        items - array of items to be serialized
        +
        Returns:
        +
        contiguous, serialized representation of the given array of unserialized items
        +
        +
      • +
      + + + +
        +
      • +

        deserializeFromMemory

        +
        @Deprecated
        +public Double[] deserializeFromMemory​(org.apache.datasketches.memory.Memory mem,
        +                                      int numItems)
        +
        Deprecated.
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Deserialize a contiguous sequence of serialized items from a given Memory.
        +
        +
        Specified by:
        +
        deserializeFromMemory in class ArrayOfItemsSerDe<Double>
        +
        Parameters:
        +
        mem - Memory containing a contiguous sequence of serialized items
        +
        numItems - number of items in the contiguous serialized sequence.
        +
        Returns:
        +
        array of deserialized items
        +
        +
      • +
      + + + +
        +
      • +

        deserializeFromMemory

        +
        public Double[] deserializeFromMemory​(org.apache.datasketches.memory.Memory mem,
        +                                      long offsetBytes,
        +                                      int numItems)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Deserialize a contiguous sequence of serialized items from a given Memory.
        +
        +
        Specified by:
        +
        deserializeFromMemory in class ArrayOfItemsSerDe<Double>
        +
        Parameters:
        +
        mem - Memory containing a contiguous sequence of serialized items
        +
        offsetBytes - the starting offset in the given Memory.
        +
        numItems - number of items in the contiguous serialized sequence.
        +
        Returns:
        +
        array of deserialized items
        +
        +
      • +
      + + + +
        +
      • +

        sizeOf

        +
        public int sizeOf​(Double item)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns the serialized size in bytes of a single unserialized item.
        +
        +
        Specified by:
        +
        sizeOf in class ArrayOfItemsSerDe<Double>
        +
        Parameters:
        +
        item - a specific item
        +
        Returns:
        +
        the serialized size in bytes of a single unserialized item.
        +
        +
      • +
      + + + +
        +
      • +

        sizeOf

        +
        public int sizeOf​(Double[] items)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns the serialized size in bytes of the array of items.
        +
        +
        Overrides:
        +
        sizeOf in class ArrayOfItemsSerDe<Double>
        +
        Parameters:
        +
        items - an array of items.
        +
        Returns:
        +
        the serialized size in bytes of the array of items.
        +
        +
      • +
      + + + +
        +
      • +

        sizeOf

        +
        public int sizeOf​(org.apache.datasketches.memory.Memory mem,
        +                  long offsetBytes,
        +                  int numItems)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns the serialized size in bytes of the number of contiguous serialized items in Memory. + The capacity of the given Memory can be much larger that the required size of the items.
        +
        +
        Specified by:
        +
        sizeOf in class ArrayOfItemsSerDe<Double>
        +
        Parameters:
        +
        mem - the given Memory.
        +
        offsetBytes - the starting offset in the given Memory.
        +
        numItems - the number of serialized items contained in the Memory
        +
        Returns:
        +
        the serialized size in bytes of the given number of items.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString​(Double item)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns a human readable string of an item.
        +
        +
        Specified by:
        +
        toString in class ArrayOfItemsSerDe<Double>
        +
        Parameters:
        +
        item - a specific item
        +
        Returns:
        +
        a human readable string of an item.
        +
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/common/ArrayOfItemsSerDe.html b/docs/5.0.2/org/apache/datasketches/common/ArrayOfItemsSerDe.html new file mode 100644 index 000000000..7130db05a --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/ArrayOfItemsSerDe.html @@ -0,0 +1,545 @@ + + + + + +ArrayOfItemsSerDe (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfItemsSerDe<T>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.common.ArrayOfItemsSerDe<T>
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ArrayOfItemsSerDe

        +
        public ArrayOfItemsSerDe()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        serializeToByteArray

        +
        public abstract byte[] serializeToByteArray​(T item)
        +
        Serialize a single unserialized item to a byte array.
        +
        +
        Parameters:
        +
        item - the item to be serialized
        +
        Returns:
        +
        serialized representation of the given item
        +
        +
      • +
      + + + + + +
        +
      • +

        serializeToByteArray

        +
        public abstract byte[] serializeToByteArray​(T[] items)
        +
        Serialize an array of unserialized items to a byte array of contiguous serialized items.
        +
        +
        Parameters:
        +
        items - array of items to be serialized
        +
        Returns:
        +
        contiguous, serialized representation of the given array of unserialized items
        +
        +
      • +
      + + + +
        +
      • +

        deserializeFromMemory

        +
        @Deprecated
        +public abstract T[] deserializeFromMemory​(org.apache.datasketches.memory.Memory mem,
        +                                          int numItems)
        + +
        Deserialize a contiguous sequence of serialized items from a given Memory.
        +
        +
        Parameters:
        +
        mem - Memory containing a contiguous sequence of serialized items
        +
        numItems - number of items in the contiguous serialized sequence.
        +
        Returns:
        +
        array of deserialized items
        +
        +
      • +
      + + + +
        +
      • +

        deserializeFromMemory

        +
        public abstract T[] deserializeFromMemory​(org.apache.datasketches.memory.Memory mem,
        +                                          long offsetBytes,
        +                                          int numItems)
        +
        Deserialize a contiguous sequence of serialized items from a given Memory.
        +
        +
        Parameters:
        +
        mem - Memory containing a contiguous sequence of serialized items
        +
        offsetBytes - the starting offset in the given Memory.
        +
        numItems - number of items in the contiguous serialized sequence.
        +
        Returns:
        +
        array of deserialized items
        +
        +
      • +
      + + + + + +
        +
      • +

        sizeOf

        +
        public abstract int sizeOf​(T item)
        +
        Returns the serialized size in bytes of a single unserialized item.
        +
        +
        Parameters:
        +
        item - a specific item
        +
        Returns:
        +
        the serialized size in bytes of a single unserialized item.
        +
        +
      • +
      + + + + + +
        +
      • +

        sizeOf

        +
        public int sizeOf​(T[] items)
        +
        Returns the serialized size in bytes of the array of items.
        +
        +
        Parameters:
        +
        items - an array of items.
        +
        Returns:
        +
        the serialized size in bytes of the array of items.
        +
        +
      • +
      + + + +
        +
      • +

        sizeOf

        +
        public abstract int sizeOf​(org.apache.datasketches.memory.Memory mem,
        +                           long offsetBytes,
        +                           int numItems)
        +
        Returns the serialized size in bytes of the number of contiguous serialized items in Memory. + The capacity of the given Memory can be much larger that the required size of the items.
        +
        +
        Parameters:
        +
        mem - the given Memory.
        +
        offsetBytes - the starting offset in the given Memory.
        +
        numItems - the number of serialized items contained in the Memory
        +
        Returns:
        +
        the serialized size in bytes of the given number of items.
        +
        +
      • +
      + + + + + +
        +
      • +

        toString

        +
        public abstract String toString​(T item)
        +
        Returns a human readable string of an item.
        +
        +
        Parameters:
        +
        item - a specific item
        +
        Returns:
        +
        a human readable string of an item.
        +
        +
      • +
      + + + +
        +
      • +

        getClassOfT

        +
        public abstract Class<?> getClassOfT()
        +
        Returns the concrete class of type T
        +
        +
        Returns:
        +
        the concrete class of type T
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/common/ArrayOfLongsSerDe.html b/docs/5.0.2/org/apache/datasketches/common/ArrayOfLongsSerDe.html new file mode 100644 index 000000000..0df85bedc --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/ArrayOfLongsSerDe.html @@ -0,0 +1,553 @@ + + + + + +ArrayOfLongsSerDe (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfLongsSerDe

+
+
+ +
+
    +
  • +
    +
    public class ArrayOfLongsSerDe
    +extends ArrayOfItemsSerDe<Long>
    +
    Methods of serializing and deserializing arrays of Long.
    +
    +
    Author:
    +
    Alexander Saydakov
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ArrayOfLongsSerDe

        +
        public ArrayOfLongsSerDe()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        serializeToByteArray

        +
        public byte[] serializeToByteArray​(Long item)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Serialize a single unserialized item to a byte array.
        +
        +
        Specified by:
        +
        serializeToByteArray in class ArrayOfItemsSerDe<Long>
        +
        Parameters:
        +
        item - the item to be serialized
        +
        Returns:
        +
        serialized representation of the given item
        +
        +
      • +
      + + + +
        +
      • +

        serializeToByteArray

        +
        public byte[] serializeToByteArray​(Long[] items)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Serialize an array of unserialized items to a byte array of contiguous serialized items.
        +
        +
        Specified by:
        +
        serializeToByteArray in class ArrayOfItemsSerDe<Long>
        +
        Parameters:
        +
        items - array of items to be serialized
        +
        Returns:
        +
        contiguous, serialized representation of the given array of unserialized items
        +
        +
      • +
      + + + +
        +
      • +

        deserializeFromMemory

        +
        @Deprecated
        +public Long[] deserializeFromMemory​(org.apache.datasketches.memory.Memory mem,
        +                                    int numItems)
        +
        Deprecated.
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Deserialize a contiguous sequence of serialized items from a given Memory.
        +
        +
        Specified by:
        +
        deserializeFromMemory in class ArrayOfItemsSerDe<Long>
        +
        Parameters:
        +
        mem - Memory containing a contiguous sequence of serialized items
        +
        numItems - number of items in the contiguous serialized sequence.
        +
        Returns:
        +
        array of deserialized items
        +
        +
      • +
      + + + +
        +
      • +

        deserializeFromMemory

        +
        public Long[] deserializeFromMemory​(org.apache.datasketches.memory.Memory mem,
        +                                    long offsetBytes,
        +                                    int numItems)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Deserialize a contiguous sequence of serialized items from a given Memory.
        +
        +
        Specified by:
        +
        deserializeFromMemory in class ArrayOfItemsSerDe<Long>
        +
        Parameters:
        +
        mem - Memory containing a contiguous sequence of serialized items
        +
        offsetBytes - the starting offset in the given Memory.
        +
        numItems - number of items in the contiguous serialized sequence.
        +
        Returns:
        +
        array of deserialized items
        +
        +
      • +
      + + + +
        +
      • +

        sizeOf

        +
        public int sizeOf​(Long item)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns the serialized size in bytes of a single unserialized item.
        +
        +
        Specified by:
        +
        sizeOf in class ArrayOfItemsSerDe<Long>
        +
        Parameters:
        +
        item - a specific item
        +
        Returns:
        +
        the serialized size in bytes of a single unserialized item.
        +
        +
      • +
      + + + +
        +
      • +

        sizeOf

        +
        public int sizeOf​(Long[] items)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns the serialized size in bytes of the array of items.
        +
        +
        Overrides:
        +
        sizeOf in class ArrayOfItemsSerDe<Long>
        +
        Parameters:
        +
        items - an array of items.
        +
        Returns:
        +
        the serialized size in bytes of the array of items.
        +
        +
      • +
      + + + +
        +
      • +

        sizeOf

        +
        public int sizeOf​(org.apache.datasketches.memory.Memory mem,
        +                  long offsetBytes,
        +                  int numItems)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns the serialized size in bytes of the number of contiguous serialized items in Memory. + The capacity of the given Memory can be much larger that the required size of the items.
        +
        +
        Specified by:
        +
        sizeOf in class ArrayOfItemsSerDe<Long>
        +
        Parameters:
        +
        mem - the given Memory.
        +
        offsetBytes - the starting offset in the given Memory.
        +
        numItems - the number of serialized items contained in the Memory
        +
        Returns:
        +
        the serialized size in bytes of the given number of items.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString​(Long item)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns a human readable string of an item.
        +
        +
        Specified by:
        +
        toString in class ArrayOfItemsSerDe<Long>
        +
        Parameters:
        +
        item - a specific item
        +
        Returns:
        +
        a human readable string of an item.
        +
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/common/ArrayOfNumbersSerDe.html b/docs/5.0.2/org/apache/datasketches/common/ArrayOfNumbersSerDe.html new file mode 100644 index 000000000..67c20b53e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/ArrayOfNumbersSerDe.html @@ -0,0 +1,561 @@ + + + + + +ArrayOfNumbersSerDe (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfNumbersSerDe

+
+
+ +
+
    +
  • +
    +
    public class ArrayOfNumbersSerDe
    +extends ArrayOfItemsSerDe<Number>
    +
    Methods of serializing and deserializing arrays of the object version of primitive types of + Number. The array can be a mix of primitive object types. + +

    This class serializes numbers with a leading byte (ASCII character) indicating the type. + The class keeps the values byte aligned, even though only 3 bits are strictly necessary to + encode one of the 6 different primitives with object types that extend Number.

    + +

    Classes handled are: Long, Integer, Short, + Byte, Double, and Float.

    +
    +
    Author:
    +
    Jon Malkin
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ArrayOfNumbersSerDe

        +
        public ArrayOfNumbersSerDe()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        serializeToByteArray

        +
        public byte[] serializeToByteArray​(Number item)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Serialize a single unserialized item to a byte array.
        +
        +
        Specified by:
        +
        serializeToByteArray in class ArrayOfItemsSerDe<Number>
        +
        Parameters:
        +
        item - the item to be serialized
        +
        Returns:
        +
        serialized representation of the given item
        +
        +
      • +
      + + + +
        +
      • +

        serializeToByteArray

        +
        public byte[] serializeToByteArray​(Number[] items)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Serialize an array of unserialized items to a byte array of contiguous serialized items.
        +
        +
        Specified by:
        +
        serializeToByteArray in class ArrayOfItemsSerDe<Number>
        +
        Parameters:
        +
        items - array of items to be serialized
        +
        Returns:
        +
        contiguous, serialized representation of the given array of unserialized items
        +
        +
      • +
      + + + +
        +
      • +

        deserializeFromMemory

        +
        @Deprecated
        +public Number[] deserializeFromMemory​(org.apache.datasketches.memory.Memory mem,
        +                                      int numItems)
        +
        Deprecated.
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Deserialize a contiguous sequence of serialized items from a given Memory.
        +
        +
        Specified by:
        +
        deserializeFromMemory in class ArrayOfItemsSerDe<Number>
        +
        Parameters:
        +
        mem - Memory containing a contiguous sequence of serialized items
        +
        numItems - number of items in the contiguous serialized sequence.
        +
        Returns:
        +
        array of deserialized items
        +
        +
      • +
      + + + +
        +
      • +

        deserializeFromMemory

        +
        public Number[] deserializeFromMemory​(org.apache.datasketches.memory.Memory mem,
        +                                      long offsetBytes,
        +                                      int numItems)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Deserialize a contiguous sequence of serialized items from a given Memory.
        +
        +
        Specified by:
        +
        deserializeFromMemory in class ArrayOfItemsSerDe<Number>
        +
        Parameters:
        +
        mem - Memory containing a contiguous sequence of serialized items
        +
        offsetBytes - the starting offset in the given Memory.
        +
        numItems - number of items in the contiguous serialized sequence.
        +
        Returns:
        +
        array of deserialized items
        +
        +
      • +
      + + + +
        +
      • +

        sizeOf

        +
        public int sizeOf​(Number item)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns the serialized size in bytes of a single unserialized item.
        +
        +
        Specified by:
        +
        sizeOf in class ArrayOfItemsSerDe<Number>
        +
        Parameters:
        +
        item - a specific item
        +
        Returns:
        +
        the serialized size in bytes of a single unserialized item.
        +
        +
      • +
      + + + +
        +
      • +

        sizeOf

        +
        public int sizeOf​(Number[] items)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns the serialized size in bytes of the array of items.
        +
        +
        Overrides:
        +
        sizeOf in class ArrayOfItemsSerDe<Number>
        +
        Parameters:
        +
        items - an array of items.
        +
        Returns:
        +
        the serialized size in bytes of the array of items.
        +
        +
      • +
      + + + +
        +
      • +

        sizeOf

        +
        public int sizeOf​(org.apache.datasketches.memory.Memory mem,
        +                  long offsetBytes,
        +                  int numItems)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns the serialized size in bytes of the number of contiguous serialized items in Memory. + The capacity of the given Memory can be much larger that the required size of the items.
        +
        +
        Specified by:
        +
        sizeOf in class ArrayOfItemsSerDe<Number>
        +
        Parameters:
        +
        mem - the given Memory.
        +
        offsetBytes - the starting offset in the given Memory.
        +
        numItems - the number of serialized items contained in the Memory
        +
        Returns:
        +
        the serialized size in bytes of the given number of items.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString​(Number item)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns a human readable string of an item.
        +
        +
        Specified by:
        +
        toString in class ArrayOfItemsSerDe<Number>
        +
        Parameters:
        +
        item - a specific item
        +
        Returns:
        +
        a human readable string of an item.
        +
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/common/ArrayOfStringsSerDe.html b/docs/5.0.2/org/apache/datasketches/common/ArrayOfStringsSerDe.html new file mode 100644 index 000000000..5b8147278 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/ArrayOfStringsSerDe.html @@ -0,0 +1,540 @@ + + + + + +ArrayOfStringsSerDe (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfStringsSerDe

+
+
+ +
+
    +
  • +
    +
    public class ArrayOfStringsSerDe
    +extends ArrayOfItemsSerDe<String>
    +
    Methods of serializing and deserializing arrays of String. + This class serializes strings in UTF-8 format, which is more compact compared to + ArrayOfUtf16StringsSerDe. In an extreme case when all strings are in ASCII, + this method is 2 times more compact, but it takes more time to encode and decode + by a factor of 1.5 to 2. + +

    The serialization

    +
    +
    Author:
    +
    Alexander Saydakov
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ArrayOfStringsSerDe

        +
        public ArrayOfStringsSerDe()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        serializeToByteArray

        +
        public byte[] serializeToByteArray​(String item)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Serialize a single unserialized item to a byte array.
        +
        +
        Specified by:
        +
        serializeToByteArray in class ArrayOfItemsSerDe<String>
        +
        Parameters:
        +
        item - the item to be serialized
        +
        Returns:
        +
        serialized representation of the given item
        +
        +
      • +
      + + + +
        +
      • +

        serializeToByteArray

        +
        public byte[] serializeToByteArray​(String[] items)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Serialize an array of unserialized items to a byte array of contiguous serialized items.
        +
        +
        Specified by:
        +
        serializeToByteArray in class ArrayOfItemsSerDe<String>
        +
        Parameters:
        +
        items - array of items to be serialized
        +
        Returns:
        +
        contiguous, serialized representation of the given array of unserialized items
        +
        +
      • +
      + + + +
        +
      • +

        deserializeFromMemory

        +
        @Deprecated
        +public String[] deserializeFromMemory​(org.apache.datasketches.memory.Memory mem,
        +                                      int numItems)
        +
        Deprecated.
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Deserialize a contiguous sequence of serialized items from a given Memory.
        +
        +
        Specified by:
        +
        deserializeFromMemory in class ArrayOfItemsSerDe<String>
        +
        Parameters:
        +
        mem - Memory containing a contiguous sequence of serialized items
        +
        numItems - number of items in the contiguous serialized sequence.
        +
        Returns:
        +
        array of deserialized items
        +
        +
      • +
      + + + +
        +
      • +

        deserializeFromMemory

        +
        public String[] deserializeFromMemory​(org.apache.datasketches.memory.Memory mem,
        +                                      long offsetBytes,
        +                                      int numItems)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Deserialize a contiguous sequence of serialized items from a given Memory.
        +
        +
        Specified by:
        +
        deserializeFromMemory in class ArrayOfItemsSerDe<String>
        +
        Parameters:
        +
        mem - Memory containing a contiguous sequence of serialized items
        +
        offsetBytes - the starting offset in the given Memory.
        +
        numItems - number of items in the contiguous serialized sequence.
        +
        Returns:
        +
        array of deserialized items
        +
        +
      • +
      + + + +
        +
      • +

        sizeOf

        +
        public int sizeOf​(String item)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns the serialized size in bytes of a single unserialized item.
        +
        +
        Specified by:
        +
        sizeOf in class ArrayOfItemsSerDe<String>
        +
        Parameters:
        +
        item - a specific item
        +
        Returns:
        +
        the serialized size in bytes of a single unserialized item.
        +
        +
      • +
      + + + +
        +
      • +

        sizeOf

        +
        public int sizeOf​(org.apache.datasketches.memory.Memory mem,
        +                  long offsetBytes,
        +                  int numItems)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns the serialized size in bytes of the number of contiguous serialized items in Memory. + The capacity of the given Memory can be much larger that the required size of the items.
        +
        +
        Specified by:
        +
        sizeOf in class ArrayOfItemsSerDe<String>
        +
        Parameters:
        +
        mem - the given Memory.
        +
        offsetBytes - the starting offset in the given Memory.
        +
        numItems - the number of serialized items contained in the Memory
        +
        Returns:
        +
        the serialized size in bytes of the given number of items.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString​(String item)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns a human readable string of an item.
        +
        +
        Specified by:
        +
        toString in class ArrayOfItemsSerDe<String>
        +
        Parameters:
        +
        item - a specific item
        +
        Returns:
        +
        a human readable string of an item.
        +
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/common/ArrayOfUtf16StringsSerDe.html b/docs/5.0.2/org/apache/datasketches/common/ArrayOfUtf16StringsSerDe.html new file mode 100644 index 000000000..ba47c6cd5 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/ArrayOfUtf16StringsSerDe.html @@ -0,0 +1,538 @@ + + + + + +ArrayOfUtf16StringsSerDe (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfUtf16StringsSerDe

+
+
+ +
+
    +
  • +
    +
    public class ArrayOfUtf16StringsSerDe
    +extends ArrayOfItemsSerDe<String>
    +
    Methods of serializing and deserializing arrays of String. + This class serializes strings using internal Java representation as char[], where each char + is a 16-bit code. The result is larger than one from ArrayOfStringsSerDe. + In an extreme case when all strings are in ASCII, the size is doubled. However it takes + less time to serialize and deserialize by a factor of 1.5 to 2.
    +
    +
    Author:
    +
    Alexander Saydakov
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ArrayOfUtf16StringsSerDe

        +
        public ArrayOfUtf16StringsSerDe()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        serializeToByteArray

        +
        public byte[] serializeToByteArray​(String item)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Serialize a single unserialized item to a byte array.
        +
        +
        Specified by:
        +
        serializeToByteArray in class ArrayOfItemsSerDe<String>
        +
        Parameters:
        +
        item - the item to be serialized
        +
        Returns:
        +
        serialized representation of the given item
        +
        +
      • +
      + + + +
        +
      • +

        serializeToByteArray

        +
        public byte[] serializeToByteArray​(String[] items)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Serialize an array of unserialized items to a byte array of contiguous serialized items.
        +
        +
        Specified by:
        +
        serializeToByteArray in class ArrayOfItemsSerDe<String>
        +
        Parameters:
        +
        items - array of items to be serialized
        +
        Returns:
        +
        contiguous, serialized representation of the given array of unserialized items
        +
        +
      • +
      + + + +
        +
      • +

        deserializeFromMemory

        +
        @Deprecated
        +public String[] deserializeFromMemory​(org.apache.datasketches.memory.Memory mem,
        +                                      int numItems)
        +
        Deprecated.
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Deserialize a contiguous sequence of serialized items from a given Memory.
        +
        +
        Specified by:
        +
        deserializeFromMemory in class ArrayOfItemsSerDe<String>
        +
        Parameters:
        +
        mem - Memory containing a contiguous sequence of serialized items
        +
        numItems - number of items in the contiguous serialized sequence.
        +
        Returns:
        +
        array of deserialized items
        +
        +
      • +
      + + + +
        +
      • +

        deserializeFromMemory

        +
        public String[] deserializeFromMemory​(org.apache.datasketches.memory.Memory mem,
        +                                      long offsetBytes,
        +                                      int numItems)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Deserialize a contiguous sequence of serialized items from a given Memory.
        +
        +
        Specified by:
        +
        deserializeFromMemory in class ArrayOfItemsSerDe<String>
        +
        Parameters:
        +
        mem - Memory containing a contiguous sequence of serialized items
        +
        offsetBytes - the starting offset in the given Memory.
        +
        numItems - number of items in the contiguous serialized sequence.
        +
        Returns:
        +
        array of deserialized items
        +
        +
      • +
      + + + +
        +
      • +

        sizeOf

        +
        public int sizeOf​(String item)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns the serialized size in bytes of a single unserialized item.
        +
        +
        Specified by:
        +
        sizeOf in class ArrayOfItemsSerDe<String>
        +
        Parameters:
        +
        item - a specific item
        +
        Returns:
        +
        the serialized size in bytes of a single unserialized item.
        +
        +
      • +
      + + + +
        +
      • +

        sizeOf

        +
        public int sizeOf​(org.apache.datasketches.memory.Memory mem,
        +                  long offsetBytes,
        +                  int numItems)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns the serialized size in bytes of the number of contiguous serialized items in Memory. + The capacity of the given Memory can be much larger that the required size of the items.
        +
        +
        Specified by:
        +
        sizeOf in class ArrayOfItemsSerDe<String>
        +
        Parameters:
        +
        mem - the given Memory.
        +
        offsetBytes - the starting offset in the given Memory.
        +
        numItems - the number of serialized items contained in the Memory
        +
        Returns:
        +
        the serialized size in bytes of the given number of items.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString​(String item)
        +
        Description copied from class: ArrayOfItemsSerDe
        +
        Returns a human readable string of an item.
        +
        +
        Specified by:
        +
        toString in class ArrayOfItemsSerDe<String>
        +
        Parameters:
        +
        item - a specific item
        +
        Returns:
        +
        a human readable string of an item.
        +
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/common/BoundsOnBinomialProportions.html b/docs/5.0.2/org/apache/datasketches/common/BoundsOnBinomialProportions.html new file mode 100644 index 000000000..453622877 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/BoundsOnBinomialProportions.html @@ -0,0 +1,473 @@ + + + + + +BoundsOnBinomialProportions (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class BoundsOnBinomialProportions

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.common.BoundsOnBinomialProportions
    • +
    +
  • +
+
+
    +
  • +
    +
    public final class BoundsOnBinomialProportions
    +extends Object
    +
    Confidence intervals for binomial proportions. + +

    This class computes an approximation to the Clopper-Pearson confidence interval + for a binomial proportion. Exact Clopper-Pearson intervals are strictly + conservative, but these approximations are not.

    + +

    The main inputs are numbers n and k, which are not the same as other things + that are called n and k in our sketching library. There is also a third + parameter, numStdDev, that specifies the desired confidence level.

    +
      +
    • n is the number of independent randomized trials. It is given and therefore known.
    • +
    • p is the probability of a trial being a success. It is unknown.
    • +
    • k is the number of trials (out of n) that turn out to be successes. It is + a random variable governed by a binomial distribution. After any given + batch of n independent trials, the random variable k has a specific + value which is observed and is therefore known.
    • +
    • pHat = k / n is an unbiased estimate of the unknown success + probability p.
    • +
    + +

    Alternatively, consider a coin with unknown heads probability p. Where + n is the number of independent flips of that coin, and k is the number + of times that the coin comes up heads during a given batch of n flips. + This class computes a frequentist confidence interval [lowerBoundOnP, upperBoundOnP] for the + unknown p.

    + +

    Conceptually, the desired confidence level is specified by a tail probability delta.

    + +

    Ideally, over a large ensemble of independent batches of trials, + the fraction of batches in which the true p lies below lowerBoundOnP would be at most + delta, and the fraction of batches in which the true p lies above upperBoundOnP + would also be at most delta. + +

    Setting aside the philosophical difficulties attaching to that statement, it isn't quite + true because we are approximating the Clopper-Pearson interval.

    + +

    Finally, we point out that in this class's interface, the confidence parameter delta is + not specified directly, but rather through a "number of standard deviations" numStdDev. + The library effectively converts that to a delta via delta = normalCDF (-1.0 * numStdDev).

    + +

    It is perhaps worth emphasizing that the library is NOT merely adding and subtracting + numStdDev standard deviations to the estimate. It is doing something better, that to some + extent accounts for the fact that the binomial distribution has a non-gaussian shape.

    + +

    In particular, it is using an approximation to the inverse of the incomplete beta function + that appears as formula 26.5.22 on page 945 of the "Handbook of Mathematical Functions" + by Abramowitz and Stegun.

    +
    +
    Author:
    +
    Kevin Lang
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static doubleapproximateLowerBoundOnP​(long n, + long k, + double numStdDevs) +
      Computes lower bound of approximate Clopper-Pearson confidence interval for a binomial + proportion.
      +
      static doubleapproximateUpperBoundOnP​(long n, + long k, + double numStdDevs) +
      Computes upper bound of approximate Clopper-Pearson confidence interval for a binomial + proportion.
      +
      static doubleerf​(double x) +
      Computes an approximation to the erf() function.
      +
      static doubleestimateUnknownP​(long n, + long k) +
      Computes an estimate of an unknown binomial proportion.
      +
      static doublenormalCDF​(double x) +
      Computes an approximation to normalCDF(x).
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        approximateLowerBoundOnP

        +
        public static double approximateLowerBoundOnP​(long n,
        +                                              long k,
        +                                              double numStdDevs)
        +
        Computes lower bound of approximate Clopper-Pearson confidence interval for a binomial + proportion. + +

        Implementation Notes:
        + The approximateLowerBoundOnP is defined with respect to the right tail of the binomial + distribution.

        +
          +
        • We want to solve for the p for which sumj,k,nbino(j;n,p) + = delta.
        • +
        • We now restate that in terms of the left tail.
        • +
        • We want to solve for the p for which sumj,0,(k-1)bino(j;n,p) + = 1 - delta.
        • +
        • Define x = 1-p.
        • +
        • We want to solve for the x for which Ix(n-k+1,k) = 1 - delta.
        • +
        • We specify 1-delta via numStdDevs through the right tail of the standard normal + distribution.
        • +
        • Smaller values of numStdDevs correspond to bigger values of 1-delta and hence to smaller + values of delta. In fact, usefully small values of delta correspond to negative values of + numStdDevs.
        • +
        • return p = 1-x.
        • +
        +
        +
        Parameters:
        +
        n - is the number of trials. Must be non-negative.
        +
        k - is the number of successes. Must be non-negative, and cannot exceed n.
        +
        numStdDevs - the number of standard deviations defining the confidence interval
        +
        Returns:
        +
        the lower bound of the approximate Clopper-Pearson confidence interval for the + unknown success probability.
        +
        +
      • +
      + + + +
        +
      • +

        approximateUpperBoundOnP

        +
        public static double approximateUpperBoundOnP​(long n,
        +                                              long k,
        +                                              double numStdDevs)
        +
        Computes upper bound of approximate Clopper-Pearson confidence interval for a binomial + proportion. + +

        Implementation Notes:
        + The approximateUpperBoundOnP is defined with respect to the left tail of the binomial + distribution.

        +
          +
        • We want to solve for the p for which sumj,0,kbino(j;n,p) + = delta.
        • +
        • Define x = 1-p.
        • +
        • We want to solve for the x for which Ix(n-k,k+1) = delta.
        • +
        • We specify delta via numStdDevs through the right tail of the standard normal + distribution.
        • +
        • Bigger values of numStdDevs correspond to smaller values of delta.
        • +
        • return p = 1-x.
        • +
        +
        +
        Parameters:
        +
        n - is the number of trials. Must be non-negative.
        +
        k - is the number of successes. Must be non-negative, and cannot exceed n.
        +
        numStdDevs - the number of standard deviations defining the confidence interval
        +
        Returns:
        +
        the upper bound of the approximate Clopper-Pearson confidence interval for the + unknown success probability.
        +
        +
      • +
      + + + +
        +
      • +

        estimateUnknownP

        +
        public static double estimateUnknownP​(long n,
        +                                      long k)
        +
        Computes an estimate of an unknown binomial proportion.
        +
        +
        Parameters:
        +
        n - is the number of trials. Must be non-negative.
        +
        k - is the number of successes. Must be non-negative, and cannot exceed n.
        +
        Returns:
        +
        the estimate of the unknown binomial proportion.
        +
        +
      • +
      + + + +
        +
      • +

        erf

        +
        public static double erf​(double x)
        +
        Computes an approximation to the erf() function.
        +
        +
        Parameters:
        +
        x - is the input to the erf function
        +
        Returns:
        +
        returns erf(x), accurate to roughly 7 decimal digits.
        +
        +
      • +
      + + + +
        +
      • +

        normalCDF

        +
        public static double normalCDF​(double x)
        +
        Computes an approximation to normalCDF(x).
        +
        +
        Parameters:
        +
        x - is the input to the normalCDF function
        +
        Returns:
        +
        returns the approximation to normalCDF(x).
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/common/BoundsOnRatiosInSampledSets.html b/docs/5.0.2/org/apache/datasketches/common/BoundsOnRatiosInSampledSets.html new file mode 100644 index 000000000..9de67ed32 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/BoundsOnRatiosInSampledSets.html @@ -0,0 +1,404 @@ + + + + + +BoundsOnRatiosInSampledSets (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class BoundsOnRatiosInSampledSets

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.common.BoundsOnRatiosInSampledSets
    • +
    +
  • +
+
+
    +
  • +
    +
    public final class BoundsOnRatiosInSampledSets
    +extends Object
    +
    This class is used to compute the bounds on the estimate of the ratio |B| / |A|, where: +
      +
    • |A| is the unknown size of a set A of unique identifiers.
    • +
    • |B| is the unknown size of a subset B of A.
    • +
    • a = |SA| is the observed size of a sample of A + that was obtained by Bernoulli sampling with a known inclusion probability f.
    • +
    • b = |SA ∩ B| is the observed size of a subset + of SA.
    • +
    +
    +
    Author:
    +
    Kevin Lang
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getLowerBoundForBoverA

        +
        public static double getLowerBoundForBoverA​(long a,
        +                                            long b,
        +                                            double f)
        +
        Return the approximate lower bound based on a 95% confidence interval
        +
        +
        Parameters:
        +
        a - See class javadoc
        +
        b - See class javadoc
        +
        f - the inclusion probability used to produce the set with size a and should + generally be less than 0.5. Above this value, the results not be reliable. + When f = 1.0 this returns the estimate.
        +
        Returns:
        +
        the approximate upper bound
        +
        +
      • +
      + + + +
        +
      • +

        getUpperBoundForBoverA

        +
        public static double getUpperBoundForBoverA​(long a,
        +                                            long b,
        +                                            double f)
        +
        Return the approximate upper bound based on a 95% confidence interval
        +
        +
        Parameters:
        +
        a - See class javadoc
        +
        b - See class javadoc
        +
        f - the inclusion probability used to produce the set with size a.
        +
        Returns:
        +
        the approximate lower bound
        +
        +
      • +
      + + + +
        +
      • +

        getEstimateOfBoverA

        +
        public static double getEstimateOfBoverA​(long a,
        +                                         long b)
        +
        Return the estimate of b over a
        +
        +
        Parameters:
        +
        a - See class javadoc
        +
        b - See class javadoc
        +
        Returns:
        +
        the estimate of b over a
        +
        +
      • +
      + + + +
        +
      • +

        getEstimateOfA

        +
        public static double getEstimateOfA​(long a,
        +                                    double f)
        +
        Return the estimate of A. See class javadoc.
        +
        +
        Parameters:
        +
        a - See class javadoc
        +
        f - the inclusion probability used to produce the set with size a.
        +
        Returns:
        +
        the approximate lower bound
        +
        +
      • +
      + + + +
        +
      • +

        getEstimateOfB

        +
        public static double getEstimateOfB​(long b,
        +                                    double f)
        +
        Return the estimate of B. See class javadoc.
        +
        +
        Parameters:
        +
        b - See class javadoc
        +
        f - the inclusion probability used to produce the set with size b.
        +
        Returns:
        +
        the approximate lower bound
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/common/ByteArrayUtil.html b/docs/5.0.2/org/apache/datasketches/common/ByteArrayUtil.html new file mode 100644 index 000000000..cbc68817f --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/ByteArrayUtil.html @@ -0,0 +1,921 @@ + + + + + +ByteArrayUtil (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ByteArrayUtil

+
+
+ +
+
    +
  • +
    +
    public final class ByteArrayUtil
    +extends Object
    +
    Useful methods for byte arrays.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      ByteArrayUtil() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static voidcopyBytes​(byte[] source, + int srcStart, + byte[] target, + int tgtStart, + int numBytes) +
      Copies bytes from source to target with offsets on both the source and target.
      +
      static doublegetDoubleBE​(byte[] array, + int offset) +
      Get a double from the given byte array starting at the given offset + in big endian order.
      +
      static doublegetDoubleLE​(byte[] array, + int offset) +
      Get a double from the given byte array starting at the given offset + in little endian order.
      +
      static floatgetFloatBE​(byte[] array, + int offset) +
      Get a float from the given byte array starting at the given offset + in big endian order.
      +
      static floatgetFloatLE​(byte[] array, + int offset) +
      Get a float from the given byte array starting at the given offset + in little endian order.
      +
      static intgetIntBE​(byte[] array, + int offset) +
      Get a int from the given byte array starting at the given offset + in big endian order.
      +
      static intgetIntLE​(byte[] array, + int offset) +
      Get a int from the given byte array starting at the given offset + in little endian order.
      +
      static longgetLongBE​(byte[] array, + int offset) +
      Get a long from the source byte array starting at the given offset + in big endian order.
      +
      static longgetLongLE​(byte[] array, + int offset) +
      Get a long from the given byte array starting at the given offset + in little endian order.
      +
      static shortgetShortBE​(byte[] array, + int offset) +
      Get a short from the given byte array starting at the given offset + in big endian order.
      +
      static shortgetShortLE​(byte[] array, + int offset) +
      Get a short from the given byte array starting at the given offset + in little endian order.
      +
      static voidputDoubleBE​(byte[] array, + int offset, + double value) +
      Put the source double into the destination byte array starting at the given offset + in big endian order.
      +
      static voidputDoubleLE​(byte[] array, + int offset, + double value) +
      Put the source double into the destination byte array starting at the given offset + in little endian order.
      +
      static voidputFloatBE​(byte[] array, + int offset, + float value) +
      Put the source float into the destination byte array starting at the given offset + in big endian order.
      +
      static voidputFloatLE​(byte[] array, + int offset, + float value) +
      Put the source float into the destination byte array starting at the given offset + in little endian order.
      +
      static voidputIntBE​(byte[] array, + int offset, + int value) +
      Put the source int into the destination byte array starting at the given offset + in big endian order.
      +
      static voidputIntLE​(byte[] array, + int offset, + int value) +
      Put the source int into the destination byte array starting at the given offset + in little endian order.
      +
      static voidputLongBE​(byte[] array, + int offset, + long value) +
      Put the source long into the destination byte array starting at the given offset + in big endian order.
      +
      static voidputLongLE​(byte[] array, + int offset, + long value) +
      Put the source long into the destination byte array starting at the given offset + in little endian order.
      +
      static voidputShortBE​(byte[] array, + int offset, + short value) +
      Put the source short into the destination byte array starting at the given offset + in big endian order.
      +
      static voidputShortLE​(byte[] array, + int offset, + short value) +
      Put the source short into the destination byte array starting at the given offset + in little endian order.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ByteArrayUtil

        +
        public ByteArrayUtil()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        copyBytes

        +
        public static void copyBytes​(byte[] source,
        +                             int srcStart,
        +                             byte[] target,
        +                             int tgtStart,
        +                             int numBytes)
        +
        Copies bytes from source to target with offsets on both the source and target.
        +
        +
        Parameters:
        +
        source - the given source
        +
        srcStart - the source starting index
        +
        target - the give target
        +
        tgtStart - the target starting index
        +
        numBytes - the number of bytes to be transferred.
        +
        +
      • +
      + + + +
        +
      • +

        getShortLE

        +
        public static short getShortLE​(byte[] array,
        +                               int offset)
        +
        Get a short from the given byte array starting at the given offset + in little endian order. + There is no bounds checking.
        +
        +
        Parameters:
        +
        array - source byte array
        +
        offset - source offset
        +
        Returns:
        +
        the short
        +
        +
      • +
      + + + +
        +
      • +

        putShortLE

        +
        public static void putShortLE​(byte[] array,
        +                              int offset,
        +                              short value)
        +
        Put the source short into the destination byte array starting at the given offset + in little endian order. + There is no bounds checking.
        +
        +
        Parameters:
        +
        array - destination byte array
        +
        offset - destination offset
        +
        value - source short
        +
        +
      • +
      + + + +
        +
      • +

        getShortBE

        +
        public static short getShortBE​(byte[] array,
        +                               int offset)
        +
        Get a short from the given byte array starting at the given offset + in big endian order. + There is no bounds checking.
        +
        +
        Parameters:
        +
        array - source byte array
        +
        offset - source offset
        +
        Returns:
        +
        the short
        +
        +
      • +
      + + + +
        +
      • +

        putShortBE

        +
        public static void putShortBE​(byte[] array,
        +                              int offset,
        +                              short value)
        +
        Put the source short into the destination byte array starting at the given offset + in big endian order. + There is no bounds checking.
        +
        +
        Parameters:
        +
        array - destination byte array
        +
        offset - destination offset
        +
        value - source short
        +
        +
      • +
      + + + +
        +
      • +

        getIntLE

        +
        public static int getIntLE​(byte[] array,
        +                           int offset)
        +
        Get a int from the given byte array starting at the given offset + in little endian order. + There is no bounds checking.
        +
        +
        Parameters:
        +
        array - source byte array
        +
        offset - source offset
        +
        Returns:
        +
        the int
        +
        +
      • +
      + + + +
        +
      • +

        putIntLE

        +
        public static void putIntLE​(byte[] array,
        +                            int offset,
        +                            int value)
        +
        Put the source int into the destination byte array starting at the given offset + in little endian order. + There is no bounds checking.
        +
        +
        Parameters:
        +
        array - destination byte array
        +
        offset - destination offset
        +
        value - source int
        +
        +
      • +
      + + + +
        +
      • +

        getIntBE

        +
        public static int getIntBE​(byte[] array,
        +                           int offset)
        +
        Get a int from the given byte array starting at the given offset + in big endian order. + There is no bounds checking.
        +
        +
        Parameters:
        +
        array - source byte array
        +
        offset - source offset
        +
        Returns:
        +
        the int
        +
        +
      • +
      + + + +
        +
      • +

        putIntBE

        +
        public static void putIntBE​(byte[] array,
        +                            int offset,
        +                            int value)
        +
        Put the source int into the destination byte array starting at the given offset + in big endian order. + There is no bounds checking.
        +
        +
        Parameters:
        +
        array - destination byte array
        +
        offset - destination offset
        +
        value - source int
        +
        +
      • +
      + + + +
        +
      • +

        getLongLE

        +
        public static long getLongLE​(byte[] array,
        +                             int offset)
        +
        Get a long from the given byte array starting at the given offset + in little endian order. + There is no bounds checking.
        +
        +
        Parameters:
        +
        array - source byte array
        +
        offset - source offset
        +
        Returns:
        +
        the long
        +
        +
      • +
      + + + +
        +
      • +

        putLongLE

        +
        public static void putLongLE​(byte[] array,
        +                             int offset,
        +                             long value)
        +
        Put the source long into the destination byte array starting at the given offset + in little endian order. + There is no bounds checking.
        +
        +
        Parameters:
        +
        array - destination byte array
        +
        offset - destination offset
        +
        value - source long
        +
        +
      • +
      + + + +
        +
      • +

        getLongBE

        +
        public static long getLongBE​(byte[] array,
        +                             int offset)
        +
        Get a long from the source byte array starting at the given offset + in big endian order. + There is no bounds checking.
        +
        +
        Parameters:
        +
        array - source byte array
        +
        offset - source starting point
        +
        Returns:
        +
        the long
        +
        +
      • +
      + + + +
        +
      • +

        putLongBE

        +
        public static void putLongBE​(byte[] array,
        +                             int offset,
        +                             long value)
        +
        Put the source long into the destination byte array starting at the given offset + in big endian order. + There is no bounds checking.
        +
        +
        Parameters:
        +
        array - destination byte array
        +
        offset - destination starting point
        +
        value - source long
        +
        +
      • +
      + + + +
        +
      • +

        getFloatLE

        +
        public static float getFloatLE​(byte[] array,
        +                               int offset)
        +
        Get a float from the given byte array starting at the given offset + in little endian order. + There is no bounds checking.
        +
        +
        Parameters:
        +
        array - source byte array
        +
        offset - source offset
        +
        Returns:
        +
        the float
        +
        +
      • +
      + + + +
        +
      • +

        putFloatLE

        +
        public static void putFloatLE​(byte[] array,
        +                              int offset,
        +                              float value)
        +
        Put the source float into the destination byte array starting at the given offset + in little endian order. + There is no bounds checking.
        +
        +
        Parameters:
        +
        array - destination byte array
        +
        offset - destination offset
        +
        value - source float
        +
        +
      • +
      + + + +
        +
      • +

        getFloatBE

        +
        public static float getFloatBE​(byte[] array,
        +                               int offset)
        +
        Get a float from the given byte array starting at the given offset + in big endian order. + There is no bounds checking.
        +
        +
        Parameters:
        +
        array - source byte array
        +
        offset - source offset
        +
        Returns:
        +
        the float
        +
        +
      • +
      + + + +
        +
      • +

        putFloatBE

        +
        public static void putFloatBE​(byte[] array,
        +                              int offset,
        +                              float value)
        +
        Put the source float into the destination byte array starting at the given offset + in big endian order. + There is no bounds checking.
        +
        +
        Parameters:
        +
        array - destination byte array
        +
        offset - destination offset
        +
        value - source float
        +
        +
      • +
      + + + +
        +
      • +

        getDoubleLE

        +
        public static double getDoubleLE​(byte[] array,
        +                                 int offset)
        +
        Get a double from the given byte array starting at the given offset + in little endian order. + There is no bounds checking.
        +
        +
        Parameters:
        +
        array - source byte array
        +
        offset - source offset
        +
        Returns:
        +
        the double
        +
        +
      • +
      + + + +
        +
      • +

        putDoubleLE

        +
        public static void putDoubleLE​(byte[] array,
        +                               int offset,
        +                               double value)
        +
        Put the source double into the destination byte array starting at the given offset + in little endian order. + There is no bounds checking.
        +
        +
        Parameters:
        +
        array - destination byte array
        +
        offset - destination offset
        +
        value - source double
        +
        +
      • +
      + + + +
        +
      • +

        getDoubleBE

        +
        public static double getDoubleBE​(byte[] array,
        +                                 int offset)
        +
        Get a double from the given byte array starting at the given offset + in big endian order. + There is no bounds checking.
        +
        +
        Parameters:
        +
        array - source byte array
        +
        offset - source offset
        +
        Returns:
        +
        the double
        +
        +
      • +
      + + + +
        +
      • +

        putDoubleBE

        +
        public static void putDoubleBE​(byte[] array,
        +                               int offset,
        +                               double value)
        +
        Put the source double into the destination byte array starting at the given offset + in big endian order. + There is no bounds checking.
        +
        +
        Parameters:
        +
        array - destination byte array
        +
        offset - destination offset
        +
        value - source double
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/common/Family.html b/docs/5.0.2/org/apache/datasketches/common/Family.html new file mode 100644 index 000000000..6af21576d --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/Family.html @@ -0,0 +1,846 @@ + + + + + +Family (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum Family

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Serializable, Comparable<Family>
    +
    +
    +
    public enum Family
    +extends Enum<Family>
    +
    Defines the various families of sketch and set operation classes. A family defines a set of + classes that share fundamental algorithms and behaviors. The classes within a family may + still differ by how they are stored and accessed. For example, internally there are separate + classes for the QuickSelect sketch algorithm that operate on the Java heap and off-heap. + Not all of these families have parallel forms on and off-heap but are included for completeness.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Enum Constants 
      Enum ConstantDescription
      A_NOT_B +
      The A and not B family is an operation for the Theta Sketch Framework of sketches.
      +
      ALPHA +
      The Alpha Sketch family is a member of the Theta Sketch Framework of sketches and is best + suited for real-time processes where both the updating of the sketch and getting the estimate + is performed directly on the sketch.
      +
      COMPACT +
      The Compact Sketch family is a member of the Theta Sketch Framework of sketches.
      +
      COUNTMIN +
      CountMin Sketch
      +
      CPC +
      Compressed Probabilistic Counting (CPC) Sketch
      +
      FREQUENCY +
      The Frequency family of sketches.
      +
      HLL +
      The HLL family of sketches.
      +
      INTERSECTION +
      The Intersection family is an operation for the Theta Sketch Framework of sketches.
      +
      KLL +
      KLL quantiles sketch
      +
      QUANTILES +
      The Quantiles family of sketches.
      +
      QUICKSELECT +
      The QuickSelect Sketch family is a member of the Theta Sketch Framework of sketches and + is the workhorse of the Theta Sketch Families and can be constructed for either on-heap or + off-heap operation.
      +
      REQ +
      Relative Error Quantiles Sketch
      +
      RESERVOIR +
      The Reservoir family of sketches.
      +
      RESERVOIR_UNION +
      The reservoir sampling family of Union operations.
      +
      TUPLE +
      The Tuple family of sketches is a large family of sketches that are extensions of the + Theta Sketch Framework.
      +
      UNION +
      The Union family is an operation for the Theta Sketch Framework of sketches.
      +
      VAROPT +
      The VarOpt family of sketches.
      +
      VAROPT_UNION +
      The VarOpt family of sketches.
      +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        ALPHA

        +
        public static final Family ALPHA
        +
        The Alpha Sketch family is a member of the Theta Sketch Framework of sketches and is best + suited for real-time processes where both the updating of the sketch and getting the estimate + is performed directly on the sketch. In this situation the AlphaSketch has roughly a + 30% improvement (~1/sqrt(2*k)) in its error distribution as compared to the QuickSelect + (or similar KMV-derived) sketches. + +

        If the AlphaSketch is fed into any SetOperation, the error distribution reverts back to the + normal QuickSelect/KMV error distribution (~1/sqrt(k)). For this reason, the AlphaSketch + does not have a sister class for off-heap operation. The Alpha Sketch has a roughly 30% faster + overall update time as compared to the QuickSelect sketch family.

        + +

        The Alpha Sketch is created using the UpdateSketch.builder(). + See Alpha TCF and + Theta Sketch Framework

        +
      • +
      + + + +
        +
      • +

        QUICKSELECT

        +
        public static final Family QUICKSELECT
        +
        The QuickSelect Sketch family is a member of the Theta Sketch Framework of sketches and + is the workhorse of the Theta Sketch Families and can be constructed for either on-heap or + off-heap operation. + The QuickSelect Sketch is created using the UpdateSketch.builder(). + See Quick Select TCF
        +
      • +
      + + + +
        +
      • +

        COMPACT

        +
        public static final Family COMPACT
        +
        The Compact Sketch family is a member of the Theta Sketch Framework of sketches. + The are read-only and cannot be updated, but can participate in any of the Set Operations. + The compact sketches are never created directly with a constructor or Builder. + Instead they are created as a result of the compact() + method of an UpdateSketch or as a result of a getSketchSamples() of a SetOperation.
        +
      • +
      + + + +
        +
      • +

        UNION

        +
        public static final Family UNION
        +
        The Union family is an operation for the Theta Sketch Framework of sketches. + The Union is constructed using the SetOperation.builder().
        +
      • +
      + + + +
        +
      • +

        INTERSECTION

        +
        public static final Family INTERSECTION
        +
        The Intersection family is an operation for the Theta Sketch Framework of sketches. + The Intersection is constructed using the SetOperation.builder().
        +
      • +
      + + + +
        +
      • +

        A_NOT_B

        +
        public static final Family A_NOT_B
        +
        The A and not B family is an operation for the Theta Sketch Framework of sketches. + The AnotB operation is constructed using the SetOperation.builder().
        +
      • +
      + + + +
        +
      • +

        HLL

        +
        public static final Family HLL
        +
        The HLL family of sketches. (Not part of TSF.)
        +
      • +
      + + + +
        +
      • +

        QUANTILES

        +
        public static final Family QUANTILES
        +
        The Quantiles family of sketches. (Not part of TSF.)
        +
      • +
      + + + +
        +
      • +

        TUPLE

        +
        public static final Family TUPLE
        +
        The Tuple family of sketches is a large family of sketches that are extensions of the + Theta Sketch Framework.
        +
      • +
      + + + +
        +
      • +

        FREQUENCY

        +
        public static final Family FREQUENCY
        +
        The Frequency family of sketches. (Not part of TSF.)
        +
      • +
      + + + +
        +
      • +

        RESERVOIR

        +
        public static final Family RESERVOIR
        +
        The Reservoir family of sketches. (Not part of TSF.)
        +
      • +
      + + + +
        +
      • +

        RESERVOIR_UNION

        +
        public static final Family RESERVOIR_UNION
        +
        The reservoir sampling family of Union operations. (Not part of TSF.)
        +
      • +
      + + + +
        +
      • +

        VAROPT

        +
        public static final Family VAROPT
        +
        The VarOpt family of sketches. (Not part of TSF.)
        +
      • +
      + + + +
        +
      • +

        VAROPT_UNION

        +
        public static final Family VAROPT_UNION
        +
        The VarOpt family of sketches. (Not part of TSF.)
        +
      • +
      + + + +
        +
      • +

        KLL

        +
        public static final Family KLL
        +
        KLL quantiles sketch
        +
      • +
      + + + +
        +
      • +

        CPC

        +
        public static final Family CPC
        +
        Compressed Probabilistic Counting (CPC) Sketch
        +
      • +
      + + + +
        +
      • +

        REQ

        +
        public static final Family REQ
        +
        Relative Error Quantiles Sketch
        +
      • +
      + + + +
        +
      • +

        COUNTMIN

        +
        public static final Family COUNTMIN
        +
        CountMin Sketch
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static Family[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (Family c : Family.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static Family valueOf​(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        getID

        +
        public int getID()
        +
        Returns the byte ID for this family
        +
        +
        Returns:
        +
        the byte ID for this family
        +
        +
      • +
      + + + +
        +
      • +

        checkFamilyID

        +
        public void checkFamilyID​(int id)
        +
        +
        Parameters:
        +
        id - the given id, a value < 128.
        +
        +
      • +
      + + + +
        +
      • +

        getFamilyName

        +
        public String getFamilyName()
        +
        Returns the name for this family
        +
        +
        Returns:
        +
        the name for this family
        +
        +
      • +
      + + + +
        +
      • +

        getMinPreLongs

        +
        public int getMinPreLongs()
        +
        Returns the minimum preamble size for this family in longs
        +
        +
        Returns:
        +
        the minimum preamble size for this family in longs
        +
        +
      • +
      + + + +
        +
      • +

        getMaxPreLongs

        +
        public int getMaxPreLongs()
        +
        Returns the maximum preamble size for this family in longs
        +
        +
        Returns:
        +
        the maximum preamble size for this family in longs
        +
        +
      • +
      + + + + + + + +
        +
      • +

        idToFamily

        +
        public static Family idToFamily​(int id)
        +
        Returns the Family given the ID
        +
        +
        Parameters:
        +
        id - the given ID
        +
        Returns:
        +
        the Family given the ID
        +
        +
      • +
      + + + +
        +
      • +

        stringToFamily

        +
        public static Family stringToFamily​(String famName)
        +
        Returns the Family given the family name
        +
        +
        Parameters:
        +
        famName - the family name
        +
        Returns:
        +
        the Family given the family name
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/common/ResizeFactor.html b/docs/5.0.2/org/apache/datasketches/common/ResizeFactor.html new file mode 100644 index 000000000..9e982868c --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/ResizeFactor.html @@ -0,0 +1,489 @@ + + + + + +ResizeFactor (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum ResizeFactor

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Serializable, Comparable<ResizeFactor>
    +
    +
    +
    public enum ResizeFactor
    +extends Enum<ResizeFactor>
    +
    For the Families that accept this configuration parameter, it controls the size multiple that + affects how fast the internal cache grows, when more space is required. + See Resize Factor
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        X1

        +
        public static final ResizeFactor X1
        +
        Do not resize. Sketch will be configured to full size.
        +
      • +
      + + + +
        +
      • +

        X2

        +
        public static final ResizeFactor X2
        +
        Resize factor is 2.
        +
      • +
      + + + +
        +
      • +

        X4

        +
        public static final ResizeFactor X4
        +
        Resize factor is 4.
        +
      • +
      + + + +
        +
      • +

        X8

        +
        public static final ResizeFactor X8
        +
        Resize factor is 8.
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static ResizeFactor[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (ResizeFactor c : ResizeFactor.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static ResizeFactor valueOf​(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        lg

        +
        public int lg()
        +
        Returns the Log-base 2 of the Resize Factor
        +
        +
        Returns:
        +
        the Log-base 2 of the Resize Factor
        +
        +
      • +
      + + + +
        +
      • +

        getRF

        +
        public static ResizeFactor getRF​(int lg)
        +
        Returns the Resize Factor given the Log-base 2 of the Resize Factor
        +
        +
        Parameters:
        +
        lg - a value between zero and 3, inclusive.
        +
        Returns:
        +
        the Resize Factor given the Log-base 2 of the Resize Factor
        +
        +
      • +
      + + + +
        +
      • +

        getValue

        +
        public int getValue()
        +
        Returns the Resize Factor
        +
        +
        Returns:
        +
        the Resize Factor
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/common/SketchesArgumentException.html b/docs/5.0.2/org/apache/datasketches/common/SketchesArgumentException.html new file mode 100644 index 000000000..a5ec2e75c --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/SketchesArgumentException.html @@ -0,0 +1,317 @@ + + + + + +SketchesArgumentException (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SketchesArgumentException

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Serializable
    +
    +
    +
    public class SketchesArgumentException
    +extends SketchesException
    +
    Illegal Arguments Exception class for the library
    +
    +
    Author:
    +
    Lee Rhodes
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SketchesArgumentException

        +
        public SketchesArgumentException​(String message)
        +
        Constructs a new runtime exception with the specified detail message. The cause is not + initialized, and may subsequently be initialized by a call to + Throwable.initCause(java.lang.Throwable).
        +
        +
        Parameters:
        +
        message - the detail message. The detail message is saved for later retrieval by the + Throwable.getMessage() method.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/common/SketchesException.html b/docs/5.0.2/org/apache/datasketches/common/SketchesException.html new file mode 100644 index 000000000..f7bc383e7 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/SketchesException.html @@ -0,0 +1,344 @@ + + + + + +SketchesException (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SketchesException

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SketchesException

        +
        public SketchesException​(String message)
        +
        Constructs a new runtime exception with the specified detail message. The cause is not + initialized, and may subsequently be initialized by a call to + Throwable.initCause(java.lang.Throwable).
        +
        +
        Parameters:
        +
        message - the detail message. The detail message is saved for later retrieval by the + Throwable.getMessage() method.
        +
        +
      • +
      + + + +
        +
      • +

        SketchesException

        +
        public SketchesException​(String message,
        +                         Throwable cause)
        +
        Constructs a new runtime exception with the specified detail message and cause. + +

        Note that the detail message associated with cause is not automatically incorporated + in this runtime exception's detail message.

        +
        +
        Parameters:
        +
        message - the detail message (which is saved for later retrieval by the + Throwable.getMessage() method).
        +
        cause - the cause (which is saved for later retrieval by the Throwable.getCause() + method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/common/SketchesReadOnlyException.html b/docs/5.0.2/org/apache/datasketches/common/SketchesReadOnlyException.html new file mode 100644 index 000000000..84221407f --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/SketchesReadOnlyException.html @@ -0,0 +1,338 @@ + + + + + +SketchesReadOnlyException (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SketchesReadOnlyException

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Serializable
    +
    +
    +
    public class SketchesReadOnlyException
    +extends SketchesException
    +
    Write operation attempted on a read-only class.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SketchesReadOnlyException

        +
        public SketchesReadOnlyException()
        +
        Constructs a new runtime exception with the message: + "Write operation attempted on a read-only class." + +

        The cause is not initialized, and may subsequently be initialized by a call to + Throwable.initCause(java.lang.Throwable).

        +
      • +
      + + + +
        +
      • +

        SketchesReadOnlyException

        +
        public SketchesReadOnlyException​(String message)
        +
        Constructs a new runtime exception with the specified detail message. The cause is not + initialized, and may subsequently be initialized by a call to + Throwable.initCause(java.lang.Throwable).
        +
        +
        Parameters:
        +
        message - the detail message. The detail message is saved for later retrieval by the + Throwable.getMessage() method.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/common/SketchesStateException.html b/docs/5.0.2/org/apache/datasketches/common/SketchesStateException.html new file mode 100644 index 000000000..0e7f7fd0d --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/SketchesStateException.html @@ -0,0 +1,317 @@ + + + + + +SketchesStateException (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SketchesStateException

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SketchesStateException

        +
        public SketchesStateException​(String message)
        +
        Constructs a new runtime exception with the specified detail message. The cause is not + initialized, and may subsequently be initialized by a call to + Throwable.initCause(java.lang.Throwable).
        +
        +
        Parameters:
        +
        message - the detail message. The detail message is saved for later retrieval by the + Throwable.getMessage() method.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/common/SuppressFBWarnings.html b/docs/5.0.2/org/apache/datasketches/common/SuppressFBWarnings.html new file mode 100644 index 000000000..334dc991e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/SuppressFBWarnings.html @@ -0,0 +1,290 @@ + + + + + +SuppressFBWarnings (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Annotation Type SuppressFBWarnings

+
+
+
+
    +
  • +
    +
    @Retention(CLASS)
    +public @interface SuppressFBWarnings
    +
    Used to suppress SpotBug warnings.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Optional Element Summary

      + + + + + + + + + + + + + + + + + +
      Optional Elements 
      Modifier and TypeOptional ElementDescription
      Stringjustification +
      Optional explanation for the suppression.
      +
      String[]value +
      A list of comma-separated, quoted SpotBugs warnings that are to be suppressed in the associated + annotated element.
      +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        value

        +
        String[] value
        +
        A list of comma-separated, quoted SpotBugs warnings that are to be suppressed in the associated + annotated element. The value can be a bug category, kind or pattern.
        +
        +
        Returns:
        +
        list of relevant bug descriptors
        +
        +
        +
        Default:
        +
        {}
        +
        +
      • +
      +
    • +
    +
    +
    +
      +
    • + + +
        +
      • +

        justification

        +
        String justification
        +
        Optional explanation for the suppression.
        +
        +
        Returns:
        +
        explanation
        +
        +
        +
        Default:
        +
        ""
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/common/Util.html b/docs/5.0.2/org/apache/datasketches/common/Util.html new file mode 100644 index 000000000..ac8d14d25 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/Util.html @@ -0,0 +1,1680 @@ + + + + + +Util (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Util

+
+
+ +
+
    +
  • +
    +
    public final class Util
    +extends Object
    +
    Common utility functions.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      static doubleINVERSE_GOLDEN +
      The inverse golden ratio as a fraction.
      +
      static longINVERSE_GOLDEN_U64 +
      The inverse golden ratio as an unsigned long.
      +
      static doubleLOG2 +
      The natural logarithm of 2.0.
      +
      static doubleLONG_MAX_VALUE_AS_DOUBLE +
      Long.MAX_VALUE as a double.
      +
      static StringLS +
      The java line separator character as a String.
      +
      static charTAB +
      The tab character
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static intbytesToInt​(byte[] arr) +
      Returns an int extracted from a Little-Endian byte array.
      +
      static longbytesToLong​(byte[] arr) +
      Returns a long extracted from a Little-Endian byte array.
      +
      static StringbytesToString​(byte[] arr, + boolean signed, + boolean littleEndian, + String sep) +
      Returns a string view of a byte array
      +
      static intceilingIntPowerOf2​(int n) +
      Computes the int ceiling power of 2 within the range [1, 2^30].
      +
      static longceilingLongPowerOf2​(long n) +
      Computes the long ceiling power of 2 within the range [1, 2^62].
      +
      static doubleceilingPowerBaseOfDouble​(double base, + double n) +
      Returns the ceiling of a given n given a base, where the ceiling is an integral power of the base.
      +
      static StringcharacterPad​(String s, + int fieldLength, + char padChar, + boolean postpend) +
      Prepend or postpend the given string with the given character to fill the given field length.
      +
      static voidcheckBounds​(long reqOff, + long reqLen, + long allocSize) +
      Check the requested offset and length against the allocated size.
      +
      static voidcheckIfIntPowerOf2​(int powerOf2, + String argName) +
      Checks the given int argument to make sure it is a positive power of 2 and greater than zero.
      +
      static voidcheckIfLongPowerOf2​(long powerOf2, + String argName) +
      Checks the given long argument to make sure it is a positive power of 2 and greater than zero.
      +
      static voidcheckIfMultipleOf8AndGT0​(long v, + String argName) +
      Checks if parameter v is a multiple of 8 and greater than zero.
      +
      static voidcheckProbability​(double p, + String argName) +
      Checks the given parameter to make sure it is positive and between 0.0 inclusive and 1.0 + inclusive.
      +
      static intexactLog2OfInt​(int powerOf2) +
      Returns the log2 of the given int value if it is an exact power of 2 and greater than zero.
      +
      static intexactLog2OfInt​(int powerOf2, + String argName) +
      Returns the log2 of the given int value if it is an exact power of 2 and greater than zero.
      +
      static intexactLog2OfLong​(long powerOf2) +
      Returns the log2 of the given long value if it is an exact power of 2 and greater than zero.
      +
      static intexactLog2OfLong​(long powerOf2, + String argName) +
      Returns the log2 of the given long value if it is an exact power of 2 and greater than zero.
      +
      static doublefloorPowerBaseOfDouble​(double base, + double n) +
      Computes the floor of a given n given base, where the floor is an integral power of the base.
      +
      static intfloorPowerOf2​(int n) +
      Computes the floor power of 2 given n is in the range [1, 2^31-1].
      +
      static longfloorPowerOf2​(long n) +
      Computes the floor power of 2 given n is in the range [1, 2^63-1].
      +
      static byte[]intToBytes​(int v, + byte[] arr) +
      Returns a Little-Endian byte array extracted from the given int.
      +
      static StringintToFixedLengthString​(int number, + int length) +
      Converts the given number to a string prepended with spaces, if necessary, to + match the given length.
      +
      static doubleinvPow2​(int e) +
      Computes the inverse integer power of 2: 1/(2^e) = 2^(-e).
      +
      static booleanisEven​(long n) +
      Returns true if given n is even.
      +
      static booleanisIntPowerOf2​(int powerOf2) +
      Returns true if given int argument is exactly a positive power of 2 and greater than zero.
      +
      static booleanisLessThanUnsigned​(long n1, + long n2) +
      Unsigned compare with longs.
      +
      static booleanisLongPowerOf2​(long powerOf2) +
      Returns true if given long argument is exactly a positive power of 2 and greater than zero.
      +
      static booleanisMultipleOf8AndGT0​(long v) +
      Returns true if v is a multiple of 8 and greater than zero
      +
      static booleanisOdd​(long n) +
      Returns true if given n is odd.
      +
      static <T> booleanle​(Object item1, + Object item2, + Comparator<? super T> c) +
      Is item1 Less-Than-Or-Equal-To item2
      +
      static doublelog2​(double value) +
      The log2(value)
      +
      static doublelogBaseOfX​(double base, + double x) +
      Returns the logbase(x).
      +
      static byte[]longToBytes​(long v, + byte[] arr) +
      Returns a Little-Endian byte array extracted from the given long.
      +
      static StringlongToHexBytes​(long v) +
      Returns a string of spaced hex bytes in Big-Endian order.
      +
      static <T> booleanlt​(Object item1, + Object item2, + Comparator<? super T> c) +
      Is item1 Less-Than item2
      +
      static <T> ObjectmaxT​(Object item1, + Object item2, + Comparator<? super T> c) +
      Finds the maximum of two generic items
      +
      static StringmilliSecToString​(long mS) +
      Returns the given time in milliseconds formatted as Hours:Min:Sec.mSec
      +
      static <T> ObjectminT​(Object item1, + Object item2, + Comparator<? super T> c) +
      Finds the minimum of two generic items
      +
      static StringnanoSecToString​(long nS) +
      Returns the given time in nanoseconds formatted as Sec.mSec_uSec_nSec
      +
      static intnumberOfLeadingOnes​(long v) +
      Returns the number of one bits preceding the highest-order ("leftmost") zero-bit in the + two's complement binary representation of the specified long value, or 64 if the value is equal + to minus one.
      +
      static intnumberOfTrailingOnes​(long v) +
      Returns the number of one bits following the lowest-order ("rightmost") zero-bit in the + two's complement binary representation of the specified long value, or 64 if the value is equal + to minus one.
      +
      static intnumDigits​(int n) +
      Computes the number of decimal digits of the number n
      +
      static doublepowerSeriesNextDouble​(int ppb, + double curPoint, + boolean roundToLong, + double logBase) +
      Computes the next larger double in the power series + point = logBase( i / ppb ) given the current point in the series.
      +
      static longpwr2SeriesNext​(int ppo, + long curPoint) +
      Computes the next larger integer point in the power series + point = 2( i / ppo ) given the current point in the series.
      +
      static intpwr2SeriesPrev​(int ppo, + int curPoint) +
      Computes the previous, smaller integer point in the power series + point = 2( i / ppo ) given the current point in the series.
      +
      static StringzeroPad​(String s, + int fieldLength) +
      Prepend the given string with zeros.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        LS

        +
        public static final String LS
        +
        The java line separator character as a String.
        +
      • +
      + + + + + + + +
        +
      • +

        LOG2

        +
        public static final double LOG2
        +
        The natural logarithm of 2.0.
        +
      • +
      + + + +
        +
      • +

        INVERSE_GOLDEN_U64

        +
        public static final long INVERSE_GOLDEN_U64
        +
        The inverse golden ratio as an unsigned long.
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        INVERSE_GOLDEN

        +
        public static final double INVERSE_GOLDEN
        +
        The inverse golden ratio as a fraction. + This has more precision than using the formula: (Math.sqrt(5.0) - 1.0) / 2.0.
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        LONG_MAX_VALUE_AS_DOUBLE

        +
        public static final double LONG_MAX_VALUE_AS_DOUBLE
        +
        Long.MAX_VALUE as a double.
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        bytesToInt

        +
        public static int bytesToInt​(byte[] arr)
        +
        Returns an int extracted from a Little-Endian byte array.
        +
        +
        Parameters:
        +
        arr - the given byte array
        +
        Returns:
        +
        an int extracted from a Little-Endian byte array.
        +
        +
      • +
      + + + +
        +
      • +

        bytesToLong

        +
        public static long bytesToLong​(byte[] arr)
        +
        Returns a long extracted from a Little-Endian byte array.
        +
        +
        Parameters:
        +
        arr - the given byte array
        +
        Returns:
        +
        a long extracted from a Little-Endian byte array.
        +
        +
      • +
      + + + +
        +
      • +

        intToBytes

        +
        public static byte[] intToBytes​(int v,
        +                                byte[] arr)
        +
        Returns a Little-Endian byte array extracted from the given int.
        +
        +
        Parameters:
        +
        v - the given int
        +
        arr - a given array of 4 bytes that will be returned with the data
        +
        Returns:
        +
        a Little-Endian byte array extracted from the given int.
        +
        +
      • +
      + + + +
        +
      • +

        longToBytes

        +
        public static byte[] longToBytes​(long v,
        +                                 byte[] arr)
        +
        Returns a Little-Endian byte array extracted from the given long.
        +
        +
        Parameters:
        +
        v - the given long
        +
        arr - a given array of 8 bytes that will be returned with the data
        +
        Returns:
        +
        a Little-Endian byte array extracted from the given long.
        +
        +
      • +
      + + + +
        +
      • +

        longToHexBytes

        +
        public static String longToHexBytes​(long v)
        +
        Returns a string of spaced hex bytes in Big-Endian order.
        +
        +
        Parameters:
        +
        v - the given long
        +
        Returns:
        +
        string of spaced hex bytes in Big-Endian order.
        +
        +
      • +
      + + + +
        +
      • +

        bytesToString

        +
        public static String bytesToString​(byte[] arr,
        +                                   boolean signed,
        +                                   boolean littleEndian,
        +                                   String sep)
        +
        Returns a string view of a byte array
        +
        +
        Parameters:
        +
        arr - the given byte array
        +
        signed - set true if you want the byte values signed.
        +
        littleEndian - set true if you want Little-Endian order
        +
        sep - the separator string between bytes
        +
        Returns:
        +
        a string view of a byte array
        +
        +
      • +
      + + + +
        +
      • +

        nanoSecToString

        +
        public static String nanoSecToString​(long nS)
        +
        Returns the given time in nanoseconds formatted as Sec.mSec_uSec_nSec
        +
        +
        Parameters:
        +
        nS - the given nanoseconds
        +
        Returns:
        +
        the given time in nanoseconds formatted as Sec.mSec_uSec_nSec
        +
        +
      • +
      + + + +
        +
      • +

        milliSecToString

        +
        public static String milliSecToString​(long mS)
        +
        Returns the given time in milliseconds formatted as Hours:Min:Sec.mSec
        +
        +
        Parameters:
        +
        mS - the given milliseconds
        +
        Returns:
        +
        the given time in milliseconds formatted as Hours:Min:Sec.mSec
        +
        +
      • +
      + + + +
        +
      • +

        zeroPad

        +
        public static String zeroPad​(String s,
        +                             int fieldLength)
        +
        Prepend the given string with zeros. If the given string is equal or greater than the given + field length, it will be returned without modification.
        +
        +
        Parameters:
        +
        s - the given string
        +
        fieldLength - desired total field length including the given string
        +
        Returns:
        +
        the given string prepended with zeros.
        +
        +
      • +
      + + + +
        +
      • +

        characterPad

        +
        public static String characterPad​(String s,
        +                                  int fieldLength,
        +                                  char padChar,
        +                                  boolean postpend)
        +
        Prepend or postpend the given string with the given character to fill the given field length. + If the given string is equal to or greater than the given field length, it will be returned without modification.
        +
        +
        Parameters:
        +
        s - the given string
        +
        fieldLength - the desired field length
        +
        padChar - the desired pad character
        +
        postpend - if true append the pacCharacters to the end of the string.
        +
        Returns:
        +
        prepended or postpended given string with the given character to fill the given field length.
        +
        +
      • +
      + + + +
        +
      • +

        checkIfMultipleOf8AndGT0

        +
        public static void checkIfMultipleOf8AndGT0​(long v,
        +                                            String argName)
        +
        Checks if parameter v is a multiple of 8 and greater than zero.
        +
        +
        Parameters:
        +
        v - The parameter to check
        +
        argName - This name will be part of the error message if the check fails.
        +
        +
      • +
      + + + +
        +
      • +

        isMultipleOf8AndGT0

        +
        public static boolean isMultipleOf8AndGT0​(long v)
        +
        Returns true if v is a multiple of 8 and greater than zero
        +
        +
        Parameters:
        +
        v - The parameter to check
        +
        Returns:
        +
        true if v is a multiple of 8 and greater than zero
        +
        +
      • +
      + + + +
        +
      • +

        isIntPowerOf2

        +
        public static boolean isIntPowerOf2​(int powerOf2)
        +
        Returns true if given int argument is exactly a positive power of 2 and greater than zero.
        +
        +
        Parameters:
        +
        powerOf2 - The input argument.
        +
        Returns:
        +
        true if argument is exactly a positive power of 2 and greater than zero.
        +
        +
      • +
      + + + +
        +
      • +

        isLongPowerOf2

        +
        public static boolean isLongPowerOf2​(long powerOf2)
        +
        Returns true if given long argument is exactly a positive power of 2 and greater than zero.
        +
        +
        Parameters:
        +
        powerOf2 - The input argument.
        +
        Returns:
        +
        true if argument is exactly a positive power of 2 and greater than zero.
        +
        +
      • +
      + + + +
        +
      • +

        checkIfIntPowerOf2

        +
        public static void checkIfIntPowerOf2​(int powerOf2,
        +                                      String argName)
        +
        Checks the given int argument to make sure it is a positive power of 2 and greater than zero. + If not it throws an exception with the user supplied local argument name.
        +
        +
        Parameters:
        +
        powerOf2 - The input int argument must be a power of 2 and greater than zero.
        +
        argName - Used in the thrown exception.
        +
        Throws:
        +
        SketchesArgumentException - if not a power of 2 nor greater than zero.
        +
        +
      • +
      + + + +
        +
      • +

        checkIfLongPowerOf2

        +
        public static void checkIfLongPowerOf2​(long powerOf2,
        +                                       String argName)
        +
        Checks the given long argument to make sure it is a positive power of 2 and greater than zero. + If not, it throws an exception with the user supplied local argument name.
        +
        +
        Parameters:
        +
        powerOf2 - The input long argument must be a power of 2 and greater than zero.
        +
        argName - Used in the thrown exception.
        +
        Throws:
        +
        SketchesArgumentException - if not a power of 2 nor greater than zero.
        +
        +
      • +
      + + + +
        +
      • +

        ceilingIntPowerOf2

        +
        public static int ceilingIntPowerOf2​(int n)
        +
        Computes the int ceiling power of 2 within the range [1, 2^30]. This is the smallest positive power + of 2 that is equal to or greater than the given n and a mathematical integer. + +

        For: +

          +
        • n ≤ 1: returns 1
        • +
        • 2^30 ≤ n ≤ 2^31 -1 : returns 2^30
        • +
        • n == an exact power of 2 : returns n
        • +
        • otherwise returns the smallest power of 2 ≥ n and equal to a mathematical integer
        • +
        +
        +
        Parameters:
        +
        n - The input int argument.
        +
        Returns:
        +
        the ceiling power of 2.
        +
        +
      • +
      + + + +
        +
      • +

        ceilingLongPowerOf2

        +
        public static long ceilingLongPowerOf2​(long n)
        +
        Computes the long ceiling power of 2 within the range [1, 2^62]. This is the smallest positive power + of 2 that is equal to or greater than the given n and a mathematical long. + +

        For: +

          +
        • n ≤ 1: returns 1
        • +
        • 2^62 ≤ n ≤ 2^63 -1 : returns 2^62
        • +
        • n == an exact power of 2 : returns n
        • +
        • otherwise returns the smallest power of 2 ≥ n and equal to a mathematical integer
        • +
        +
        +
        Parameters:
        +
        n - The input long argument.
        +
        Returns:
        +
        the ceiling power of 2.
        +
        +
      • +
      + + + +
        +
      • +

        floorPowerOf2

        +
        public static int floorPowerOf2​(int n)
        +
        Computes the floor power of 2 given n is in the range [1, 2^31-1]. + This is the largest positive power of 2 that equal to or less than the given n and equal + to a mathematical integer. + +

        For: +

          +
        • n ≤ 1: returns 1
        • +
        • 2^30 ≤ n ≤ 2^31 -1 : returns 2^30
        • +
        • n == a power of 2 : returns n
        • +
        • otherwise returns the largest power of 2 less than n and equal to a mathematical + integer.
        • +
        +
        +
        Parameters:
        +
        n - The given int argument.
        +
        Returns:
        +
        the floor power of 2 as an int.
        +
        +
      • +
      + + + +
        +
      • +

        floorPowerOf2

        +
        public static long floorPowerOf2​(long n)
        +
        Computes the floor power of 2 given n is in the range [1, 2^63-1]. + This is the largest positive power of 2 that is equal to or less than the given n and + equal to a mathematical integer. + +

        For: +

          +
        • n ≤ 1: returns 1
        • +
        • 2^62 ≤ n ≤ 2^63 -1 : returns 2^62
        • +
        • n == a power of 2 : returns n
        • +
        • otherwise returns the largest power of 2 less than n and equal to a mathematical + integer.
        • +
        +
        +
        Parameters:
        +
        n - The given long argument.
        +
        Returns:
        +
        the floor power of 2 as a long
        +
        +
      • +
      + + + +
        +
      • +

        invPow2

        +
        public static double invPow2​(int e)
        +
        Computes the inverse integer power of 2: 1/(2^e) = 2^(-e).
        +
        +
        Parameters:
        +
        e - a positive value between 0 and 1023 inclusive
        +
        Returns:
        +
        the inverse integer power of 2: 1/(2^e) = 2^(-e)
        +
        +
      • +
      + + + +
        +
      • +

        pwr2SeriesNext

        +
        public static long pwr2SeriesNext​(int ppo,
        +                                  long curPoint)
        +
        Computes the next larger integer point in the power series + point = 2( i / ppo ) given the current point in the series. + For illustration, this can be used in a loop as follows: + +
        
        +     int maxP = 1024;
        +     int minP = 1;
        +     int ppo = 2;
        +
        +     for (int p = minP; p <= maxP; p = pwr2LawNext(ppo, p)) {
        +       System.out.print(p + " ");
        +     }
        +     //generates the following series:
        +     //1 2 3 4 6 8 11 16 23 32 45 64 91 128 181 256 362 512 724 1024
        + 
        +
        +
        Parameters:
        +
        ppo - Points-Per-Octave, or the number of points per integer powers of 2 in the series.
        +
        curPoint - the current point of the series. Must be ≥ 1.
        +
        Returns:
        +
        the next point in the power series.
        +
        +
      • +
      + + + +
        +
      • +

        pwr2SeriesPrev

        +
        public static int pwr2SeriesPrev​(int ppo,
        +                                 int curPoint)
        +
        Computes the previous, smaller integer point in the power series + point = 2( i / ppo ) given the current point in the series. + For illustration, this can be used in a loop as follows: + +
        
        +     int maxP = 1024;
        +     int minP = 1;
        +     int ppo = 2;
        +
        +     for (int p = maxP; p >= minP; p = pwr2LawPrev(ppo, p)) {
        +       System.out.print(p + " ");
        +     }
        +     //generates the following series:
        +     //1024 724 512 362 256 181 128 91 64 45 32 23 16 11 8 6 4 3 2 1
        + 
        +
        +
        Parameters:
        +
        ppo - Points-Per-Octave, or the number of points per integer powers of 2 in the series.
        +
        curPoint - the current point of the series. Must be ≥ 1.
        +
        Returns:
        +
        the previous, smaller point in the power series. + A returned value of zero terminates the series.
        +
        +
      • +
      + + + +
        +
      • +

        powerSeriesNextDouble

        +
        public static double powerSeriesNextDouble​(int ppb,
        +                                           double curPoint,
        +                                           boolean roundToLong,
        +                                           double logBase)
        +
        Computes the next larger double in the power series + point = logBase( i / ppb ) given the current point in the series. + For illustration, this can be used in a loop as follows: + +
        
        +     double maxP = 1024.0;
        +     double minP = 1.0;
        +     int ppb = 2;
        +     double logBase = 2.0;
        +
        +     for (double p = minP; p <= maxP; p = powerSeriesNextDouble(ppb, p, true, logBase)) {
        +       System.out.print(p + " ");
        +     }
        +     //generates the following series:
        +     //1 2 3 4 6 8 11 16 23 32 45 64 91 128 181 256 362 512 724 1024
        + 
        +
        +
        Parameters:
        +
        ppb - Points-Per-Base, or the number of points per integer powers of base in the series.
        +
        curPoint - the current point of the series. Must be ≥ 1.0.
        +
        roundToLong - if true the output will be rounded to the nearest long.
        +
        logBase - the desired base of the logarithms
        +
        Returns:
        +
        the next point in the power series.
        +
        +
      • +
      + + + +
        +
      • +

        ceilingPowerBaseOfDouble

        +
        public static double ceilingPowerBaseOfDouble​(double base,
        +                                              double n)
        +
        Returns the ceiling of a given n given a base, where the ceiling is an integral power of the base. + This is the smallest positive power of base that is equal to or greater than the given n + and equal to a mathematical integer. + The result of this function is consistent with ceilingIntPowerOf2(int) for values + less than one. I.e., if n < 1, the result is 1. + +

        The formula is: baseceiling(logbase(x))

        +
        +
        Parameters:
        +
        base - The number in the expression ⌈basen⌉.
        +
        n - The input argument.
        +
        Returns:
        +
        the ceiling power of base as a double and equal to a mathematical integer.
        +
        +
      • +
      + + + +
        +
      • +

        floorPowerBaseOfDouble

        +
        public static double floorPowerBaseOfDouble​(double base,
        +                                            double n)
        +
        Computes the floor of a given n given base, where the floor is an integral power of the base. + This is the largest positive power of base that is equal to or less than the given n + and equal to a mathematical integer. + The result of this function is consistent with floorPowerOf2(int) for values + less than one. I.e., if n < 1, the result is 1. + +

        The formula is: basefloor(logbase(x))

        +
        +
        Parameters:
        +
        base - The number in the expression ⌊basen⌋.
        +
        n - The input argument.
        +
        Returns:
        +
        the floor power of 2 and equal to a mathematical integer.
        +
        +
      • +
      + + + +
        +
      • +

        log2

        +
        public static double log2​(double value)
        +
        The log2(value)
        +
        +
        Parameters:
        +
        value - the given value
        +
        Returns:
        +
        log2(value)
        +
        +
      • +
      + + + +
        +
      • +

        logBaseOfX

        +
        public static double logBaseOfX​(double base,
        +                                double x)
        +
        Returns the logbase(x). Example, if base = 2.0: logB(2.0, x) = log(x) / log(2.0).
        +
        +
        Parameters:
        +
        base - The number in the expression log(x) / log(base).
        +
        x - the given value
        +
        Returns:
        +
        the logbase(x)
        +
        +
      • +
      + + + +
        +
      • +

        numberOfTrailingOnes

        +
        public static int numberOfTrailingOnes​(long v)
        +
        Returns the number of one bits following the lowest-order ("rightmost") zero-bit in the + two's complement binary representation of the specified long value, or 64 if the value is equal + to minus one.
        +
        +
        Parameters:
        +
        v - the value whose number of trailing ones is to be computed.
        +
        Returns:
        +
        the number of one bits following the lowest-order ("rightmost") zero-bit in the + two's complement binary representation of the specified long value, or 64 if the value is equal + to minus one.
        +
        +
      • +
      + + + +
        +
      • +

        numberOfLeadingOnes

        +
        public static int numberOfLeadingOnes​(long v)
        +
        Returns the number of one bits preceding the highest-order ("leftmost") zero-bit in the + two's complement binary representation of the specified long value, or 64 if the value is equal + to minus one.
        +
        +
        Parameters:
        +
        v - the value whose number of leading ones is to be computed.
        +
        Returns:
        +
        the number of one bits preceding the lowest-order ("rightmost") zero-bit in the + two's complement binary representation of the specified long value, or 64 if the value is equal + to minus one.
        +
        +
      • +
      + + + +
        +
      • +

        exactLog2OfInt

        +
        public static int exactLog2OfInt​(int powerOf2,
        +                                 String argName)
        +
        Returns the log2 of the given int value if it is an exact power of 2 and greater than zero. + If not, it throws an exception with the user supplied local argument name.
        +
        +
        Parameters:
        +
        powerOf2 - must be a power of 2 and greater than zero.
        +
        argName - the argument name used in the exception if thrown.
        +
        Returns:
        +
        the log2 of the given value if it is an exact power of 2 and greater than zero.
        +
        Throws:
        +
        SketchesArgumentException - if not a power of 2 nor greater than zero.
        +
        +
      • +
      + + + +
        +
      • +

        exactLog2OfLong

        +
        public static int exactLog2OfLong​(long powerOf2,
        +                                  String argName)
        +
        Returns the log2 of the given long value if it is an exact power of 2 and greater than zero. + If not, it throws an exception with the user supplied local argument name.
        +
        +
        Parameters:
        +
        powerOf2 - must be a power of 2 and greater than zero.
        +
        argName - the argument name used in the exception if thrown.
        +
        Returns:
        +
        the log2 of the given value if it is an exact power of 2 and greater than zero.
        +
        Throws:
        +
        SketchesArgumentException - if not a power of 2 nor greater than zero.
        +
        +
      • +
      + + + +
        +
      • +

        exactLog2OfInt

        +
        public static int exactLog2OfInt​(int powerOf2)
        +
        Returns the log2 of the given int value if it is an exact power of 2 and greater than zero. + If not, it throws an exception.
        +
        +
        Parameters:
        +
        powerOf2 - must be a power of 2 and greater than zero.
        +
        Returns:
        +
        the log2 of the given int value if it is an exact power of 2 and greater than zero.
        +
        +
      • +
      + + + +
        +
      • +

        exactLog2OfLong

        +
        public static int exactLog2OfLong​(long powerOf2)
        +
        Returns the log2 of the given long value if it is an exact power of 2 and greater than zero. + If not, it throws an exception.
        +
        +
        Parameters:
        +
        powerOf2 - must be a power of 2 and greater than zero.
        +
        Returns:
        +
        the log2 of the given long value if it is an exact power of 2 and greater than zero.
        +
        +
      • +
      + + + +
        +
      • +

        checkBounds

        +
        public static void checkBounds​(long reqOff,
        +                               long reqLen,
        +                               long allocSize)
        +
        Check the requested offset and length against the allocated size. + The invariants equation is: 0 <= reqOff <= reqLen <= reqOff + reqLen <= allocSize. + If this equation is violated an SketchesArgumentException will be thrown.
        +
        +
        Parameters:
        +
        reqOff - the requested offset
        +
        reqLen - the requested length
        +
        allocSize - the allocated size.
        +
        +
      • +
      + + + +
        +
      • +

        checkProbability

        +
        public static void checkProbability​(double p,
        +                                    String argName)
        +
        Checks the given parameter to make sure it is positive and between 0.0 inclusive and 1.0 + inclusive.
        +
        +
        Parameters:
        +
        p - See Sampling Probability, p
        +
        argName - Used in the thrown exception.
        +
        +
      • +
      + + + +
        +
      • +

        isLessThanUnsigned

        +
        public static boolean isLessThanUnsigned​(long n1,
        +                                         long n2)
        +
        Unsigned compare with longs.
        +
        +
        Parameters:
        +
        n1 - A long to be treated as if unsigned.
        +
        n2 - A long to be treated as if unsigned.
        +
        Returns:
        +
        true if n1 > n2.
        +
        +
      • +
      + + + +
        +
      • +

        isEven

        +
        public static boolean isEven​(long n)
        +
        Returns true if given n is even.
        +
        +
        Parameters:
        +
        n - the given n
        +
        Returns:
        +
        true if given n is even.
        +
        +
      • +
      + + + +
        +
      • +

        isOdd

        +
        public static boolean isOdd​(long n)
        +
        Returns true if given n is odd.
        +
        +
        Parameters:
        +
        n - the given n
        +
        Returns:
        +
        true if given n is odd.
        +
        +
      • +
      + + + +
        +
      • +

        numDigits

        +
        public static int numDigits​(int n)
        +
        Computes the number of decimal digits of the number n
        +
        +
        Parameters:
        +
        n - the given number
        +
        Returns:
        +
        the number of decimal digits of the number n
        +
        +
      • +
      + + + +
        +
      • +

        intToFixedLengthString

        +
        public static String intToFixedLengthString​(int number,
        +                                            int length)
        +
        Converts the given number to a string prepended with spaces, if necessary, to + match the given length. + +

        For example, assume a sequence of integers from 1 to 1000. The largest value has + four decimal digits. Convert the entire sequence of strings to the form " 1" to "1000". + When these strings are sorted they will be in numerical sequence: " 1", " 2", ... "1000".

        +
        +
        Parameters:
        +
        number - the given number
        +
        length - the desired string length.
        +
        Returns:
        +
        the given number to a string prepended with spaces
        +
        +
      • +
      + + + +
        +
      • +

        minT

        +
        public static <T> Object minT​(Object item1,
        +                              Object item2,
        +                              Comparator<? super T> c)
        +
        Finds the minimum of two generic items
        +
        +
        Type Parameters:
        +
        T - the type
        +
        Parameters:
        +
        item1 - item one
        +
        item2 - item two
        +
        c - the given comparator
        +
        Returns:
        +
        the minimum value
        +
        +
      • +
      + + + +
        +
      • +

        maxT

        +
        public static <T> Object maxT​(Object item1,
        +                              Object item2,
        +                              Comparator<? super T> c)
        +
        Finds the maximum of two generic items
        +
        +
        Type Parameters:
        +
        T - the type
        +
        Parameters:
        +
        item1 - item one
        +
        item2 - item two
        +
        c - the given comparator
        +
        Returns:
        +
        the maximum value
        +
        +
      • +
      + + + +
        +
      • +

        lt

        +
        public static <T> boolean lt​(Object item1,
        +                             Object item2,
        +                             Comparator<? super T> c)
        +
        Is item1 Less-Than item2
        +
        +
        Type Parameters:
        +
        T - the type
        +
        Parameters:
        +
        item1 - item one
        +
        item2 - item two
        +
        c - the given comparator
        +
        Returns:
        +
        true if item1 Less-Than item2
        +
        +
      • +
      + + + +
        +
      • +

        le

        +
        public static <T> boolean le​(Object item1,
        +                             Object item2,
        +                             Comparator<? super T> c)
        +
        Is item1 Less-Than-Or-Equal-To item2
        +
        +
        Type Parameters:
        +
        T - the type
        +
        Parameters:
        +
        item1 - item one
        +
        item2 - item two
        +
        c - the given comparator
        +
        Returns:
        +
        true if item1 Less-Than-Or-Equal-To item2
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfBooleansSerDe.html b/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfBooleansSerDe.html new file mode 100644 index 000000000..e2cb84789 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfBooleansSerDe.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.common.ArrayOfBooleansSerDe (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.common.ArrayOfBooleansSerDe

+
+
No usage of org.apache.datasketches.common.ArrayOfBooleansSerDe
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfDoublesSerDe.html b/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfDoublesSerDe.html new file mode 100644 index 000000000..953c95d37 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfDoublesSerDe.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.common.ArrayOfDoublesSerDe (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.common.ArrayOfDoublesSerDe

+
+
No usage of org.apache.datasketches.common.ArrayOfDoublesSerDe
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfItemsSerDe.html b/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfItemsSerDe.html new file mode 100644 index 000000000..680aa6cdd --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfItemsSerDe.html @@ -0,0 +1,549 @@ + + + + + +Uses of Class org.apache.datasketches.common.ArrayOfItemsSerDe (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.common.ArrayOfItemsSerDe

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfLongsSerDe.html b/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfLongsSerDe.html new file mode 100644 index 000000000..b9165acb0 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfLongsSerDe.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.common.ArrayOfLongsSerDe (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.common.ArrayOfLongsSerDe

+
+
No usage of org.apache.datasketches.common.ArrayOfLongsSerDe
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfNumbersSerDe.html b/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfNumbersSerDe.html new file mode 100644 index 000000000..bf4dcc195 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfNumbersSerDe.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.common.ArrayOfNumbersSerDe (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.common.ArrayOfNumbersSerDe

+
+
No usage of org.apache.datasketches.common.ArrayOfNumbersSerDe
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfStringsSerDe.html b/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfStringsSerDe.html new file mode 100644 index 000000000..d86508906 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfStringsSerDe.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.common.ArrayOfStringsSerDe (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.common.ArrayOfStringsSerDe

+
+
No usage of org.apache.datasketches.common.ArrayOfStringsSerDe
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfUtf16StringsSerDe.html b/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfUtf16StringsSerDe.html new file mode 100644 index 000000000..b6fc82d10 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/class-use/ArrayOfUtf16StringsSerDe.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.common.ArrayOfUtf16StringsSerDe (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.common.ArrayOfUtf16StringsSerDe

+
+
No usage of org.apache.datasketches.common.ArrayOfUtf16StringsSerDe
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/common/class-use/BoundsOnBinomialProportions.html b/docs/5.0.2/org/apache/datasketches/common/class-use/BoundsOnBinomialProportions.html new file mode 100644 index 000000000..86c358399 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/class-use/BoundsOnBinomialProportions.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.common.BoundsOnBinomialProportions (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.common.BoundsOnBinomialProportions

+
+
No usage of org.apache.datasketches.common.BoundsOnBinomialProportions
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/common/class-use/BoundsOnRatiosInSampledSets.html b/docs/5.0.2/org/apache/datasketches/common/class-use/BoundsOnRatiosInSampledSets.html new file mode 100644 index 000000000..502663cc1 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/class-use/BoundsOnRatiosInSampledSets.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.common.BoundsOnRatiosInSampledSets (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.common.BoundsOnRatiosInSampledSets

+
+
No usage of org.apache.datasketches.common.BoundsOnRatiosInSampledSets
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/common/class-use/ByteArrayUtil.html b/docs/5.0.2/org/apache/datasketches/common/class-use/ByteArrayUtil.html new file mode 100644 index 000000000..205d0d8d5 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/class-use/ByteArrayUtil.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.common.ByteArrayUtil (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.common.ByteArrayUtil

+
+
No usage of org.apache.datasketches.common.ByteArrayUtil
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/common/class-use/Family.html b/docs/5.0.2/org/apache/datasketches/common/class-use/Family.html new file mode 100644 index 000000000..b95625406 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/class-use/Family.html @@ -0,0 +1,361 @@ + + + + + +Uses of Class org.apache.datasketches.common.Family (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.common.Family

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/common/class-use/ResizeFactor.html b/docs/5.0.2/org/apache/datasketches/common/class-use/ResizeFactor.html new file mode 100644 index 000000000..7eb83be22 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/class-use/ResizeFactor.html @@ -0,0 +1,439 @@ + + + + + +Uses of Class org.apache.datasketches.common.ResizeFactor (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.common.ResizeFactor

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/common/class-use/SketchesArgumentException.html b/docs/5.0.2/org/apache/datasketches/common/class-use/SketchesArgumentException.html new file mode 100644 index 000000000..6061aae31 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/class-use/SketchesArgumentException.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.common.SketchesArgumentException (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.common.SketchesArgumentException

+
+
No usage of org.apache.datasketches.common.SketchesArgumentException
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/common/class-use/SketchesException.html b/docs/5.0.2/org/apache/datasketches/common/class-use/SketchesException.html new file mode 100644 index 000000000..8159d3033 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/class-use/SketchesException.html @@ -0,0 +1,211 @@ + + + + + +Uses of Class org.apache.datasketches.common.SketchesException (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.common.SketchesException

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/common/class-use/SketchesReadOnlyException.html b/docs/5.0.2/org/apache/datasketches/common/class-use/SketchesReadOnlyException.html new file mode 100644 index 000000000..f8b86eab5 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/class-use/SketchesReadOnlyException.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.common.SketchesReadOnlyException (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.common.SketchesReadOnlyException

+
+
No usage of org.apache.datasketches.common.SketchesReadOnlyException
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/common/class-use/SketchesStateException.html b/docs/5.0.2/org/apache/datasketches/common/class-use/SketchesStateException.html new file mode 100644 index 000000000..683750453 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/class-use/SketchesStateException.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.common.SketchesStateException (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.common.SketchesStateException

+
+
No usage of org.apache.datasketches.common.SketchesStateException
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/common/class-use/SuppressFBWarnings.html b/docs/5.0.2/org/apache/datasketches/common/class-use/SuppressFBWarnings.html new file mode 100644 index 000000000..e63a7812e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/class-use/SuppressFBWarnings.html @@ -0,0 +1,460 @@ + + + + + +Uses of Class org.apache.datasketches.common.SuppressFBWarnings (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.common.SuppressFBWarnings

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/common/class-use/Util.html b/docs/5.0.2/org/apache/datasketches/common/class-use/Util.html new file mode 100644 index 000000000..3452c801a --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/class-use/Util.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.common.Util (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.common.Util

+
+
No usage of org.apache.datasketches.common.Util
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/common/package-summary.html b/docs/5.0.2/org/apache/datasketches/common/package-summary.html new file mode 100644 index 000000000..1ff674f4b --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/package-summary.html @@ -0,0 +1,319 @@ + + + + + +org.apache.datasketches.common (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches.common

+
+
+
+ + +
This package is for common classes that may be used across all the sketch families.
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    ArrayOfBooleansSerDe +
    Methods of serializing and deserializing arrays of Boolean as a bit array.
    +
    ArrayOfDoublesSerDe +
    Methods of serializing and deserializing arrays of Double.
    +
    ArrayOfItemsSerDe<T> +
    Base class for serializing and deserializing custom types.
    +
    ArrayOfLongsSerDe +
    Methods of serializing and deserializing arrays of Long.
    +
    ArrayOfNumbersSerDe +
    Methods of serializing and deserializing arrays of the object version of primitive types of + Number.
    +
    ArrayOfStringsSerDe +
    Methods of serializing and deserializing arrays of String.
    +
    ArrayOfUtf16StringsSerDe +
    Methods of serializing and deserializing arrays of String.
    +
    BoundsOnBinomialProportions +
    Confidence intervals for binomial proportions.
    +
    BoundsOnRatiosInSampledSets +
    This class is used to compute the bounds on the estimate of the ratio |B| / |A|, where: + + |A| is the unknown size of a set A of unique identifiers. + |B| is the unknown size of a subset B of A. + a = |SA| is the observed size of a sample of A + that was obtained by Bernoulli sampling with a known inclusion probability f. + b = |SA ∩ B| is the observed size of a subset + of SA. +
    +
    ByteArrayUtil +
    Useful methods for byte arrays.
    +
    Util +
    Common utility functions.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    Family +
    Defines the various families of sketch and set operation classes.
    +
    ResizeFactor +
    For the Families that accept this configuration parameter, it controls the size multiple that + affects how fast the internal cache grows, when more space is required.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + + + + + +
    Exception Summary 
    ExceptionDescription
    SketchesArgumentException +
    Illegal Arguments Exception class for the library
    +
    SketchesException +
    Exception class for the library
    +
    SketchesReadOnlyException +
    Write operation attempted on a read-only class.
    +
    SketchesStateException +
    Illegal State Exception class for the library
    +
    +
  • +
  • + + + + + + + + + + + + +
    Annotation Types Summary 
    Annotation TypeDescription
    SuppressFBWarnings +
    Used to suppress SpotBug warnings.
    +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/common/package-tree.html b/docs/5.0.2/org/apache/datasketches/common/package-tree.html new file mode 100644 index 000000000..42a5d3bfe --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/package-tree.html @@ -0,0 +1,217 @@ + + + + + +org.apache.datasketches.common Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches.common

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+

Annotation Type Hierarchy

+ +
+
+

Enum Hierarchy

+ +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/common/package-use.html b/docs/5.0.2/org/apache/datasketches/common/package-use.html new file mode 100644 index 000000000..3921e6db3 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/common/package-use.html @@ -0,0 +1,498 @@ + + + + + +Uses of Package org.apache.datasketches.common (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches.common

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/cpc/CompressionCharacterization.html b/docs/5.0.2/org/apache/datasketches/cpc/CompressionCharacterization.html new file mode 100644 index 000000000..43fb67e27 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/cpc/CompressionCharacterization.html @@ -0,0 +1,331 @@ + + + + + +CompressionCharacterization (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class CompressionCharacterization

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.cpc.CompressionCharacterization
    • +
    +
  • +
+
+
    +
  • +
    +
    public class CompressionCharacterization
    +extends Object
    +
    This code is used both by unit tests, for short running tests, + and by the characterization repository for longer running, more exhaustive testing. To be + accessible for both, this code is part of the main hierarchy. It is not used during normal + production runtime.
    +
    +
    Author:
    +
    Lee Rhodes, Kevin Lang
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CompressionCharacterization

        +
        public CompressionCharacterization​(int lgMinK,
        +                                   int lgMaxK,
        +                                   int lgMinT,
        +                                   int lgMaxT,
        +                                   int lgMulK,
        +                                   int uPPO,
        +                                   int incLgK,
        +                                   PrintStream pS,
        +                                   PrintWriter pW)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        start

        +
        public void start()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/cpc/CpcSketch.html b/docs/5.0.2/org/apache/datasketches/cpc/CpcSketch.html new file mode 100644 index 000000000..c15fdb6ef --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/cpc/CpcSketch.html @@ -0,0 +1,1000 @@ + + + + + +CpcSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class CpcSketch

+
+
+ +
+
    +
  • +
    +
    public final class CpcSketch
    +extends Object
    +
    This is a unique-counting sketch that implements the + Compressed Probabilistic Counting (CPC, a.k.a FM85) algorithms developed by Kevin Lang in + his paper + Back to the Future: an Even More Nearly + Optimal Cardinality Estimation Algorithm. + +

    This sketch is extremely space-efficient when serialized. In an apples-to-apples empirical + comparison against compressed HyperLogLog sketches, this new algorithm simultaneously wins on + the two dimensions of the space/accuracy tradeoff and produces sketches that are + smaller than the entropy of HLL, so no possible implementation of compressed HLL can match its + space efficiency for a given accuracy. As described in the paper this sketch implements a newly + developed ICON estimator algorithm that survives unioning operations, another + well-known estimator, the + Historical Inverse Probability (HIP) estimator + does not. + The update speed performance of this sketch is quite fast and is comparable to the speed of HLL. + The unioning (merging) capability of this sketch also allows for merging of sketches with + different configurations of K. + +

    For additional security this sketch can be configured with a user-specified hash seed.

    +
    +
    Author:
    +
    Lee Rhodes, Kevin Lang
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      static intDEFAULT_LG_K +
      The default Log_base2 of K
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      CpcSketch() +
      Constructor with default log_base2 of k
      +
      CpcSketch​(int lgK) +
      Constructor with log_base2 of k.
      +
      CpcSketch​(int lgK, + long seed) +
      Constructor with log_base2 of k and seed.
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      doublegetEstimate() +
      Returns the best estimate of the cardinality of the sketch.
      +
      static FamilygetFamily() +
      Return the DataSketches identifier for this CPC family of sketches.
      +
      intgetLgK() +
      Return the parameter LgK.
      +
      doublegetLowerBound​(int kappa) +
      Returns the best estimate of the lower bound of the confidence interval given kappa, + the number of standard deviations from the mean.
      +
      static intgetMaxSerializedBytes​(int lgK) +
      The actual size of a compressed CPC sketch has a small random variance, but the following + empirically measured size should be large enough for at least 99.9 percent of sketches.
      +
      doublegetUpperBound​(int kappa) +
      Returns the best estimate of the upper bound of the confidence interval given kappa, + the number of standard deviations from the mean.
      +
      static CpcSketchheapify​(byte[] byteArray) +
      Return the given byte array as a CpcSketch on the Java heap using the DEFAULT_UPDATE_SEED.
      +
      static CpcSketchheapify​(byte[] byteArray, + long seed) +
      Return the given byte array as a CpcSketch on the Java heap.
      +
      static CpcSketchheapify​(org.apache.datasketches.memory.Memory mem) +
      Return the given Memory as a CpcSketch on the Java heap using the DEFAULT_UPDATE_SEED.
      +
      static CpcSketchheapify​(org.apache.datasketches.memory.Memory mem, + long seed) +
      Return the given Memory as a CpcSketch on the Java heap.
      +
      booleanisEmpty() +
      Return true if this sketch is empty
      +
      voidreset() +
      Resets this sketch to empty but retains the original LgK and Seed.
      +
      byte[]toByteArray() +
      Return this sketch as a compressed byte array.
      +
      StringtoString() +
      Return a human-readable string summary of this sketch
      +
      StringtoString​(boolean detail) +
      Return a human-readable string summary of this sketch
      +
      static StringtoString​(byte[] byteArr, + boolean detail) +
      Returns a human readable string of the preamble of a byte array image of a CpcSketch.
      +
      static StringtoString​(org.apache.datasketches.memory.Memory mem, + boolean detail) +
      Returns a human readable string of the preamble of a Memory image of a CpcSketch.
      +
      voidupdate​(byte[] data) +
      Present the given byte array as a potential unique item.
      +
      voidupdate​(char[] data) +
      Present the given char array as a potential unique item.
      +
      voidupdate​(double datum) +
      Present the given double (or float) datum as a potential unique item.
      +
      voidupdate​(int[] data) +
      Present the given integer array as a potential unique item.
      +
      voidupdate​(long datum) +
      Present the given long as a potential unique item.
      +
      voidupdate​(long[] data) +
      Present the given long array as a potential unique item.
      +
      voidupdate​(String datum) +
      Present the given String as a potential unique item.
      +
      booleanvalidate() +
      Convience function that this Sketch is valid.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        DEFAULT_LG_K

        +
        public static final int DEFAULT_LG_K
        +
        The default Log_base2 of K
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CpcSketch

        +
        public CpcSketch()
        +
        Constructor with default log_base2 of k
        +
      • +
      + + + +
        +
      • +

        CpcSketch

        +
        public CpcSketch​(int lgK)
        +
        Constructor with log_base2 of k.
        +
        +
        Parameters:
        +
        lgK - the given log_base2 of k
        +
        +
      • +
      + + + +
        +
      • +

        CpcSketch

        +
        public CpcSketch​(int lgK,
        +                 long seed)
        +
        Constructor with log_base2 of k and seed.
        +
        +
        Parameters:
        +
        lgK - the given log_base2 of k
        +
        seed - the given seed
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getEstimate

        +
        public double getEstimate()
        +
        Returns the best estimate of the cardinality of the sketch.
        +
        +
        Returns:
        +
        the best estimate of the cardinality of the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getFamily

        +
        public static Family getFamily()
        +
        Return the DataSketches identifier for this CPC family of sketches.
        +
        +
        Returns:
        +
        the DataSketches identifier for this CPC family of sketches.
        +
        +
      • +
      + + + +
        +
      • +

        getLgK

        +
        public int getLgK()
        +
        Return the parameter LgK.
        +
        +
        Returns:
        +
        the parameter LgK.
        +
        +
      • +
      + + + +
        +
      • +

        getLowerBound

        +
        public double getLowerBound​(int kappa)
        +
        Returns the best estimate of the lower bound of the confidence interval given kappa, + the number of standard deviations from the mean.
        +
        +
        Parameters:
        +
        kappa - the given number of standard deviations from the mean: 1, 2 or 3.
        +
        Returns:
        +
        the best estimate of the lower bound of the confidence interval given kappa.
        +
        +
      • +
      + + + +
        +
      • +

        getMaxSerializedBytes

        +
        public static int getMaxSerializedBytes​(int lgK)
        +
        The actual size of a compressed CPC sketch has a small random variance, but the following + empirically measured size should be large enough for at least 99.9 percent of sketches. + +

        For small values of n the size can be much smaller.

        +
        +
        Parameters:
        +
        lgK - the given value of lgK.
        +
        Returns:
        +
        the estimated maximum compressed serialized size of a sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getUpperBound

        +
        public double getUpperBound​(int kappa)
        +
        Returns the best estimate of the upper bound of the confidence interval given kappa, + the number of standard deviations from the mean.
        +
        +
        Parameters:
        +
        kappa - the given number of standard deviations from the mean: 1, 2 or 3.
        +
        Returns:
        +
        the best estimate of the upper bound of the confidence interval given kappa.
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static CpcSketch heapify​(org.apache.datasketches.memory.Memory mem)
        +
        Return the given Memory as a CpcSketch on the Java heap using the DEFAULT_UPDATE_SEED.
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        Returns:
        +
        the given Memory as a CpcSketch on the Java heap.
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static CpcSketch heapify​(byte[] byteArray)
        +
        Return the given byte array as a CpcSketch on the Java heap using the DEFAULT_UPDATE_SEED.
        +
        +
        Parameters:
        +
        byteArray - the given byte array
        +
        Returns:
        +
        the given byte array as a CpcSketch on the Java heap.
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static CpcSketch heapify​(org.apache.datasketches.memory.Memory mem,
        +                                long seed)
        +
        Return the given Memory as a CpcSketch on the Java heap.
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        seed - the seed used to create the original sketch from which the Memory was derived.
        +
        Returns:
        +
        the given Memory as a CpcSketch on the Java heap.
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static CpcSketch heapify​(byte[] byteArray,
        +                                long seed)
        +
        Return the given byte array as a CpcSketch on the Java heap.
        +
        +
        Parameters:
        +
        byteArray - the given byte array
        +
        seed - the seed used to create the original sketch from which the byte array was derived.
        +
        Returns:
        +
        the given byte array as a CpcSketch on the Java heap.
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        Return true if this sketch is empty
        +
        +
        Returns:
        +
        true if this sketch is empty
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public final void reset()
        +
        Resets this sketch to empty but retains the original LgK and Seed.
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray()
        +
        Return this sketch as a compressed byte array.
        +
        +
        Returns:
        +
        this sketch as a compressed byte array.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(long datum)
        +
        Present the given long as a potential unique item.
        +
        +
        Parameters:
        +
        datum - The given long datum.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(double datum)
        +
        Present the given double (or float) datum as a potential unique item. + The double will be converted to a long using Double.doubleToLongBits(datum), + which normalizes all NaN values to a single NaN representation. + Plus and minus zero will be normalized to plus zero. + The special floating-point values NaN and +/- Infinity are treated as distinct.
        +
        +
        Parameters:
        +
        datum - The given double datum.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(String datum)
        +
        Present the given String as a potential unique item. + The string is converted to a byte array using UTF8 encoding. + If the string is null or empty no update attempt is made and the method returns. + +

        Note: About 2X faster performance can be obtained by first converting the String to a + char[] and updating the sketch with that. This bypasses the complexity of the Java UTF_8 + encoding. This, of course, will not produce the same internal hash values as updating directly + with a String. So be consistent! Unioning two sketches, one fed with strings and the other + fed with char[] will be meaningless. +

        +
        +
        Parameters:
        +
        datum - The given String.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(byte[] data)
        +
        Present the given byte array as a potential unique item. + If the byte array is null or empty no update attempt is made and the method returns.
        +
        +
        Parameters:
        +
        data - The given byte array.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(char[] data)
        +
        Present the given char array as a potential unique item. + If the char array is null or empty no update attempt is made and the method returns. + +

        Note: this will not produce the same output hash values as the update(String) + method but will be a little faster as it avoids the complexity of the UTF8 encoding.

        +
        +
        Parameters:
        +
        data - The given char array.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(int[] data)
        +
        Present the given integer array as a potential unique item. + If the integer array is null or empty no update attempt is made and the method returns.
        +
        +
        Parameters:
        +
        data - The given int array.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(long[] data)
        +
        Present the given long array as a potential unique item. + If the long array is null or empty no update attempt is made and the method returns.
        +
        +
        Parameters:
        +
        data - The given long array.
        +
        +
      • +
      + + + +
        +
      • +

        validate

        +
        public boolean validate()
        +
        Convience function that this Sketch is valid. This is a troubleshooting tool + for sketches that have been heapified from serialized images. + +

        If you are starting with a serialized image as a byte array, first heapify + the byte array to a sketch, which performs a number of checks. Then use this + function as one additional check on the sketch.

        +
        +
        Returns:
        +
        true if this sketch is validated.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Return a human-readable string summary of this sketch
        +
        +
        Overrides:
        +
        toString in class Object
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString​(boolean detail)
        +
        Return a human-readable string summary of this sketch
        +
        +
        Parameters:
        +
        detail - include data detail
        +
        Returns:
        +
        a human-readable string summary of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString​(byte[] byteArr,
        +                              boolean detail)
        +
        Returns a human readable string of the preamble of a byte array image of a CpcSketch.
        +
        +
        Parameters:
        +
        byteArr - the given byte array
        +
        detail - if true, a dump of the compressed window and surprising value streams will be + included.
        +
        Returns:
        +
        a human readable string of the preamble of a byte array image of a CpcSketch.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString​(org.apache.datasketches.memory.Memory mem,
        +                              boolean detail)
        +
        Returns a human readable string of the preamble of a Memory image of a CpcSketch.
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        detail - if true, a dump of the compressed window and surprising value streams will be + included.
        +
        Returns:
        +
        a human readable string of the preamble of a Memory image of a CpcSketch.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/cpc/CpcUnion.html b/docs/5.0.2/org/apache/datasketches/cpc/CpcUnion.html new file mode 100644 index 000000000..b80fd72b2 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/cpc/CpcUnion.html @@ -0,0 +1,430 @@ + + + + + +CpcUnion (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class CpcUnion

+
+
+ +
+
    +
  • +
    +
    public class CpcUnion
    +extends Object
    +
    The union (merge) operation for the CPC sketches.
    +
    +
    Author:
    +
    Lee Rhodes, Kevin Lang
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CpcUnion

        +
        public CpcUnion()
        +
        Construct this unioning object with the default LgK and the default update seed.
        +
      • +
      + + + +
        +
      • +

        CpcUnion

        +
        public CpcUnion​(int lgK)
        +
        Construct this unioning object with LgK and the default update seed.
        +
        +
        Parameters:
        +
        lgK - The given log2 of K.
        +
        +
      • +
      + + + +
        +
      • +

        CpcUnion

        +
        public CpcUnion​(int lgK,
        +                long seed)
        +
        Construct this unioning object with LgK and a given seed.
        +
        +
        Parameters:
        +
        lgK - The given log2 of K.
        +
        seed - The given seed.
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        update

        +
        public void update​(CpcSketch sketch)
        +
        Update this union with a CpcSketch.
        +
        +
        Parameters:
        +
        sketch - the given CpcSketch.
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public CpcSketch getResult()
        +
        Returns the result of union operations as a CPC sketch.
        +
        +
        Returns:
        +
        the result of union operations as a CPC sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getLgK

        +
        public int getLgK()
        +
        Returns the current value of Log_base2 of K. Note that due to merging with source sketches that + may have a lower value of LgK, this value can be less than what the union object was configured + with.
        +
        +
        Returns:
        +
        the current value of Log_base2 of K.
        +
        +
      • +
      + + + +
        +
      • +

        getFamily

        +
        public static Family getFamily()
        +
        Return the DataSketches identifier for this CPC family of sketches.
        +
        +
        Returns:
        +
        the DataSketches identifier for this CPC family of sketches.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/cpc/CpcWrapper.html b/docs/5.0.2/org/apache/datasketches/cpc/CpcWrapper.html new file mode 100644 index 000000000..ca7431827 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/cpc/CpcWrapper.html @@ -0,0 +1,439 @@ + + + + + +CpcWrapper (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class CpcWrapper

+
+
+ +
+
    +
  • +
    +
    public final class CpcWrapper
    +extends Object
    +
    This provides a read-only view of a serialized image of a CpcSketch, which can be + on-heap or off-heap represented as a Memory object, or on-heap represented as a byte array.
    +
    +
    Author:
    +
    Lee Rhodes, Kevin Lang
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      CpcWrapper​(byte[] byteArray) +
      Construct a read-only view of the given byte array that contains a CpcSketch.
      +
      CpcWrapper​(org.apache.datasketches.memory.Memory mem) +
      Construct a read-only view of the given Memory that contains a CpcSketch
      +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CpcWrapper

        +
        public CpcWrapper​(org.apache.datasketches.memory.Memory mem)
        +
        Construct a read-only view of the given Memory that contains a CpcSketch
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        +
      • +
      + + + +
        +
      • +

        CpcWrapper

        +
        public CpcWrapper​(byte[] byteArray)
        +
        Construct a read-only view of the given byte array that contains a CpcSketch.
        +
        +
        Parameters:
        +
        byteArray - the given byte array
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getEstimate

        +
        public double getEstimate()
        +
        Returns the best estimate of the cardinality of the sketch.
        +
        +
        Returns:
        +
        the best estimate of the cardinality of the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getFamily

        +
        public static Family getFamily()
        +
        Return the DataSketches identifier for this CPC family of sketches.
        +
        +
        Returns:
        +
        the DataSketches identifier for this CPC family of sketches.
        +
        +
      • +
      + + + +
        +
      • +

        getLgK

        +
        public int getLgK()
        +
        Returns the configured Log_base2 of K of this sketch.
        +
        +
        Returns:
        +
        the configured Log_base2 of K of this sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getLowerBound

        +
        public double getLowerBound​(int kappa)
        +
        Returns the best estimate of the lower bound of the confidence interval given kappa, + the number of standard deviations from the mean.
        +
        +
        Parameters:
        +
        kappa - the given number of standard deviations from the mean: 1, 2 or 3.
        +
        Returns:
        +
        the best estimate of the lower bound of the confidence interval given kappa.
        +
        +
      • +
      + + + +
        +
      • +

        getUpperBound

        +
        public double getUpperBound​(int kappa)
        +
        Returns the best estimate of the upper bound of the confidence interval given kappa, + the number of standard deviations from the mean.
        +
        +
        Parameters:
        +
        kappa - the given number of standard deviations from the mean: 1, 2 or 3.
        +
        Returns:
        +
        the best estimate of the upper bound of the confidence interval given kappa.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/cpc/MergingValidation.html b/docs/5.0.2/org/apache/datasketches/cpc/MergingValidation.html new file mode 100644 index 000000000..7764fab5f --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/cpc/MergingValidation.html @@ -0,0 +1,337 @@ + + + + + +MergingValidation (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class MergingValidation

+
+
+ +
+
    +
  • +
    +
    public class MergingValidation
    +extends Object
    +
    This code is used both by unit tests, for short running tests, + and by the characterization repository for longer running, more exhaustive testing. To be + accessible for both, this code is part of the main hierarchy. It is not used during normal + production runtime.
    +
    +
    Author:
    +
    Lee Rhodes, Kevin Lang
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        MergingValidation

        +
        public MergingValidation​(int lgMinK,
        +                         int lgMaxK,
        +                         int lgMulK,
        +                         int uPPO,
        +                         int incLgK,
        +                         PrintStream pS,
        +                         PrintWriter pW)
        +
        +
        Parameters:
        +
        lgMinK - lgMinK
        +
        lgMaxK - lgMaxK
        +
        lgMulK - lgMulK
        +
        uPPO - uPPO
        +
        incLgK - incLgK
        +
        pS - pS
        +
        pW - pW
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        start

        +
        public void start()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/cpc/QuickMergingValidation.html b/docs/5.0.2/org/apache/datasketches/cpc/QuickMergingValidation.html new file mode 100644 index 000000000..2b8b249d8 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/cpc/QuickMergingValidation.html @@ -0,0 +1,334 @@ + + + + + +QuickMergingValidation (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class QuickMergingValidation

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.cpc.QuickMergingValidation
    • +
    +
  • +
+
+
    +
  • +
    +
    public class QuickMergingValidation
    +extends Object
    +
    This code is used both by unit tests, for short running tests, + and by the characterization repository for longer running, more exhaustive testing. To be + accessible for both, this code is part of the main hierarchy. It is not used during normal + production runtime. + +

    This test of merging is the equal K case and is less exhaustive than TestAlltest + but is more practical for large values of K.

    +
    +
    Author:
    +
    Lee Rhodes, Kevin Lang
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        QuickMergingValidation

        +
        public QuickMergingValidation​(int lgMinK,
        +                              int lgMaxK,
        +                              int incLgK,
        +                              PrintStream ps,
        +                              PrintWriter pw)
        +
        +
        Parameters:
        +
        lgMinK - lgMinK
        +
        lgMaxK - lgMaxK
        +
        incLgK - incLgK
        +
        ps - ps
        +
        pw - pw
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        start

        +
        public void start()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/cpc/StreamingValidation.html b/docs/5.0.2/org/apache/datasketches/cpc/StreamingValidation.html new file mode 100644 index 000000000..4fd6b5230 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/cpc/StreamingValidation.html @@ -0,0 +1,334 @@ + + + + + +StreamingValidation (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class StreamingValidation

+
+
+ +
+
    +
  • +
    +
    public class StreamingValidation
    +extends Object
    +
    This code is used both by unit tests, for short running tests, + and by the characterization repository for longer running, more exhaustive testing. To be + accessible for both, this code is part of the main hierarchy. It is not used during normal + production runtime.
    +
    +
    Author:
    +
    Lee Rhodes, Kevin Lang
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        StreamingValidation

        +
        public StreamingValidation​(int lgMinK,
        +                           int lgMaxK,
        +                           int trials,
        +                           int ppoN,
        +                           PrintStream pS,
        +                           PrintWriter pW)
        +
        +
        Parameters:
        +
        lgMinK - lgMinK
        +
        lgMaxK - lgMaxK
        +
        trials - trials
        +
        ppoN - ppoN
        +
        pS - pS
        +
        pW - pW
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        start

        +
        public void start()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/cpc/TestUtil.html b/docs/5.0.2/org/apache/datasketches/cpc/TestUtil.html new file mode 100644 index 000000000..2c44cdebb --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/cpc/TestUtil.html @@ -0,0 +1,273 @@ + + + + + +TestUtil (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class TestUtil

+
+
+ +
+
    +
  • +
    +
    public class TestUtil
    +extends Object
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TestUtil

        +
        public TestUtil()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/cpc/class-use/CompressionCharacterization.html b/docs/5.0.2/org/apache/datasketches/cpc/class-use/CompressionCharacterization.html new file mode 100644 index 000000000..974159df6 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/cpc/class-use/CompressionCharacterization.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.cpc.CompressionCharacterization (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.cpc.CompressionCharacterization

+
+
No usage of org.apache.datasketches.cpc.CompressionCharacterization
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/cpc/class-use/CpcSketch.html b/docs/5.0.2/org/apache/datasketches/cpc/class-use/CpcSketch.html new file mode 100644 index 000000000..f9ba8ef11 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/cpc/class-use/CpcSketch.html @@ -0,0 +1,244 @@ + + + + + +Uses of Class org.apache.datasketches.cpc.CpcSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.cpc.CpcSketch

+
+
+
    +
  • + + + + + + + + + + + + +
    Packages that use CpcSketch 
    PackageDescription
    org.apache.datasketches.cpc +
    Compressed Probabilistic Counting sketch family
    +
    +
  • +
  • +
      +
    • +
      + + +

      Uses of CpcSketch in org.apache.datasketches.cpc

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.cpc that return CpcSketch 
      Modifier and TypeMethodDescription
      CpcSketchCpcUnion.getResult() +
      Returns the result of union operations as a CPC sketch.
      +
      static CpcSketchCpcSketch.heapify​(byte[] byteArray) +
      Return the given byte array as a CpcSketch on the Java heap using the DEFAULT_UPDATE_SEED.
      +
      static CpcSketchCpcSketch.heapify​(byte[] byteArray, + long seed) +
      Return the given byte array as a CpcSketch on the Java heap.
      +
      static CpcSketchCpcSketch.heapify​(org.apache.datasketches.memory.Memory mem) +
      Return the given Memory as a CpcSketch on the Java heap using the DEFAULT_UPDATE_SEED.
      +
      static CpcSketchCpcSketch.heapify​(org.apache.datasketches.memory.Memory mem, + long seed) +
      Return the given Memory as a CpcSketch on the Java heap.
      +
      + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.cpc with parameters of type CpcSketch 
      Modifier and TypeMethodDescription
      voidCpcUnion.update​(CpcSketch sketch) +
      Update this union with a CpcSketch.
      +
      +
      +
    • +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/cpc/class-use/CpcUnion.html b/docs/5.0.2/org/apache/datasketches/cpc/class-use/CpcUnion.html new file mode 100644 index 000000000..bb087f245 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/cpc/class-use/CpcUnion.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.cpc.CpcUnion (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.cpc.CpcUnion

+
+
No usage of org.apache.datasketches.cpc.CpcUnion
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/cpc/class-use/CpcWrapper.html b/docs/5.0.2/org/apache/datasketches/cpc/class-use/CpcWrapper.html new file mode 100644 index 000000000..e0e28885b --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/cpc/class-use/CpcWrapper.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.cpc.CpcWrapper (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.cpc.CpcWrapper

+
+
No usage of org.apache.datasketches.cpc.CpcWrapper
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/cpc/class-use/MergingValidation.html b/docs/5.0.2/org/apache/datasketches/cpc/class-use/MergingValidation.html new file mode 100644 index 000000000..24a775195 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/cpc/class-use/MergingValidation.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.cpc.MergingValidation (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.cpc.MergingValidation

+
+
No usage of org.apache.datasketches.cpc.MergingValidation
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/cpc/class-use/QuickMergingValidation.html b/docs/5.0.2/org/apache/datasketches/cpc/class-use/QuickMergingValidation.html new file mode 100644 index 000000000..2941364af --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/cpc/class-use/QuickMergingValidation.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.cpc.QuickMergingValidation (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.cpc.QuickMergingValidation

+
+
No usage of org.apache.datasketches.cpc.QuickMergingValidation
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/cpc/class-use/StreamingValidation.html b/docs/5.0.2/org/apache/datasketches/cpc/class-use/StreamingValidation.html new file mode 100644 index 000000000..f74507d47 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/cpc/class-use/StreamingValidation.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.cpc.StreamingValidation (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.cpc.StreamingValidation

+
+
No usage of org.apache.datasketches.cpc.StreamingValidation
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/cpc/class-use/TestUtil.html b/docs/5.0.2/org/apache/datasketches/cpc/class-use/TestUtil.html new file mode 100644 index 000000000..b9b40292f --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/cpc/class-use/TestUtil.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.cpc.TestUtil (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.cpc.TestUtil

+
+
No usage of org.apache.datasketches.cpc.TestUtil
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/cpc/package-summary.html b/docs/5.0.2/org/apache/datasketches/cpc/package-summary.html new file mode 100644 index 000000000..b2e16c82a --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/cpc/package-summary.html @@ -0,0 +1,223 @@ + + + + + +org.apache.datasketches.cpc (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches.cpc

+
+
+
+ + +
Compressed Probabilistic Counting sketch family
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    CompressionCharacterization +
    This code is used both by unit tests, for short running tests, + and by the characterization repository for longer running, more exhaustive testing.
    +
    CpcSketch +
    This is a unique-counting sketch that implements the + Compressed Probabilistic Counting (CPC, a.k.a FM85) algorithms developed by Kevin Lang in + his paper + Back to the Future: an Even More Nearly + Optimal Cardinality Estimation Algorithm.
    +
    CpcUnion +
    The union (merge) operation for the CPC sketches.
    +
    CpcWrapper +
    This provides a read-only view of a serialized image of a CpcSketch, which can be + on-heap or off-heap represented as a Memory object, or on-heap represented as a byte array.
    +
    MergingValidation +
    This code is used both by unit tests, for short running tests, + and by the characterization repository for longer running, more exhaustive testing.
    +
    QuickMergingValidation +
    This code is used both by unit tests, for short running tests, + and by the characterization repository for longer running, more exhaustive testing.
    +
    StreamingValidation +
    This code is used both by unit tests, for short running tests, + and by the characterization repository for longer running, more exhaustive testing.
    +
    TestUtil 
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/cpc/package-tree.html b/docs/5.0.2/org/apache/datasketches/cpc/package-tree.html new file mode 100644 index 000000000..0792a45a9 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/cpc/package-tree.html @@ -0,0 +1,171 @@ + + + + + +org.apache.datasketches.cpc Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches.cpc

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/cpc/package-use.html b/docs/5.0.2/org/apache/datasketches/cpc/package-use.html new file mode 100644 index 000000000..fe6b14430 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/cpc/package-use.html @@ -0,0 +1,192 @@ + + + + + +Uses of Package org.apache.datasketches.cpc (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches.cpc

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/fdt/FdtSketch.html b/docs/5.0.2/org/apache/datasketches/fdt/FdtSketch.html new file mode 100644 index 000000000..ea2be4cfa --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/fdt/FdtSketch.html @@ -0,0 +1,830 @@ + + + + + +FdtSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class FdtSketch

+
+
+ +
+
    +
  • +
    +
    public final class FdtSketch
    +extends ArrayOfStringsSketch
    +
    A Frequent Distinct Tuples sketch. + +

    Suppose our data is a stream of pairs {IP address, User ID} and we want to identify the + IP addresses that have the most distinct User IDs. Or conversely, we would like to identify + the User IDs that have the most distinct IP addresses. This is a common challenge in the + analysis of big data and the FDT sketch helps solve this problem using probabilistic techniques. + +

    More generally, given a multiset of tuples with dimensions {d1,d2, d3, ..., dN}, + and a primary subset of dimensions M < N, our task is to identify the combinations of + M subset dimensions that have the most frequent number of distinct combinations of + the N-M non-primary dimensions. + +

    Please refer to the web page + + https://datasketches.apache.org/docs/Frequency/FrequentDistinctTuplesSketch.html for a more + complete discussion about this sketch.

    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        FdtSketch

        +
        public FdtSketch​(int lgK)
        +
        Create new instance of Frequent Distinct Tuples sketch with the given + Log-base2 of required nominal entries.
        +
        +
        Parameters:
        +
        lgK - Log-base2 of required nominal entries.
        +
        +
      • +
      + + + +
        +
      • +

        FdtSketch

        +
        public FdtSketch​(double threshold,
        +                 double rse)
        +
        Create a new instance of Frequent Distinct Tuples sketch with a size determined by the given + threshold and rse.
        +
        +
        Parameters:
        +
        threshold - : the fraction, between zero and 1.0, of the total distinct stream length + that defines a "Frequent" (or heavy) item.
        +
        rse - the maximum Relative Standard Error for the estimate of the distinct population of a + reported tuple (selected with a primary key) at the threshold.
        +
        +
      • +
      + + + +
        +
      • +

        FdtSketch

        +
        public FdtSketch​(FdtSketch sketch)
        +
        Copy Constructor
        +
        +
        Parameters:
        +
        sketch - the sketch to copy
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        update

        +
        public void update​(String[] tuple)
        +
        Update the sketch with the given string array tuple.
        +
        +
        Parameters:
        +
        tuple - the given string array tuple.
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public List<Group> getResult​(int[] priKeyIndices,
        +                             int limit,
        +                             int numStdDev,
        +                             char sep)
        +
        Returns an ordered List of Groups of the most frequent distinct population of subset tuples + represented by the count of entries of each group.
        +
        +
        Parameters:
        +
        priKeyIndices - these indices define the dimensions used for the Primary Keys.
        +
        limit - the maximum number of groups to return. If this value is ≤ 0, all + groups will be returned.
        +
        numStdDev - the number of standard deviations for the upper and lower error bounds, + this value is an integer and must be one of 1, 2, or 3. + See Number of Standard Deviations
        +
        sep - the separator character
        +
        Returns:
        +
        an ordered List of Groups of the most frequent distinct population of subset tuples + represented by the count of entries of each group.
        +
        +
      • +
      + + + +
        +
      • +

        getPostProcessor

        +
        public PostProcessor getPostProcessor()
        +
        Returns the PostProcessor that enables multiple queries against the sketch results. + This assumes the default Group and the default separator character '|'.
        +
        +
        Returns:
        +
        the PostProcessor
        +
        +
      • +
      + + + +
        +
      • +

        getPostProcessor

        +
        public PostProcessor getPostProcessor​(Group group,
        +                                      char sep)
        +
        Returns the PostProcessor that enables multiple queries against the sketch results.
        +
        +
        Parameters:
        +
        group - the Group class to use during post processing.
        +
        sep - the separator character.
        +
        Returns:
        +
        the PostProcessor
        +
        +
      • +
      + + + +
        +
      • +

        getRetainedEntries

        +
        public int getRetainedEntries()
        +
        +
        Specified by:
        +
        getRetainedEntries in class Sketch<S extends Summary>
        +
        Returns:
        +
        number of retained entries
        +
        +
      • +
      + + + +
        +
      • +

        getCountLessThanThetaLong

        +
        public int getCountLessThanThetaLong​(long thetaLong)
        +
        Description copied from class: Sketch
        +
        Gets the number of hash values less than the given theta expressed as a long.
        +
        +
        Specified by:
        +
        getCountLessThanThetaLong in class Sketch<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

        +
        public ResizeFactor 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

        +
        public CompactSketch<S> compact()
        +
        Converts the current state of the sketch into a compact sketch
        +
        +
        Specified by:
        +
        compact in class Sketch<S extends Summary>
        +
        Returns:
        +
        compact sketch
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        @Deprecated
        +public 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.
        +
        +
        This serializes an UpdatableSketch (QuickSelectSketch).
        +
        +
        Specified by:
        +
        toByteArray in class Sketch<S extends Summary>
        +
        Returns:
        +
        serialized representation of an UpdatableSketch (QuickSelectSketch).
        +
        +
      • +
      + + + + + +
        +
      • +

        insertSummary

        +
        protected void insertSummary​(int index,
        +                             S summary)
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/fdt/Group.html b/docs/5.0.2/org/apache/datasketches/fdt/Group.html new file mode 100644 index 000000000..a5afd88e3 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/fdt/Group.html @@ -0,0 +1,566 @@ + + + + + +Group (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Group

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Comparable<Group>
    +
    +
    +
    public class Group
    +extends Object
    +implements Comparable<Group>
    +
    Defines a Group from a Frequent Distinct Tuple query. This class is called internally during + post processing and is not intended to be called by the user.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Group

        +
        public Group()
        +
        Construct an empty Group
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        init

        +
        public Group init​(String priKey,
        +                  int count,
        +                  double estimate,
        +                  double ub,
        +                  double lb,
        +                  double fraction,
        +                  double rse)
        +
        Specifies the parameters to be listed as columns
        +
        +
        Parameters:
        +
        priKey - the primary key of the FDT sketch
        +
        count - the number of retained rows associated with this group
        +
        estimate - the estimate of the original population associated with this group
        +
        ub - the upper bound of the estimate
        +
        lb - the lower bound of the estimate
        +
        fraction - the fraction of all retained rows of the sketch associated with this group
        +
        rse - the estimated Relative Standard Error for this group.
        +
        Returns:
        +
        return this
        +
        +
      • +
      + + + +
        +
      • +

        getPrimaryKey

        +
        public String getPrimaryKey()
        +
        +
        Returns:
        +
        priKey of type T
        +
        +
      • +
      + + + +
        +
      • +

        getCount

        +
        public int getCount()
        +
        +
        Returns:
        +
        the count
        +
        +
      • +
      + + + +
        +
      • +

        getEstimate

        +
        public double getEstimate()
        +
        +
        Returns:
        +
        the estimate
        +
        +
      • +
      + + + +
        +
      • +

        getUpperBound

        +
        public double getUpperBound()
        +
        +
        Returns:
        +
        the upper bound
        +
        +
      • +
      + + + +
        +
      • +

        getLowerBound

        +
        public double getLowerBound()
        +
        +
        Returns:
        +
        the lower bound
        +
        +
      • +
      + + + +
        +
      • +

        getFraction

        +
        public double getFraction()
        +
        +
        Returns:
        +
        the fraction for this group
        +
        +
      • +
      + + + +
        +
      • +

        getRse

        +
        public double getRse()
        +
        +
        Returns:
        +
        the RSE
        +
        +
      • +
      + + + +
        +
      • +

        getHeader

        +
        public String getHeader()
        +
        +
        Returns:
        +
        the descriptive header
        +
        +
      • +
      + + + + + + + +
        +
      • +

        compareTo

        +
        public int compareTo​(Group that)
        +
        +
        Specified by:
        +
        compareTo in interface Comparable<Group>
        +
        Parameters:
        +
        that - The Group to compare to
        +
        +
      • +
      + + + +
        +
      • +

        equals

        +
        public boolean equals​(Object that)
        +
        +
        Overrides:
        +
        equals in class Object
        +
        +
      • +
      + + + +
        +
      • +

        hashCode

        +
        public int hashCode()
        +
        +
        Overrides:
        +
        hashCode in class Object
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/fdt/PostProcessor.html b/docs/5.0.2/org/apache/datasketches/fdt/PostProcessor.html new file mode 100644 index 000000000..604dcfbe0 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/fdt/PostProcessor.html @@ -0,0 +1,365 @@ + + + + + +PostProcessor (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class PostProcessor

+
+
+ +
+
    +
  • +
    +
    public class PostProcessor
    +extends Object
    +
    This processes the contents of a FDT sketch to extract the + primary keys with the most frequent unique combinations of the non-primary dimensions. + The source sketch is not modified.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PostProcessor

        +
        public PostProcessor​(FdtSketch sketch,
        +                     Group group,
        +                     char sep)
        +
        Construct with a populated FdtSketch
        +
        +
        Parameters:
        +
        sketch - the given sketch to query.
        +
        group - the Group
        +
        sep - the separator character
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getGroupCount

        +
        public int getGroupCount()
        +
        Returns the number of groups in the final sketch.
        +
        +
        Returns:
        +
        the number of groups in the final sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getGroupList

        +
        public List<Group> getGroupList​(int[] priKeyIndices,
        +                                int numStdDev,
        +                                int limit)
        +
        Return the most frequent Groups associated with Primary Keys based on the size of the groups.
        +
        +
        Parameters:
        +
        priKeyIndices - the indices of the primary dimensions
        +
        numStdDev - the number of standard deviations for the error bounds, this value is an + integer and must be one of 1, 2, or 3. + See Number of Standard Deviations
        +
        limit - the maximum number of rows to return. If ≤ 0, all rows will be returned.
        +
        Returns:
        +
        the most frequent Groups associated with Primary Keys based on the size of the groups.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/fdt/class-use/FdtSketch.html b/docs/5.0.2/org/apache/datasketches/fdt/class-use/FdtSketch.html new file mode 100644 index 000000000..1a87ef2ad --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/fdt/class-use/FdtSketch.html @@ -0,0 +1,218 @@ + + + + + +Uses of Class org.apache.datasketches.fdt.FdtSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.fdt.FdtSketch

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/fdt/class-use/Group.html b/docs/5.0.2/org/apache/datasketches/fdt/class-use/Group.html new file mode 100644 index 000000000..742fca423 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/fdt/class-use/Group.html @@ -0,0 +1,273 @@ + + + + + +Uses of Class org.apache.datasketches.fdt.Group (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.fdt.Group

+
+
+
    +
  • + + + + + + + + + + + + +
    Packages that use Group 
    PackageDescription
    org.apache.datasketches.fdt +
    Frequent Distinct Tuples Sketch
    +
    +
  • +
  • +
      +
    • +
      + + +

      Uses of Group in org.apache.datasketches.fdt

      + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.fdt that return Group 
      Modifier and TypeMethodDescription
      GroupGroup.init​(String priKey, + int count, + double estimate, + double ub, + double lb, + double fraction, + double rse) +
      Specifies the parameters to be listed as columns
      +
      + + + + + + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.fdt that return types with arguments of type Group 
      Modifier and TypeMethodDescription
      List<Group>PostProcessor.getGroupList​(int[] priKeyIndices, + int numStdDev, + int limit) +
      Return the most frequent Groups associated with Primary Keys based on the size of the groups.
      +
      List<Group>FdtSketch.getResult​(int[] priKeyIndices, + int limit, + int numStdDev, + char sep) +
      Returns an ordered List of Groups of the most frequent distinct population of subset tuples + represented by the count of entries of each group.
      +
      + + + + + + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.fdt with parameters of type Group 
      Modifier and TypeMethodDescription
      intGroup.compareTo​(Group that) 
      PostProcessorFdtSketch.getPostProcessor​(Group group, + char sep) +
      Returns the PostProcessor that enables multiple queries against the sketch results.
      +
      + + + + + + + + + + + + +
      Constructors in org.apache.datasketches.fdt with parameters of type Group 
      ConstructorDescription
      PostProcessor​(FdtSketch sketch, + Group group, + char sep) +
      Construct with a populated FdtSketch
      +
      +
      +
    • +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/fdt/class-use/PostProcessor.html b/docs/5.0.2/org/apache/datasketches/fdt/class-use/PostProcessor.html new file mode 100644 index 000000000..d0601bbd5 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/fdt/class-use/PostProcessor.html @@ -0,0 +1,205 @@ + + + + + +Uses of Class org.apache.datasketches.fdt.PostProcessor (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.fdt.PostProcessor

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/fdt/package-summary.html b/docs/5.0.2/org/apache/datasketches/fdt/package-summary.html new file mode 100644 index 000000000..c1cd5afb4 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/fdt/package-summary.html @@ -0,0 +1,187 @@ + + + + + +org.apache.datasketches.fdt (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches.fdt

+
+
+
+ + +
Frequent Distinct Tuples Sketch
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    FdtSketch +
    A Frequent Distinct Tuples sketch.
    +
    Group +
    Defines a Group from a Frequent Distinct Tuple query.
    +
    PostProcessor +
    This processes the contents of a FDT sketch to extract the + primary keys with the most frequent unique combinations of the non-primary dimensions.
    +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/fdt/package-tree.html b/docs/5.0.2/org/apache/datasketches/fdt/package-tree.html new file mode 100644 index 000000000..3ae5c8388 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/fdt/package-tree.html @@ -0,0 +1,178 @@ + + + + + +org.apache.datasketches.fdt Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches.fdt

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/fdt/package-use.html b/docs/5.0.2/org/apache/datasketches/fdt/package-use.html new file mode 100644 index 000000000..948b678a5 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/fdt/package-use.html @@ -0,0 +1,201 @@ + + + + + +Uses of Package org.apache.datasketches.fdt (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches.fdt

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/frequencies/ErrorType.html b/docs/5.0.2/org/apache/datasketches/frequencies/ErrorType.html new file mode 100644 index 000000000..9801c2564 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/frequencies/ErrorType.html @@ -0,0 +1,396 @@ + + + + + +ErrorType (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum ErrorType

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Serializable, Comparable<ErrorType>
    +
    +
    +
    public enum ErrorType
    +extends Enum<ErrorType>
    +
    Specifies one of two types of error regions of the statistical classification Confusion Matrix + that can be excluded from a returned sample of Frequent Items.
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        NO_FALSE_POSITIVES

        +
        public static final ErrorType NO_FALSE_POSITIVES
        +
        No Type I error samples will be included in the sample set, + which means all Truly Negative samples will be excluded from the sample set. + However, there may be Type II error samples (False Negatives) + that should have been included that were not. + This is a subset of the NO_FALSE_NEGATIVES ErrorType.
        +
      • +
      + + + +
        +
      • +

        NO_FALSE_NEGATIVES

        +
        public static final ErrorType NO_FALSE_NEGATIVES
        +
        No Type II error samples will be excluded from the sample set, + which means all Truly Positive samples will be included in the sample set. + However, there may be Type I error samples (False Positives) + that were included that should not have been.
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static ErrorType[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (ErrorType c : ErrorType.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static ErrorType valueOf​(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/frequencies/ItemsSketch.Row.html b/docs/5.0.2/org/apache/datasketches/frequencies/ItemsSketch.Row.html new file mode 100644 index 000000000..be92b2c92 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/frequencies/ItemsSketch.Row.html @@ -0,0 +1,458 @@ + + + + + +ItemsSketch.Row (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ItemsSketch.Row<T>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.frequencies.ItemsSketch.Row<T>
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getItem

        +
        public T getItem()
        +
        +
        Returns:
        +
        item of type T
        +
        +
      • +
      + + + +
        +
      • +

        getEstimate

        +
        public long getEstimate()
        +
        +
        Returns:
        +
        the estimate
        +
        +
      • +
      + + + +
        +
      • +

        getUpperBound

        +
        public long getUpperBound()
        +
        +
        Returns:
        +
        the upper bound
        +
        +
      • +
      + + + +
        +
      • +

        getLowerBound

        +
        public long getLowerBound()
        +
        +
        Returns:
        +
        return the lower bound
        +
        +
      • +
      + + + +
        +
      • +

        getRowHeader

        +
        public static String getRowHeader()
        +
        +
        Returns:
        +
        the descriptive row header
        +
        +
      • +
      + + + + + + + +
        +
      • +

        compareTo

        +
        public int compareTo​(ItemsSketch.Row<T> that)
        +
        This compareTo is strictly limited to the Row.getEstimate() value and does not imply any + ordering whatsoever to the other elements of the row: item and upper and lower bounds. + Defined this way, this compareTo will be consistent with hashCode() and equals(Object).
        +
        +
        Specified by:
        +
        compareTo in interface Comparable<T>
        +
        Parameters:
        +
        that - the other row to compare to.
        +
        Returns:
        +
        a negative integer, zero, or a positive integer as this.getEstimate() is less than, + equal to, or greater than that.getEstimate().
        +
        +
      • +
      + + + +
        +
      • +

        hashCode

        +
        public int hashCode()
        +
        This hashCode is computed only from the Row.getEstimate() value. + Defined this way, this hashCode will be consistent with equals(Object):
        + If (x.equals(y)) implies: x.hashCode() == y.hashCode().
        + If (!x.equals(y)) does NOT imply: x.hashCode() != y.hashCode().
        +
        +
        Overrides:
        +
        hashCode in class Object
        +
        Returns:
        +
        the hashCode computed from getEstimate().
        +
        +
      • +
      + + + +
        +
      • +

        equals

        +
        public boolean equals​(Object obj)
        +
        This equals is computed only from the Row.getEstimate() value and does not imply equality + of the other items within the row: item and upper and lower bounds. + Defined this way, this equals will be consistent with compareTo(Row).
        +
        +
        Overrides:
        +
        equals in class Object
        +
        Parameters:
        +
        obj - the other row to determine equality with.
        +
        Returns:
        +
        true if this.getEstimate() equals ((Row<T>)obj).getEstimate().
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/frequencies/ItemsSketch.html b/docs/5.0.2/org/apache/datasketches/frequencies/ItemsSketch.html new file mode 100644 index 000000000..a4b5df74c --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/frequencies/ItemsSketch.html @@ -0,0 +1,964 @@ + + + + + +ItemsSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ItemsSketch<T>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.frequencies.ItemsSketch<T>
    • +
    +
  • +
+
+
    +
  • +
    +
    Type Parameters:
    +
    T - The type of item to be tracked by this sketch
    +
    +
    +
    public class ItemsSketch<T>
    +extends Object
    +

    This sketch is useful for tracking approximate frequencies of items of type <T> + with optional associated counts (<T> item, long count) that are members of a + multiset of such items. The true frequency of an item is defined to be the sum of associated + counts.

    + +

    This implementation provides the following capabilities:

    +
      +
    • Estimate the frequency of an item.
    • +
    • Return upper and lower bounds of any item, such that the true frequency is always + between the upper and lower bounds.
    • +
    • Return a global maximum error that holds for all items in the stream.
    • +
    • Return an array of frequent items that qualify either a NO_FALSE_POSITIVES or a + NO_FALSE_NEGATIVES error type.
    • +
    • Merge itself with another sketch object created from this class.
    • +
    • Serialize/Deserialize to/from a byte array.
    • +
    + +

    Space Usage

    + +

    The sketch is initialized with a maxMapSize that specifies the maximum physical + length of the internal hash map of the form (<T> item, long count). + The maxMapSize must be a power of 2.

    + +

    The hash map starts at a very small size (8 entries), and grows as needed up to the + specified maxMapSize.

    + +

    Excluding external space required for the item objects, the internal memory space usage of + this sketch is 18 * mapSize bytes (assuming 8 bytes for each Java reference), plus a small + constant number of additional bytes. The internal memory space usage of this sketch will never + exceed 18 * maxMapSize bytes, plus a small constant number of additional bytes.

    + +

    Maximum Capacity of the Sketch

    + +

    The LOAD_FACTOR for the hash map is internally set at 75%, + which means at any time the map capacity of (item, count) pairs is mapCap = 0.75 * + mapSize. + The maximum capacity of (item, count) pairs of the sketch is maxMapCap = 0.75 * + maxMapSize.

    + +

    Updating the sketch with (item, count) pairs

    + +

    If the item is found in the hash map, the mapped count field (the "counter") is + incremented by the incoming count, otherwise, a new counter "(item, count) pair" is + created. If the number of tracked counters reaches the maximum capacity of the hash map + the sketch decrements all of the counters (by an approximately computed median), and + removes any non-positive counters.

    + +

    Accuracy

    + +

    If fewer than 0.75 * maxMapSize different items are inserted into the sketch the + estimated frequencies returned by the sketch will be exact.

    + +

    The logic of the frequent items sketch is such that the stored counts and true counts are + never too different. + More specifically, for any item, the sketch can return an estimate of the + true frequency of item, along with upper and lower bounds on the frequency + (that hold deterministically).

    + +

    For this implementation and for a specific active item, it is guaranteed that + the true frequency will be between the Upper Bound (UB) and the Lower Bound (LB) computed for + that item. Specifically, (UB- LB) ≤ W * epsilon, where W denotes the + sum of all item counts, and epsilon = 3.5/M, where M is the maxMapSize.

    + +

    This is a worst case guarantee that applies to arbitrary inputs.1 + For inputs typically seen in practice (UB-LB) is usually much smaller. +

    + +

    Background

    + +

    This code implements a variant of what is commonly known as the "Misra-Gries + algorithm". Variants of it were discovered and rediscovered and redesigned several times + over the years:

    +
    • "Finding repeated elements", Misra, Gries, 1982
    • +
    • "Frequency estimation of Internet packet streams with limited space" Demaine, + Lopez-Ortiz, Munro, 2002
    • +
    • "A simple algorithm for finding frequent elements in streams and bags" Karp, Shenker, + Papadimitriou, 2003
    • +
    • "Efficient Computation of Frequent and Top-k Elements in Data Streams" Metwally, + Agrawal, Abbadi, 2006
    • +
    + + 1 For speed we do employ some randomization that introduces a small probability that + our proof of the worst-case bound might not apply to a given run. However, we have ensured + that this probability is extremely small. For example, if the stream causes one table purge + (rebuild), our proof of the worst case bound applies with probability at least 1 - 1E-14. + If the stream causes 1E9 purges, our proof applies with probability at least 1 - 1E-5.
    +
    +
    Author:
    +
    Justin Thaler, Alexander Saydakov
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeClassDescription
      static class ItemsSketch.Row<T> +
      Row class that defines the return values from a getFrequentItems query.
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      ItemsSketch​(int maxMapSize) +
      Construct this sketch with the parameter maxMapSize and the default initialMapSize (8).
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static doublegetAprioriError​(int maxMapSize, + long estimatedTotalStreamWeight) +
      Returns the estimated a priori error given the maxMapSize for the sketch and the + estimatedTotalStreamWeight.
      +
      intgetCurrentMapCapacity() +
      Returns the current number of counters the sketch is configured to support.
      +
      static doublegetEpsilon​(int maxMapSize) +
      Returns epsilon used to compute a priori error.
      +
      longgetEstimate​(T item) +
      Gets the estimate of the frequency of the given item.
      +
      ItemsSketch.Row<T>[]getFrequentItems​(long threshold, + ErrorType errorType) +
      Returns an array of Rows that include frequent items, estimates, upper and lower bounds + given a threshold and an ErrorCondition.
      +
      ItemsSketch.Row<T>[]getFrequentItems​(ErrorType errorType) +
      Returns an array of Rows that include frequent items, estimates, upper and lower bounds + given an ErrorCondition and the default threshold.
      +
      static <T> ItemsSketch<T>getInstance​(org.apache.datasketches.memory.Memory srcMem, + ArrayOfItemsSerDe<T> serDe) +
      Returns a sketch instance of this class from the given srcMem, + which must be a Memory representation of this sketch class.
      +
      longgetLowerBound​(T item) +
      Gets the guaranteed lower bound frequency of the given item, which can never be + negative.
      +
      longgetMaximumError() 
      intgetMaximumMapCapacity() +
      Returns the maximum number of counters the sketch is configured to support.
      +
      intgetNumActiveItems() 
      longgetStreamLength() +
      Returns the sum of the frequencies in the stream seen so far by the sketch
      +
      longgetUpperBound​(T item) +
      Gets the guaranteed upper bound frequency of the given item.
      +
      booleanisEmpty() +
      Returns true if this sketch is empty
      +
      ItemsSketch<T>merge​(ItemsSketch<T> other) +
      This function merges the other sketch into this one.
      +
      voidreset() +
      Resets this sketch to a virgin state.
      +
      byte[]toByteArray​(ArrayOfItemsSerDe<T> serDe) +
      Returns a byte array representation of this sketch
      +
      StringtoString() +
      Returns a human readable summary of this sketch.
      +
      static StringtoString​(byte[] byteArr) +
      Returns a human readable string of the preamble of a byte array image of a ItemsSketch.
      +
      static StringtoString​(org.apache.datasketches.memory.Memory mem) +
      Returns a human readable string of the preamble of a Memory image of a ItemsSketch.
      +
      voidupdate​(T item) +
      Update this sketch with an item and a frequency count of one.
      +
      voidupdate​(T item, + long count) +
      Update this sketch with an item and a positive frequency count.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ItemsSketch

        +
        public ItemsSketch​(int maxMapSize)
        +
        Construct this sketch with the parameter maxMapSize and the default initialMapSize (8).
        +
        +
        Parameters:
        +
        maxMapSize - Determines the physical size of the internal hash map managed by this + sketch and must be a power of 2. The maximum capacity of this internal hash map is + 0.75 times * maxMapSize. Both the ultimate accuracy and size of this sketch are + functions of maxMapSize.
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getInstance

        +
        public static <T> ItemsSketch<T> getInstance​(org.apache.datasketches.memory.Memory srcMem,
        +                                             ArrayOfItemsSerDe<T> serDe)
        +
        Returns a sketch instance of this class from the given srcMem, + which must be a Memory representation of this sketch class.
        +
        +
        Type Parameters:
        +
        T - The type of item that this sketch will track
        +
        Parameters:
        +
        srcMem - a Memory representation of a sketch of this class. + See Memory
        +
        serDe - an instance of ArrayOfItemsSerDe
        +
        Returns:
        +
        a sketch instance of this class.
        +
        +
      • +
      + + + +
        +
      • +

        getAprioriError

        +
        public static double getAprioriError​(int maxMapSize,
        +                                     long estimatedTotalStreamWeight)
        +
        Returns the estimated a priori error given the maxMapSize for the sketch and the + estimatedTotalStreamWeight.
        +
        +
        Parameters:
        +
        maxMapSize - the planned map size to be used when constructing this sketch.
        +
        estimatedTotalStreamWeight - the estimated total stream weight.
        +
        Returns:
        +
        the estimated a priori error.
        +
        +
      • +
      + + + +
        +
      • +

        getCurrentMapCapacity

        +
        public int getCurrentMapCapacity()
        +
        Returns the current number of counters the sketch is configured to support.
        +
        +
        Returns:
        +
        the current number of counters the sketch is configured to support.
        +
        +
      • +
      + + + +
        +
      • +

        getEpsilon

        +
        public static double getEpsilon​(int maxMapSize)
        +
        Returns epsilon used to compute a priori error. + This is just the value 3.5 / maxMapSize.
        +
        +
        Parameters:
        +
        maxMapSize - the planned map size to be used when constructing this sketch.
        +
        Returns:
        +
        epsilon used to compute a priori error.
        +
        +
      • +
      + + + + + +
        +
      • +

        getEstimate

        +
        public long getEstimate​(T item)
        +
        Gets the estimate of the frequency of the given item. + Note: The true frequency of a item would be the sum of the counts as a result of the + two update functions.
        +
        +
        Parameters:
        +
        item - the given item
        +
        Returns:
        +
        the estimate of the frequency of the given item
        +
        +
      • +
      + + + + + +
        +
      • +

        getLowerBound

        +
        public long getLowerBound​(T item)
        +
        Gets the guaranteed lower bound frequency of the given item, which can never be + negative.
        +
        +
        Parameters:
        +
        item - the given item.
        +
        Returns:
        +
        the guaranteed lower bound frequency of the given item. That is, a number which + is guaranteed to be no larger than the real frequency.
        +
        +
      • +
      + + + +
        +
      • +

        getFrequentItems

        +
        public ItemsSketch.Row<T>[] getFrequentItems​(long threshold,
        +                                             ErrorType errorType)
        +
        Returns an array of Rows that include frequent items, estimates, upper and lower bounds + given a threshold and an ErrorCondition. If the threshold is lower than getMaximumError(), + then getMaximumError() will be used instead. + +

        The method first examines all active items in the sketch (items that have a counter). + +

        If ErrorType = NO_FALSE_NEGATIVES, this will include an item in the result + list if getUpperBound(item) > threshold. + There will be no false negatives, i.e., no Type II error. + There may be items in the set with true frequencies less than the threshold + (false positives).

        + +

        If ErrorType = NO_FALSE_POSITIVES, this will include an item in the result + list if getLowerBound(item) > threshold. + There will be no false positives, i.e., no Type I error. + There may be items omitted from the set with true frequencies greater than the + threshold (false negatives).

        +
        +
        Parameters:
        +
        threshold - to include items in the result list
        +
        errorType - determines whether no false positives or no false negatives are + desired.
        +
        Returns:
        +
        an array of frequent items
        +
        +
      • +
      + + + +
        +
      • +

        getFrequentItems

        +
        public ItemsSketch.Row<T>[] getFrequentItems​(ErrorType errorType)
        +
        Returns an array of Rows that include frequent items, estimates, upper and lower bounds + given an ErrorCondition and the default threshold. + This is the same as getFrequentItems(getMaximumError(), errorType)
        +
        +
        Parameters:
        +
        errorType - determines whether no false positives or no false negatives are + desired.
        +
        Returns:
        +
        an array of frequent items
        +
        +
      • +
      + + + +
        +
      • +

        getMaximumError

        +
        public long getMaximumError()
        +
        +
        Returns:
        +
        An upper bound on the maximum error of getEstimate(item) for any item. + This is equivalent to the maximum distance between the upper bound and the lower bound + for any item.
        +
        +
      • +
      + + + +
        +
      • +

        getMaximumMapCapacity

        +
        public int getMaximumMapCapacity()
        +
        Returns the maximum number of counters the sketch is configured to support.
        +
        +
        Returns:
        +
        the maximum number of counters the sketch is configured to support.
        +
        +
      • +
      + + + +
        +
      • +

        getNumActiveItems

        +
        public int getNumActiveItems()
        +
        +
        Returns:
        +
        the number of active items in the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getStreamLength

        +
        public long getStreamLength()
        +
        Returns the sum of the frequencies in the stream seen so far by the sketch
        +
        +
        Returns:
        +
        the sum of the frequencies in the stream seen so far by the sketch
        +
        +
      • +
      + + + + + +
        +
      • +

        getUpperBound

        +
        public long getUpperBound​(T item)
        +
        Gets the guaranteed upper bound frequency of the given item.
        +
        +
        Parameters:
        +
        item - the given item
        +
        Returns:
        +
        the guaranteed upper bound frequency of the given item. That is, a number which + is guaranteed to be no smaller than the real frequency.
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        Returns true if this sketch is empty
        +
        +
        Returns:
        +
        true if this sketch is empty
        +
        +
      • +
      + + + +
        +
      • +

        merge

        +
        public ItemsSketch<T> merge​(ItemsSketch<T> other)
        +
        This function merges the other sketch into this one. + The other sketch may be of a different size.
        +
        +
        Parameters:
        +
        other - sketch of this class
        +
        Returns:
        +
        a sketch whose estimates are within the guarantees of the + largest error tolerance of the two merged sketches.
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Resets this sketch to a virgin state.
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray​(ArrayOfItemsSerDe<T> serDe)
        +
        Returns a byte array representation of this sketch
        +
        +
        Parameters:
        +
        serDe - an instance of ArrayOfItemsSerDe
        +
        Returns:
        +
        a byte array representation of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Returns a human readable summary of this sketch.
        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        a human readable summary of this sketch.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString​(byte[] byteArr)
        +
        Returns a human readable string of the preamble of a byte array image of a ItemsSketch.
        +
        +
        Parameters:
        +
        byteArr - the given byte array
        +
        Returns:
        +
        a human readable string of the preamble of a byte array image of a ItemsSketch.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString​(org.apache.datasketches.memory.Memory mem)
        +
        Returns a human readable string of the preamble of a Memory image of a ItemsSketch.
        +
        +
        Parameters:
        +
        mem - the given Memory object
        +
        Returns:
        +
        a human readable string of the preamble of a Memory image of a ItemsSketch.
        +
        +
      • +
      + + + + + +
        +
      • +

        update

        +
        public void update​(T item)
        +
        Update this sketch with an item and a frequency count of one.
        +
        +
        Parameters:
        +
        item - for which the frequency should be increased.
        +
        +
      • +
      + + + + + +
        +
      • +

        update

        +
        public void update​(T item,
        +                   long count)
        +
        Update this sketch with an item and a positive frequency count.
        +
        +
        Parameters:
        +
        item - for which the frequency should be increased. The sketch uses + hashCode() and equals() methods of the type T.
        +
        count - the amount by which the frequency of the item should be increased. + A count of zero is a no-op, and a negative count will throw an exception.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/frequencies/LongsSketch.Row.html b/docs/5.0.2/org/apache/datasketches/frequencies/LongsSketch.Row.html new file mode 100644 index 000000000..81d1528de --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/frequencies/LongsSketch.Row.html @@ -0,0 +1,454 @@ + + + + + +LongsSketch.Row (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class LongsSketch.Row

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.frequencies.LongsSketch.Row
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getItem

        +
        public long getItem()
        +
        +
        Returns:
        +
        item of type T
        +
        +
      • +
      + + + +
        +
      • +

        getEstimate

        +
        public long getEstimate()
        +
        +
        Returns:
        +
        the estimate
        +
        +
      • +
      + + + +
        +
      • +

        getUpperBound

        +
        public long getUpperBound()
        +
        +
        Returns:
        +
        the upper bound
        +
        +
      • +
      + + + +
        +
      • +

        getLowerBound

        +
        public long getLowerBound()
        +
        +
        Returns:
        +
        return the lower bound
        +
        +
      • +
      + + + +
        +
      • +

        getRowHeader

        +
        public static String getRowHeader()
        +
        +
        Returns:
        +
        the descriptive row header
        +
        +
      • +
      + + + + + + + +
        +
      • +

        compareTo

        +
        public int compareTo​(LongsSketch.Row that)
        +
        This compareTo is strictly limited to the Row.getEstimate() value and does not imply any + ordering whatsoever to the other elements of the row: item and upper and lower bounds. + Defined this way, this compareTo will be consistent with hashCode() and equals(Object).
        +
        +
        Specified by:
        +
        compareTo in interface Comparable<LongsSketch.Row>
        +
        Parameters:
        +
        that - the other row to compare to.
        +
        Returns:
        +
        a negative integer, zero, or a positive integer as this.getEstimate() is less than, + equal to, or greater than that.getEstimate().
        +
        +
      • +
      + + + +
        +
      • +

        hashCode

        +
        public int hashCode()
        +
        This hashCode is computed only from the Row.getEstimate() value. + Defined this way, this hashCode will be consistent with equals(Object):
        + If (x.equals(y)) implies: x.hashCode() == y.hashCode().
        + If (!x.equals(y)) does NOT imply: x.hashCode() != y.hashCode().
        +
        +
        Overrides:
        +
        hashCode in class Object
        +
        Returns:
        +
        the hashCode computed from getEstimate().
        +
        +
      • +
      + + + +
        +
      • +

        equals

        +
        public boolean equals​(Object obj)
        +
        This equals is computed only from the Row.getEstimate() value and does not imply equality + of the other items within the row: item and upper and lower bounds. + Defined this way, this equals will be consistent with compareTo(Row).
        +
        +
        Overrides:
        +
        equals in class Object
        +
        Parameters:
        +
        obj - the other row to determine equality with.
        +
        Returns:
        +
        true if this.getEstimate() equals ((Row)obj).getEstimate().
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/frequencies/LongsSketch.html b/docs/5.0.2/org/apache/datasketches/frequencies/LongsSketch.html new file mode 100644 index 000000000..72c6f32e7 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/frequencies/LongsSketch.html @@ -0,0 +1,1009 @@ + + + + + +LongsSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class LongsSketch

+
+
+ +
+
    +
  • +
    +
    public class LongsSketch
    +extends Object
    +

    This sketch is useful for tracking approximate frequencies of long items with optional + associated counts (long item, long count) that are members of a multiset of + such items. The true frequency of an item is defined to be the sum of associated counts.

    + +

    This implementation provides the following capabilities:

    +
      +
    • Estimate the frequency of an item.
    • +
    • Return upper and lower bounds of any item, such that the true frequency is always + between the upper and lower bounds.
    • +
    • Return a global maximum error that holds for all items in the stream.
    • +
    • Return an array of frequent items that qualify either a NO_FALSE_POSITIVES or a + NO_FALSE_NEGATIVES error type.
    • +
    • Merge itself with another sketch object created from this class.
    • +
    • Serialize/Deserialize to/from a String or byte array.
    • +
    + +

    Space Usage

    + +

    The sketch is initialized with a maxMapSize that specifies the maximum physical + length of the internal hash map of the form (long item, long count). + The maxMapSize must be a power of 2.

    + +

    The hash map starts at a very small size (8 entries), and grows as needed up to the + specified maxMapSize.

    + +

    At any moment the internal memory space usage of this sketch is 18 * mapSize bytes, + plus a small constant number of additional bytes. The maximum internal memory space usage of + this sketch will never exceed 18 * maxMapSize bytes, plus a small constant number of + additional bytes.

    + +

    Maximum Capacity of the Sketch

    + +

    The LOAD_FACTOR for the hash map is internally set at 75%, + which means at any time the map capacity of (item, count) pairs is mapCap = + 0.75 * mapSize. + The maximum capacity of (item, count) pairs of the sketch is maxMapCap = + 0.75 * maxMapSize.

    + +

    Updating the sketch with (item, count) pairs

    + +

    If the item is found in the hash map, the mapped count field (the "counter") is + incremented by the incoming count, otherwise, a new counter "(item, count) pair" is + created. If the number of tracked counters reaches the maximum capacity of the hash map + the sketch decrements all of the counters (by an approximately computed median), and + removes any non-positive counters.

    + +

    Accuracy

    + +

    If fewer than 0.75 * maxMapSize different items are inserted into the sketch the + estimated frequencies returned by the sketch will be exact.

    + +

    The logic of the frequent items sketch is such that the stored counts and true counts are + never too different. + More specifically, for any item, the sketch can return an estimate of the + true frequency of item, along with upper and lower bounds on the frequency + (that hold deterministically).

    + +

    For this implementation and for a specific active item, it is guaranteed that + the true frequency will be between the Upper Bound (UB) and the Lower Bound (LB) computed for + that item. Specifically, (UB- LB) ≤ W * epsilon, where W denotes the + sum of all item counts, and epsilon = 3.5/M, where M is the maxMapSize.

    + +

    This is a worst case guarantee that applies to arbitrary inputs.1 + For inputs typically seen in practice (UB-LB) is usually much smaller. +

    + +

    Background

    + +

    This code implements a variant of what is commonly known as the "Misra-Gries + algorithm". Variants of it were discovered and rediscovered and redesigned several times + over the years:

    +
    • "Finding repeated elements", Misra, Gries, 1982
    • +
    • "Frequency estimation of Internet packet streams with limited space" Demaine, + Lopez-Ortiz, Munro, 2002
    • +
    • "A simple algorithm for finding frequent elements in streams and bags" Karp, Shenker, + Papadimitriou, 2003
    • +
    • "Efficient Computation of Frequent and Top-k Elements in Data Streams" Metwally, + Agrawal, Abbadi, 2006
    • +
    + + 1 For speed we do employ some randomization that introduces a small probability that + our proof of the worst-case bound might not apply to a given run. However, we have ensured + that this probability is extremely small. For example, if the stream causes one table purge + (rebuild), our proof of the worst case bound applies with probability at least 1 - 1E-14. + If the stream causes 1E9 purges, our proof applies with probability at least 1 - 1E-5.
    +
    +
    Author:
    +
    Justin Thaler, Lee Rhodes
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeClassDescription
      static class LongsSketch.Row +
      Row class that defines the return values from a getFrequentItems query.
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      LongsSketch​(int maxMapSize) +
      Construct this sketch with the parameter maxMapSize and the default initialMapSize (8).
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static doublegetAprioriError​(int maxMapSize, + long estimatedTotalStreamWeight) +
      Returns the estimated a priori error given the maxMapSize for the sketch and the + estimatedTotalStreamWeight.
      +
      intgetCurrentMapCapacity() +
      Returns the current number of counters the sketch is configured to support.
      +
      static doublegetEpsilon​(int maxMapSize) +
      Returns epsilon used to compute a priori error.
      +
      longgetEstimate​(long item) +
      Gets the estimate of the frequency of the given item.
      +
      LongsSketch.Row[]getFrequentItems​(long threshold, + ErrorType errorType) +
      Returns an array of Rows that include frequent items, estimates, upper and lower bounds + given a threshold and an ErrorCondition.
      +
      LongsSketch.Row[]getFrequentItems​(ErrorType errorType) +
      Returns an array of Rows that include frequent items, estimates, upper and lower bounds + given an ErrorCondition and the default threshold.
      +
      static LongsSketchgetInstance​(String string) +
      Returns a sketch instance of this class from the given String, + which must be a String representation of this sketch class.
      +
      static LongsSketchgetInstance​(org.apache.datasketches.memory.Memory srcMem) +
      Returns a sketch instance of this class from the given srcMem, + which must be a Memory representation of this sketch class.
      +
      longgetLowerBound​(long item) +
      Gets the guaranteed lower bound frequency of the given item, which can never be + negative.
      +
      longgetMaximumError() 
      intgetMaximumMapCapacity() +
      Returns the maximum number of counters the sketch is configured to support.
      +
      intgetNumActiveItems() 
      intgetStorageBytes() +
      Returns the number of bytes required to store this sketch as an array of bytes.
      +
      longgetStreamLength() +
      Returns the sum of the frequencies (weights or counts) in the stream seen so far by the sketch
      +
      longgetUpperBound​(long item) +
      Gets the guaranteed upper bound frequency of the given item.
      +
      booleanisEmpty() +
      Returns true if this sketch is empty
      +
      LongsSketchmerge​(LongsSketch other) +
      This function merges the other sketch into this one.
      +
      voidreset() +
      Resets this sketch to a virgin state.
      +
      StringserializeToString() +
      Returns a String representation of this sketch
      +
      byte[]toByteArray() +
      Returns a byte array representation of this sketch
      +
      StringtoString() +
      Returns a human readable summary of this sketch.
      +
      static StringtoString​(byte[] byteArr) +
      Returns a human readable string of the preamble of a byte array image of a LongsSketch.
      +
      static StringtoString​(org.apache.datasketches.memory.Memory mem) +
      Returns a human readable string of the preamble of a Memory image of a LongsSketch.
      +
      voidupdate​(long item) +
      Update this sketch with an item and a frequency count of one.
      +
      voidupdate​(long item, + long count) +
      Update this sketch with a item and a positive frequency count (or weight).
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        LongsSketch

        +
        public LongsSketch​(int maxMapSize)
        +
        Construct this sketch with the parameter maxMapSize and the default initialMapSize (8).
        +
        +
        Parameters:
        +
        maxMapSize - Determines the physical size of the internal hash map managed by this + sketch and must be a power of 2. The maximum capacity of this internal hash map is + 0.75 times * maxMapSize. Both the ultimate accuracy and size of this sketch are a + function of maxMapSize.
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getInstance

        +
        public static LongsSketch getInstance​(org.apache.datasketches.memory.Memory srcMem)
        +
        Returns a sketch instance of this class from the given srcMem, + which must be a Memory representation of this sketch class.
        +
        +
        Parameters:
        +
        srcMem - a Memory representation of a sketch of this class. + See Memory
        +
        Returns:
        +
        a sketch instance of this class.
        +
        +
      • +
      + + + +
        +
      • +

        getInstance

        +
        public static LongsSketch getInstance​(String string)
        +
        Returns a sketch instance of this class from the given String, + which must be a String representation of this sketch class.
        +
        +
        Parameters:
        +
        string - a String representation of a sketch of this class.
        +
        Returns:
        +
        a sketch instance of this class.
        +
        +
      • +
      + + + +
        +
      • +

        getAprioriError

        +
        public static double getAprioriError​(int maxMapSize,
        +                                     long estimatedTotalStreamWeight)
        +
        Returns the estimated a priori error given the maxMapSize for the sketch and the + estimatedTotalStreamWeight.
        +
        +
        Parameters:
        +
        maxMapSize - the planned map size to be used when constructing this sketch.
        +
        estimatedTotalStreamWeight - the estimated total stream weight.
        +
        Returns:
        +
        the estimated a priori error.
        +
        +
      • +
      + + + +
        +
      • +

        getCurrentMapCapacity

        +
        public int getCurrentMapCapacity()
        +
        Returns the current number of counters the sketch is configured to support.
        +
        +
        Returns:
        +
        the current number of counters the sketch is configured to support.
        +
        +
      • +
      + + + +
        +
      • +

        getEpsilon

        +
        public static double getEpsilon​(int maxMapSize)
        +
        Returns epsilon used to compute a priori error. + This is just the value 3.5 / maxMapSize.
        +
        +
        Parameters:
        +
        maxMapSize - the planned map size to be used when constructing this sketch.
        +
        Returns:
        +
        epsilon used to compute a priori error.
        +
        +
      • +
      + + + +
        +
      • +

        getEstimate

        +
        public long getEstimate​(long item)
        +
        Gets the estimate of the frequency of the given item. + Note: The true frequency of a item would be the sum of the counts as a result of the + two update functions.
        +
        +
        Parameters:
        +
        item - the given item
        +
        Returns:
        +
        the estimate of the frequency of the given item
        +
        +
      • +
      + + + +
        +
      • +

        getLowerBound

        +
        public long getLowerBound​(long item)
        +
        Gets the guaranteed lower bound frequency of the given item, which can never be + negative.
        +
        +
        Parameters:
        +
        item - the given item.
        +
        Returns:
        +
        the guaranteed lower bound frequency of the given item. That is, a number which + is guaranteed to be no larger than the real frequency.
        +
        +
      • +
      + + + +
        +
      • +

        getFrequentItems

        +
        public LongsSketch.Row[] getFrequentItems​(long threshold,
        +                                          ErrorType errorType)
        +
        Returns an array of Rows that include frequent items, estimates, upper and lower bounds + given a threshold and an ErrorCondition. If the threshold is lower than getMaximumError(), + then getMaximumError() will be used instead. + +

        The method first examines all active items in the sketch (items that have a counter). + +

        If ErrorType = NO_FALSE_NEGATIVES, this will include an item in the result + list if getUpperBound(item) > threshold. + There will be no false negatives, i.e., no Type II error. + There may be items in the set with true frequencies less than the threshold + (false positives).

        + +

        If ErrorType = NO_FALSE_POSITIVES, this will include an item in the result + list if getLowerBound(item) > threshold. + There will be no false positives, i.e., no Type I error. + There may be items omitted from the set with true frequencies greater than the + threshold (false negatives). This is a subset of the NO_FALSE_NEGATIVES case.

        +
        +
        Parameters:
        +
        threshold - to include items in the result list
        +
        errorType - determines whether no false positives or no false negatives are + desired.
        +
        Returns:
        +
        an array of frequent items
        +
        +
      • +
      + + + +
        +
      • +

        getFrequentItems

        +
        public LongsSketch.Row[] getFrequentItems​(ErrorType errorType)
        +
        Returns an array of Rows that include frequent items, estimates, upper and lower bounds + given an ErrorCondition and the default threshold. + This is the same as getFrequentItems(getMaximumError(), errorType)
        +
        +
        Parameters:
        +
        errorType - determines whether no false positives or no false negatives are + desired.
        +
        Returns:
        +
        an array of frequent items
        +
        +
      • +
      + + + +
        +
      • +

        getMaximumError

        +
        public long getMaximumError()
        +
        +
        Returns:
        +
        An upper bound on the maximum error of getEstimate(item) for any item. + This is equivalent to the maximum distance between the upper bound and the lower bound + for any item.
        +
        +
      • +
      + + + +
        +
      • +

        getMaximumMapCapacity

        +
        public int getMaximumMapCapacity()
        +
        Returns the maximum number of counters the sketch is configured to support.
        +
        +
        Returns:
        +
        the maximum number of counters the sketch is configured to support.
        +
        +
      • +
      + + + +
        +
      • +

        getNumActiveItems

        +
        public int getNumActiveItems()
        +
        +
        Returns:
        +
        the number of active items in the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getStorageBytes

        +
        public int getStorageBytes()
        +
        Returns the number of bytes required to store this sketch as an array of bytes.
        +
        +
        Returns:
        +
        the number of bytes required to store this sketch as an array of bytes.
        +
        +
      • +
      + + + +
        +
      • +

        getStreamLength

        +
        public long getStreamLength()
        +
        Returns the sum of the frequencies (weights or counts) in the stream seen so far by the sketch
        +
        +
        Returns:
        +
        the sum of the frequencies in the stream seen so far by the sketch
        +
        +
      • +
      + + + +
        +
      • +

        getUpperBound

        +
        public long getUpperBound​(long item)
        +
        Gets the guaranteed upper bound frequency of the given item.
        +
        +
        Parameters:
        +
        item - the given item
        +
        Returns:
        +
        the guaranteed upper bound frequency of the given item. That is, a number which + is guaranteed to be no smaller than the real frequency.
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        Returns true if this sketch is empty
        +
        +
        Returns:
        +
        true if this sketch is empty
        +
        +
      • +
      + + + +
        +
      • +

        merge

        +
        public LongsSketch merge​(LongsSketch other)
        +
        This function merges the other sketch into this one. + The other sketch may be of a different size.
        +
        +
        Parameters:
        +
        other - sketch of this class
        +
        Returns:
        +
        a sketch whose estimates are within the guarantees of the + largest error tolerance of the two merged sketches.
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Resets this sketch to a virgin state.
        +
      • +
      + + + +
        +
      • +

        serializeToString

        +
        public String serializeToString()
        +
        Returns a String representation of this sketch
        +
        +
        Returns:
        +
        a String representation of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray()
        +
        Returns a byte array representation of this sketch
        +
        +
        Returns:
        +
        a byte array representation of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Returns a human readable summary of this sketch.
        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        a human readable summary of this sketch.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString​(byte[] byteArr)
        +
        Returns a human readable string of the preamble of a byte array image of a LongsSketch.
        +
        +
        Parameters:
        +
        byteArr - the given byte array
        +
        Returns:
        +
        a human readable string of the preamble of a byte array image of a LongsSketch.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString​(org.apache.datasketches.memory.Memory mem)
        +
        Returns a human readable string of the preamble of a Memory image of a LongsSketch.
        +
        +
        Parameters:
        +
        mem - the given Memory object
        +
        Returns:
        +
        a human readable string of the preamble of a Memory image of a LongsSketch.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(long item)
        +
        Update this sketch with an item and a frequency count of one.
        +
        +
        Parameters:
        +
        item - for which the frequency should be increased.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(long item,
        +                   long count)
        +
        Update this sketch with a item and a positive frequency count (or weight).
        +
        +
        Parameters:
        +
        item - for which the frequency should be increased. The item can be any long value + and is only used by the sketch to determine uniqueness.
        +
        count - the amount by which the frequency of the item should be increased. + An count of zero is a no-op, and a negative count will throw an exception.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/frequencies/class-use/ErrorType.html b/docs/5.0.2/org/apache/datasketches/frequencies/class-use/ErrorType.html new file mode 100644 index 000000000..23dff9ad0 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/frequencies/class-use/ErrorType.html @@ -0,0 +1,250 @@ + + + + + +Uses of Class org.apache.datasketches.frequencies.ErrorType (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.frequencies.ErrorType

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/frequencies/class-use/ItemsSketch.Row.html b/docs/5.0.2/org/apache/datasketches/frequencies/class-use/ItemsSketch.Row.html new file mode 100644 index 000000000..13b43d124 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/frequencies/class-use/ItemsSketch.Row.html @@ -0,0 +1,226 @@ + + + + + +Uses of Class org.apache.datasketches.frequencies.ItemsSketch.Row (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.frequencies.ItemsSketch.Row

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/frequencies/class-use/ItemsSketch.html b/docs/5.0.2/org/apache/datasketches/frequencies/class-use/ItemsSketch.html new file mode 100644 index 000000000..ccc6be8ce --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/frequencies/class-use/ItemsSketch.html @@ -0,0 +1,224 @@ + + + + + +Uses of Class org.apache.datasketches.frequencies.ItemsSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.frequencies.ItemsSketch

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/frequencies/class-use/LongsSketch.Row.html b/docs/5.0.2/org/apache/datasketches/frequencies/class-use/LongsSketch.Row.html new file mode 100644 index 000000000..1b1121e90 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/frequencies/class-use/LongsSketch.Row.html @@ -0,0 +1,226 @@ + + + + + +Uses of Class org.apache.datasketches.frequencies.LongsSketch.Row (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.frequencies.LongsSketch.Row

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/frequencies/class-use/LongsSketch.html b/docs/5.0.2/org/apache/datasketches/frequencies/class-use/LongsSketch.html new file mode 100644 index 000000000..28335bc20 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/frequencies/class-use/LongsSketch.html @@ -0,0 +1,231 @@ + + + + + +Uses of Class org.apache.datasketches.frequencies.LongsSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.frequencies.LongsSketch

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/frequencies/package-summary.html b/docs/5.0.2/org/apache/datasketches/frequencies/package-summary.html new file mode 100644 index 000000000..454069e99 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/frequencies/package-summary.html @@ -0,0 +1,221 @@ + + + + + +org.apache.datasketches.frequencies (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches.frequencies

+
+
+
+ + +
This package is dedicated to streaming algorithms that enable estimation of the + frequency of occurrence of items in a weighted multiset stream of items. + If the frequency distribution of items is sufficiently skewed, these algorithms are very + useful in identifying the "Heavy Hitters" that occurred most frequently in the stream. + The accuracy of the estimation of the frequency of an item has well understood error + bounds that can be returned by the sketch. + +

These algorithms are sometimes referred to as "TopN" algorithms.

+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    ItemsSketch<T> +
    This sketch is useful for tracking approximate frequencies of items of type <T> + with optional associated counts (<T> item, long count) that are members of a + multiset of such items.
    +
    ItemsSketch.Row<T> +
    Row class that defines the return values from a getFrequentItems query.
    +
    LongsSketch +
    This sketch is useful for tracking approximate frequencies of long items with optional + associated counts (long item, long count) that are members of a multiset of + such items.
    +
    LongsSketch.Row +
    Row class that defines the return values from a getFrequentItems query.
    +
    +
  • +
  • + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    ErrorType +
    Specifies one of two types of error regions of the statistical classification Confusion Matrix + that can be excluded from a returned sample of Frequent Items.
    +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/frequencies/package-tree.html b/docs/5.0.2/org/apache/datasketches/frequencies/package-tree.html new file mode 100644 index 000000000..b2781eace --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/frequencies/package-tree.html @@ -0,0 +1,181 @@ + + + + + +org.apache.datasketches.frequencies Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches.frequencies

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+

Enum Hierarchy

+ +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/frequencies/package-use.html b/docs/5.0.2/org/apache/datasketches/frequencies/package-use.html new file mode 100644 index 000000000..4f375f700 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/frequencies/package-use.html @@ -0,0 +1,218 @@ + + + + + +Uses of Package org.apache.datasketches.frequencies (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches.frequencies

+
+
+
    +
  • + + + + + + + + + + + + +
    Packages that use org.apache.datasketches.frequencies 
    PackageDescription
    org.apache.datasketches.frequencies +
    This package is dedicated to streaming algorithms that enable estimation of the + frequency of occurrence of items in a weighted multiset stream of items.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Classes in org.apache.datasketches.frequencies used by org.apache.datasketches.frequencies 
    ClassDescription
    ErrorType +
    Specifies one of two types of error regions of the statistical classification Confusion Matrix + that can be excluded from a returned sample of Frequent Items.
    +
    ItemsSketch +
    This sketch is useful for tracking approximate frequencies of items of type <T> + with optional associated counts (<T> item, long count) that are members of a + multiset of such items.
    +
    ItemsSketch.Row +
    Row class that defines the return values from a getFrequentItems query.
    +
    LongsSketch +
    This sketch is useful for tracking approximate frequencies of long items with optional + associated counts (long item, long count) that are members of a multiset of + such items.
    +
    LongsSketch.Row +
    Row class that defines the return values from a getFrequentItems query.
    +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/hash/MurmurHash3.html b/docs/5.0.2/org/apache/datasketches/hash/MurmurHash3.html new file mode 100644 index 000000000..f13b422a9 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hash/MurmurHash3.html @@ -0,0 +1,612 @@ + + + + + +MurmurHash3 (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class MurmurHash3

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Serializable
    +
    +
    +
    public final class MurmurHash3
    +extends Object
    +implements Serializable
    +

    + The MurmurHash3 is a fast, non-cryptographic, 128-bit hash function that has + excellent avalanche and 2-way bit independence properties. +

    + +

    + Austin Appleby's C++ + + MurmurHash3_x64_128(...), final revision 150, + which is in the Public Domain, was the inspiration for this implementation in Java. +

    + +

    + This java implementation pays close attention to the C++ algorithms in order to + maintain bit-wise compatibility, but the design is quite different. This implementation has also + been extended to include processing of arrays of longs, char or ints, which was not part of the + original C++ implementation. This implementation produces the same exact output hash bits as + the above C++ method given the same input.

    + +

    In addition, with this implementation, the hash of byte[], char[], int[], or long[] will + produce the same hash result if, and only if, all the arrays have the same exact length in + bytes, and if the contents of the values in the arrays have the same byte endianness and + overall order. There is a unit test for this class that demonstrates this.

    + +

    + The structure of this implementation also reflects a separation of code that is dependent on the + input structure (in this case byte[], int[] or long[]) from code that is independent of the input + structure. This also makes the code more readable and suitable for future extensions. +

    + +

    Note that even though this hash function produces 128 bits, the entropy of the resulting hash cannot + be greater than the entropy of the input. For example, if the input is only a single long of 64 bits, + the entropy of the resulting 128 bit hash is no greater than 64 bits.

    +
    +
    Author:
    +
    Lee Rhodes
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static long[]hash​(byte[] key, + int offsetBytes, + int lengthBytes, + long seed) +
      Hash a portion of the given byte[] array.
      +
      static long[]hash​(byte[] key, + long seed) +
      Hash the given byte[] array.
      +
      static long[]hash​(char[] key, + int offsetChars, + int lengthChars, + long seed) +
      Hash a portion of the given char[] array.
      +
      static long[]hash​(char[] key, + long seed) +
      Hash the given char[] array.
      +
      static long[]hash​(int[] key, + int offsetInts, + int lengthInts, + long seed) +
      Hash a portion of the given int[] array.
      +
      static long[]hash​(int[] key, + long seed) +
      Hash the given int[] array.
      +
      static long[]hash​(long[] key, + int offsetLongs, + int lengthLongs, + long seed) +
      Hash a portion of the given long[] array.
      +
      static long[]hash​(long[] key, + long seed) +
      Hash the given long[] array.
      +
      static long[]hash​(long key, + long seed) +
      Hash the given long.
      +
      static long[]hash​(ByteBuffer buf, + long seed) +
      Hash the remaining bytes of the given ByteBuffer starting at position().
      +
      static long[]hash​(org.apache.datasketches.memory.Memory mem, + long seed) +
      Hash the given Memory.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        hash

        +
        public static long[] hash​(long key,
        +                          long seed)
        +
        Hash the given long.
        +
        +
        Parameters:
        +
        key - The input long.
        +
        seed - A long valued seed.
        +
        Returns:
        +
        a 128-bit hash of the input as a long array of size 2.
        +
        +
      • +
      + + + +
        +
      • +

        hash

        +
        public static long[] hash​(long[] key,
        +                          long seed)
        +
        Hash the given long[] array.
        +
        +
        Parameters:
        +
        key - The input long[] array. It must be non-null and non-empty.
        +
        seed - A long valued seed.
        +
        Returns:
        +
        a 128-bit hash of the input as a long array of size 2.
        +
        +
      • +
      + + + +
        +
      • +

        hash

        +
        public static long[] hash​(long[] key,
        +                          int offsetLongs,
        +                          int lengthLongs,
        +                          long seed)
        +
        Hash a portion of the given long[] array.
        +
        +
        Parameters:
        +
        key - The input long[] array. It must be non-null and non-empty.
        +
        offsetLongs - the starting offset in longs.
        +
        lengthLongs - the length in longs of the portion of the array to be hashed.
        +
        seed - A long valued seed.
        +
        Returns:
        +
        a 128-bit hash of the input as a long array of size 2
        +
        +
      • +
      + + + +
        +
      • +

        hash

        +
        public static long[] hash​(int[] key,
        +                          long seed)
        +
        Hash the given int[] array.
        +
        +
        Parameters:
        +
        key - The input int[] array. It must be non-null and non-empty.
        +
        seed - A long valued seed.
        +
        Returns:
        +
        a 128-bit hash of the input as a long array of size 2.
        +
        +
      • +
      + + + +
        +
      • +

        hash

        +
        public static long[] hash​(int[] key,
        +                          int offsetInts,
        +                          int lengthInts,
        +                          long seed)
        +
        Hash a portion of the given int[] array.
        +
        +
        Parameters:
        +
        key - The input int[] array. It must be non-null and non-empty.
        +
        offsetInts - the starting offset in ints.
        +
        lengthInts - the length in ints of the portion of the array to be hashed.
        +
        seed - A long valued seed.
        +
        Returns:
        +
        a 128-bit hash of the input as a long array of size 2.
        +
        +
      • +
      + + + +
        +
      • +

        hash

        +
        public static long[] hash​(char[] key,
        +                          long seed)
        +
        Hash the given char[] array.
        +
        +
        Parameters:
        +
        key - The input char[] array. It must be non-null and non-empty.
        +
        seed - A long valued seed.
        +
        Returns:
        +
        a 128-bit hash of the input as a long array of size 2
        +
        +
      • +
      + + + +
        +
      • +

        hash

        +
        public static long[] hash​(char[] key,
        +                          int offsetChars,
        +                          int lengthChars,
        +                          long seed)
        +
        Hash a portion of the given char[] array.
        +
        +
        Parameters:
        +
        key - The input char[] array. It must be non-null and non-empty.
        +
        offsetChars - the starting offset in chars.
        +
        lengthChars - the length in chars of the portion of the array to be hashed.
        +
        seed - A long valued seed.
        +
        Returns:
        +
        a 128-bit hash of the input as a long array of size 2
        +
        +
      • +
      + + + +
        +
      • +

        hash

        +
        public static long[] hash​(byte[] key,
        +                          long seed)
        +
        Hash the given byte[] array.
        +
        +
        Parameters:
        +
        key - The input byte[] array. It must be non-null and non-empty.
        +
        seed - A long valued seed.
        +
        Returns:
        +
        a 128-bit hash of the input as a long array of size 2.
        +
        +
      • +
      + + + +
        +
      • +

        hash

        +
        public static long[] hash​(byte[] key,
        +                          int offsetBytes,
        +                          int lengthBytes,
        +                          long seed)
        +
        Hash a portion of the given byte[] array.
        +
        +
        Parameters:
        +
        key - The input byte[] array. It must be non-null and non-empty.
        +
        offsetBytes - the starting offset in bytes.
        +
        lengthBytes - the length in bytes of the portion of the array to be hashed.
        +
        seed - A long valued seed.
        +
        Returns:
        +
        a 128-bit hash of the input as a long array of size 2.
        +
        +
      • +
      + + + +
        +
      • +

        hash

        +
        public static long[] hash​(ByteBuffer buf,
        +                          long seed)
        +
        Hash the remaining bytes of the given ByteBuffer starting at position().
        +
        +
        Parameters:
        +
        buf - The input ByteBuffer. It must be non-null and non-empty.
        +
        seed - A long valued seed.
        +
        Returns:
        +
        a 128-bit hash of the input as a long array of size 2.
        +
        +
      • +
      + + + +
        +
      • +

        hash

        +
        public static long[] hash​(org.apache.datasketches.memory.Memory mem,
        +                          long seed)
        +
        Hash the given Memory. + +

        Note: if you want to hash only a portion of Memory, convert it to the + appropriate Region first with ByteOrder = Little Endian. If it is not + Little Endian a new region view will be created as Little Endian. + This does not change the underlying data.

        +
        +
        Parameters:
        +
        mem - The input Memory. It must be non-null and non-empty.
        +
        seed - A long valued seed.
        +
        Returns:
        +
        a 128-bit hash of the input as a long array of size 2.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/hash/MurmurHash3Adaptor.html b/docs/5.0.2/org/apache/datasketches/hash/MurmurHash3Adaptor.html new file mode 100644 index 000000000..7166e5df6 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hash/MurmurHash3Adaptor.html @@ -0,0 +1,886 @@ + + + + + +MurmurHash3Adaptor (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class MurmurHash3Adaptor

+
+
+ +
+
    +
  • +
    +
    public final class MurmurHash3Adaptor
    +extends Object
    +
    A general purpose wrapper for the MurmurHash3. +
      +
    • Inputs can be long, long[], int[], char[], byte[], double or String.
    • +
    • Returns null if arrays or String is null or empty.
    • +
    • Provides methods for returning the 128-bit result as either an array of 2 longs or as a byte + array of 16 bytes.
    • +
    • Provides modulo, asDouble and asInt functions.
    • +
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static doubleasDouble​(long[] hash) +
      Returns a uniform random double with a minimum inclusive value of zero and a maximum exclusive + value of 1.0.
      +
      static intasInt​(byte[] data, + int n) +
      Returns a deterministic uniform random integer between zero (inclusive) and + n (exclusive) given the input data.
      +
      static intasInt​(double datum, + int n) +
      Returns a deterministic uniform random integer between zero (inclusive) and + n (exclusive) given the input double.
      +
      static intasInt​(int[] data, + int n) +
      Returns a deterministic uniform random integer between zero (inclusive) and + n (exclusive) given the input data.
      +
      static intasInt​(long[] data, + int n) +
      Returns a deterministic uniform random integer between zero (inclusive) and + n (exclusive) given the input data.
      +
      static intasInt​(long datum, + int n) +
      Returns a deterministic uniform random integer between zero (inclusive) and + n (exclusive) given the input datum.
      +
      static intasInt​(String datum, + int n) +
      Returns a deterministic uniform random integer between zero (inclusive) and + n (exclusive) given the input datum.
      +
      static byte[]hashToBytes​(byte[] data, + long seed) +
      Hash a byte[] and long seed.
      +
      static byte[]hashToBytes​(char[] data, + long seed) +
      Hash a char[] and long seed.
      +
      static byte[]hashToBytes​(double datum, + long seed) +
      Hash a double and long seed.
      +
      static byte[]hashToBytes​(int[] data, + long seed) +
      Hash an int[] and long seed.
      +
      static byte[]hashToBytes​(long[] data, + long seed) +
      Hash a long[] and long seed.
      +
      static byte[]hashToBytes​(long datum, + long seed) +
      Hash a long and long seed.
      +
      static byte[]hashToBytes​(String datum, + long seed) +
      Hash a String and long seed.
      +
      static long[]hashToLongs​(byte[] data, + long seed) +
      Hash a byte[] and long seed.
      +
      static long[]hashToLongs​(char[] data, + long seed) +
      Hash a char[] and long seed.
      +
      static long[]hashToLongs​(double datum, + long seed) +
      Hash a double and long seed.
      +
      static long[]hashToLongs​(int[] data, + long seed) +
      Hash a int[] and long seed.
      +
      static long[]hashToLongs​(long[] data, + long seed) +
      Hash a long[] and long seed.
      +
      static long[]hashToLongs​(long datum, + long seed) +
      Hash a long and long seed.
      +
      static long[]hashToLongs​(String datum, + long seed) +
      Hash a String and long seed.
      +
      static intmodulo​(long[] hash, + int divisor) +
      Returns the remainder from the modulo division of the 128-bit output of the murmurHash3 by the + divisor.
      +
      static intmodulo​(long h0, + long h1, + int divisor) +
      Returns the remainder from the modulo division of the 128-bit output of the murmurHash3 by the + divisor.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        hashToBytes

        +
        public static byte[] hashToBytes​(long datum,
        +                                 long seed)
        +
        Hash a long and long seed.
        +
        +
        Parameters:
        +
        datum - the input long value
        +
        seed - A long valued seed.
        +
        Returns:
        +
        The 128-bit hash as a byte[16] in Big Endian order from 2 64-bit longs.
        +
        +
      • +
      + + + +
        +
      • +

        hashToBytes

        +
        public static byte[] hashToBytes​(long[] data,
        +                                 long seed)
        +
        Hash a long[] and long seed.
        +
        +
        Parameters:
        +
        data - the input long array
        +
        seed - A long valued seed.
        +
        Returns:
        +
        The 128-bit hash as a byte[16] in Big Endian order from 2 64-bit longs.
        +
        +
      • +
      + + + +
        +
      • +

        hashToBytes

        +
        public static byte[] hashToBytes​(int[] data,
        +                                 long seed)
        +
        Hash an int[] and long seed.
        +
        +
        Parameters:
        +
        data - the input int array
        +
        seed - A long valued seed.
        +
        Returns:
        +
        The 128-bit hash as a byte[16] in Big Endian order from 2 64-bit longs.
        +
        +
      • +
      + + + +
        +
      • +

        hashToBytes

        +
        public static byte[] hashToBytes​(char[] data,
        +                                 long seed)
        +
        Hash a char[] and long seed.
        +
        +
        Parameters:
        +
        data - the input char array
        +
        seed - A long valued seed.
        +
        Returns:
        +
        The 128-bit hash as a byte[16] in Big Endian order from 2 64-bit longs.
        +
        +
      • +
      + + + +
        +
      • +

        hashToBytes

        +
        public static byte[] hashToBytes​(byte[] data,
        +                                 long seed)
        +
        Hash a byte[] and long seed.
        +
        +
        Parameters:
        +
        data - the input byte array
        +
        seed - A long valued seed.
        +
        Returns:
        +
        The 128-bit hash as a byte[16] in Big Endian order from 2 64-bit longs.
        +
        +
      • +
      + + + +
        +
      • +

        hashToBytes

        +
        public static byte[] hashToBytes​(double datum,
        +                                 long seed)
        +
        Hash a double and long seed.
        +
        +
        Parameters:
        +
        datum - the input double
        +
        seed - A long valued seed.
        +
        Returns:
        +
        The 128-bit hash as a byte[16] in Big Endian order from 2 64-bit longs.
        +
        +
      • +
      + + + +
        +
      • +

        hashToBytes

        +
        public static byte[] hashToBytes​(String datum,
        +                                 long seed)
        +
        Hash a String and long seed.
        +
        +
        Parameters:
        +
        datum - the input String
        +
        seed - A long valued seed.
        +
        Returns:
        +
        The 128-bit hash as a byte[16] in Big Endian order from 2 64-bit longs.
        +
        +
      • +
      + + + +
        +
      • +

        hashToLongs

        +
        public static long[] hashToLongs​(long datum,
        +                                 long seed)
        +
        Hash a long and long seed.
        +
        +
        Parameters:
        +
        datum - the input long
        +
        seed - A long valued seed.
        +
        Returns:
        +
        The 128-bit hash as a long[2].
        +
        +
      • +
      + + + +
        +
      • +

        hashToLongs

        +
        public static long[] hashToLongs​(long[] data,
        +                                 long seed)
        +
        Hash a long[] and long seed.
        +
        +
        Parameters:
        +
        data - the input long array.
        +
        seed - A long valued seed.
        +
        Returns:
        +
        The 128-bit hash as a long[2].
        +
        +
      • +
      + + + +
        +
      • +

        hashToLongs

        +
        public static long[] hashToLongs​(int[] data,
        +                                 long seed)
        +
        Hash a int[] and long seed.
        +
        +
        Parameters:
        +
        data - the input int array.
        +
        seed - A long valued seed.
        +
        Returns:
        +
        The 128-bit hash as a long[2].
        +
        +
      • +
      + + + +
        +
      • +

        hashToLongs

        +
        public static long[] hashToLongs​(char[] data,
        +                                 long seed)
        +
        Hash a char[] and long seed.
        +
        +
        Parameters:
        +
        data - the input char array.
        +
        seed - A long valued seed.
        +
        Returns:
        +
        The 128-bit hash as a long[2].
        +
        +
      • +
      + + + +
        +
      • +

        hashToLongs

        +
        public static long[] hashToLongs​(byte[] data,
        +                                 long seed)
        +
        Hash a byte[] and long seed.
        +
        +
        Parameters:
        +
        data - the input byte array.
        +
        seed - A long valued seed.
        +
        Returns:
        +
        The 128-bit hash as a long[2].
        +
        +
      • +
      + + + +
        +
      • +

        hashToLongs

        +
        public static long[] hashToLongs​(double datum,
        +                                 long seed)
        +
        Hash a double and long seed.
        +
        +
        Parameters:
        +
        datum - the input double.
        +
        seed - A long valued seed.
        +
        Returns:
        +
        The 128-bit hash as a long[2].
        +
        +
      • +
      + + + +
        +
      • +

        hashToLongs

        +
        public static long[] hashToLongs​(String datum,
        +                                 long seed)
        +
        Hash a String and long seed.
        +
        +
        Parameters:
        +
        datum - the input String.
        +
        seed - A long valued seed.
        +
        Returns:
        +
        The 128-bit hash as a long[2].
        +
        +
      • +
      + + + +
        +
      • +

        asInt

        +
        public static int asInt​(long[] data,
        +                        int n)
        +
        Returns a deterministic uniform random integer between zero (inclusive) and + n (exclusive) given the input data.
        +
        +
        Parameters:
        +
        data - the input long array.
        +
        n - The upper exclusive bound of the integers produced. Must be > 1.
        +
        Returns:
        +
        deterministic uniform random integer
        +
        +
      • +
      + + + +
        +
      • +

        asInt

        +
        public static int asInt​(int[] data,
        +                        int n)
        +
        Returns a deterministic uniform random integer between zero (inclusive) and + n (exclusive) given the input data.
        +
        +
        Parameters:
        +
        data - the input int array.
        +
        n - The upper exclusive bound of the integers produced. Must be > 1.
        +
        Returns:
        +
        deterministic uniform random integer
        +
        +
      • +
      + + + +
        +
      • +

        asInt

        +
        public static int asInt​(byte[] data,
        +                        int n)
        +
        Returns a deterministic uniform random integer between zero (inclusive) and + n (exclusive) given the input data.
        +
        +
        Parameters:
        +
        data - the input byte array.
        +
        n - The upper exclusive bound of the integers produced. Must be > 1.
        +
        Returns:
        +
        deterministic uniform random integer.
        +
        +
      • +
      + + + +
        +
      • +

        asInt

        +
        public static int asInt​(long datum,
        +                        int n)
        +
        Returns a deterministic uniform random integer between zero (inclusive) and + n (exclusive) given the input datum.
        +
        +
        Parameters:
        +
        datum - the input long
        +
        n - The upper exclusive bound of the integers produced. Must be > 1.
        +
        Returns:
        +
        deterministic uniform random integer
        +
        +
      • +
      + + + +
        +
      • +

        asInt

        +
        public static int asInt​(double datum,
        +                        int n)
        +
        Returns a deterministic uniform random integer between zero (inclusive) and + n (exclusive) given the input double.
        +
        +
        Parameters:
        +
        datum - the given double.
        +
        n - The upper exclusive bound of the integers produced. Must be > 1.
        +
        Returns:
        +
        deterministic uniform random integer
        +
        +
      • +
      + + + +
        +
      • +

        asInt

        +
        public static int asInt​(String datum,
        +                        int n)
        +
        Returns a deterministic uniform random integer between zero (inclusive) and + n (exclusive) given the input datum.
        +
        +
        Parameters:
        +
        datum - the given String.
        +
        n - The upper exclusive bound of the integers produced. Must be > 1.
        +
        Returns:
        +
        deterministic uniform random integer
        +
        +
      • +
      + + + +
        +
      • +

        asDouble

        +
        public static double asDouble​(long[] hash)
        +
        Returns a uniform random double with a minimum inclusive value of zero and a maximum exclusive + value of 1.0. + +

        The double values produced are only as random as the MurmurHash3 algorithm, which may be + adequate for many applications. However, if you are looking for high guarantees of randomness + you should turn to more sophisticated random generators such as Mersenne Twister or Well + algorithms.

        +
        +
        Parameters:
        +
        hash - The output of the MurmurHash3.
        +
        Returns:
        +
        the uniform random double.
        +
        +
      • +
      + + + +
        +
      • +

        modulo

        +
        public static int modulo​(long h0,
        +                         long h1,
        +                         int divisor)
        +
        Returns the remainder from the modulo division of the 128-bit output of the murmurHash3 by the + divisor.
        +
        +
        Parameters:
        +
        h0 - The lower 64-bits of the 128-bit MurmurHash3 hash.
        +
        h1 - The upper 64-bits of the 128-bit MurmurHash3 hash.
        +
        divisor - Must be positive and greater than zero.
        +
        Returns:
        +
        the modulo result.
        +
        +
      • +
      + + + +
        +
      • +

        modulo

        +
        public static int modulo​(long[] hash,
        +                         int divisor)
        +
        Returns the remainder from the modulo division of the 128-bit output of the murmurHash3 by the + divisor.
        +
        +
        Parameters:
        +
        hash - The size 2 long array from the MurmurHash3.
        +
        divisor - Must be positive and greater than zero.
        +
        Returns:
        +
        the modulo result
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/hash/XxHash.html b/docs/5.0.2/org/apache/datasketches/hash/XxHash.html new file mode 100644 index 000000000..ed7f97617 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hash/XxHash.html @@ -0,0 +1,361 @@ + + + + + +XxHash (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class XxHash

+
+
+ +
+
    +
  • +
    +
    public class XxHash
    +extends Object
    +
    The XxHash is a fast, non-cryptographic, 64-bit hash function that has + excellent avalanche and 2-way bit independence properties. + +

    This class wraps the + Memory Component XxHash + implementation.

    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        XxHash

        +
        public XxHash()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        hash

        +
        public static long hash​(org.apache.datasketches.memory.Memory mem,
        +                        long offsetBytes,
        +                        long lengthBytes,
        +                        long seed)
        +
        Compute the hash of the given Memory object.
        +
        +
        Parameters:
        +
        mem - The given Memory object
        +
        offsetBytes - Starting at this offset in bytes
        +
        lengthBytes - Continuing for this number of bytes
        +
        seed - use this seed for the hash function
        +
        Returns:
        +
        return the resulting 64-bit hash value.
        +
        +
      • +
      + + + +
        +
      • +

        hash

        +
        public static long hash​(long in,
        +                        long seed)
        +
        Returns a 64-bit hash.
        +
        +
        Parameters:
        +
        in - a long
        +
        seed - A long valued seed.
        +
        Returns:
        +
        the hash
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/hash/class-use/MurmurHash3.html b/docs/5.0.2/org/apache/datasketches/hash/class-use/MurmurHash3.html new file mode 100644 index 000000000..8e331b0f4 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hash/class-use/MurmurHash3.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.hash.MurmurHash3 (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.hash.MurmurHash3

+
+
No usage of org.apache.datasketches.hash.MurmurHash3
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/hash/class-use/MurmurHash3Adaptor.html b/docs/5.0.2/org/apache/datasketches/hash/class-use/MurmurHash3Adaptor.html new file mode 100644 index 000000000..39ba925ce --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hash/class-use/MurmurHash3Adaptor.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.hash.MurmurHash3Adaptor (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.hash.MurmurHash3Adaptor

+
+
No usage of org.apache.datasketches.hash.MurmurHash3Adaptor
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/hash/class-use/XxHash.html b/docs/5.0.2/org/apache/datasketches/hash/class-use/XxHash.html new file mode 100644 index 000000000..be49bf3c9 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hash/class-use/XxHash.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.hash.XxHash (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.hash.XxHash

+
+
No usage of org.apache.datasketches.hash.XxHash
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/hash/package-summary.html b/docs/5.0.2/org/apache/datasketches/hash/package-summary.html new file mode 100644 index 000000000..42a2948d1 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hash/package-summary.html @@ -0,0 +1,195 @@ + + + + + +org.apache.datasketches.hash (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches.hash

+
+
+
+ + +

The hash package contains a high-performing and extended Java implementations + of Austin Appleby's 128-bit MurmurHash3 hash function originally coded in C. + This core MurmurHash3.java class is used throughout many of the sketch classes for consistency + and as long as the user specifies the same seed will result in coordinated hash operations. + This package also contains an adaptor class that extends the basic class with more functions + commonly associated with hashing. +

+
+
    +
  • + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    MurmurHash3 +
    + The MurmurHash3 is a fast, non-cryptographic, 128-bit hash function that has + excellent avalanche and 2-way bit independence properties.
    +
    MurmurHash3Adaptor +
    A general purpose wrapper for the MurmurHash3.
    +
    XxHash +
    The XxHash is a fast, non-cryptographic, 64-bit hash function that has + excellent avalanche and 2-way bit independence properties.
    +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/hash/package-tree.html b/docs/5.0.2/org/apache/datasketches/hash/package-tree.html new file mode 100644 index 000000000..c96c75dce --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hash/package-tree.html @@ -0,0 +1,166 @@ + + + + + +org.apache.datasketches.hash Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches.hash

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/hash/package-use.html b/docs/5.0.2/org/apache/datasketches/hash/package-use.html new file mode 100644 index 000000000..adb4f878d --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hash/package-use.html @@ -0,0 +1,149 @@ + + + + + +Uses of Package org.apache.datasketches.hash (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches.hash

+
+
No usage of org.apache.datasketches.hash
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/hll/HllSketch.html b/docs/5.0.2/org/apache/datasketches/hll/HllSketch.html new file mode 100644 index 000000000..4f5240691 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hll/HllSketch.html @@ -0,0 +1,1513 @@ + + + + + +HllSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class HllSketch

+
+
+ +
+
    +
  • +
    +
    public class HllSketch
    +extends Object
    +
    The HllSketch is actually a collection of compact implementations of Phillipe Flajolet’s HyperLogLog (HLL) + sketch but with significantly improved error behavior and excellent speed performance. + +

    If the use case for sketching is primarily counting uniques and merging, the HLL sketch is the 2nd highest + performing in terms of accuracy for storage space consumed in the DataSketches library + (the new CPC sketch developed by Kevin J. Lang now beats HLL in terms of accuracy / space). + For large counts, HLL sketches can be 2 to 8 times smaller for the same accuracy than the DataSketches Theta + Sketches when serialized, but the Theta sketches can do set intersections and differences while HLL and CPC cannot. + The CPC sketch and HLL share similar use cases, but the CPC sketch is about 30 to 40% smaller than the HLL sketch + when serialized and larger than the HLL when active in memory. Choose your weapons!

    + +

    A new HLL sketch is created with a simple constructor:

    +
    
    + int lgK = 12; //This is log-base2 of k, so k = 4096. lgK can be from 4 to 21
    + HllSketch sketch = new HllSketch(lgK); //TgtHllType.HLL_4 is the default
    + //OR
    + HllSketch sketch = new HllSketch(lgK, TgtHllType.HLL_6);
    + //OR
    + HllSketch sketch = new HllSketch(lgK, TgtHllType.HLL_8);
    + 
    + +

    All three different sketch types are targets in that the sketches start out in a warm-up mode that is small in + size and gradually grows as needed until the full HLL array is allocated. The HLL_4, HLL_6 and HLL_8 represent + different levels of compression of the final HLL array where the 4, 6 and 8 refer to the number of bits each + bucket of the HLL array is compressed down to. + The HLL_4 is the most compressed but generally slower than the other two, especially during union operations.

    + +

    All three types share the same API. Updating the HllSketch is very simple:

    + +
    
    + long n = 1000000;
    + for (int i = 0; i < n; i++) {
    +   sketch.update(i);
    + }
    + 
    + +

    Each of the presented integers above are first hashed into 128-bit hash values that are used by the sketch + HLL algorithm, so the above loop is essentially equivalent to using a random number generator initialized with a + seed so that the sequence is deterministic and random.

    + +

    Obtaining the cardinality results from the sketch is also simple:

    + +
    
    + double estimate = sketch.getEstimate();
    + double estUB = sketch.getUpperBound(1.0); //the upper bound at 1 standard deviation.
    + double estLB = sketch.getLowerBound(1.0); //the lower bound at 1 standard deviation.
    + //OR
    + System.out.println(sketch.toString()); //will output a summary of the sketch.
    + 
    + +

    Which produces a console output something like this:

    + +
    
    + ### HLL SKETCH SUMMARY:
    +   Log Config K   : 12
    +   Hll Target     : HLL_4
    +   Current Mode   : HLL
    +   LB             : 977348.7024560181
    +   Estimate       : 990116.6007366662
    +   UB             : 1003222.5095308956
    +   OutOfOrder Flag: false
    +   CurMin         : 5
    +   NumAtCurMin    : 1
    +   HipAccum       : 990116.6007366662
    + 
    +
    +
    Author:
    +
    Lee Rhodes, Kevin Lang
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      static TgtHllTypeDEFAULT_HLL_TYPE +
      The default HLL-TYPE is HLL_4
      +
      static intDEFAULT_LG_K +
      The default Log_base2 of K
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      HllSketch() +
      Constructs a new on-heap sketch with the default lgConfigK and tgtHllType.
      +
      HllSketch​(int lgConfigK) +
      Constructs a new on-heap sketch with the default tgtHllType.
      +
      HllSketch​(int lgConfigK, + TgtHllType tgtHllType) +
      Constructs a new on-heap sketch with the type of HLL sketch to configure.
      +
      HllSketch​(int lgConfigK, + TgtHllType tgtHllType, + org.apache.datasketches.memory.WritableMemory dstMem) +
      Constructs a new sketch with the type of HLL sketch to configure and the given + WritableMemory as the destination for the sketch.
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      HllSketchcopy() +
      Return a copy of this sketch onto the Java heap.
      +
      HllSketchcopyAs​(TgtHllType tgtHllType) +
      Return a deep copy of this sketch onto the Java heap with the specified TgtHllType.
      +
      intgetCompactSerializationBytes() +
      Gets the size in bytes of the current sketch when serialized using + toCompactByteArray().
      +
      doublegetCompositeEstimate() +
      This is less accurate than the getEstimate() method and is automatically used + when the sketch has gone through union operations where the more accurate HIP estimator + cannot be used.
      +
      doublegetEstimate() +
      Return the cardinality estimate
      +
      intgetLgConfigK() +
      Gets the lgConfigK.
      +
      doublegetLowerBound​(int numStdDev) +
      Gets the approximate lower error bound given the specified number of Standard Deviations.
      +
      static intgetMaxUpdatableSerializationBytes​(int lgConfigK, + TgtHllType tgtHllType) +
      Returns the maximum size in bytes that this sketch can grow to given lgConfigK.
      +
      static doublegetRelErr​(boolean upperBound, + boolean oooFlag, + int lgConfigK, + int numStdDev) +
      Gets the current (approximate) Relative Error (RE) asymptotic values given several + parameters.
      +
      static intgetSerializationVersion() +
      Returns the current serialization version.
      +
      static intgetSerializationVersion​(org.apache.datasketches.memory.Memory mem) +
      Returns the current serialization version of the given Memory.
      +
      TgtHllTypegetTgtHllType() +
      Gets the TgtHllType
      +
      intgetUpdatableSerializationBytes() +
      Gets the size in bytes of the current sketch when serialized using + toUpdatableByteArray().
      +
      doublegetUpperBound​(int numStdDev) +
      Gets the approximate upper error bound given the specified number of Standard Deviations.
      +
      static HllSketchheapify​(byte[] byteArray) +
      Heapify the given byte array, which must be a valid HllSketch image and may have data.
      +
      static HllSketchheapify​(org.apache.datasketches.memory.Memory srcMem) +
      Heapify the given Memory, which must be a valid HllSketch image and may have data.
      +
      booleanisCompact() +
      Returns true if the backing memory of this sketch is in compact form.
      +
      booleanisEmpty() +
      Returns true if empty
      +
      booleanisEstimationMode() +
      This HLL family of sketches and operators is always estimating, even for very small values.
      +
      booleanisMemory() +
      Returns true if this sketch was created using Memory.
      +
      booleanisOffHeap() +
      Returns true if the backing memory for this sketch is off-heap.
      +
      booleanisSameResource​(org.apache.datasketches.memory.Memory mem) +
      Returns true if the given Memory refers to the same underlying resource as this sketch.
      +
      voidreset() +
      Resets to empty, but does not change the configured values of lgConfigK and tgtHllType.
      +
      byte[]toCompactByteArray() +
      Serializes this sketch as a byte array in compact form.
      +
      StringtoString() +
      Human readable summary as a string.
      +
      StringtoString​(boolean summary, + boolean detail, + boolean auxDetail) +
      Human readable summary with optional detail.
      +
      StringtoString​(boolean summary, + boolean detail, + boolean auxDetail, + boolean all) +
      Human readable summary with optional detail
      +
      static StringtoString​(byte[] byteArr) +
      Returns a human readable string of the preamble of a byte array image of an HllSketch.
      +
      static StringtoString​(org.apache.datasketches.memory.Memory mem) +
      Returns a human readable string of the preamble of a Memory image of an HllSketch.
      +
      byte[]toUpdatableByteArray() +
      Serializes this sketch as a byte array in an updatable form.
      +
      voidupdate​(byte[] data) +
      Present the given byte array as a potential unique item.
      +
      voidupdate​(char[] data) +
      Present the given char array as a potential unique item.
      +
      voidupdate​(double datum) +
      Present the given double (or float) datum as a potential unique item.
      +
      voidupdate​(int[] data) +
      Present the given integer array as a potential unique item.
      +
      voidupdate​(long datum) +
      Present the given long as a potential unique item.
      +
      voidupdate​(long[] data) +
      Present the given long array as a potential unique item.
      +
      voidupdate​(String datum) +
      Present the given String as a potential unique item.
      +
      voidupdate​(ByteBuffer data) +
      Present the given byte buffer as a potential unique item.
      +
      static HllSketchwrap​(org.apache.datasketches.memory.Memory srcMem) +
      Wraps the given read-only Memory that must be a image of a valid sketch, + which may be in compact or updatable form, and should have data.
      +
      static HllSketchwritableWrap​(org.apache.datasketches.memory.WritableMemory srcWmem) +
      Wraps the given WritableMemory, which must be a image of a valid updatable sketch, + and may have data.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        DEFAULT_LG_K

        +
        public static final int DEFAULT_LG_K
        +
        The default Log_base2 of K
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        DEFAULT_HLL_TYPE

        +
        public static final TgtHllType DEFAULT_HLL_TYPE
        +
        The default HLL-TYPE is HLL_4
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HllSketch

        +
        public HllSketch()
        +
        Constructs a new on-heap sketch with the default lgConfigK and tgtHllType.
        +
      • +
      + + + +
        +
      • +

        HllSketch

        +
        public HllSketch​(int lgConfigK)
        +
        Constructs a new on-heap sketch with the default tgtHllType.
        +
        +
        Parameters:
        +
        lgConfigK - The Log2 of K for the target HLL sketch. This value must be + between 4 and 21 inclusively.
        +
        +
      • +
      + + + +
        +
      • +

        HllSketch

        +
        public HllSketch​(int lgConfigK,
        +                 TgtHllType tgtHllType)
        +
        Constructs a new on-heap sketch with the type of HLL sketch to configure.
        +
        +
        Parameters:
        +
        lgConfigK - The Log2 of K for the target HLL sketch. This value must be + between 4 and 21 inclusively.
        +
        tgtHllType - the desired HLL type.
        +
        +
      • +
      + + + +
        +
      • +

        HllSketch

        +
        public HllSketch​(int lgConfigK,
        +                 TgtHllType tgtHllType,
        +                 org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Constructs a new sketch with the type of HLL sketch to configure and the given + WritableMemory as the destination for the sketch. This WritableMemory is usually configured + for off-heap memory. What remains on the java heap is a thin wrapper object that reads and + writes to the given WritableMemory. + +

        The given dstMem is checked for the required capacity as determined by + getMaxUpdatableSerializationBytes(int, TgtHllType).

        +
        +
        Parameters:
        +
        lgConfigK - The Log2 of K for the target HLL sketch. This value must be + between 4 and 21 inclusively.
        +
        tgtHllType - the desired HLL type.
        +
        dstMem - the destination memory for the sketch.
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        heapify

        +
        public static final HllSketch heapify​(byte[] byteArray)
        +
        Heapify the given byte array, which must be a valid HllSketch image and may have data.
        +
        +
        Parameters:
        +
        byteArray - the given byte array. This byteArray is not modified and is not retained + by the on-heap sketch.
        +
        Returns:
        +
        an HllSketch on the java heap.
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static final HllSketch heapify​(org.apache.datasketches.memory.Memory srcMem)
        +
        Heapify the given Memory, which must be a valid HllSketch image and may have data.
        +
        +
        Parameters:
        +
        srcMem - the given Memory, which is read-only.
        +
        Returns:
        +
        an HllSketch on the java heap.
        +
        +
      • +
      + + + +
        +
      • +

        writableWrap

        +
        public static final HllSketch writableWrap​(org.apache.datasketches.memory.WritableMemory srcWmem)
        +
        Wraps the given WritableMemory, which must be a image of a valid updatable sketch, + and may have data. What remains on the java heap is a + thin wrapper object that reads and writes to the given WritableMemory, which, depending on + how the user configures the WritableMemory, may actually reside on the Java heap or off-heap. + +

        The given dstMem is checked for the required capacity as determined by + getMaxUpdatableSerializationBytes(int, TgtHllType).

        +
        +
        Parameters:
        +
        srcWmem - an writable image of a valid source sketch with data.
        +
        Returns:
        +
        an HllSketch where the sketch data is in the given dstMem.
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static final HllSketch wrap​(org.apache.datasketches.memory.Memory srcMem)
        +
        Wraps the given read-only Memory that must be a image of a valid sketch, + which may be in compact or updatable form, and should have data. Any attempt to update the + given source Memory will throw an exception.
        +
        +
        Parameters:
        +
        srcMem - a read-only image of a valid source sketch.
        +
        Returns:
        +
        an HllSketch, where the read-only data of the sketch is in the given srcMem.
        +
        +
      • +
      + + + +
        +
      • +

        copy

        +
        public HllSketch copy()
        +
        Return a copy of this sketch onto the Java heap.
        +
        +
        Returns:
        +
        a copy of this sketch onto the Java heap.
        +
        +
      • +
      + + + +
        +
      • +

        copyAs

        +
        public HllSketch copyAs​(TgtHllType tgtHllType)
        +
        Return a deep copy of this sketch onto the Java heap with the specified TgtHllType.
        +
        +
        Parameters:
        +
        tgtHllType - the TgtHllType enum
        +
        Returns:
        +
        a deep copy of this sketch with the specified TgtHllType.
        +
        +
      • +
      + + + +
        +
      • +

        getCompositeEstimate

        +
        public double getCompositeEstimate()
        +
        This is less accurate than the getEstimate() method and is automatically used + when the sketch has gone through union operations where the more accurate HIP estimator + cannot be used. + This is made public only for error characterization software that exists in separate + packages and is not intended for normal use.
        +
        +
        Returns:
        +
        the composite estimate
        +
        +
      • +
      + + + +
        +
      • +

        getEstimate

        +
        public double getEstimate()
        +
        Return the cardinality estimate
        +
        +
        Returns:
        +
        the cardinality estimate
        +
        +
      • +
      + + + +
        +
      • +

        getLgConfigK

        +
        public int getLgConfigK()
        +
        Gets the lgConfigK.
        +
        +
        Returns:
        +
        the lgConfigK.
        +
        +
      • +
      + + + +
        +
      • +

        getCompactSerializationBytes

        +
        public int getCompactSerializationBytes()
        +
        Gets the size in bytes of the current sketch when serialized using + toCompactByteArray().
        +
        +
        Returns:
        +
        the size in bytes of the current sketch when serialized using + toCompactByteArray().
        +
        +
      • +
      + + + +
        +
      • +

        getLowerBound

        +
        public double getLowerBound​(int numStdDev)
        +
        Gets the approximate lower error bound given the specified number of Standard Deviations.
        +
        +
        Parameters:
        +
        numStdDev - This must be an integer between 1 and 3, inclusive. + See Number of Standard Deviations
        +
        Returns:
        +
        the lower bound.
        +
        +
      • +
      + + + +
        +
      • +

        getMaxUpdatableSerializationBytes

        +
        public static final int getMaxUpdatableSerializationBytes​(int lgConfigK,
        +                                                          TgtHllType tgtHllType)
        +
        Returns the maximum size in bytes that this sketch can grow to given lgConfigK. + However, for the HLL_4 sketch type, this value can be exceeded in extremely rare cases. + If exceeded, it will be larger by only a few percent.
        +
        +
        Parameters:
        +
        lgConfigK - The Log2 of K for the target HLL sketch. This value must be + between 4 and 21 inclusively.
        +
        tgtHllType - the desired Hll type
        +
        Returns:
        +
        the maximum size in bytes that this sketch can grow to.
        +
        +
      • +
      + + + +
        +
      • +

        getTgtHllType

        +
        public TgtHllType getTgtHllType()
        +
        Gets the TgtHllType
        +
        +
        Returns:
        +
        the TgtHllType enum value
        +
        +
      • +
      + + + +
        +
      • +

        getUpdatableSerializationBytes

        +
        public int getUpdatableSerializationBytes()
        +
        Gets the size in bytes of the current sketch when serialized using + toUpdatableByteArray().
        +
        +
        Returns:
        +
        the size in bytes of the current sketch when serialized using + toUpdatableByteArray().
        +
        +
      • +
      + + + +
        +
      • +

        getUpperBound

        +
        public double getUpperBound​(int numStdDev)
        +
        Gets the approximate upper error bound given the specified number of Standard Deviations.
        +
        +
        Parameters:
        +
        numStdDev - This must be an integer between 1 and 3, inclusive. + Number of Standard Deviations
        +
        Returns:
        +
        the upper bound.
        +
        +
      • +
      + + + +
        +
      • +

        isCompact

        +
        public boolean isCompact()
        +
        Returns true if the backing memory of this sketch is in compact form.
        +
        +
        Returns:
        +
        true if the backing memory of this sketch is in compact form.
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        Returns true if empty
        +
        +
        Returns:
        +
        true if empty
        +
        +
      • +
      + + + +
        +
      • +

        isMemory

        +
        public boolean isMemory()
        +
        Returns true if this sketch was created using Memory.
        +
        +
        Returns:
        +
        true if this sketch was created using Memory.
        +
        +
      • +
      + + + +
        +
      • +

        isOffHeap

        +
        public boolean isOffHeap()
        +
        Returns true if the backing memory for this sketch is off-heap.
        +
        +
        Returns:
        +
        true if the backing memory for this sketch is off-heap.
        +
        +
      • +
      + + + +
        +
      • +

        isSameResource

        +
        public boolean isSameResource​(org.apache.datasketches.memory.Memory mem)
        +
        Returns true if the given Memory refers to the same underlying resource as this sketch. + The capacities must be the same. If this is a region, + the region offset must also be the same. + +

        This is only relevant for HLL_4 sketches that have been configured for off-heap + using WritableMemory or Memory. For on-heap sketches or unions this will return false. + +

        It is rare, but possible, the the off-heap memory that has been allocated to an HLL_4 + sketch may not be large enough. If this should happen, the sketch makes a request for more + memory from the owner of the resource and then moves itself to this new location. This all + happens transparently to the user. This method provides a means for the user to + inquire of the sketch if it has, in fact, moved itself.

        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        Returns:
        +
        true if the given Memory refers to the same underlying resource as this sketch or + union.
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Resets to empty, but does not change the configured values of lgConfigK and tgtHllType.
        +
      • +
      + + + +
        +
      • +

        toCompactByteArray

        +
        public byte[] toCompactByteArray()
        +
        Serializes this sketch as a byte array in compact form. The compact form is smaller in size + than the updatable form and read-only. It can be used in union operations as follows: +
        
        +     Union union; HllSketch sk, sk2;
        +     int lgK = 12;
        +     sk = new HllSketch(lgK, TgtHllType.HLL_4); //can be 4, 6, or 8
        +     for (int i = 0; i < (2 << lgK); i++) { sk.update(i); }
        +     byte[] arr = HllSketch.toCompactByteArray();
        +     //...
        +     union = Union.heapify(arr); //initializes the union using data from the array.
        +     //OR, if used in an off-heap environment:
        +     union = Union.heapify(Memory.wrap(arr)); //same as above, except from Memory object.
        +
        +     //To recover an updatable heap sketch:
        +     sk2 = HllSketch.heapify(arr);
        +     //OR, if used in an off-heap environment:
        +     sk2 = HllSketch.heapify(Memory.wrap(arr));
        + 
        + +

        The sketch "wrapping" operation skips actual deserialization thus is quite fast. However, + any attempt to update the derived HllSketch will result in a Read-only exception.

        + +

        Note that in some cases, based on the state of the sketch, the compact form is + indistiguishable from the updatable form. In these cases the updatable form is returned + and the compact flag bit will not be set.

        +
        +
        Returns:
        +
        this sketch as a compact byte array.
        +
        +
      • +
      + + + +
        +
      • +

        toUpdatableByteArray

        +
        public byte[] toUpdatableByteArray()
        +
        Serializes this sketch as a byte array in an updatable form. The updatable form is larger than + the compact form. The use of this form is primarily in environments that support updating + sketches in off-heap memory. If the sketch is constructed using HLL_8, sketch updating and + union updating operations can actually occur in WritableMemory, which can be off-heap: +
        
        +     Union union; HllSketch sk;
        +     int lgK = 12;
        +     sk = new HllSketch(lgK, TgtHllType.HLL_8) //must be 8
        +     for (int i = 0; i < (2 << lgK); i++) { sk.update(i); }
        +     byte[] arr = sk.toUpdatableByteArray();
        +     WritableMemory wmem = WritableMemory.wrap(arr);
        +     //...
        +     union = Union.writableWrap(wmem); //no deserialization!
        + 
        +
        +
        Returns:
        +
        this sketch as an updatable byte array.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString​(boolean summary,
        +                       boolean detail,
        +                       boolean auxDetail,
        +                       boolean all)
        +
        Human readable summary with optional detail
        +
        +
        Parameters:
        +
        summary - if true, output the sketch summary
        +
        detail - if true, output the internal data array
        +
        auxDetail - if true, output the internal Aux array, if it exists.
        +
        all - if true, outputs all entries including empty ones
        +
        Returns:
        +
        human readable string with optional detail.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString​(byte[] byteArr)
        +
        Returns a human readable string of the preamble of a byte array image of an HllSketch.
        +
        +
        Parameters:
        +
        byteArr - the given byte array
        +
        Returns:
        +
        a human readable string of the preamble of a byte array image of an HllSketch.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString​(org.apache.datasketches.memory.Memory mem)
        +
        Returns a human readable string of the preamble of a Memory image of an HllSketch.
        +
        +
        Parameters:
        +
        mem - the given Memory object
        +
        Returns:
        +
        a human readable string of the preamble of a Memory image of an HllSketch.
        +
        +
      • +
      + + + +
        +
      • +

        getSerializationVersion

        +
        public static final int getSerializationVersion()
        +
        Returns the current serialization version.
        +
        +
        Returns:
        +
        the current serialization version.
        +
        +
      • +
      + + + +
        +
      • +

        getSerializationVersion

        +
        public static final int getSerializationVersion​(org.apache.datasketches.memory.Memory mem)
        +
        Returns the current serialization version of the given Memory.
        +
        +
        Parameters:
        +
        mem - the given Memory containing a serialized HllSketch image.
        +
        Returns:
        +
        the current serialization version.
        +
        +
      • +
      + + + +
        +
      • +

        getRelErr

        +
        public static double getRelErr​(boolean upperBound,
        +                               boolean oooFlag,
        +                               int lgConfigK,
        +                               int numStdDev)
        +
        Gets the current (approximate) Relative Error (RE) asymptotic values given several + parameters. This is used primarily for testing.
        +
        +
        Parameters:
        +
        upperBound - return the RE for the Upper Bound, otherwise for the Lower Bound.
        +
        oooFlag - set true if the sketch is the result of a non qualifying union operation.
        +
        lgConfigK - the configured value for the sketch.
        +
        numStdDev - the given number of Standard Deviations. This must be an integer between + 1 and 3, inclusive. + Number of Standard Deviations
        +
        Returns:
        +
        the current (approximate) RelativeError
        +
        +
      • +
      + + + +
        +
      • +

        isEstimationMode

        +
        public boolean isEstimationMode()
        +
        This HLL family of sketches and operators is always estimating, even for very small values.
        +
        +
        Returns:
        +
        true
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Human readable summary as a string.
        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        Human readable summary as a string.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString​(boolean summary,
        +                       boolean detail,
        +                       boolean auxDetail)
        +
        Human readable summary with optional detail. Does not list empty entries.
        +
        +
        Parameters:
        +
        summary - if true, output the sketch summary
        +
        detail - if true, output the internal data array
        +
        auxDetail - if true, output the internal Aux array, if it exists.
        +
        Returns:
        +
        human readable string with optional detail.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(long datum)
        +
        Present the given long as a potential unique item.
        +
        +
        Parameters:
        +
        datum - The given long datum.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(double datum)
        +
        Present the given double (or float) datum as a potential unique item. + The double will be converted to a long using Double.doubleToLongBits(datum), + which normalizes all NaN values to a single NaN representation. + Plus and minus zero will be normalized to plus zero. + The special floating-point values NaN and +/- Infinity are treated as distinct.
        +
        +
        Parameters:
        +
        datum - The given double datum.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(String datum)
        +
        Present the given String as a potential unique item. + The string is converted to a byte array using UTF8 encoding. + If the string is null or empty no update attempt is made and the method returns. + +

        Note: About 2X faster performance can be obtained by first converting the String to a + char[] and updating the sketch with that. This bypasses the complexity of the Java UTF_8 + encoding. This, of course, will not produce the same internal hash values as updating directly + with a String. So be consistent! Unioning two sketches, one fed with strings and the other + fed with char[] will be meaningless. +

        +
        +
        Parameters:
        +
        datum - The given String.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(ByteBuffer data)
        +
        Present the given byte buffer as a potential unique item. + Bytes are read from the current position of the buffer until its limit. + If the byte buffer is null or has no bytes remaining, no update attempt is made and the method returns. + +

        This method will not modify the position, mark, limit, or byte order of the buffer.

        + +

        Little-endian order is preferred, but not required. This method may perform better if the provided byte + buffer is in little-endian order.

        +
        +
        Parameters:
        +
        data - The given byte buffer.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(byte[] data)
        +
        Present the given byte array as a potential unique item. + If the byte array is null or empty no update attempt is made and the method returns.
        +
        +
        Parameters:
        +
        data - The given byte array.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(char[] data)
        +
        Present the given char array as a potential unique item. + If the char array is null or empty no update attempt is made and the method returns. + +

        Note: this will not produce the same output hash values as the update(String) + method but will be a little faster as it avoids the complexity of the UTF8 encoding.

        +
        +
        Parameters:
        +
        data - The given char array.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(int[] data)
        +
        Present the given integer array as a potential unique item. + If the integer array is null or empty no update attempt is made and the method returns.
        +
        +
        Parameters:
        +
        data - The given int array.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(long[] data)
        +
        Present the given long array as a potential unique item. + If the long array is null or empty no update attempt is made and the method returns.
        +
        +
        Parameters:
        +
        data - The given long array.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/hll/TgtHllType.html b/docs/5.0.2/org/apache/datasketches/hll/TgtHllType.html new file mode 100644 index 000000000..fa65f6fd1 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hll/TgtHllType.html @@ -0,0 +1,438 @@ + + + + + +TgtHllType (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum TgtHllType

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Serializable, Comparable<TgtHllType>
    +
    +
    +
    public enum TgtHllType
    +extends Enum<TgtHllType>
    +
    Specifies the target type of HLL sketch to be created. It is a target in that the actual + allocation of the HLL array is deferred until sufficient number of items have been received by + the warm-up phases. + +

    These three target types are isomorphic representations of the same underlying HLL algorithm. + Thus, given the same value of lgConfigK and the same input, all three HLL target types + will produce identical estimates and have identical error distributions.

    + +

    The memory (and also the serialization) of the sketch during this early warmup phase starts + out very small (8 bytes, when empty) and then grows in increments of 4 bytes as required + until the full HLL array is allocated. This transition point occurs at about 10% of K for + sketches where lgConfigK is > 8.

    + +
      +
    • HLL 8 This uses an 8-bit byte per HLL bucket. It is generally the + fastest in terms of update time, but has the largest storage footprint of about + K bytes.
    • + +
    • HLL 6 This uses a 6-bit field per HLL bucket. It is the generally the next fastest + in terms of update time with a storage footprint of about 3/4 * K bytes.
    • + +
    • HLL 4 This uses a 4-bit field per HLL bucket and for large counts may require + the use of a small internal auxiliary array for storing statistical exceptions, which are rare. + For the values of lgConfigK > 13 (K = 8192), + this additional array adds about 3% to the overall storage. It is generally the slowest in + terms of update time, but has the smallest storage footprint of about + K/2 * 1.03 bytes.
    • +
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static TgtHllType[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (TgtHllType c : TgtHllType.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static TgtHllType valueOf​(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        fromOrdinal

        +
        public static final TgtHllType fromOrdinal​(int typeId)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/hll/Union.html b/docs/5.0.2/org/apache/datasketches/hll/Union.html new file mode 100644 index 000000000..2c72486ae --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hll/Union.html @@ -0,0 +1,1311 @@ + + + + + +Union (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Union

+
+
+ +
+
    +
  • +
    +
    public class Union
    +extends Object
    +
    This performs union operations for all HllSketches. This union operator can be configured to be + on or off heap. The source sketch given to this union using the update(HllSketch) can + be configured with any precision value lgConfigK (from 4 to 21), any TgtHllType + (HLL_4, HLL_6, HLL_8), and either on or off-heap; and it can be in either of the sparse modes + (LIST or SET), or the dense mode (HLL). + +

    Although the API for this union operator parallels many of the methods of the + HllSketch, the behavior of the union operator has some fundamental differences.

    + +

    First, this union operator is configured with a lgMaxK instead of the normal + lgConfigK. Generally, this union operator will inherit the lowest lgConfigK + less than lgMaxK that it has seen. However, the lgConfigK of incoming sketches that + are still in sparse are ignored. The lgMaxK provides the user the ability to specify the + largest maximum size for the union operation. + +

    Second, the user cannot specify the TgtHllType as an input parameter to the union. + Instead, it is specified for the sketch returned with getResult(TgtHllType). + +

    The following graph illustrates the HLL Merge speed.

    + +

    HLL LgK12 Union Speed

    + This graph illustrates the relative merging speed of the HLL 4,6,8 Java HLL sketches compared to + the DataSketches C++ implementations of the same sketches. With this particular test (merging 32 relative large + sketches together), the Java HLL 8 is the fastest and the Java HLL 4 the slowest, with a mixed cluster in the middle. + Union / Merging speed is somewhat difficult to measure as the performance is very dependent on the mix of sketch + sizes (and types) you are merging. So your mileage will vary! + +

    For a complete example of using the Union operator + see Union Example.

    +
    +
    Author:
    +
    Lee Rhodes, Kevin Lang
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Union() +
      Construct this Union operator with the default maximum log-base-2 of K.
      +
      Union​(int lgMaxK) +
      Construct this Union operator with a given maximum log-base-2 of K.
      +
      Union​(int lgMaxK, + org.apache.datasketches.memory.WritableMemory dstWmem) +
      Construct this Union operator with a given maximum log-base-2 of K and the given + WritableMemory as the destination for this Union.
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      intgetCompactSerializationBytes() +
      Gets the size in bytes of the current sketch when serialized using + toCompactByteArray().
      +
      doublegetCompositeEstimate() +
      This is less accurate than the getEstimate() method and is automatically used + when the sketch has gone through union operations where the more accurate HIP estimator + cannot be used.
      +
      doublegetEstimate() +
      Return the cardinality estimate
      +
      intgetLgConfigK() +
      Gets the effective lgConfigK for the union operator, which may be less than + lgMaxK.
      +
      doublegetLowerBound​(int numStdDev) +
      Gets the approximate lower error bound given the specified number of Standard Deviations.
      +
      static intgetMaxSerializationBytes​(int lgK) +
      Returns the maximum size in bytes that this union operator can grow to given a lgK.
      +
      static doublegetRelErr​(boolean upperBound, + boolean oooFlag, + int lgConfigK, + int numStdDev) +
      Gets the current (approximate) Relative Error (RE) asymptotic values given several + parameters.
      +
      HllSketchgetResult() +
      Return the result of this union operator as an HLL_4 sketch.
      +
      HllSketchgetResult​(TgtHllType tgtHllType) +
      Return the result of this union operator with the specified TgtHllType
      +
      static intgetSerializationVersion() +
      Returns the current serialization version.
      +
      static intgetSerializationVersion​(org.apache.datasketches.memory.Memory mem) +
      Returns the current serialization version of the given Memory.
      +
      TgtHllTypegetTgtHllType() +
      Gets the TgtHllType
      +
      intgetUpdatableSerializationBytes() +
      Gets the size in bytes of the current sketch when serialized using + toUpdatableByteArray().
      +
      doublegetUpperBound​(int numStdDev) +
      Gets the approximate upper error bound given the specified number of Standard Deviations.
      +
      static Unionheapify​(byte[] byteArray) +
      Construct a union operator populated with the given byte array image of an HllSketch.
      +
      static Unionheapify​(org.apache.datasketches.memory.Memory mem) +
      Construct a union operator populated with the given Memory image of an HllSketch.
      +
      booleanisCompact() +
      Returns true if the backing memory of this sketch is in compact form.
      +
      booleanisEmpty() +
      Returns true if empty
      +
      booleanisEstimationMode() +
      This HLL family of sketches and operators is always estimating, even for very small values.
      +
      booleanisMemory() +
      Returns true if this sketch was created using Memory.
      +
      booleanisOffHeap() +
      Returns true if the backing memory for this sketch is off-heap.
      +
      booleanisSameResource​(org.apache.datasketches.memory.Memory mem) +
      Returns true if the given Memory refers to the same underlying resource as this sketch.
      +
      voidreset() +
      Resets to empty and retains the current lgK, but does not change the configured value of + lgMaxK.
      +
      byte[]toCompactByteArray() +
      Gets the serialization of this union operator as a byte array in compact form, which is + designed to be heapified only.
      +
      StringtoString() +
      Human readable summary as a string.
      +
      StringtoString​(boolean summary, + boolean detail, + boolean auxDetail) +
      Human readable summary with optional detail.
      +
      StringtoString​(boolean summary, + boolean hllDetail, + boolean auxDetail, + boolean all) +
      Human readable summary with optional detail
      +
      byte[]toUpdatableByteArray() +
      Serializes this sketch as a byte array in an updatable form.
      +
      voidupdate​(byte[] data) +
      Present the given byte array as a potential unique item.
      +
      voidupdate​(char[] data) +
      Present the given char array as a potential unique item.
      +
      voidupdate​(double datum) +
      Present the given double (or float) datum as a potential unique item.
      +
      voidupdate​(int[] data) +
      Present the given integer array as a potential unique item.
      +
      voidupdate​(long datum) +
      Present the given long as a potential unique item.
      +
      voidupdate​(long[] data) +
      Present the given long array as a potential unique item.
      +
      voidupdate​(String datum) +
      Present the given String as a potential unique item.
      +
      voidupdate​(ByteBuffer data) +
      Present the given byte buffer as a potential unique item.
      +
      voidupdate​(HllSketch sketch) +
      Update this union operator with the given sketch.
      +
      static UnionwritableWrap​(org.apache.datasketches.memory.WritableMemory srcWmem) +
      Wraps the given WritableMemory, which must be a image of a valid updatable HLL_8 sketch, + and may have data.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Union

        +
        public Union()
        +
        Construct this Union operator with the default maximum log-base-2 of K.
        +
      • +
      + + + +
        +
      • +

        Union

        +
        public Union​(int lgMaxK)
        +
        Construct this Union operator with a given maximum log-base-2 of K.
        +
        +
        Parameters:
        +
        lgMaxK - the desired maximum log-base-2 of K. This value must be + between 4 and 21 inclusively.
        +
        +
      • +
      + + + +
        +
      • +

        Union

        +
        public Union​(int lgMaxK,
        +             org.apache.datasketches.memory.WritableMemory dstWmem)
        +
        Construct this Union operator with a given maximum log-base-2 of K and the given + WritableMemory as the destination for this Union. This WritableMemory is usually configured + for off-heap memory. What remains on the java heap is a thin wrapper object that reads and + writes to the given WritableMemory. + +

        The given dstMem is checked for the required capacity as determined by + HllSketch.getMaxUpdatableSerializationBytes(int, TgtHllType).

        +
        +
        Parameters:
        +
        lgMaxK - the desired maximum log-base-2 of K. This value must be + between 4 and 21 inclusively.
        +
        dstWmem - the destination writable memory for the sketch.
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        heapify

        +
        public static final Union heapify​(byte[] byteArray)
        +
        Construct a union operator populated with the given byte array image of an HllSketch.
        +
        +
        Parameters:
        +
        byteArray - the given byte array
        +
        Returns:
        +
        a union operator populated with the given byte array image of an HllSketch.
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static final Union heapify​(org.apache.datasketches.memory.Memory mem)
        +
        Construct a union operator populated with the given Memory image of an HllSketch.
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        Returns:
        +
        a union operator populated with the given Memory image of an HllSketch.
        +
        +
      • +
      + + + +
        +
      • +

        writableWrap

        +
        public static final Union writableWrap​(org.apache.datasketches.memory.WritableMemory srcWmem)
        +
        Wraps the given WritableMemory, which must be a image of a valid updatable HLL_8 sketch, + and may have data. What remains on the java heap is a + thin wrapper object that reads and writes to the given WritableMemory, which, depending on + how the user configures the WritableMemory, may actually reside on the Java heap or off-heap. + +

        The given dstMem is checked for the required capacity as determined by + HllSketch.getMaxUpdatableSerializationBytes(int, TgtHllType), and for the correct type.

        +
        +
        Parameters:
        +
        srcWmem - an writable image of a valid sketch with data.
        +
        Returns:
        +
        a Union operator where the sketch data is in the given dstMem.
        +
        +
      • +
      + + + +
        +
      • +

        getCompositeEstimate

        +
        public double getCompositeEstimate()
        +
        This is less accurate than the getEstimate() method and is automatically used + when the sketch has gone through union operations where the more accurate HIP estimator + cannot be used. + This is made public only for error characterization software that exists in separate + packages and is not intended for normal use.
        +
        +
        Returns:
        +
        the composite estimate
        +
        +
      • +
      + + + +
        +
      • +

        getCompactSerializationBytes

        +
        public int getCompactSerializationBytes()
        +
        Gets the size in bytes of the current sketch when serialized using + toCompactByteArray().
        +
        +
        Returns:
        +
        the size in bytes of the current sketch when serialized using + toCompactByteArray().
        +
        +
      • +
      + + + +
        +
      • +

        getEstimate

        +
        public double getEstimate()
        +
        Return the cardinality estimate
        +
        +
        Returns:
        +
        the cardinality estimate
        +
        +
      • +
      + + + +
        +
      • +

        getLgConfigK

        +
        public int getLgConfigK()
        +
        Gets the effective lgConfigK for the union operator, which may be less than + lgMaxK.
        +
        +
        Returns:
        +
        the lgConfigK.
        +
        +
      • +
      + + + +
        +
      • +

        getLowerBound

        +
        public double getLowerBound​(int numStdDev)
        +
        Gets the approximate lower error bound given the specified number of Standard Deviations.
        +
        +
        Parameters:
        +
        numStdDev - This must be an integer between 1 and 3, inclusive. + See Number of Standard Deviations
        +
        Returns:
        +
        the lower bound.
        +
        +
      • +
      + + + +
        +
      • +

        getMaxSerializationBytes

        +
        public static int getMaxSerializationBytes​(int lgK)
        +
        Returns the maximum size in bytes that this union operator can grow to given a lgK.
        +
        +
        Parameters:
        +
        lgK - The maximum Log2 of K for this union operator. This value must be + between 4 and 21 inclusively.
        +
        Returns:
        +
        the maximum size in bytes that this union operator can grow to.
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public HllSketch getResult()
        +
        Return the result of this union operator as an HLL_4 sketch.
        +
        +
        Returns:
        +
        the result of this union operator as an HLL_4 sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public HllSketch getResult​(TgtHllType tgtHllType)
        +
        Return the result of this union operator with the specified TgtHllType
        +
        +
        Parameters:
        +
        tgtHllType - the TgtHllType enum
        +
        Returns:
        +
        the result of this union operator with the specified TgtHllType
        +
        +
      • +
      + + + +
        +
      • +

        getTgtHllType

        +
        public TgtHllType getTgtHllType()
        +
        Gets the TgtHllType
        +
        +
        Returns:
        +
        the TgtHllType enum value
        +
        +
      • +
      + + + +
        +
      • +

        getUpdatableSerializationBytes

        +
        public int getUpdatableSerializationBytes()
        +
        Gets the size in bytes of the current sketch when serialized using + toUpdatableByteArray().
        +
        +
        Returns:
        +
        the size in bytes of the current sketch when serialized using + toUpdatableByteArray().
        +
        +
      • +
      + + + +
        +
      • +

        getUpperBound

        +
        public double getUpperBound​(int numStdDev)
        +
        Gets the approximate upper error bound given the specified number of Standard Deviations.
        +
        +
        Parameters:
        +
        numStdDev - This must be an integer between 1 and 3, inclusive. + Number of Standard Deviations
        +
        Returns:
        +
        the upper bound.
        +
        +
      • +
      + + + +
        +
      • +

        isCompact

        +
        public boolean isCompact()
        +
        Returns true if the backing memory of this sketch is in compact form.
        +
        +
        Returns:
        +
        true if the backing memory of this sketch is in compact form.
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        Returns true if empty
        +
        +
        Returns:
        +
        true if empty
        +
        +
      • +
      + + + +
        +
      • +

        isMemory

        +
        public boolean isMemory()
        +
        Returns true if this sketch was created using Memory.
        +
        +
        Returns:
        +
        true if this sketch was created using Memory.
        +
        +
      • +
      + + + +
        +
      • +

        isOffHeap

        +
        public boolean isOffHeap()
        +
        Returns true if the backing memory for this sketch is off-heap.
        +
        +
        Returns:
        +
        true if the backing memory for this sketch is off-heap.
        +
        +
      • +
      + + + +
        +
      • +

        isSameResource

        +
        public boolean isSameResource​(org.apache.datasketches.memory.Memory mem)
        +
        Returns true if the given Memory refers to the same underlying resource as this sketch. + The capacities must be the same. If this is a region, + the region offset must also be the same. + +

        This is only relevant for HLL_4 sketches that have been configured for off-heap + using WritableMemory or Memory. For on-heap sketches or unions this will return false. + +

        It is rare, but possible, the the off-heap memory that has been allocated to an HLL_4 + sketch may not be large enough. If this should happen, the sketch makes a request for more + memory from the owner of the resource and then moves itself to this new location. This all + happens transparently to the user. This method provides a means for the user to + inquire of the sketch if it has, in fact, moved itself.

        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        Returns:
        +
        true if the given Memory refers to the same underlying resource as this sketch or + union.
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Resets to empty and retains the current lgK, but does not change the configured value of + lgMaxK.
        +
      • +
      + + + +
        +
      • +

        toCompactByteArray

        +
        public byte[] toCompactByteArray()
        +
        Gets the serialization of this union operator as a byte array in compact form, which is + designed to be heapified only. It is not directly updatable. + For the Union operator, this is the serialization of the internal state of + the union operator as a sketch.
        +
        +
        Returns:
        +
        the serialization of this union operator as a byte array.
        +
        +
      • +
      + + + +
        +
      • +

        toUpdatableByteArray

        +
        public byte[] toUpdatableByteArray()
        +
        Serializes this sketch as a byte array in an updatable form. The updatable form is larger than + the compact form. The use of this form is primarily in environments that support updating + sketches in off-heap memory. If the sketch is constructed using HLL_8, sketch updating and + union updating operations can actually occur in WritableMemory, which can be off-heap: +
        
        +     Union union; HllSketch sk;
        +     int lgK = 12;
        +     sk = new HllSketch(lgK, TgtHllType.HLL_8) //must be 8
        +     for (int i = 0; i < (2 << lgK); i++) { sk.update(i); }
        +     byte[] arr = sk.toUpdatableByteArray();
        +     WritableMemory wmem = WritableMemory.wrap(arr);
        +     //...
        +     union = Union.writableWrap(wmem); //no deserialization!
        + 
        +
        +
        Returns:
        +
        this sketch as an updatable byte array.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString​(boolean summary,
        +                       boolean hllDetail,
        +                       boolean auxDetail,
        +                       boolean all)
        +
        Human readable summary with optional detail
        +
        +
        Parameters:
        +
        summary - if true, output the sketch summary
        +
        hllDetail - if true, output the internal data array
        +
        auxDetail - if true, output the internal Aux array, if it exists.
        +
        all - if true, outputs all entries including empty ones
        +
        Returns:
        +
        human readable string with optional detail.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(HllSketch sketch)
        +
        Update this union operator with the given sketch.
        +
        +
        Parameters:
        +
        sketch - the given sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getSerializationVersion

        +
        public static final int getSerializationVersion()
        +
        Returns the current serialization version.
        +
        +
        Returns:
        +
        the current serialization version.
        +
        +
      • +
      + + + +
        +
      • +

        getSerializationVersion

        +
        public static final int getSerializationVersion​(org.apache.datasketches.memory.Memory mem)
        +
        Returns the current serialization version of the given Memory.
        +
        +
        Parameters:
        +
        mem - the given Memory containing a serialized HllSketch image.
        +
        Returns:
        +
        the current serialization version.
        +
        +
      • +
      + + + +
        +
      • +

        getRelErr

        +
        public static double getRelErr​(boolean upperBound,
        +                               boolean oooFlag,
        +                               int lgConfigK,
        +                               int numStdDev)
        +
        Gets the current (approximate) Relative Error (RE) asymptotic values given several + parameters. This is used primarily for testing.
        +
        +
        Parameters:
        +
        upperBound - return the RE for the Upper Bound, otherwise for the Lower Bound.
        +
        oooFlag - set true if the sketch is the result of a non qualifying union operation.
        +
        lgConfigK - the configured value for the sketch.
        +
        numStdDev - the given number of Standard Deviations. This must be an integer between + 1 and 3, inclusive. + Number of Standard Deviations
        +
        Returns:
        +
        the current (approximate) RelativeError
        +
        +
      • +
      + + + +
        +
      • +

        isEstimationMode

        +
        public boolean isEstimationMode()
        +
        This HLL family of sketches and operators is always estimating, even for very small values.
        +
        +
        Returns:
        +
        true
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Human readable summary as a string.
        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        Human readable summary as a string.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString​(boolean summary,
        +                       boolean detail,
        +                       boolean auxDetail)
        +
        Human readable summary with optional detail. Does not list empty entries.
        +
        +
        Parameters:
        +
        summary - if true, output the sketch summary
        +
        detail - if true, output the internal data array
        +
        auxDetail - if true, output the internal Aux array, if it exists.
        +
        Returns:
        +
        human readable string with optional detail.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(long datum)
        +
        Present the given long as a potential unique item.
        +
        +
        Parameters:
        +
        datum - The given long datum.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(double datum)
        +
        Present the given double (or float) datum as a potential unique item. + The double will be converted to a long using Double.doubleToLongBits(datum), + which normalizes all NaN values to a single NaN representation. + Plus and minus zero will be normalized to plus zero. + The special floating-point values NaN and +/- Infinity are treated as distinct.
        +
        +
        Parameters:
        +
        datum - The given double datum.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(String datum)
        +
        Present the given String as a potential unique item. + The string is converted to a byte array using UTF8 encoding. + If the string is null or empty no update attempt is made and the method returns. + +

        Note: About 2X faster performance can be obtained by first converting the String to a + char[] and updating the sketch with that. This bypasses the complexity of the Java UTF_8 + encoding. This, of course, will not produce the same internal hash values as updating directly + with a String. So be consistent! Unioning two sketches, one fed with strings and the other + fed with char[] will be meaningless. +

        +
        +
        Parameters:
        +
        datum - The given String.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(ByteBuffer data)
        +
        Present the given byte buffer as a potential unique item. + Bytes are read from the current position of the buffer until its limit. + If the byte buffer is null or has no bytes remaining, no update attempt is made and the method returns. + +

        This method will not modify the position, mark, limit, or byte order of the buffer.

        + +

        Little-endian order is preferred, but not required. This method may perform better if the provided byte + buffer is in little-endian order.

        +
        +
        Parameters:
        +
        data - The given byte buffer.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(byte[] data)
        +
        Present the given byte array as a potential unique item. + If the byte array is null or empty no update attempt is made and the method returns.
        +
        +
        Parameters:
        +
        data - The given byte array.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(char[] data)
        +
        Present the given char array as a potential unique item. + If the char array is null or empty no update attempt is made and the method returns. + +

        Note: this will not produce the same output hash values as the update(String) + method but will be a little faster as it avoids the complexity of the UTF8 encoding.

        +
        +
        Parameters:
        +
        data - The given char array.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(int[] data)
        +
        Present the given integer array as a potential unique item. + If the integer array is null or empty no update attempt is made and the method returns.
        +
        +
        Parameters:
        +
        data - The given int array.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(long[] data)
        +
        Present the given long array as a potential unique item. + If the long array is null or empty no update attempt is made and the method returns.
        +
        +
        Parameters:
        +
        data - The given long array.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/hll/class-use/HllSketch.html b/docs/5.0.2/org/apache/datasketches/hll/class-use/HllSketch.html new file mode 100644 index 000000000..7f4a7a716 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hll/class-use/HllSketch.html @@ -0,0 +1,265 @@ + + + + + +Uses of Class org.apache.datasketches.hll.HllSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.hll.HllSketch

+
+
+
    +
  • + + + + + + + + + + + + +
    Packages that use HllSketch 
    PackageDescription
    org.apache.datasketches.hll +
    The DataSketches™ HLL sketch family package
    +
    +
  • +
  • +
      +
    • +
      + + +

      Uses of HllSketch in org.apache.datasketches.hll

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.hll that return HllSketch 
      Modifier and TypeMethodDescription
      HllSketchHllSketch.copy() +
      Return a copy of this sketch onto the Java heap.
      +
      HllSketchHllSketch.copyAs​(TgtHllType tgtHllType) +
      Return a deep copy of this sketch onto the Java heap with the specified TgtHllType.
      +
      HllSketchUnion.getResult() +
      Return the result of this union operator as an HLL_4 sketch.
      +
      HllSketchUnion.getResult​(TgtHllType tgtHllType) +
      Return the result of this union operator with the specified TgtHllType
      +
      static HllSketchHllSketch.heapify​(byte[] byteArray) +
      Heapify the given byte array, which must be a valid HllSketch image and may have data.
      +
      static HllSketchHllSketch.heapify​(org.apache.datasketches.memory.Memory srcMem) +
      Heapify the given Memory, which must be a valid HllSketch image and may have data.
      +
      static HllSketchHllSketch.wrap​(org.apache.datasketches.memory.Memory srcMem) +
      Wraps the given read-only Memory that must be a image of a valid sketch, + which may be in compact or updatable form, and should have data.
      +
      static HllSketchHllSketch.writableWrap​(org.apache.datasketches.memory.WritableMemory srcWmem) +
      Wraps the given WritableMemory, which must be a image of a valid updatable sketch, + and may have data.
      +
      + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.hll with parameters of type HllSketch 
      Modifier and TypeMethodDescription
      voidUnion.update​(HllSketch sketch) +
      Update this union operator with the given sketch.
      +
      +
      +
    • +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/hll/class-use/TgtHllType.html b/docs/5.0.2/org/apache/datasketches/hll/class-use/TgtHllType.html new file mode 100644 index 000000000..db5a1a00f --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hll/class-use/TgtHllType.html @@ -0,0 +1,294 @@ + + + + + +Uses of Class org.apache.datasketches.hll.TgtHllType (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.hll.TgtHllType

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/hll/class-use/Union.html b/docs/5.0.2/org/apache/datasketches/hll/class-use/Union.html new file mode 100644 index 000000000..fea30dbcf --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hll/class-use/Union.html @@ -0,0 +1,212 @@ + + + + + +Uses of Class org.apache.datasketches.hll.Union (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.hll.Union

+
+
+
    +
  • + + + + + + + + + + + + +
    Packages that use Union 
    PackageDescription
    org.apache.datasketches.hll +
    The DataSketches™ HLL sketch family package
    +
    +
  • +
  • +
      +
    • +
      + + +

      Uses of Union in org.apache.datasketches.hll

      + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.hll that return Union 
      Modifier and TypeMethodDescription
      static UnionUnion.heapify​(byte[] byteArray) +
      Construct a union operator populated with the given byte array image of an HllSketch.
      +
      static UnionUnion.heapify​(org.apache.datasketches.memory.Memory mem) +
      Construct a union operator populated with the given Memory image of an HllSketch.
      +
      static UnionUnion.writableWrap​(org.apache.datasketches.memory.WritableMemory srcWmem) +
      Wraps the given WritableMemory, which must be a image of a valid updatable HLL_8 sketch, + and may have data.
      +
      +
      +
    • +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/hll/doc-files/HLL_HIP_K12T20U20.png b/docs/5.0.2/org/apache/datasketches/hll/doc-files/HLL_HIP_K12T20U20.png new file mode 100644 index 000000000..7d3c8348f Binary files /dev/null and b/docs/5.0.2/org/apache/datasketches/hll/doc-files/HLL_HIP_K12T20U20.png differ diff --git a/docs/5.0.2/org/apache/datasketches/hll/doc-files/HLL_UnionTime4_6_8_Java_CPP.png b/docs/5.0.2/org/apache/datasketches/hll/doc-files/HLL_UnionTime4_6_8_Java_CPP.png new file mode 100644 index 000000000..23225887b Binary files /dev/null and b/docs/5.0.2/org/apache/datasketches/hll/doc-files/HLL_UnionTime4_6_8_Java_CPP.png differ diff --git a/docs/5.0.2/org/apache/datasketches/hll/package-summary.html b/docs/5.0.2/org/apache/datasketches/hll/package-summary.html new file mode 100644 index 000000000..74aa8ad91 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hll/package-summary.html @@ -0,0 +1,336 @@ + + + + + +org.apache.datasketches.hll (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches.hll

+
+
+
+ + +

The DataSketches™ HLL sketch family package

+ HllSketch and Union + are the public facing classes of this high performance implementation of Phillipe Flajolet's + HyperLogLog algorithm[1] but with significantly improved error behavior and important features that can be + essential for large production systems that must handle massive data. + +

Key Features of the DataSketches™ HLL Sketch and its companion Union

+ +

Advanced Estimation Algorithms for Optimum Accuracy

+ +

Zero error at low cardinalities

+ The HLL sketch leverages highly compact arrays and hash tables to keep exact counts until the transition to + dense mode is required for space reasons. The result is perfect accuracy for very low cardinalities. + +

Accuracy for very small streams can be important because Big Data is often fragmented into millions of smaller + streams (or segments) that inevitably are power-law distributed in size. If you are sketching all these fragments, + as a general rule, more than 80% of your sketches will be very small, 20% will be much larger, and only a few very + large in cardinality. + +

HIP / Martingale Estimator

+ When obtaining a cardinality estimate, the sketch automatically determines if it was the result of the capture of + a single stream, or if was the result of certain qualifying union operations. If this is the case the sketch will + take advantage of Edith Cohen's Historical Inverse Probability (HIP) estimation algorithm[2], which was + also independently developed by Daniel Ting as the Martingale estimation algorithm[3]. + This will result in a 20% improvement in accuracy over the standard Flajolet estimator. + If it is not a single stream or if the specific union operation did not qualify, + the estimator will default to the Composite Estimator. + +

Composite Estimator

+ This advanced estimator is a blend of several algorithms including new algorithms developed by Kevin Lang for his + Compressed Probabilistic Counting (CPC) sketch[4]. These algorithms provide near optimal estimation accuracy + for cases that don't qualify for HIP / Martingale estimation. + +

As a result of all of this work on accuracy, one will get a very smooth curve of the underlying accuracy of the + sketch once the statistical randomness is removed through multiple trials. This can be observed in the + following graph.

+ +

HLL Accuracy[6]

+ +

The above graph has 7 curves. At y = 0, is the median line that hugs the x-axis so closely that it can't be seen. + The two curves, just above and just below the x-axis, correspond to +/- 1 standard deviation (SD) of error. + The distance between either one of this pair and the x-axis is also known as the Relative Standard Error (RSE). + This type of graph for illustrating sketch error we call a "pitchfork plot".

+ +

The next two curves above and below correspond to +/- 2 SD, and + the top-most and bottom-most curves correspond to +/- 3 SD. + The chart grid lines are set at +/- multiples of Relative Standard Error (RSE) that correspond to +/- 1,2,3 SD. + Below the cardinality of about 512 there is no error at all. This is the point where this particular + sketch transitions from sparse to dense (or estimation) mode.

+ +

Three HLL Types

+ This HLL implementation offers three different types of HLL sketch, each with different + trade-offs with accuracy, space and performance. These types are selected with the + TgtHllType parameter. + +

In terms of accuracy, all three types, for the same lgConfigK, have the same error + distribution as a function of cardinality.

+ +

The configuration parameter lgConfigK is the log-base-2 of K, + where K is the number of buckets or slots for the sketch. lgConfigK impacts both accuracy and + the size of the sketch in memory and when stored.

+ +

HLL 8

+ This uses an 8-bit byte per HLL bucket. It is generally the + fastest in terms of update time but has the largest storage footprint of about K bytes. + +

HLL 6

+ This uses a 6-bit field per HLL bucket. It is the generally the next fastest + in terms of update time with a storage footprint of about 3/4 * K bytes. + +

HLL 4

+ This uses a 4-bit field per HLL bucket and for large counts may require + the use of a small internal auxiliary array for storing statistical exceptions, which are rare. + For the values of lgConfigK > 13 (K = 8192), + this additional array adds about 3% to the overall storage. It is generally the slowest in + terms of update time, but has the smallest storage footprint of about K/2 * 1.03 bytes. + +

Off-Heap Operation

+ This HLL sketch also offers the capability of operating off-heap. Given a WritableMemory[5] object + created by the user, the sketch will perform all of its updates and internal phase transitions + in that object, which can actually reside either on-heap or off-heap based on how it was + configured. In large systems that must update and union many millions of sketches, having the + sketch operate off-heap avoids the serialization and deserialization costs of moving sketches from heap to + off-heap and back, and reduces the need for garbage collection. + +

Merging sketches with different configured lgConfigK

+ This enables a user to union a HLL sketch that was configured with, say, lgConfigK = 12 + with another loaded HLL sketch that was configured with, say, lgConfigK = 14. + +

Why is this important? Suppose you have been building a history of sketches of your customer's + data that go back a full year (or 5 or 10!) that were all configured with lgConfigK = 12. Because sketches + are so much smaller than the raw data it is possible that the raw data was discarded keeping only the sketches. + Even if you have the raw data, it might be very expensive and time consuming to reload and rebuild all your + sketches with a larger more accurate size, say, lgConfigK = 14. + This capability enables you to merge last year's data with this year's data built with larger sketches and still + have meaningful results.

+ +

In other words, you can change your mind about what size sketch you need for your application at any time and + will not lose access to the data contained in your older historical sketches.

+ +

This capability does come with a caveat: The resulting accuracy of the merged sketch will be the accuracy of the + smaller of the two sketches. Without this capability, you would either be stuck with the configuration you first + chose forever, or you would have to rebuild all your sketches from scratch, or worse, not be able to recover your + historical data.

+ +

Multi-language, multi-platform.

+ The binary structures for our sketch serializations are language and platform independent. + This means it is possible to generate an HLL sketch on a C++ Windows platform and it can be used on a + Java or Python Unix platform. + +

[1] Philippe Flajolet, et al, +HyperLogLog: the analysis of a near-optimal cardinality estimation algorithm. + DMTCS proc. AH, 2007, 127-146. + +

[2] Edith Cohen, +All-Distances Sketches, Revisited: HIP Estimators for Massive Graphs Analysis. + PODS'14, June 22-27, Snowbird, UT, USA. + +

[3] Daniel Ting, + +Streamed Approximate Counting of Distinct Elements, Beating Optimal Batch Methods. + KDD'14 August 24, 2014 New York, New York USA. + +

[4] Kevin Lang, + +Back to the Future: an Even More Nearly Optimal Cardinality Estimation Algorithm. + arXiv 1708.06839, August 22, 2017, Yahoo Research. + +

[5] Memory Component, + +DataSketches Memory Component + +

[6] MacBook Pro 2.3 GHz 8-Core Intel Core i9

+
+
Author:
+
Lee Rhodes, Kevin Lang
+
See Also:
+
CpcSketch
+
+
+
    +
  • + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    HllSketch +
    The HllSketch is actually a collection of compact implementations of Phillipe Flajolet’s HyperLogLog (HLL) + sketch but with significantly improved error behavior and excellent speed performance.
    +
    Union +
    This performs union operations for all HllSketches.
    +
    +
  • +
  • + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    TgtHllType +
    Specifies the target type of HLL sketch to be created.
    +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/hll/package-tree.html b/docs/5.0.2/org/apache/datasketches/hll/package-tree.html new file mode 100644 index 000000000..d7d45b13c --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hll/package-tree.html @@ -0,0 +1,179 @@ + + + + + +org.apache.datasketches.hll Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches.hll

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • org.apache.datasketches.hll.HllSketch
    • +
    • org.apache.datasketches.hll.Union
    • +
    +
  • +
+
+
+

Enum Hierarchy

+ +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/hll/package-use.html b/docs/5.0.2/org/apache/datasketches/hll/package-use.html new file mode 100644 index 000000000..487971001 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hll/package-use.html @@ -0,0 +1,201 @@ + + + + + +Uses of Package org.apache.datasketches.hll (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches.hll

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/hllmap/UniqueCountMap.html b/docs/5.0.2/org/apache/datasketches/hllmap/UniqueCountMap.html new file mode 100644 index 000000000..eb10e920f --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hllmap/UniqueCountMap.html @@ -0,0 +1,591 @@ + + + + + +UniqueCountMap (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class UniqueCountMap

+
+
+ +
+
    +
  • +
    +
    public final class UniqueCountMap
    +extends Object
    +
    This is a real-time, key-value HLL mapping sketch that tracks approximate unique counts of + identifiers (the values) associated with each key. An example might be tracking the number of + unique user identifiers associated with each IP address. This map has been specifically designed + for the use-case where the number of keys is quite large (many millions) and the distribution of + identifiers per key is very skewed. A typical distribution where this works well is a + power-law distribution of identifiers per key of the form y = Cx, + where α < 0.5, and C is roughly ymax. + For example, with 100M keys, over 75% of the keys would have only + one identifier, 99% of the keys would have less than 20 identifiers, 99.9% would have less than + 200 identifiers, and a very tiny fraction might have identifiers in the thousands. + +

    The space consumed by this map is quite sensitive to the actual distribution of identifiers + per key, so you should characterize and or experiment with your typical input streams. + Nonetheless, our experiments on live streams of over 100M keys required about 1.4GB of space. + +

    Given such highly-skewed distributions, using this map is far more efficient space-wise than + the alternative of dedicating an HLL sketch per key. Based on our use cases, after + subtracting the space required for key storage, the average bytes per key required for unique + count estimation (getAverageSketchMemoryPerKey()) is about 10. + +

    Internally, this map is implemented as a hierarchy of internal hash maps with progressively + increasing storage allocated for unique count estimation. As a key acquires more identifiers it + is "promoted" up to a higher internal map. The final map of keys is a map of compact HLL + sketches. + +

    The unique values in all the internal maps, except the final HLL map, are stored in a special + form called a coupon. A coupon is a 16-bit value that fully describes a k=1024 HLL bin. + It contains 10 bits of address and a 6-bit HLL value. + +

    All internal maps use a prime number size and Knuth's Open Addressing Double Hash (OADH) + search algorithm. + +

    The internal base map holds all the keys and each key is associated with one 16-bit value. + Initially, the value is a single coupon. Once the key is promoted, this 16-bit field contains a + reference to the internal map where the key is still active. + +

    The intermediate maps between the base map and the final HLL map are of two types. + The first few of these are called traverse maps where the coupons are + stored as unsorted arrays. After the traverse maps are the coupon hash maps, where the coupons + are stored in small OASH hash tables. + +

    All the intermediate maps support deletes and can dynamically grow and shrink as required by + the input stream. + +

    The sketch estimator algorithms are unbiased with a Relative Standard Error (RSE) + of about 2.6% with 68% confidence, or equivalently, about 5.2% with a 95% confidence. + +

    In a parallel package in the sketches-misc repository, there are 2 classes that can be used + from the command line to feed this mapping sketch piped from standard-in for experimental + evaluation. The first is ProcessIpStream, which processes simple IP/ID pairs and the second, + ProcessDistributionStream, which processes pairs that describe a distribution. + In this same package is the VariousMapRSETest class that was used to generate the error plots + for the web site. Please refer to the javadocs for those classes for more information.

    +
    +
    Author:
    +
    Lee Rhodes, Alexander Saydakov, Kevin Lang
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      UniqueCountMap​(int keySizeBytes) +
      Constructs a UniqueCountMap with an initial capacity of one million entries.
      +
      UniqueCountMap​(int initialNumEntries, + int keySizeBytes) +
      Constructs a UniqueCountMap with a given initial number of entries.
      +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        UniqueCountMap

        +
        public UniqueCountMap​(int keySizeBytes)
        +
        Constructs a UniqueCountMap with an initial capacity of one million entries.
        +
        +
        Parameters:
        +
        keySizeBytes - must be at least 4 bytes to have sufficient entropy.
        +
        +
      • +
      + + + +
        +
      • +

        UniqueCountMap

        +
        public UniqueCountMap​(int initialNumEntries,
        +                      int keySizeBytes)
        +
        Constructs a UniqueCountMap with a given initial number of entries.
        +
        +
        Parameters:
        +
        initialNumEntries - The initial number of entries provides a tradeoff between + wasted space, if too high, and wasted time resizing the table, if too low.
        +
        keySizeBytes - must be at least 4 bytes to have sufficient entropy
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        update

        +
        public double update​(byte[] key,
        +                     byte[] identifier)
        +
        Updates the map with a given key and identifier and returns the estimate of the number of + unique identifiers encountered so far for the given key.
        +
        +
        Parameters:
        +
        key - the given key
        +
        identifier - the given identifier for unique counting associated with the key
        +
        Returns:
        +
        the estimate of the number of unique identifiers encountered so far for the given key.
        +
        +
      • +
      + + + +
        +
      • +

        getEstimate

        +
        public double getEstimate​(byte[] key)
        +
        Retrieves the current estimate of unique count for a given key.
        +
        +
        Parameters:
        +
        key - given key
        +
        Returns:
        +
        estimate of unique count so far
        +
        +
      • +
      + + + +
        +
      • +

        getUpperBound

        +
        public double getUpperBound​(byte[] key)
        +
        Returns the upper bound cardinality with respect to getEstimate(byte[]) associated + with the given key.
        +
        +
        Parameters:
        +
        key - the given key
        +
        Returns:
        +
        the upper bound cardinality with respect to getEstimate(byte[]) associated + with the given key.
        +
        +
      • +
      + + + +
        +
      • +

        getLowerBound

        +
        public double getLowerBound​(byte[] key)
        +
        Returns the lower bound cardinality with respect to getEstimate(byte[]) associated + with the given key.
        +
        +
        Parameters:
        +
        key - the given key
        +
        Returns:
        +
        the lower bound cardinality with respect to getEstimate(byte[]) associated + with the given key.
        +
        +
      • +
      + + + +
        +
      • +

        getActiveEntries

        +
        public int getActiveEntries()
        +
        Returns the number of active, unique keys across all internal maps
        +
        +
        Returns:
        +
        the number of active, unique keys across all internal maps
        +
        +
      • +
      + + + +
        +
      • +

        getMemoryUsageBytes

        +
        public long getMemoryUsageBytes()
        +
        Returns total bytes used by all internal maps
        +
        +
        Returns:
        +
        total bytes used by all internal maps
        +
        +
      • +
      + + + +
        +
      • +

        getKeyMemoryUsageBytes

        +
        public long getKeyMemoryUsageBytes()
        +
        Returns total bytes used for key storage
        +
        +
        Returns:
        +
        total bytes used for key storage
        +
        +
      • +
      + + + +
        +
      • +

        getAverageSketchMemoryPerKey

        +
        public double getAverageSketchMemoryPerKey()
        +
        Returns the average memory storage per key that is dedicated to sketching the unique counts.
        +
        +
        Returns:
        +
        the average memory storage per key that is dedicated to sketching the unique counts.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Returns a string with a human-readable summary of the UniqueCountMap and all the internal maps
        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        human-readable summary
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/hllmap/class-use/UniqueCountMap.html b/docs/5.0.2/org/apache/datasketches/hllmap/class-use/UniqueCountMap.html new file mode 100644 index 000000000..ab02b52bf --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hllmap/class-use/UniqueCountMap.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.hllmap.UniqueCountMap (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.hllmap.UniqueCountMap

+
+
No usage of org.apache.datasketches.hllmap.UniqueCountMap
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/hllmap/package-summary.html b/docs/5.0.2/org/apache/datasketches/hllmap/package-summary.html new file mode 100644 index 000000000..e9d92d90e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hllmap/package-summary.html @@ -0,0 +1,192 @@ + + + + + +org.apache.datasketches.hllmap (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches.hllmap

+
+
+
+ + +
The hllmap package contains a space efficient HLL mapping sketch of keys to approximate unique + count of identifiers. For example, counting the number of unique users (identifiers) per IP + address. + +

In cases where the number of keys is very large, having an individual HLL sketch per key may + not be practical. If the distribution of values per key is highly skewed where the vast + majority of keys have only a few values then this mapping sketch will make sense as it will be + far more space efficient than dedicating individual HLL sketches per key. + +

From our own testing, sketching 100 million IPv4 addresses with such a + highly skewed distribution of identifiers per IP uses only 1.4GB of memory. This translates to + an average of about 10 bytes per IP allocated to the equivalent of a full k=1024 HLL sketch + and provides an RSE of less than 2.5%. Your results will vary depending on the actual + distribution of identifiers per key.

+
+
See Also:
+
UniqueCountMap
+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    UniqueCountMap +
    This is a real-time, key-value HLL mapping sketch that tracks approximate unique counts of + identifiers (the values) associated with each key.
    +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/hllmap/package-tree.html b/docs/5.0.2/org/apache/datasketches/hllmap/package-tree.html new file mode 100644 index 000000000..5fba38f25 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hllmap/package-tree.html @@ -0,0 +1,164 @@ + + + + + +org.apache.datasketches.hllmap Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches.hllmap

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/hllmap/package-use.html b/docs/5.0.2/org/apache/datasketches/hllmap/package-use.html new file mode 100644 index 000000000..984fa5012 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/hllmap/package-use.html @@ -0,0 +1,149 @@ + + + + + +Uses of Package org.apache.datasketches.hllmap (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches.hllmap

+
+
No usage of org.apache.datasketches.hllmap
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/KllDoublesSketch.html b/docs/5.0.2/org/apache/datasketches/kll/KllDoublesSketch.html new file mode 100644 index 000000000..69bed84d6 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/KllDoublesSketch.html @@ -0,0 +1,1067 @@ + + + + + +KllDoublesSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class KllDoublesSketch

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        newHeapInstance

        +
        public static KllDoublesSketch newHeapInstance()
        +
        Create a new heap instance of this sketch with the default k = 200. + The default k = 200 results in a normalized rank error of about + 1.65%. Larger K will have smaller error but the sketch will be larger (and slower).
        +
        +
        Returns:
        +
        new KllDoublesSketch on the Java heap.
        +
        +
      • +
      + + + +
        +
      • +

        newHeapInstance

        +
        public static KllDoublesSketch newHeapInstance​(int k)
        +
        Create a new heap instance of this sketch with a given parameter k. + k can be between 8, inclusive, and 65535, inclusive. + The default k = 200 results in a normalized rank error of about + 1.65%. Larger K will have smaller error but the sketch will be larger (and slower).
        +
        +
        Parameters:
        +
        k - parameter that controls size of the sketch and accuracy of estimates.
        +
        Returns:
        +
        new KllDoublesSketch on the Java heap.
        +
        +
      • +
      + + + +
        +
      • +

        newDirectInstance

        +
        public static KllDoublesSketch newDirectInstance​(org.apache.datasketches.memory.WritableMemory dstMem,
        +                                                 org.apache.datasketches.memory.MemoryRequestServer memReqSvr)
        +
        Create a new direct updatable instance of this sketch with the default k. + The default k = 200 results in a normalized rank error of about + 1.65%. Larger k will have smaller error but the sketch will be larger (and slower).
        +
        +
        Parameters:
        +
        dstMem - the given destination WritableMemory object for use by the sketch
        +
        memReqSvr - the given MemoryRequestServer to request a larger WritableMemory
        +
        Returns:
        +
        a new direct instance of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        newDirectInstance

        +
        public static KllDoublesSketch newDirectInstance​(int k,
        +                                                 org.apache.datasketches.memory.WritableMemory dstMem,
        +                                                 org.apache.datasketches.memory.MemoryRequestServer memReqSvr)
        +
        Create a new direct updatable instance of this sketch with a given k.
        +
        +
        Parameters:
        +
        k - parameter that controls size of the sketch and accuracy of estimates.
        +
        dstMem - the given destination WritableMemory object for use by the sketch
        +
        memReqSvr - the given MemoryRequestServer to request a larger WritableMemory
        +
        Returns:
        +
        a new direct instance of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static KllDoublesSketch heapify​(org.apache.datasketches.memory.Memory srcMem)
        +
        Factory heapify takes a compact sketch image in Memory and instantiates an on-heap sketch. + The resulting sketch will not retain any link to the source Memory.
        +
        +
        Parameters:
        +
        srcMem - a compact Memory image of a sketch serialized by this sketch. + See Memory
        +
        Returns:
        +
        a heap-based sketch based on the given Memory.
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static KllDoublesSketch wrap​(org.apache.datasketches.memory.Memory srcMem)
        +
        Wrap a sketch around the given read only compact source Memory containing sketch data + that originated from this sketch.
        +
        +
        Parameters:
        +
        srcMem - the read only source Memory
        +
        Returns:
        +
        instance of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        writableWrap

        +
        public static KllDoublesSketch writableWrap​(org.apache.datasketches.memory.WritableMemory srcMem,
        +                                            org.apache.datasketches.memory.MemoryRequestServer memReqSvr)
        +
        Wrap a sketch around the given source Writable Memory containing sketch data + that originated from this sketch.
        +
        +
        Parameters:
        +
        srcMem - a WritableMemory that contains data.
        +
        memReqSvr - the given MemoryRequestServer to request a larger WritableMemory
        +
        Returns:
        +
        instance of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        getCDF

        +
        public double[] getCDF​(double[] splitPoints,
        +                       QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesDoublesAPI
        +
        Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(false) function.

        +
        +
        Specified by:
        +
        getCDF in interface QuantilesDoublesAPI
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 overlapping intervals. + +

        The start of each interval is below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and the end of the interval + is the rank or cumulative probability corresponding to the split point.

        + +

        The (m+1)th interval represents 100% of the distribution represented by the sketch + and consistent with the definition of a cumulative probability distribution, thus the (m+1)th + rank or probability in the returned array is always 1.0.

        + +

        If a split point exactly equals a retained item of the sketch and the search criterion is:

        + +
          +
        • INCLUSIVE, the resulting cumulative probability will include that item.
        • +
        • EXCLUSIVE, the resulting cumulative probability will not include the weight of that split point.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
        +
        +
      • +
      + + + +
        +
      • +

        getPMF

        +
        public double[] getPMF​(double[] splitPoints,
        +                       QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesDoublesAPI
        +
        Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(true) function.

        +
        +
        Specified by:
        +
        getPMF in interface QuantilesDoublesAPI
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 consecutive, non-overlapping intervals. + +

        Each interval except for the end intervals starts with a split point and ends with the next split + point in sequence.

        + +

        The first interval starts below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and ends with the first split point

        + +

        The last (m+1)th interval starts with the last split point and ends after the last + item retained by the sketch corresponding to a rank or probability of 1.0.

        + +

        The sum of the probability masses of all (m+1) intervals is 1.0.

        + +

        If the search criterion is:

        + +
          +
        • INCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will include that item. If the lower split point equals an item retained by the sketch, the interval will exclude + that item.
        • +
        • EXCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will exclude that item. If the lower split point equals an item retained by the sketch, the interval will include + that item.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        public double getQuantile​(double rank,
        +                          QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesDoublesAPI
        +
        Gets the approximate quantile of the given normalized rank and the given search criterion.
        +
        +
        Specified by:
        +
        getQuantile in interface QuantilesDoublesAPI
        +
        Parameters:
        +
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        searchCrit - If INCLUSIVE, the given rank includes all quantiles ≤ + the quantile directly corresponding to the given rank. + If EXCLUSIVE, he given rank includes all quantiles < + the quantile directly corresponding to the given rank.
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantiles

        +
        public double[] getQuantiles​(double[] ranks,
        +                             QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesDoublesAPI
        +
        Gets an array of quantiles from the given array of normalized ranks.
        +
        +
        Specified by:
        +
        getQuantiles in interface QuantilesDoublesAPI
        +
        Parameters:
        +
        ranks - the given array of normalized ranks, each of which must be + in the interval [0.0,1.0].
        +
        searchCrit - if INCLUSIVE, the given ranks include all quantiles ≤ + the quantile directly corresponding to each rank.
        +
        Returns:
        +
        an array of quantiles corresponding to the given array of normalized ranks.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantileLowerBound

        +
        public double getQuantileLowerBound​(double rank)
        +
        Gets the lower bound of the quantile confidence interval in which the quantile of the + given rank exists. + +

        Although it is possible to estimate the probability that the true quantile + exists within the quantile confidence interval specified by the upper and lower quantile bounds, + it is not possible to guarantee the width of the quantile confidence interval + as an additive or multiplicative percent of the true quantile.

        + The approximate probability that the true quantile is within the confidence interval + specified by the upper and lower quantile bounds for this sketch is 0.99.
        +
        +
        Specified by:
        +
        getQuantileLowerBound in interface QuantilesDoublesAPI
        +
        Parameters:
        +
        rank - the given normalized rank
        +
        Returns:
        +
        the lower bound of the quantile confidence interval in which the quantile of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantileUpperBound

        +
        public double getQuantileUpperBound​(double rank)
        +
        Gets the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists. + +

        Although it is possible to estimate the probability that the true quantile + exists within the quantile confidence interval specified by the upper and lower quantile bounds, + it is not possible to guarantee the width of the quantile interval + as an additive or multiplicative percent of the true quantile.

        + The approximate probability that the true quantile is within the confidence interval + specified by the upper and lower quantile bounds for this sketch is 0.99.
        +
        +
        Specified by:
        +
        getQuantileUpperBound in interface QuantilesDoublesAPI
        +
        Parameters:
        +
        rank - the given normalized rank
        +
        Returns:
        +
        the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getRank

        +
        public double getRank​(double quantile,
        +                      QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesDoublesAPI
        +
        Gets the normalized rank corresponding to the given a quantile.
        +
        +
        Specified by:
        +
        getRank in interface QuantilesDoublesAPI
        +
        Parameters:
        +
        quantile - the given quantile
        +
        searchCrit - if INCLUSIVE the given quantile is included into the rank.
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getRankLowerBound

        +
        public double getRankLowerBound​(double rank)
        +
        Gets the lower bound of the rank confidence interval in which the true rank of the + given rank exists. + The approximate probability that the true rank is within the confidence interval + specified by the upper and lower rank bounds for this sketch is 0.99.
        +
        +
        Specified by:
        +
        getRankLowerBound in interface QuantilesAPI
        +
        Parameters:
        +
        rank - the given normalized rank.
        +
        Returns:
        +
        the lower bound of the rank confidence interval in which the true rank of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getRankUpperBound

        +
        public double getRankUpperBound​(double rank)
        +
        Gets the upper bound of the rank confidence interval in which the true rank of the + given rank exists. + The approximate probability that the true rank is within the confidence interval + specified by the upper and lower rank bounds for this sketch is 0.99.
        +
        +
        Specified by:
        +
        getRankUpperBound in interface QuantilesAPI
        +
        Parameters:
        +
        rank - the given normalized rank.
        +
        Returns:
        +
        the upper bound of the rank confidence interval in which the true rank of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getRanks

        +
        public double[] getRanks​(double[] quantiles,
        +                         QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesDoublesAPI
        +
        Gets an array of normalized ranks corresponding to the given array of quantiles and the given + search criterion.
        +
        +
        Specified by:
        +
        getRanks in interface QuantilesDoublesAPI
        +
        Parameters:
        +
        quantiles - the given array of quantiles
        +
        searchCrit - if INCLUSIVE, the given quantiles include the rank directly corresponding to each quantile.
        +
        Returns:
        +
        an array of normalized ranks corresponding to the given array of quantiles.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        merge

        +
        public final void merge​(KllSketch other)
        +
        Description copied from class: KllSketch
        +
        Merges another sketch into this one. + Attempting to merge a sketch of the wrong type will throw an exception.
        +
        +
        Specified by:
        +
        merge in class KllSketch
        +
        Parameters:
        +
        other - sketch to merge into this one
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public final void reset()
        +
        Resets this sketch to the empty state. + If the sketch is read only this does nothing. + +

        The parameter k will not change.

        +

        The parameter k will not change.

        +
        +
        Specified by:
        +
        reset in interface QuantilesAPI
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray()
        +
        Description copied from interface: QuantilesDoublesAPI
        +
        Returns a byte array representation of this sketch.
        +
        +
        Specified by:
        +
        toByteArray in interface QuantilesDoublesAPI
        +
        Returns:
        +
        a byte array representation of this sketch.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString​(boolean withSummary,
        +                       boolean withData)
        +
        Description copied from class: KllSketch
        +
        Returns a summary of the sketch as a string.
        +
        +
        Overrides:
        +
        toString in class KllSketch
        +
        Parameters:
        +
        withSummary - if true includes sketch summary information
        +
        withData - if true include sketch data
        +
        Returns:
        +
        string representation of sketch summary
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(double item)
        +
        Description copied from interface: QuantilesDoublesAPI
        +
        Updates this sketch with the given item.
        +
        +
        Specified by:
        +
        update in interface QuantilesDoublesAPI
        +
        Parameters:
        +
        item - from a stream of quantiles. NaNs are ignored.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/KllDoublesSketchIterator.html b/docs/5.0.2/org/apache/datasketches/kll/KllDoublesSketchIterator.html new file mode 100644 index 000000000..3e7991e89 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/KllDoublesSketchIterator.html @@ -0,0 +1,322 @@ + + + + + +KllDoublesSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class KllDoublesSketchIterator

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getQuantile

        +
        public double getQuantile()
        +
        Description copied from interface: QuantilesDoublesSketchIterator
        +
        Gets the double quantile at the current index. + +

        Don't call this before calling next() for the first time + or after getting false from next().

        +
        +
        Specified by:
        +
        getQuantile in interface QuantilesDoublesSketchIterator
        +
        Returns:
        +
        the double quantile at the current index.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/KllDoublesSketchSortedView.html b/docs/5.0.2/org/apache/datasketches/kll/KllDoublesSketchSortedView.html new file mode 100644 index 000000000..5236294c5 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/KllDoublesSketchSortedView.html @@ -0,0 +1,555 @@ + + + + + +KllDoublesSketchSortedView (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class KllDoublesSketchSortedView

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.kll.KllDoublesSketchSortedView
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    DoublesSortedView, SortedView
    +
    +
    +
    public final class KllDoublesSketchSortedView
    +extends Object
    +implements DoublesSortedView
    +
    The SortedView of the KllDoublesSketch.
    +
    +
    Author:
    +
    Alexander Saydakov, Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        KllDoublesSketchSortedView

        +
        public KllDoublesSketchSortedView​(KllDoublesSketch sketch)
        +
        Constructs this Sorted View given the sketch
        +
        +
        Parameters:
        +
        sketch - the given KllDoublesSketch.
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getCumulativeWeights

        +
        public long[] getCumulativeWeights()
        +
        Description copied from interface: SortedView
        +
        Returns the array of cumulative weights from the sketch. + Also known as the natural ranks, which are the Natural Numbers on the interval [1, N].
        +
        +
        Specified by:
        +
        getCumulativeWeights in interface SortedView
        +
        Returns:
        +
        the array of cumulative weights (or natural ranks).
        +
        +
      • +
      + + + +
        +
      • +

        getMaxItem

        +
        public double getMaxItem()
        +
        Description copied from interface: DoublesSortedView
        +
        Returns the maximum item of the stream. This may be distinct from the largest item retained by the + sketch algorithm.
        +
        +
        Specified by:
        +
        getMaxItem in interface DoublesSortedView
        +
        Returns:
        +
        the maximum item of the stream
        +
        +
      • +
      + + + +
        +
      • +

        getMinItem

        +
        public double getMinItem()
        +
        Description copied from interface: DoublesSortedView
        +
        Returns the minimum item of the stream. This may be distinct from the smallest item retained by the + sketch algorithm.
        +
        +
        Specified by:
        +
        getMinItem in interface DoublesSortedView
        +
        Returns:
        +
        the minimum item of the stream
        +
        +
      • +
      + + + +
        +
      • +

        getN

        +
        public long getN()
        +
        Description copied from interface: SortedView
        +
        Returns the total number of items presented to the sourcing sketch.
        +
        +
        Specified by:
        +
        getN in interface SortedView
        +
        Returns:
        +
        the total number of items presented to the sourcing sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        public double getQuantile​(double rank,
        +                          QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: DoublesSortedView
        +
        Gets the approximate quantile of the given normalized rank and the given search criterion.
        +
        +
        Specified by:
        +
        getQuantile in interface DoublesSortedView
        +
        Parameters:
        +
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        searchCrit - If INCLUSIVE, the given rank includes all quantiles ≤ + the quantile directly corresponding to the given rank. + If EXCLUSIVE, he given rank includes all quantiles < + the quantile directly corresponding to the given rank.
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantiles

        +
        public double[] getQuantiles()
        +
        Description copied from interface: DoublesSortedView
        +
        Returns an array of all retained quantiles by the sketch.
        +
        +
        Specified by:
        +
        getQuantiles in interface DoublesSortedView
        +
        Returns:
        +
        an array of all retained quantiles by the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getRank

        +
        public double getRank​(double quantile,
        +                      QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: DoublesSortedView
        +
        Gets the normalized rank corresponding to the given a quantile.
        +
        +
        Specified by:
        +
        getRank in interface DoublesSortedView
        +
        Parameters:
        +
        quantile - the given quantile
        +
        searchCrit - if INCLUSIVE the given quantile is included into the rank.
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        Description copied from interface: SortedView
        +
        Returns true if this sorted view is empty.
        +
        +
        Specified by:
        +
        isEmpty in interface SortedView
        +
        Returns:
        +
        true if this sorted view is empty.
        +
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/KllFloatsSketch.html b/docs/5.0.2/org/apache/datasketches/kll/KllFloatsSketch.html new file mode 100644 index 000000000..baf6dc134 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/KllFloatsSketch.html @@ -0,0 +1,1067 @@ + + + + + +KllFloatsSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class KllFloatsSketch

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        newHeapInstance

        +
        public static KllFloatsSketch newHeapInstance()
        +
        Create a new heap instance of this sketch with the default k = 200. + The default k = 200 results in a normalized rank error of about + 1.65%. Larger K will have smaller error but the sketch will be larger (and slower).
        +
        +
        Returns:
        +
        new KllFloatsSketch on the Java heap.
        +
        +
      • +
      + + + +
        +
      • +

        newHeapInstance

        +
        public static KllFloatsSketch newHeapInstance​(int k)
        +
        Create a new heap instance of this sketch with a given parameter k. + k can be between 8, inclusive, and 65535, inclusive. + The default k = 200 results in a normalized rank error of about + 1.65%. Larger K will have smaller error but the sketch will be larger (and slower).
        +
        +
        Parameters:
        +
        k - parameter that controls size of the sketch and accuracy of estimates.
        +
        Returns:
        +
        new KllFloatsSketch on the Java heap.
        +
        +
      • +
      + + + +
        +
      • +

        newDirectInstance

        +
        public static KllFloatsSketch newDirectInstance​(org.apache.datasketches.memory.WritableMemory dstMem,
        +                                                org.apache.datasketches.memory.MemoryRequestServer memReqSvr)
        +
        Create a new direct updatable instance of this sketch with the default k. + The default k = 200 results in a normalized rank error of about + 1.65%. Larger k will have smaller error but the sketch will be larger (and slower).
        +
        +
        Parameters:
        +
        dstMem - the given destination WritableMemory object for use by the sketch
        +
        memReqSvr - the given MemoryRequestServer to request a larger WritableMemory
        +
        Returns:
        +
        a new direct instance of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        newDirectInstance

        +
        public static KllFloatsSketch newDirectInstance​(int k,
        +                                                org.apache.datasketches.memory.WritableMemory dstMem,
        +                                                org.apache.datasketches.memory.MemoryRequestServer memReqSvr)
        +
        Create a new direct updatable instance of this sketch with a given k.
        +
        +
        Parameters:
        +
        k - parameter that controls size of the sketch and accuracy of estimates.
        +
        dstMem - the given destination WritableMemory object for use by the sketch
        +
        memReqSvr - the given MemoryRequestServer to request a larger WritableMemory
        +
        Returns:
        +
        a new direct instance of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static KllFloatsSketch heapify​(org.apache.datasketches.memory.Memory srcMem)
        +
        Factory heapify takes a compact sketch image in Memory and instantiates an on-heap sketch. + The resulting sketch will not retain any link to the source Memory.
        +
        +
        Parameters:
        +
        srcMem - a compact Memory image of a sketch serialized by this sketch. + See Memory
        +
        Returns:
        +
        a heap-based sketch based on the given Memory.
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static KllFloatsSketch wrap​(org.apache.datasketches.memory.Memory srcMem)
        +
        Wrap a sketch around the given read only compact source Memory containing sketch data + that originated from this sketch.
        +
        +
        Parameters:
        +
        srcMem - the read only source Memory
        +
        Returns:
        +
        instance of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        writableWrap

        +
        public static KllFloatsSketch writableWrap​(org.apache.datasketches.memory.WritableMemory srcMem,
        +                                           org.apache.datasketches.memory.MemoryRequestServer memReqSvr)
        +
        Wrap a sketch around the given source Writable Memory containing sketch data + that originated from this sketch.
        +
        +
        Parameters:
        +
        srcMem - a WritableMemory that contains data.
        +
        memReqSvr - the given MemoryRequestServer to request a larger WritableMemory
        +
        Returns:
        +
        instance of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        getCDF

        +
        public double[] getCDF​(float[] splitPoints,
        +                       QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesFloatsAPI
        +
        Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(false) function.

        +
        +
        Specified by:
        +
        getCDF in interface QuantilesFloatsAPI
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 overlapping intervals. + +

        The start of each interval is below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and the end of the interval + is the rank or cumulative probability corresponding to the split point.

        + +

        The (m+1)th interval represents 100% of the distribution represented by the sketch + and consistent with the definition of a cumulative probability distribution, thus the (m+1)th + rank or probability in the returned array is always 1.0.

        + +

        If a split point exactly equals a retained item of the sketch and the search criterion is:

        + +
          +
        • INCLUSIVE, the resulting cumulative probability will include that item.
        • +
        • EXCLUSIVE, the resulting cumulative probability will not include the weight of that split point.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
        +
        +
      • +
      + + + +
        +
      • +

        getPMF

        +
        public double[] getPMF​(float[] splitPoints,
        +                       QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesFloatsAPI
        +
        Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(true) function.

        +
        +
        Specified by:
        +
        getPMF in interface QuantilesFloatsAPI
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 consecutive, non-overlapping intervals. + +

        Each interval except for the end intervals starts with a split point and ends with the next split + point in sequence.

        + +

        The first interval starts below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and ends with the first split point

        + +

        The last (m+1)th interval starts with the last split point and ends after the last + item retained by the sketch corresponding to a rank or probability of 1.0.

        + +

        The sum of the probability masses of all (m+1) intervals is 1.0.

        + +

        If the search criterion is:

        + +
          +
        • INCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will include that item. If the lower split point equals an item retained by the sketch, the interval will exclude + that item.
        • +
        • EXCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will exclude that item. If the lower split point equals an item retained by the sketch, the interval will include + that item.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        public float getQuantile​(double rank,
        +                         QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesFloatsAPI
        +
        Gets the approximate quantile of the given normalized rank and the given search criterion.
        +
        +
        Specified by:
        +
        getQuantile in interface QuantilesFloatsAPI
        +
        Parameters:
        +
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        searchCrit - If INCLUSIVE, the given rank includes all quantiles ≤ + the quantile directly corresponding to the given rank. + If EXCLUSIVE, he given rank includes all quantiles < + the quantile directly corresponding to the given rank.
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantiles

        +
        public float[] getQuantiles​(double[] ranks,
        +                            QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesFloatsAPI
        +
        Gets an array of quantiles from the given array of normalized ranks.
        +
        +
        Specified by:
        +
        getQuantiles in interface QuantilesFloatsAPI
        +
        Parameters:
        +
        ranks - the given array of normalized ranks, each of which must be + in the interval [0.0,1.0].
        +
        searchCrit - if INCLUSIVE, the given ranks include all quantiles ≤ + the quantile directly corresponding to each rank.
        +
        Returns:
        +
        an array of quantiles corresponding to the given array of normalized ranks.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantileLowerBound

        +
        public float getQuantileLowerBound​(double rank)
        +
        Gets the lower bound of the quantile confidence interval in which the quantile of the + given rank exists. + +

        Although it is possible to estimate the probability that the true quantile + exists within the quantile confidence interval specified by the upper and lower quantile bounds, + it is not possible to guarantee the width of the quantile confidence interval + as an additive or multiplicative percent of the true quantile.

        + The approximate probability that the true quantile is within the confidence interval + specified by the upper and lower quantile bounds for this sketch is 0.99.
        +
        +
        Specified by:
        +
        getQuantileLowerBound in interface QuantilesFloatsAPI
        +
        Parameters:
        +
        rank - the given normalized rank
        +
        Returns:
        +
        the lower bound of the quantile confidence interval in which the quantile of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantileUpperBound

        +
        public float getQuantileUpperBound​(double rank)
        +
        Gets the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists. + +

        Although it is possible to estimate the probability that the true quantile + exists within the quantile confidence interval specified by the upper and lower quantile bounds, + it is not possible to guarantee the width of the quantile interval + as an additive or multiplicative percent of the true quantile.

        + The approximate probability that the true quantile is within the confidence interval + specified by the upper and lower quantile bounds for this sketch is 0.99.
        +
        +
        Specified by:
        +
        getQuantileUpperBound in interface QuantilesFloatsAPI
        +
        Parameters:
        +
        rank - the given normalized rank
        +
        Returns:
        +
        the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getRank

        +
        public double getRank​(float quantile,
        +                      QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesFloatsAPI
        +
        Gets the normalized rank corresponding to the given a quantile.
        +
        +
        Specified by:
        +
        getRank in interface QuantilesFloatsAPI
        +
        Parameters:
        +
        quantile - the given quantile
        +
        searchCrit - if INCLUSIVE the given quantile is included into the rank.
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getRankLowerBound

        +
        public double getRankLowerBound​(double rank)
        +
        Gets the lower bound of the rank confidence interval in which the true rank of the + given rank exists. + The approximate probability that the true rank is within the confidence interval + specified by the upper and lower rank bounds for this sketch is 0.99.
        +
        +
        Specified by:
        +
        getRankLowerBound in interface QuantilesAPI
        +
        Parameters:
        +
        rank - the given normalized rank.
        +
        Returns:
        +
        the lower bound of the rank confidence interval in which the true rank of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getRankUpperBound

        +
        public double getRankUpperBound​(double rank)
        +
        Gets the upper bound of the rank confidence interval in which the true rank of the + given rank exists. + The approximate probability that the true rank is within the confidence interval + specified by the upper and lower rank bounds for this sketch is 0.99.
        +
        +
        Specified by:
        +
        getRankUpperBound in interface QuantilesAPI
        +
        Parameters:
        +
        rank - the given normalized rank.
        +
        Returns:
        +
        the upper bound of the rank confidence interval in which the true rank of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getRanks

        +
        public double[] getRanks​(float[] quantiles,
        +                         QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesFloatsAPI
        +
        Gets an array of normalized ranks corresponding to the given array of quantiles and the given + search criterion.
        +
        +
        Specified by:
        +
        getRanks in interface QuantilesFloatsAPI
        +
        Parameters:
        +
        quantiles - the given array of quantiles
        +
        searchCrit - if INCLUSIVE, the given quantiles include the rank directly corresponding to each quantile.
        +
        Returns:
        +
        an array of normalized ranks corresponding to the given array of quantiles.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        merge

        +
        public final void merge​(KllSketch other)
        +
        Description copied from class: KllSketch
        +
        Merges another sketch into this one. + Attempting to merge a sketch of the wrong type will throw an exception.
        +
        +
        Specified by:
        +
        merge in class KllSketch
        +
        Parameters:
        +
        other - sketch to merge into this one
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public final void reset()
        +
        Resets this sketch to the empty state. + If the sketch is read only this does nothing. + +

        The parameter k will not change.

        +

        The parameter k will not change.

        +
        +
        Specified by:
        +
        reset in interface QuantilesAPI
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray()
        +
        Description copied from interface: QuantilesFloatsAPI
        +
        Returns a byte array representation of this sketch.
        +
        +
        Specified by:
        +
        toByteArray in interface QuantilesFloatsAPI
        +
        Returns:
        +
        a byte array representation of this sketch.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString​(boolean withSummary,
        +                       boolean withData)
        +
        Description copied from class: KllSketch
        +
        Returns a summary of the sketch as a string.
        +
        +
        Overrides:
        +
        toString in class KllSketch
        +
        Parameters:
        +
        withSummary - if true includes sketch summary information
        +
        withData - if true include sketch data
        +
        Returns:
        +
        string representation of sketch summary
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(float item)
        +
        Description copied from interface: QuantilesFloatsAPI
        +
        Updates this sketch with the given item.
        +
        +
        Specified by:
        +
        update in interface QuantilesFloatsAPI
        +
        Parameters:
        +
        item - from a stream of quantiles. NaNs are ignored.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/KllFloatsSketchIterator.html b/docs/5.0.2/org/apache/datasketches/kll/KllFloatsSketchIterator.html new file mode 100644 index 000000000..720a27ed1 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/KllFloatsSketchIterator.html @@ -0,0 +1,322 @@ + + + + + +KllFloatsSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class KllFloatsSketchIterator

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getQuantile

        +
        public float getQuantile()
        +
        Description copied from interface: QuantilesFloatsSketchIterator
        +
        Gets the float quantile at the current index. + +

        Don't call this before calling next() for the first time + or after getting false from next().

        +
        +
        Specified by:
        +
        getQuantile in interface QuantilesFloatsSketchIterator
        +
        Returns:
        +
        the float quantile at the current index.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/KllFloatsSketchSortedView.html b/docs/5.0.2/org/apache/datasketches/kll/KllFloatsSketchSortedView.html new file mode 100644 index 000000000..ddc16fe2b --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/KllFloatsSketchSortedView.html @@ -0,0 +1,555 @@ + + + + + +KllFloatsSketchSortedView (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class KllFloatsSketchSortedView

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.kll.KllFloatsSketchSortedView
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    FloatsSortedView, SortedView
    +
    +
    +
    public final class KllFloatsSketchSortedView
    +extends Object
    +implements FloatsSortedView
    +
    The SortedView of the KllFloatsSketch.
    +
    +
    Author:
    +
    Alexander Saydakov, Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        KllFloatsSketchSortedView

        +
        public KllFloatsSketchSortedView​(KllFloatsSketch sketch)
        +
        Constructs this Sorted View given the sketch
        +
        +
        Parameters:
        +
        sketch - the given KllFloatsSketch.
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getCumulativeWeights

        +
        public long[] getCumulativeWeights()
        +
        Description copied from interface: SortedView
        +
        Returns the array of cumulative weights from the sketch. + Also known as the natural ranks, which are the Natural Numbers on the interval [1, N].
        +
        +
        Specified by:
        +
        getCumulativeWeights in interface SortedView
        +
        Returns:
        +
        the array of cumulative weights (or natural ranks).
        +
        +
      • +
      + + + +
        +
      • +

        getMaxItem

        +
        public float getMaxItem()
        +
        Description copied from interface: FloatsSortedView
        +
        Returns the maximum item of the stream. This may be distinct from the largest item retained by the + sketch algorithm.
        +
        +
        Specified by:
        +
        getMaxItem in interface FloatsSortedView
        +
        Returns:
        +
        the maximum item of the stream
        +
        +
      • +
      + + + +
        +
      • +

        getMinItem

        +
        public float getMinItem()
        +
        Description copied from interface: FloatsSortedView
        +
        Returns the minimum item of the stream. This may be distinct from the smallest item retained by the + sketch algorithm.
        +
        +
        Specified by:
        +
        getMinItem in interface FloatsSortedView
        +
        Returns:
        +
        the minimum item of the stream
        +
        +
      • +
      + + + +
        +
      • +

        getN

        +
        public long getN()
        +
        Description copied from interface: SortedView
        +
        Returns the total number of items presented to the sourcing sketch.
        +
        +
        Specified by:
        +
        getN in interface SortedView
        +
        Returns:
        +
        the total number of items presented to the sourcing sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        public float getQuantile​(double rank,
        +                         QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: FloatsSortedView
        +
        Gets the approximate quantile of the given normalized rank and the given search criterion.
        +
        +
        Specified by:
        +
        getQuantile in interface FloatsSortedView
        +
        Parameters:
        +
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        searchCrit - If INCLUSIVE, the given rank includes all quantiles ≤ + the quantile directly corresponding to the given rank. + If EXCLUSIVE, he given rank includes all quantiles < + the quantile directly corresponding to the given rank.
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantiles

        +
        public float[] getQuantiles()
        +
        Description copied from interface: FloatsSortedView
        +
        Returns an array of all retained quantiles by the sketch.
        +
        +
        Specified by:
        +
        getQuantiles in interface FloatsSortedView
        +
        Returns:
        +
        an array of all retained quantiles by the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getRank

        +
        public double getRank​(float quantile,
        +                      QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: FloatsSortedView
        +
        Gets the normalized rank corresponding to the given a quantile.
        +
        +
        Specified by:
        +
        getRank in interface FloatsSortedView
        +
        Parameters:
        +
        quantile - the given quantile
        +
        searchCrit - if INCLUSIVE the given quantile is included into the rank.
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        Description copied from interface: SortedView
        +
        Returns true if this sorted view is empty.
        +
        +
        Specified by:
        +
        isEmpty in interface SortedView
        +
        Returns:
        +
        true if this sorted view is empty.
        +
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/KllItemsSketch.html b/docs/5.0.2/org/apache/datasketches/kll/KllItemsSketch.html new file mode 100644 index 000000000..40ebcdd36 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/KllItemsSketch.html @@ -0,0 +1,1073 @@ + + + + + +KllItemsSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class KllItemsSketch<T>

+
+
+ +
+
    +
  • +
    +
    Type Parameters:
    +
    T - The sketch data type.
    +
    +
    +
    All Implemented Interfaces:
    +
    PartitioningFeature<T>, QuantilesAPI, QuantilesGenericAPI<T>
    +
    +
    +
    public abstract class KllItemsSketch<T>
    +extends KllSketch
    +implements QuantilesGenericAPI<T>, PartitioningFeature<T>
    +
    This variation of the KllSketch implements generic data types. The user must provide + a suitable implementation of the java.lang.Comparator as well as an implementation of + the serializer / deserializer, org.apache.datasketches.common.ArrayOfItemsSerDe.
    +
    +
    See Also:
    +
    KllSketch
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        newHeapInstance

        +
        public static <T> KllItemsSketch<T> newHeapInstance​(Comparator<? super T> comparator,
        +                                                    ArrayOfItemsSerDe<T> serDe)
        +
        Create a new heap instance of this sketch with the default k = 200. + The default k = 200 results in a normalized rank error of about + 1.65%. Larger K will have smaller error but the sketch will be larger (and slower).
        +
        +
        Type Parameters:
        +
        T - The sketch data type.
        +
        Parameters:
        +
        comparator - to compare items
        +
        serDe - Serializer / deserializer for an array of items, T[].
        +
        Returns:
        +
        new KllItemsSketch on the Java heap.
        +
        +
      • +
      + + + +
        +
      • +

        newHeapInstance

        +
        public static <T> KllItemsSketch<T> newHeapInstance​(int k,
        +                                                    Comparator<? super T> comparator,
        +                                                    ArrayOfItemsSerDe<T> serDe)
        +
        Create a new heap instance of this sketch with a given parameter k. + k can be between DEFAULT_M and 65535, inclusive. + The default k = 200 results in a normalized rank error of about + 1.65%. Larger K will have smaller error but the sketch will be larger (and slower).
        +
        +
        Type Parameters:
        +
        T - The sketch data type
        +
        Parameters:
        +
        k - parameter that controls size of the sketch and accuracy of estimates.
        +
        comparator - to compare items
        +
        serDe - Serializer / deserializer for items of type T and T[].
        +
        Returns:
        +
        new KllItemsSketch on the heap.
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static <T> KllItemsSketch<T> heapify​(org.apache.datasketches.memory.Memory srcMem,
        +                                            Comparator<? super T> comparator,
        +                                            ArrayOfItemsSerDe<T> serDe)
        +
        Factory heapify takes a compact sketch image in Memory and instantiates an on-heap sketch. + The resulting sketch will not retain any link to the source Memory.
        +
        +
        Type Parameters:
        +
        T - The sketch data type
        +
        Parameters:
        +
        srcMem - a compact Memory image of a sketch serialized by this sketch and of the same type of T.
        +
        comparator - to compare items
        +
        serDe - Serializer / deserializer for items of type T and T[].
        +
        Returns:
        +
        a heap-based sketch based on the given Memory.
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static <T> KllItemsSketch<T> wrap​(org.apache.datasketches.memory.Memory srcMem,
        +                                         Comparator<? super T> comparator,
        +                                         ArrayOfItemsSerDe<T> serDe)
        +
        Constructs a thin wrapper on the heap around a Memory (or WritableMemory) already initialized with a + validated sketch image of a type T consistent with the given comparator and serDe. + A reference to the Memory is kept in the sketch and must remain in scope consistent + with the temporal scope of this sketch. The amount of data kept on the heap is very small. + All of the item data originally collected by the given Memory sketch object remains in the + Memory object
        +
        +
        Type Parameters:
        +
        T - The sketch data type
        +
        Parameters:
        +
        srcMem - the Memory object that this sketch will wrap.
        +
        comparator - to compare items
        +
        serDe - Serializer / deserializer for items of type T and T[].
        +
        Returns:
        +
        a heap-base sketch that is a thin wrapper around the given srcMem.
        +
        +
      • +
      + + + + + +
        +
      • +

        getCDF

        +
        public double[] getCDF​(T[] splitPoints,
        +                       QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesGenericAPI
        +
        Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(false) function.

        +
        +
        Specified by:
        +
        getCDF in interface QuantilesGenericAPI<T>
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 overlapping intervals. + +

        The start of each interval is below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and the end of the interval + is the rank or cumulative probability corresponding to the split point.

        + +

        The (m+1)th interval represents 100% of the distribution represented by the sketch + and consistent with the definition of a cumulative probability distribution, thus the (m+1)th + rank or probability in the returned array is always 1.0.

        + +

        If a split point exactly equals a retained item of the sketch and the search criterion is:

        + +
          +
        • INCLUSIVE, the resulting cumulative probability will include that item.
        • +
        • EXCLUSIVE, the resulting cumulative probability will not include the weight of that split point.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
        +
        +
      • +
      + + + +
        +
      • +

        getPartitionBoundaries

        +
        public GenericPartitionBoundaries<T> getPartitionBoundaries​(int numEquallySized,
        +                                                            QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: PartitioningFeature
        +
        This method returns an instance of + GenericPartitionBoundaries which provides + sufficient information for the user to create the given number of equally sized partitions, where "equally sized" + refers to an approximately equal number of items per partition.
        +
        +
        Specified by:
        +
        getPartitionBoundaries in interface PartitioningFeature<T>
        +
        Parameters:
        +
        numEquallySized - an integer that specifies the number of equally sized partitions between + getMinItem() and + getMaxItem(). + This must be a positive integer greater than zero. +
          +
        • A 1 will return: minItem, maxItem.
        • +
        • A 2 will return: minItem, median quantile, maxItem.
        • +
        • Etc.
        • +
        +
        searchCrit - If INCLUSIVE, all the returned quantiles are the upper boundaries of the equally sized partitions + with the exception of the lowest returned quantile, which is the lowest boundary of the lowest ranked partition. + If EXCLUSIVE, all the returned quantiles are the lower boundaries of the equally sized partitions + with the exception of the highest returned quantile, which is the upper boundary of the highest ranked partition.
        +
        Returns:
        +
        an instance of GenericPartitionBoundaries.
        +
        +
      • +
      + + + + + +
        +
      • +

        getPMF

        +
        public double[] getPMF​(T[] splitPoints,
        +                       QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesGenericAPI
        +
        Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(true) function.

        +
        +
        Specified by:
        +
        getPMF in interface QuantilesGenericAPI<T>
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 consecutive, non-overlapping intervals. + +

        Each interval except for the end intervals starts with a split point and ends with the next split + point in sequence.

        + +

        The first interval starts below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and ends with the first split point

        + +

        The last (m+1)th interval starts with the last split point and ends after the last + item retained by the sketch corresponding to a rank or probability of 1.0.

        + +

        The sum of the probability masses of all (m+1) intervals is 1.0.

        + +

        If the search criterion is:

        + +
          +
        • INCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will include that item. If the lower split point equals an item retained by the sketch, the interval will exclude + that item.
        • +
        • EXCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will exclude that item. If the lower split point equals an item retained by the sketch, the interval will include + that item.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        public T getQuantile​(double rank,
        +                     QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesGenericAPI
        +
        Gets the approximate quantile of the given normalized rank and the given search criterion.
        +
        +
        Specified by:
        +
        getQuantile in interface QuantilesGenericAPI<T>
        +
        Parameters:
        +
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        searchCrit - If INCLUSIVE, the given rank includes all quantiles ≤ + the quantile directly corresponding to the given rank. + If EXCLUSIVE, he given rank includes all quantiles < + the quantile directly corresponding to the given rank.
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantiles

        +
        public T[] getQuantiles​(double[] ranks,
        +                        QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesGenericAPI
        +
        Gets an array of quantiles from the given array of normalized ranks.
        +
        +
        Specified by:
        +
        getQuantiles in interface QuantilesGenericAPI<T>
        +
        Parameters:
        +
        ranks - the given array of normalized ranks, each of which must be + in the interval [0.0,1.0].
        +
        searchCrit - if INCLUSIVE, the given ranks include all quantiles ≤ + the quantile directly corresponding to each rank.
        +
        Returns:
        +
        an array of quantiles corresponding to the given array of normalized ranks.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantileLowerBound

        +
        public T getQuantileLowerBound​(double rank)
        +
        Description copied from interface: QuantilesGenericAPI
        +
        Gets the lower bound of the quantile confidence interval in which the quantile of the + given rank exists. + +

        Although it is possible to estimate the probability that the true quantile + exists within the quantile confidence interval specified by the upper and lower quantile bounds, + it is not possible to guarantee the width of the quantile confidence interval + as an additive or multiplicative percent of the true quantile.

        +
        +
        Specified by:
        +
        getQuantileLowerBound in interface QuantilesGenericAPI<T>
        +
        Parameters:
        +
        rank - the given normalized rank
        +
        Returns:
        +
        the lower bound of the quantile confidence interval in which the quantile of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantileUpperBound

        +
        public T getQuantileUpperBound​(double rank)
        +
        Description copied from interface: QuantilesGenericAPI
        +
        Gets the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists. + +

        Although it is possible to estimate the probability that the true quantile + exists within the quantile confidence interval specified by the upper and lower quantile bounds, + it is not possible to guarantee the width of the quantile interval + as an additive or multiplicative percent of the true quantile.

        +
        +
        Specified by:
        +
        getQuantileUpperBound in interface QuantilesGenericAPI<T>
        +
        Parameters:
        +
        rank - the given normalized rank
        +
        Returns:
        +
        the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists.
        +
        +
      • +
      + + + + + +
        +
      • +

        getRank

        +
        public double getRank​(T quantile,
        +                      QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesGenericAPI
        +
        Gets the normalized rank corresponding to the given a quantile.
        +
        +
        Specified by:
        +
        getRank in interface QuantilesGenericAPI<T>
        +
        Parameters:
        +
        quantile - the given quantile
        +
        searchCrit - if INCLUSIVE the given quantile is included into the rank.
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getRankLowerBound

        +
        public double getRankLowerBound​(double rank)
        +
        Gets the lower bound of the rank confidence interval in which the true rank of the + given rank exists. + The approximate probability that the true rank is within the confidence interval + specified by the upper and lower rank bounds for this sketch is 0.99.
        +
        +
        Specified by:
        +
        getRankLowerBound in interface QuantilesAPI
        +
        Parameters:
        +
        rank - the given normalized rank.
        +
        Returns:
        +
        the lower bound of the rank confidence interval in which the true rank of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getRankUpperBound

        +
        public double getRankUpperBound​(double rank)
        +
        Gets the upper bound of the rank confidence interval in which the true rank of the + given rank exists. + The approximate probability that the true rank is within the confidence interval + specified by the upper and lower rank bounds for this sketch is 0.99.
        +
        +
        Specified by:
        +
        getRankUpperBound in interface QuantilesAPI
        +
        Parameters:
        +
        rank - the given normalized rank.
        +
        Returns:
        +
        the upper bound of the rank confidence interval in which the true rank of the + given rank exists.
        +
        +
      • +
      + + + + + +
        +
      • +

        getRanks

        +
        public double[] getRanks​(T[] quantiles,
        +                         QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesGenericAPI
        +
        Gets an array of normalized ranks corresponding to the given array of quantiles and the given + search criterion.
        +
        +
        Specified by:
        +
        getRanks in interface QuantilesGenericAPI<T>
        +
        Parameters:
        +
        quantiles - the given array of quantiles
        +
        searchCrit - if INCLUSIVE, the given quantiles include the rank directly corresponding to each quantile.
        +
        Returns:
        +
        an array of normalized ranks corresponding to the given array of quantiles.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        merge

        +
        public final void merge​(KllSketch other)
        +
        Description copied from class: KllSketch
        +
        Merges another sketch into this one. + Attempting to merge a sketch of the wrong type will throw an exception.
        +
        +
        Specified by:
        +
        merge in class KllSketch
        +
        Parameters:
        +
        other - sketch to merge into this one
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Description copied from interface: QuantilesAPI
        +
        Resets this sketch to the empty state. + If the sketch is read only this does nothing. + +

        The parameter k will not change.

        +
        +
        Specified by:
        +
        reset in interface QuantilesAPI
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray()
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString​(boolean withSummary,
        +                       boolean withData)
        +
        Description copied from class: KllSketch
        +
        Returns a summary of the sketch as a string.
        +
        +
        Overrides:
        +
        toString in class KllSketch
        +
        Parameters:
        +
        withSummary - if true includes sketch summary information
        +
        withData - if true include sketch data
        +
        Returns:
        +
        string representation of sketch summary
        +
        +
      • +
      + + + + + +
        +
      • +

        update

        +
        public void update​(T item)
        +
        Description copied from interface: QuantilesGenericAPI
        +
        Updates this sketch with the given item.
        +
        +
        Specified by:
        +
        update in interface QuantilesGenericAPI<T>
        +
        Parameters:
        +
        item - from a stream of items. Nulls are ignored.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/KllItemsSketchIterator.html b/docs/5.0.2/org/apache/datasketches/kll/KllItemsSketchIterator.html new file mode 100644 index 000000000..447b84a7a --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/KllItemsSketchIterator.html @@ -0,0 +1,322 @@ + + + + + +KllItemsSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class KllItemsSketchIterator<T>

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getQuantile

        +
        public T getQuantile()
        +
        Description copied from interface: QuantilesGenericSketchIterator
        +
        Gets the generic quantile at the current index. + +

        Don't call this before calling next() for the first time + or after getting false from next().

        +
        +
        Specified by:
        +
        getQuantile in interface QuantilesGenericSketchIterator<T>
        +
        Returns:
        +
        the generic quantile at the current index.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/KllItemsSketchSortedView.html b/docs/5.0.2/org/apache/datasketches/kll/KllItemsSketchSortedView.html new file mode 100644 index 000000000..414f408c7 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/KllItemsSketchSortedView.html @@ -0,0 +1,699 @@ + + + + + +KllItemsSketchSortedView (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class KllItemsSketchSortedView<T>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.kll.KllItemsSketchSortedView<T>
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        getCDF

        +
        public double[] getCDF​(T[] splitPoints,
        +                       QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: GenericSortedView
        +
        Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints. + +

        If the sketch is empty this returns null.

        + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(false) function.

        +
        +
        Specified by:
        +
        getCDF in interface GenericSortedView<T>
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 overlapping intervals. + +

        The start of each interval is below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and the end of the interval + is the rank or cumulative probability corresponding to the split point.

        + +

        The (m+1)th interval represents 100% of the distribution represented by the sketch + and consistent with the definition of a cumulative probability distribution, thus the (m+1)th + rank or probability in the returned array is always 1.0.

        + +

        If a split point exactly equals a retained item of the sketch and the search criterion is:

        + +
          +
        • INCLUSIVE, the resulting cumulative probability will include that item.
        • +
        • EXCLUSIVE, the resulting cumulative probability will not include the weight of that split point.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
        +
        +
      • +
      + + + +
        +
      • +

        getCumulativeWeights

        +
        public long[] getCumulativeWeights()
        +
        Description copied from interface: SortedView
        +
        Returns the array of cumulative weights from the sketch. + Also known as the natural ranks, which are the Natural Numbers on the interval [1, N].
        +
        +
        Specified by:
        +
        getCumulativeWeights in interface SortedView
        +
        Returns:
        +
        the array of cumulative weights (or natural ranks).
        +
        +
      • +
      + + + +
        +
      • +

        getMaxItem

        +
        public T getMaxItem()
        +
        Description copied from interface: GenericSortedView
        +
        Returns the maximum item of the stream. This may be distinct from the largest item retained by the + sketch algorithm.
        +
        +
        Specified by:
        +
        getMaxItem in interface GenericSortedView<T>
        +
        Returns:
        +
        the maximum item of the stream
        +
        +
      • +
      + + + +
        +
      • +

        getMinItem

        +
        public T getMinItem()
        +
        Description copied from interface: GenericSortedView
        +
        Returns the minimum item of the stream. This may be distinct from the smallest item retained by the + sketch algorithm.
        +
        +
        Specified by:
        +
        getMinItem in interface GenericSortedView<T>
        +
        Returns:
        +
        the minimum item of the stream
        +
        +
      • +
      + + + +
        +
      • +

        getN

        +
        public long getN()
        +
        Description copied from interface: SortedView
        +
        Returns the total number of items presented to the sourcing sketch.
        +
        +
        Specified by:
        +
        getN in interface SortedView
        +
        Returns:
        +
        the total number of items presented to the sourcing sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getPartitionBoundaries

        +
        public GenericPartitionBoundaries<T> getPartitionBoundaries​(int numEquallySized,
        +                                                            QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: PartitioningFeature
        +
        This method returns an instance of + GenericPartitionBoundaries which provides + sufficient information for the user to create the given number of equally sized partitions, where "equally sized" + refers to an approximately equal number of items per partition.
        +
        +
        Specified by:
        +
        getPartitionBoundaries in interface PartitioningFeature<T>
        +
        Parameters:
        +
        numEquallySized - an integer that specifies the number of equally sized partitions between + getMinItem() and + getMaxItem(). + This must be a positive integer greater than zero. +
          +
        • A 1 will return: minItem, maxItem.
        • +
        • A 2 will return: minItem, median quantile, maxItem.
        • +
        • Etc.
        • +
        +
        searchCrit - If INCLUSIVE, all the returned quantiles are the upper boundaries of the equally sized partitions + with the exception of the lowest returned quantile, which is the lowest boundary of the lowest ranked partition. + If EXCLUSIVE, all the returned quantiles are the lower boundaries of the equally sized partitions + with the exception of the highest returned quantile, which is the upper boundary of the highest ranked partition.
        +
        Returns:
        +
        an instance of GenericPartitionBoundaries.
        +
        +
      • +
      + + + + + +
        +
      • +

        getPMF

        +
        public double[] getPMF​(T[] splitPoints,
        +                       QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: GenericSortedView
        +
        Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(true) function.

        +
        +
        Specified by:
        +
        getPMF in interface GenericSortedView<T>
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 consecutive, non-overlapping intervals. + +

        Each interval except for the end intervals starts with a split point and ends with the next split + point in sequence.

        + +

        The first interval starts below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and ends with the first split point

        + +

        The last (m+1)th interval starts with the last split point and ends after the last + item retained by the sketch corresponding to a rank or probability of 1.0.

        + +

        The sum of the probability masses of all (m+1) intervals is 1.0.

        + +

        If the search criterion is:

        + +
          +
        • INCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will include that item. If the lower split point equals an item retained by the sketch, the interval will exclude + that item.
        • +
        • EXCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will exclude that item. If the lower split point equals an item retained by the sketch, the interval will include + that item.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        public T getQuantile​(double rank,
        +                     QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: GenericSortedView
        +
        Gets the approximate quantile of the given normalized rank and the given search criterion.
        +
        +
        Specified by:
        +
        getQuantile in interface GenericSortedView<T>
        +
        Parameters:
        +
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        searchCrit - If INCLUSIVE, the given rank includes all quantiles ≤ + the quantile directly corresponding to the given rank. + If EXCLUSIVE, he given rank includes all quantiles < + the quantile directly corresponding to the given rank.
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getQuantiles

        +
        public T[] getQuantiles()
        +
        Description copied from interface: GenericSortedView
        +
        Returns the full array of quantiles.
        +
        +
        Specified by:
        +
        getQuantiles in interface GenericSortedView<T>
        +
        Returns:
        +
        the full array of quantiles.
        +
        +
      • +
      + + + + + +
        +
      • +

        getRank

        +
        public double getRank​(T quantile,
        +                      QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: GenericSortedView
        +
        Gets the normalized rank corresponding to the given a quantile.
        +
        +
        Specified by:
        +
        getRank in interface GenericSortedView<T>
        +
        Parameters:
        +
        quantile - the given quantile
        +
        searchCrit - if INCLUSIVE the given quantile is included into the rank.
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        Description copied from interface: SortedView
        +
        Returns true if this sorted view is empty.
        +
        +
        Specified by:
        +
        isEmpty in interface SortedView
        +
        Returns:
        +
        true if this sorted view is empty.
        +
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/KllSketch.SketchStructure.html b/docs/5.0.2/org/apache/datasketches/kll/KllSketch.SketchStructure.html new file mode 100644 index 000000000..c5805c440 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/KllSketch.SketchStructure.html @@ -0,0 +1,454 @@ + + + + + +KllSketch.SketchStructure (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum KllSketch.SketchStructure

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static KllSketch.SketchStructure[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (KllSketch.SketchStructure c : KllSketch.SketchStructure.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static KllSketch.SketchStructure valueOf​(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        getPreInts

        +
        public int getPreInts()
        +
      • +
      + + + +
        +
      • +

        getSerVer

        +
        public int getSerVer()
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/KllSketch.SketchType.html b/docs/5.0.2/org/apache/datasketches/kll/KllSketch.SketchType.html new file mode 100644 index 000000000..b362ab096 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/KllSketch.SketchType.html @@ -0,0 +1,425 @@ + + + + + +KllSketch.SketchType (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum KllSketch.SketchType

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static KllSketch.SketchType[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (KllSketch.SketchType c : KllSketch.SketchType.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static KllSketch.SketchType valueOf​(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        getBytes

        +
        public int getBytes()
        +
      • +
      + + + +
        +
      • +

        getName

        +
        public String getName()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/KllSketch.html b/docs/5.0.2/org/apache/datasketches/kll/KllSketch.html new file mode 100644 index 000000000..3db6e771d --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/KllSketch.html @@ -0,0 +1,816 @@ + + + + + +KllSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class KllSketch

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    QuantilesAPI
    +
    +
    +
    Direct Known Subclasses:
    +
    KllDoublesSketch, KllFloatsSketch, KllItemsSketch
    +
    +
    +
    public abstract class KllSketch
    +extends Object
    +implements QuantilesAPI
    +
    This class is the root of the KLL sketch class hierarchy. It includes the public API that is independent + of either sketch type (e.g., float, double or generic item) and independent of whether the sketch is targeted + for use on the Java heap or off-heap. + +

    KLL is an implementation of a very compact quantiles sketch with lazy compaction scheme + and nearly optimal accuracy per retained quantile.

    + +

    Reference Optimal Quantile Approximation in Streams.

    + +

    The default k of 200 yields a "single-sided" epsilon of about 1.33% and a + "double-sided" (PMF) epsilon of about 1.65%, with a confidence of 99%.

    +
    +
    Author:
    +
    Lee Rhodes, Kevin Lang, Alexander Saydakov
    +
    See Also:
    +
    KLL Sketch, +QuantilesAPI
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getKFromEpsilon

        +
        public static int getKFromEpsilon​(double epsilon,
        +                                  boolean pmf)
        +
        Gets the approximate k to use given epsilon, the normalized rank error.
        +
        +
        Parameters:
        +
        epsilon - the normalized rank error between zero and one.
        +
        pmf - if true, this function returns the k assuming the input epsilon + is the desired "double-sided" epsilon for the getPMF() function. Otherwise, this function + returns k assuming the input epsilon is the desired "single-sided" + epsilon for all the other queries.
        +
        Returns:
        +
        k given epsilon.
        +
        +
      • +
      + + + +
        +
      • +

        getMaxSerializedSizeBytes

        +
        public static int getMaxSerializedSizeBytes​(int k,
        +                                            long n,
        +                                            KllSketch.SketchType sketchType,
        +                                            boolean updatableMemFormat)
        +
        Returns upper bound on the serialized size of a KllSketch given the following parameters.
        +
        +
        Parameters:
        +
        k - parameter that controls size of the sketch and accuracy of estimates
        +
        n - stream length
        +
        sketchType - Only DOUBLES_SKETCH and FLOATS_SKETCH is supported for this operation.
        +
        updatableMemFormat - true if updatable Memory format, otherwise the standard compact format.
        +
        Returns:
        +
        upper bound on the serialized size of a KllSketch.
        +
        +
      • +
      + + + +
        +
      • +

        getNormalizedRankError

        +
        public static double getNormalizedRankError​(int k,
        +                                            boolean pmf)
        +
        Gets the normalized rank error given k and pmf. + Static method version of the getNormalizedRankError(boolean). + The epsilon returned is a best fit to 99 percent confidence empirically measured max error + in thousands of trials.
        +
        +
        Parameters:
        +
        k - the configuration parameter
        +
        pmf - if true, returns the "double-sided" normalized rank error for the getPMF() function. + Otherwise, it is the "single-sided" normalized rank error for all the other queries.
        +
        Returns:
        +
        if pmf is true, the normalized rank error for the getPMF() function. + Otherwise, it is the "single-sided" normalized rank error for all the other queries.
        +
        +
      • +
      + + + +
        +
      • +

        getNormalizedRankError

        +
        public final double getNormalizedRankError​(boolean pmf)
        +
        Gets the approximate rank error of this sketch normalized as a fraction between zero and one. + The epsilon returned is a best fit to 99 percent confidence empirically measured max error + in thousands of trials.
        +
        +
        Parameters:
        +
        pmf - if true, returns the "double-sided" normalized rank error for the getPMF() function. + Otherwise, it is the "single-sided" normalized rank error for all the other queries.
        +
        Returns:
        +
        if pmf is true, returns the "double-sided" normalized rank error for the getPMF() function. + Otherwise, it is the "single-sided" normalized rank error for all the other queries.
        +
        +
      • +
      + + + +
        +
      • +

        getNumRetained

        +
        public final int getNumRetained()
        +
        Description copied from interface: QuantilesAPI
        +
        Gets the number of quantiles retained by the sketch.
        +
        +
        Specified by:
        +
        getNumRetained in interface QuantilesAPI
        +
        Returns:
        +
        the number of quantiles retained by the sketch
        +
        +
      • +
      + + + +
        +
      • +

        getSerializedSizeBytes

        +
        public int getSerializedSizeBytes()
        +
        Returns the current number of bytes this Sketch would require if serialized in compact form.
        +
        +
        Returns:
        +
        the number of bytes this sketch would require if serialized.
        +
        +
      • +
      + + + +
        +
      • +

        hasMemory

        +
        public boolean hasMemory()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch's data structure is backed by Memory or WritableMemory.
        +
        +
        Specified by:
        +
        hasMemory in interface QuantilesAPI
        +
        Returns:
        +
        true if this sketch's data structure is backed by Memory or WritableMemory.
        +
        +
      • +
      + + + +
        +
      • +

        isCompactMemoryFormat

        +
        public boolean isCompactMemoryFormat()
        +
      • +
      + + + +
        +
      • +

        isDirect

        +
        public boolean isDirect()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch's data structure is off-heap (a.k.a., Direct or Native memory).
        +
        +
        Specified by:
        +
        isDirect in interface QuantilesAPI
        +
        Returns:
        +
        true if this sketch's data structure is off-heap (a.k.a., Direct or Native memory).
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public final boolean isEmpty()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch is empty.
        +
        +
        Specified by:
        +
        isEmpty in interface QuantilesAPI
        +
        Returns:
        +
        true if this sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        isEstimationMode

        +
        public final boolean isEstimationMode()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch is in estimation mode.
        +
        +
        Specified by:
        +
        isEstimationMode in interface QuantilesAPI
        +
        Returns:
        +
        true if this sketch is in estimation mode.
        +
        +
      • +
      + + + +
        +
      • +

        isMemoryUpdatableFormat

        +
        public final boolean isMemoryUpdatableFormat()
        +
        Returns true if the backing WritableMemory is in updatable format.
        +
        +
        Returns:
        +
        true if the backing WritableMemory is in updatable format.
        +
        +
      • +
      + + + +
        +
      • +

        isReadOnly

        +
        public final boolean isReadOnly()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch is read only.
        +
        +
        Specified by:
        +
        isReadOnly in interface QuantilesAPI
        +
        Returns:
        +
        true if this sketch is read only.
        +
        +
      • +
      + + + +
        +
      • +

        isSameResource

        +
        public final boolean isSameResource​(org.apache.datasketches.memory.Memory that)
        +
        Returns true if the backing resource of this is identical with the backing resource + of that. The capacities must be the same. If this is a region, + the region offset must also be the same.
        +
        +
        Parameters:
        +
        that - A different non-null object
        +
        Returns:
        +
        true if the backing resource of this is the same as the backing resource + of that.
        +
        +
      • +
      + + + +
        +
      • +

        merge

        +
        public abstract void merge​(KllSketch other)
        +
        Merges another sketch into this one. + Attempting to merge a sketch of the wrong type will throw an exception.
        +
        +
        Parameters:
        +
        other - sketch to merge into this one
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public final String toString()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns a summary of the key parameters of the sketch.
        +
        +
        Specified by:
        +
        toString in interface QuantilesAPI
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        a summary of the key parameters of the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString​(boolean withSummary,
        +                       boolean withData)
        +
        Returns a summary of the sketch as a string.
        +
        +
        Parameters:
        +
        withSummary - if true includes sketch summary information
        +
        withData - if true include sketch data
        +
        Returns:
        +
        string representation of sketch summary
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/KllSketchIterator.html b/docs/5.0.2/org/apache/datasketches/kll/KllSketchIterator.html new file mode 100644 index 000000000..03db93731 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/KllSketchIterator.html @@ -0,0 +1,440 @@ + + + + + +KllSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class KllSketchIterator

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        levelsArr

        +
        protected final int[] levelsArr
        +
      • +
      + + + +
        +
      • +

        numLevels

        +
        protected final int numLevels
        +
      • +
      + + + +
        +
      • +

        level

        +
        protected int level
        +
      • +
      + + + +
        +
      • +

        index

        +
        protected int index
        +
      • +
      + + + +
        +
      • +

        weight

        +
        protected long weight
        +
      • +
      + + + +
        +
      • +

        isInitialized_

        +
        protected boolean isInitialized_
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getWeight

        +
        public long getWeight()
        +
        Description copied from interface: QuantilesSketchIterator
        +
        Gets the natural weight at the current index. + +

        Don't call this before calling next() for the first time + or after getting false from next().

        +
        +
        Specified by:
        +
        getWeight in interface QuantilesSketchIterator
        +
        Returns:
        +
        the natural weight at the current index.
        +
        +
      • +
      + + + +
        +
      • +

        next

        +
        public boolean next()
        +
        Description copied from interface: QuantilesSketchIterator
        +
        Advances the index and checks if it is valid. + The state of this iterator is undefined before the first call of this method.
        +
        +
        Specified by:
        +
        next in interface QuantilesSketchIterator
        +
        Returns:
        +
        true if the next index is valid.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/class-use/KllDoublesSketch.html b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllDoublesSketch.html new file mode 100644 index 000000000..e72775f4e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllDoublesSketch.html @@ -0,0 +1,261 @@ + + + + + +Uses of Class org.apache.datasketches.kll.KllDoublesSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.kll.KllDoublesSketch

+
+
+
    +
  • + + + + + + + + + + + + +
    Packages that use KllDoublesSketch 
    PackageDescription
    org.apache.datasketches.kll +
    This package is for the implementations of the sketch algorithm developed by Zohar Karnin, Kevin Lang, + and Edo Liberty that is commonly referred to as the "KLL" sketch after the authors' last names.
    +
    +
  • +
  • +
      +
    • +
      + + +

      Uses of KllDoublesSketch in org.apache.datasketches.kll

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.kll that return KllDoublesSketch 
      Modifier and TypeMethodDescription
      static KllDoublesSketchKllDoublesSketch.heapify​(org.apache.datasketches.memory.Memory srcMem) +
      Factory heapify takes a compact sketch image in Memory and instantiates an on-heap sketch.
      +
      static KllDoublesSketchKllDoublesSketch.newDirectInstance​(int k, + org.apache.datasketches.memory.WritableMemory dstMem, + org.apache.datasketches.memory.MemoryRequestServer memReqSvr) +
      Create a new direct updatable instance of this sketch with a given k.
      +
      static KllDoublesSketchKllDoublesSketch.newDirectInstance​(org.apache.datasketches.memory.WritableMemory dstMem, + org.apache.datasketches.memory.MemoryRequestServer memReqSvr) +
      Create a new direct updatable instance of this sketch with the default k.
      +
      static KllDoublesSketchKllDoublesSketch.newHeapInstance() +
      Create a new heap instance of this sketch with the default k = 200.
      +
      static KllDoublesSketchKllDoublesSketch.newHeapInstance​(int k) +
      Create a new heap instance of this sketch with a given parameter k.
      +
      static KllDoublesSketchKllDoublesSketch.wrap​(org.apache.datasketches.memory.Memory srcMem) +
      Wrap a sketch around the given read only compact source Memory containing sketch data + that originated from this sketch.
      +
      static KllDoublesSketchKllDoublesSketch.writableWrap​(org.apache.datasketches.memory.WritableMemory srcMem, + org.apache.datasketches.memory.MemoryRequestServer memReqSvr) +
      Wrap a sketch around the given source Writable Memory containing sketch data + that originated from this sketch.
      +
      + + + + + + + + + + + + +
      Constructors in org.apache.datasketches.kll with parameters of type KllDoublesSketch 
      ConstructorDescription
      KllDoublesSketchSortedView​(KllDoublesSketch sketch) +
      Constructs this Sorted View given the sketch
      +
      +
      +
    • +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/class-use/KllDoublesSketchIterator.html b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllDoublesSketchIterator.html new file mode 100644 index 000000000..df9ddd1ce --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllDoublesSketchIterator.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.kll.KllDoublesSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.kll.KllDoublesSketchIterator

+
+
No usage of org.apache.datasketches.kll.KllDoublesSketchIterator
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/class-use/KllDoublesSketchSortedView.html b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllDoublesSketchSortedView.html new file mode 100644 index 000000000..49ee0ff2e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllDoublesSketchSortedView.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.kll.KllDoublesSketchSortedView (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.kll.KllDoublesSketchSortedView

+
+
No usage of org.apache.datasketches.kll.KllDoublesSketchSortedView
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/class-use/KllFloatsSketch.html b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllFloatsSketch.html new file mode 100644 index 000000000..2d0def9dd --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllFloatsSketch.html @@ -0,0 +1,261 @@ + + + + + +Uses of Class org.apache.datasketches.kll.KllFloatsSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.kll.KllFloatsSketch

+
+
+
    +
  • + + + + + + + + + + + + +
    Packages that use KllFloatsSketch 
    PackageDescription
    org.apache.datasketches.kll +
    This package is for the implementations of the sketch algorithm developed by Zohar Karnin, Kevin Lang, + and Edo Liberty that is commonly referred to as the "KLL" sketch after the authors' last names.
    +
    +
  • +
  • +
      +
    • +
      + + +

      Uses of KllFloatsSketch in org.apache.datasketches.kll

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.kll that return KllFloatsSketch 
      Modifier and TypeMethodDescription
      static KllFloatsSketchKllFloatsSketch.heapify​(org.apache.datasketches.memory.Memory srcMem) +
      Factory heapify takes a compact sketch image in Memory and instantiates an on-heap sketch.
      +
      static KllFloatsSketchKllFloatsSketch.newDirectInstance​(int k, + org.apache.datasketches.memory.WritableMemory dstMem, + org.apache.datasketches.memory.MemoryRequestServer memReqSvr) +
      Create a new direct updatable instance of this sketch with a given k.
      +
      static KllFloatsSketchKllFloatsSketch.newDirectInstance​(org.apache.datasketches.memory.WritableMemory dstMem, + org.apache.datasketches.memory.MemoryRequestServer memReqSvr) +
      Create a new direct updatable instance of this sketch with the default k.
      +
      static KllFloatsSketchKllFloatsSketch.newHeapInstance() +
      Create a new heap instance of this sketch with the default k = 200.
      +
      static KllFloatsSketchKllFloatsSketch.newHeapInstance​(int k) +
      Create a new heap instance of this sketch with a given parameter k.
      +
      static KllFloatsSketchKllFloatsSketch.wrap​(org.apache.datasketches.memory.Memory srcMem) +
      Wrap a sketch around the given read only compact source Memory containing sketch data + that originated from this sketch.
      +
      static KllFloatsSketchKllFloatsSketch.writableWrap​(org.apache.datasketches.memory.WritableMemory srcMem, + org.apache.datasketches.memory.MemoryRequestServer memReqSvr) +
      Wrap a sketch around the given source Writable Memory containing sketch data + that originated from this sketch.
      +
      + + + + + + + + + + + + +
      Constructors in org.apache.datasketches.kll with parameters of type KllFloatsSketch 
      ConstructorDescription
      KllFloatsSketchSortedView​(KllFloatsSketch sketch) +
      Constructs this Sorted View given the sketch
      +
      +
      +
    • +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/class-use/KllFloatsSketchIterator.html b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllFloatsSketchIterator.html new file mode 100644 index 000000000..73bf3ae30 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllFloatsSketchIterator.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.kll.KllFloatsSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.kll.KllFloatsSketchIterator

+
+
No usage of org.apache.datasketches.kll.KllFloatsSketchIterator
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/class-use/KllFloatsSketchSortedView.html b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllFloatsSketchSortedView.html new file mode 100644 index 000000000..3b24fbe3f --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllFloatsSketchSortedView.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.kll.KllFloatsSketchSortedView (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.kll.KllFloatsSketchSortedView

+
+
No usage of org.apache.datasketches.kll.KllFloatsSketchSortedView
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/class-use/KllItemsSketch.html b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllItemsSketch.html new file mode 100644 index 000000000..23cd710e9 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllItemsSketch.html @@ -0,0 +1,227 @@ + + + + + +Uses of Class org.apache.datasketches.kll.KllItemsSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.kll.KllItemsSketch

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/class-use/KllItemsSketchIterator.html b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllItemsSketchIterator.html new file mode 100644 index 000000000..612cc7cb2 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllItemsSketchIterator.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.kll.KllItemsSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.kll.KllItemsSketchIterator

+
+
No usage of org.apache.datasketches.kll.KllItemsSketchIterator
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/class-use/KllItemsSketchSortedView.html b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllItemsSketchSortedView.html new file mode 100644 index 000000000..0ac6bb7f1 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllItemsSketchSortedView.html @@ -0,0 +1,196 @@ + + + + + +Uses of Class org.apache.datasketches.kll.KllItemsSketchSortedView (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.kll.KllItemsSketchSortedView

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/class-use/KllSketch.SketchStructure.html b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllSketch.SketchStructure.html new file mode 100644 index 000000000..d8964c9bb --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllSketch.SketchStructure.html @@ -0,0 +1,212 @@ + + + + + +Uses of Class org.apache.datasketches.kll.KllSketch.SketchStructure (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.kll.KllSketch.SketchStructure

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/class-use/KllSketch.SketchType.html b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllSketch.SketchType.html new file mode 100644 index 000000000..befd640e4 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllSketch.SketchType.html @@ -0,0 +1,226 @@ + + + + + +Uses of Class org.apache.datasketches.kll.KllSketch.SketchType (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.kll.KllSketch.SketchType

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/class-use/KllSketch.html b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllSketch.html new file mode 100644 index 000000000..c82ef1bba --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllSketch.html @@ -0,0 +1,244 @@ + + + + + +Uses of Class org.apache.datasketches.kll.KllSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.kll.KllSketch

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/class-use/KllSketchIterator.html b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllSketchIterator.html new file mode 100644 index 000000000..488079194 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/class-use/KllSketchIterator.html @@ -0,0 +1,212 @@ + + + + + +Uses of Class org.apache.datasketches.kll.KllSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.kll.KllSketchIterator

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/package-summary.html b/docs/5.0.2/org/apache/datasketches/kll/package-summary.html new file mode 100644 index 000000000..9884f02e3 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/package-summary.html @@ -0,0 +1,259 @@ + + + + + +org.apache.datasketches.kll (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches.kll

+
+
+
+ + +
This package is for the implementations of the sketch algorithm developed by Zohar Karnin, Kevin Lang, + and Edo Liberty that is commonly referred to as the "KLL" sketch after the authors' last names.
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/package-tree.html b/docs/5.0.2/org/apache/datasketches/kll/package-tree.html new file mode 100644 index 000000000..17b99852d --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/package-tree.html @@ -0,0 +1,195 @@ + + + + + +org.apache.datasketches.kll Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches.kll

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+

Enum Hierarchy

+ +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/kll/package-use.html b/docs/5.0.2/org/apache/datasketches/kll/package-use.html new file mode 100644 index 000000000..ee9621df9 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/kll/package-use.html @@ -0,0 +1,232 @@ + + + + + +Uses of Package org.apache.datasketches.kll (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches.kll

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/package-summary.html b/docs/5.0.2/org/apache/datasketches/package-summary.html new file mode 100644 index 000000000..239ac3381 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/package-summary.html @@ -0,0 +1,159 @@ + + + + + +org.apache.datasketches (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches

+
+
+
+ + +
This package is the parent package for all sketch families and common code areas.
+
+
Author:
+
Lee Rhodes
+
+
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/package-tree.html b/docs/5.0.2/org/apache/datasketches/package-tree.html new file mode 100644 index 000000000..d4043de93 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/package-tree.html @@ -0,0 +1,152 @@ + + + + + +org.apache.datasketches Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches

+Package Hierarchies: + +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/package-use.html b/docs/5.0.2/org/apache/datasketches/package-use.html new file mode 100644 index 000000000..c88297ce9 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/package-use.html @@ -0,0 +1,149 @@ + + + + + +Uses of Package org.apache.datasketches (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches

+
+
No usage of org.apache.datasketches
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/partitions/BoundsRule.html b/docs/5.0.2/org/apache/datasketches/partitions/BoundsRule.html new file mode 100644 index 000000000..ef76fccb8 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/partitions/BoundsRule.html @@ -0,0 +1,401 @@ + + + + + +BoundsRule (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum BoundsRule

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        INCLUDE_BOTH

        +
        public static final BoundsRule INCLUDE_BOTH
        +
        Include both the upper and lower bounds
        +
      • +
      + + + +
        +
      • +

        INCLUDE_UPPER

        +
        public static final BoundsRule INCLUDE_UPPER
        +
        Include only the upper bound but not the lower bound
        +
      • +
      + + + +
        +
      • +

        INCLUDE_LOWER

        +
        public static final BoundsRule INCLUDE_LOWER
        +
        Include only the lower bound but not the upper bound
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static BoundsRule[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (BoundsRule c : BoundsRule.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static BoundsRule valueOf​(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/partitions/Partitioner.PartitionBoundsRow.html b/docs/5.0.2/org/apache/datasketches/partitions/Partitioner.PartitionBoundsRow.html new file mode 100644 index 000000000..650cd096f --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/partitions/Partitioner.PartitionBoundsRow.html @@ -0,0 +1,386 @@ + + + + + +Partitioner.PartitionBoundsRow (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Partitioner.PartitionBoundsRow<T>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.partitions.Partitioner.PartitionBoundsRow<T>
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        part

        +
        public int part
        +
      • +
      + + + +
        +
      • +

        levelPartId

        +
        public String levelPartId
        +
      • +
      + + + +
        +
      • +

        approxNumDeltaItems

        +
        public long approxNumDeltaItems
        +
      • +
      + + + + + + + +
        +
      • +

        lowerBound

        +
        public T lowerBound
        +
      • +
      + + + +
        +
      • +

        upperBound

        +
        public T upperBound
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/partitions/Partitioner.StackElement.html b/docs/5.0.2/org/apache/datasketches/partitions/Partitioner.StackElement.html new file mode 100644 index 000000000..d09c3ac9c --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/partitions/Partitioner.StackElement.html @@ -0,0 +1,348 @@ + + + + + +Partitioner.StackElement (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Partitioner.StackElement<T>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.partitions.Partitioner.StackElement<T>
    • +
    +
  • +
+
+ +
+
+ +
+
+ +
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/partitions/Partitioner.html b/docs/5.0.2/org/apache/datasketches/partitions/Partitioner.html new file mode 100644 index 000000000..172998df4 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/partitions/Partitioner.html @@ -0,0 +1,410 @@ + + + + + +Partitioner (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Partitioner<T,​S extends QuantilesGenericAPI<T> & PartitioningFeature<T>>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.partitions.Partitioner<T,​S>
    • +
    +
  • +
+
+
    +
  • +
    +
    Type Parameters:
    +
    T - the data type
    +
    S - the quantiles sketch that implements both QuantilesGenericAPI and PartitioningFeature.
    +
    +
    +
    public class Partitioner<T,​S extends QuantilesGenericAPI<T> & PartitioningFeature<T>>
    +extends Object
    +
    A partitioning process that can partition very large data sets into thousands + of partitions of approximately the same size. + +

    The code included here does work fine for moderate sized partitioning tasks. + As an example, using the test code in the test branch with the partitioning task of splitting + a data set of 1 billion items into 324 partitions of size 3M items completed in under 3 minutes, which was + performed on a single CPU. For much larger partitioning tasks, it is recommended that this code be leveraged into a + parallelized systems environment.

    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Partitioner

        +
        public Partitioner​(long tgtPartitionSize,
        +                   int maxPartsPerPass,
        +                   SketchFillRequest<T,​S> fillReq)
        +
        This constructor assumes a QuantileSearchCriteria of INCLUSIVE.
        +
        +
        Parameters:
        +
        tgtPartitionSize - the target size of the resulting partitions in number of items.
        +
        maxPartsPerPass - The maximum number of partitions to request from the sketch. The smaller this number is + the smaller the variance will be of the resulting partitions, but this will increase the number of passes of the + source data set.
        +
        fillReq - The is an implementation of the SketchFillRequest call-back supplied by the user and implements + the SketchFillRequest interface.
        +
        +
      • +
      + + + +
        +
      • +

        Partitioner

        +
        public Partitioner​(long tgtPartitionSize,
        +                   int maxPartsPerSk,
        +                   SketchFillRequest<T,​S> fillReq,
        +                   QuantileSearchCriteria criteria)
        +
        This constructor includes the QuantileSearchCriteria criteria as a parameter.
        +
        +
        Parameters:
        +
        tgtPartitionSize - the target size of the resulting partitions in number of items.
        +
        maxPartsPerSk - The maximum number of partitions to request from the sketch. The smaller this number is + the smaller the variance will be of the resulting partitions, but this will increase the number of passes of the + source data set.
        +
        fillReq - The is an implementation of the SketchFillRequest call-back supplied by the user.
        +
        criteria - This is the desired QuantileSearchCriteria to be used.
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        partition

        +
        public List<Partitioner.PartitionBoundsRow<T>> partition​(S sk)
        +
        This initiates the partitioning process
        +
        +
        Parameters:
        +
        sk - A sketch of the entire data set.
        +
        Returns:
        +
        the final partitioning list
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/partitions/SketchFillRequest.html b/docs/5.0.2/org/apache/datasketches/partitions/SketchFillRequest.html new file mode 100644 index 000000000..705be479e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/partitions/SketchFillRequest.html @@ -0,0 +1,279 @@ + + + + + +SketchFillRequest (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface SketchFillRequest<T,​S extends QuantilesGenericAPI<T> & PartitioningFeature<T>>

+
+
+
+
    +
  • +
    +
    public interface SketchFillRequest<T,​S extends QuantilesGenericAPI<T> & PartitioningFeature<T>>
    +
    This is a callback request to the data source to fill a quantiles sketch, + which is returned to the caller.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethodDescription
      SgetRange​(T lowerQuantile, + T upperQuantile, + BoundsRule boundsRule) +
      This is a callback request to the data source to fill a quantiles sketch + with a range of data between upper and lower bounds.
      +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        getRange

        +
        S getRange​(T lowerQuantile,
        +           T upperQuantile,
        +           BoundsRule boundsRule)
        +
        This is a callback request to the data source to fill a quantiles sketch + with a range of data between upper and lower bounds. Which of these bounds are to be included is determined by + the BoundsRule. + +

        This range of data may or may not be subsequently further partitioned.

        +
        +
        Parameters:
        +
        lowerQuantile - the lowest quantile of a range
        +
        upperQuantile - the highest quantile of a range
        +
        boundsRule - determines which quantile bounds to include
        +
        Returns:
        +
        a quantiles sketch filled from the given upper and lower bounds.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/partitions/class-use/BoundsRule.html b/docs/5.0.2/org/apache/datasketches/partitions/class-use/BoundsRule.html new file mode 100644 index 000000000..e574aa112 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/partitions/class-use/BoundsRule.html @@ -0,0 +1,238 @@ + + + + + +Uses of Class org.apache.datasketches.partitions.BoundsRule (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.partitions.BoundsRule

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/partitions/class-use/Partitioner.PartitionBoundsRow.html b/docs/5.0.2/org/apache/datasketches/partitions/class-use/Partitioner.PartitionBoundsRow.html new file mode 100644 index 000000000..8733af19c --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/partitions/class-use/Partitioner.PartitionBoundsRow.html @@ -0,0 +1,195 @@ + + + + + +Uses of Class org.apache.datasketches.partitions.Partitioner.PartitionBoundsRow (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.partitions.Partitioner.PartitionBoundsRow

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/partitions/class-use/Partitioner.StackElement.html b/docs/5.0.2/org/apache/datasketches/partitions/class-use/Partitioner.StackElement.html new file mode 100644 index 000000000..17fa4b614 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/partitions/class-use/Partitioner.StackElement.html @@ -0,0 +1,191 @@ + + + + + +Uses of Class org.apache.datasketches.partitions.Partitioner.StackElement (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.partitions.Partitioner.StackElement

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/partitions/class-use/Partitioner.html b/docs/5.0.2/org/apache/datasketches/partitions/class-use/Partitioner.html new file mode 100644 index 000000000..4bd010dd2 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/partitions/class-use/Partitioner.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.partitions.Partitioner (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.partitions.Partitioner

+
+
No usage of org.apache.datasketches.partitions.Partitioner
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/partitions/class-use/SketchFillRequest.html b/docs/5.0.2/org/apache/datasketches/partitions/class-use/SketchFillRequest.html new file mode 100644 index 000000000..ee8be90f8 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/partitions/class-use/SketchFillRequest.html @@ -0,0 +1,204 @@ + + + + + +Uses of Interface org.apache.datasketches.partitions.SketchFillRequest (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.partitions.SketchFillRequest

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/partitions/package-summary.html b/docs/5.0.2/org/apache/datasketches/partitions/package-summary.html new file mode 100644 index 000000000..6f9fa5d6a --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/partitions/package-summary.html @@ -0,0 +1,215 @@ + + + + + +org.apache.datasketches.partitions (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches.partitions

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/partitions/package-tree.html b/docs/5.0.2/org/apache/datasketches/partitions/package-tree.html new file mode 100644 index 000000000..eae9e98b4 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/partitions/package-tree.html @@ -0,0 +1,186 @@ + + + + + +org.apache.datasketches.partitions Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches.partitions

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+

Interface Hierarchy

+ +
+
+

Enum Hierarchy

+ +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/partitions/package-use.html b/docs/5.0.2/org/apache/datasketches/partitions/package-use.html new file mode 100644 index 000000000..a5c84f4ca --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/partitions/package-use.html @@ -0,0 +1,203 @@ + + + + + +Uses of Package org.apache.datasketches.partitions (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches.partitions

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/ClassicUtil.html b/docs/5.0.2/org/apache/datasketches/quantiles/ClassicUtil.html new file mode 100644 index 000000000..2e82197e5 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/ClassicUtil.html @@ -0,0 +1,318 @@ + + + + + +ClassicUtil (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ClassicUtil

+
+
+ +
+
    +
  • +
    +
    public final class ClassicUtil
    +extends Object
    +
    Utilities for the classic quantiles sketches and independent of the type.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getNormalizedRankError

        +
        public static double getNormalizedRankError​(int k,
        +                                            boolean pmf)
        +
        Used by Classic Quantiles. + Gets the normalized rank error given k and pmf for the Quantiles DoubleSketch and ItemsSketch.
        +
        +
        Parameters:
        +
        k - the configuration parameter
        +
        pmf - if true, returns the "double-sided" normalized rank error for the getPMF() function. + Otherwise, it is the "single-sided" normalized rank error for all the other queries.
        +
        Returns:
        +
        if pmf is true, the normalized rank error for the getPMF() function. + Otherwise, it is the "single-sided" normalized rank error for all the other queries.
        +
        +
      • +
      + + + +
        +
      • +

        getKFromEpsilon

        +
        public static int getKFromEpsilon​(double epsilon,
        +                                  boolean pmf)
        +
        Used by Classic Quantiles. + Gets the approximate k to use given epsilon, the normalized rank error + for the Quantiles DoubleSketch and ItemsSketch.
        +
        +
        Parameters:
        +
        epsilon - the normalized rank error between zero and one.
        +
        pmf - if true, this function returns k assuming the input epsilon + is the desired "double-sided" epsilon for the getPMF() function. Otherwise, this function + returns k assuming the input epsilon is the desired "single-sided" + epsilon for all the other queries.
        +
        Returns:
        +
        k given epsilon.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/CompactDoublesSketch.html b/docs/5.0.2/org/apache/datasketches/quantiles/CompactDoublesSketch.html new file mode 100644 index 000000000..51a21d246 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/CompactDoublesSketch.html @@ -0,0 +1,388 @@ + + + + + +CompactDoublesSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class CompactDoublesSketch

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        heapify

        +
        public static CompactDoublesSketch heapify​(org.apache.datasketches.memory.Memory srcMem)
        +
      • +
      + + + +
        +
      • +

        isReadOnly

        +
        public boolean isReadOnly()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch is read only.
        +
        +
        Specified by:
        +
        isReadOnly in interface QuantilesAPI
        +
        Specified by:
        +
        isReadOnly in class DoublesSketch
        +
        Returns:
        +
        true if this sketch is read only.
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Description copied from class: DoublesSketch
        +
        Resets this sketch to the empty state. + If the sketch is read only this does nothing. + +

        The parameter k will not change.

        +

        The parameter k will not change.

        +
        +
        Specified by:
        +
        reset in interface QuantilesAPI
        +
        Specified by:
        +
        reset in class DoublesSketch
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(double quantile)
        +
        Description copied from interface: QuantilesDoublesAPI
        +
        Updates this sketch with the given item.
        +
        +
        Parameters:
        +
        quantile - from a stream of quantiles. NaNs are ignored.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/DoublesSketch.html b/docs/5.0.2/org/apache/datasketches/quantiles/DoublesSketch.html new file mode 100644 index 000000000..6105c34ad --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/DoublesSketch.html @@ -0,0 +1,1573 @@ + + + + + +DoublesSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class DoublesSketch

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    QuantilesAPI, QuantilesDoublesAPI
    +
    +
    +
    Direct Known Subclasses:
    +
    CompactDoublesSketch, UpdateDoublesSketch
    +
    +
    +
    public abstract class DoublesSketch
    +extends Object
    +implements QuantilesDoublesAPI
    +
    This is an implementation of the Low Discrepancy Mergeable Quantiles Sketch, using doubles, + described in section 3.2 of the journal version of the paper "Mergeable Summaries" + by Agarwal, Cormode, Huang, Phillips, Wei, and Yi: + +

    Reference:

    + +

    A k of 128 produces a normalized, rank error of about 1.7%. + For example, the median returned from getQuantile(0.5) will be between the actual quantiles + from the hypothetically sorted array of input quantiles at normalized ranks of 0.483 and 0.517, with + a confidence of about 99%.

    + +
    +Table Guide for DoublesSketch Size in Bytes and Approximate Error:
    +          K => |      16      32      64     128     256     512   1,024
    +    ~ Error => | 12.145%  6.359%  3.317%  1.725%  0.894%  0.463%  0.239%
    +             N | Size in Bytes ->
    +------------------------------------------------------------------------
    +             0 |       8       8       8       8       8       8       8
    +             1 |      72      72      72      72      72      72      72
    +             3 |      72      72      72      72      72      72      72
    +             7 |     104     104     104     104     104     104     104
    +            15 |     168     168     168     168     168     168     168
    +            31 |     296     296     296     296     296     296     296
    +            63 |     424     552     552     552     552     552     552
    +           127 |     552     808   1,064   1,064   1,064   1,064   1,064
    +           255 |     680   1,064   1,576   2,088   2,088   2,088   2,088
    +           511 |     808   1,320   2,088   3,112   4,136   4,136   4,136
    +         1,023 |     936   1,576   2,600   4,136   6,184   8,232   8,232
    +         2,047 |   1,064   1,832   3,112   5,160   8,232  12,328  16,424
    +         4,095 |   1,192   2,088   3,624   6,184  10,280  16,424  24,616
    +         8,191 |   1,320   2,344   4,136   7,208  12,328  20,520  32,808
    +        16,383 |   1,448   2,600   4,648   8,232  14,376  24,616  41,000
    +        32,767 |   1,576   2,856   5,160   9,256  16,424  28,712  49,192
    +        65,535 |   1,704   3,112   5,672  10,280  18,472  32,808  57,384
    +       131,071 |   1,832   3,368   6,184  11,304  20,520  36,904  65,576
    +       262,143 |   1,960   3,624   6,696  12,328  22,568  41,000  73,768
    +       524,287 |   2,088   3,880   7,208  13,352  24,616  45,096  81,960
    +     1,048,575 |   2,216   4,136   7,720  14,376  26,664  49,192  90,152
    +     2,097,151 |   2,344   4,392   8,232  15,400  28,712  53,288  98,344
    +     4,194,303 |   2,472   4,648   8,744  16,424  30,760  57,384 106,536
    +     8,388,607 |   2,600   4,904   9,256  17,448  32,808  61,480 114,728
    +    16,777,215 |   2,728   5,160   9,768  18,472  34,856  65,576 122,920
    +    33,554,431 |   2,856   5,416  10,280  19,496  36,904  69,672 131,112
    +    67,108,863 |   2,984   5,672  10,792  20,520  38,952  73,768 139,304
    +   134,217,727 |   3,112   5,928  11,304  21,544  41,000  77,864 147,496
    +   268,435,455 |   3,240   6,184  11,816  22,568  43,048  81,960 155,688
    +   536,870,911 |   3,368   6,440  12,328  23,592  45,096  86,056 163,880
    + 1,073,741,823 |   3,496   6,696  12,840  24,616  47,144  90,152 172,072
    + 2,147,483,647 |   3,624   6,952  13,352  25,640  49,192  94,248 180,264
    + 4,294,967,295 |   3,752   7,208  13,864  26,664  51,240  98,344 188,456
    + 
    +
    +
    See Also:
    +
    QuantilesAPI
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static DoublesSketchBuilderbuilder() +
      Returns a new builder
      +
      DoublesSketchdownSample​(DoublesSketch srcSketch, + int smallerK, + org.apache.datasketches.memory.WritableMemory dstMem) +
      From an source sketch, create a new sketch that must have a smaller K.
      +
      double[]getCDF​(double[] splitPoints, + QuantileSearchCriteria searchCrit) +
      Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints.
      +
      static intgetCompactSerialiedSizeBytes​(int k, + long n) +
      Returns the number of bytes a DoublesSketch would require to store in compact form + given k and n.
      +
      intgetCurrentCompactSerializedSizeBytes() +
      Returns the current number of bytes this sketch would require to store in the compact Memory Format.
      +
      intgetCurrentUpdatableSerializedSizeBytes() +
      Returns the current number of bytes this sketch would require to store in the updatable Memory Format.
      +
      intgetK() +
      Gets the user configured parameter k, which controls the accuracy of the sketch + and its memory space usage.
      +
      static intgetKFromEpsilon​(double epsilon, + boolean pmf) +
      Gets the approximate k to use given epsilon, the normalized rank error.
      +
      abstract doublegetMaxItem() +
      Returns the maximum item of the stream.
      +
      abstract doublegetMinItem() +
      Returns the minimum item of the stream.
      +
      abstract longgetN() +
      Gets the length of the input stream offered to the sketch..
      +
      doublegetNormalizedRankError​(boolean pmf) +
      Gets the approximate rank error of this sketch normalized as a fraction between zero and one.
      +
      static doublegetNormalizedRankError​(int k, + boolean pmf) +
      Gets the normalized rank error given k and pmf.
      +
      intgetNumRetained() +
      Gets the number of quantiles retained by the sketch.
      +
      double[]getPMF​(double[] splitPoints, + QuantileSearchCriteria searchCrit) +
      Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints.
      +
      doublegetQuantile​(double rank, + QuantileSearchCriteria searchCrit) +
      Gets the approximate quantile of the given normalized rank and the given search criterion.
      +
      doublegetQuantileLowerBound​(double rank) +
      Gets the lower bound of the quantile confidence interval in which the quantile of the + given rank exists.
      +
      double[]getQuantiles​(double[] ranks, + QuantileSearchCriteria searchCrit) +
      Gets an array of quantiles from the given array of normalized ranks.
      +
      doublegetQuantileUpperBound​(double rank) +
      Gets the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists.
      +
      doublegetRank​(double quantile, + QuantileSearchCriteria searchCrit) +
      Gets the normalized rank corresponding to the given a quantile.
      +
      doublegetRankLowerBound​(double rank) +
      Gets the lower bound of the rank confidence interval in which the true rank of the + given rank exists.
      +
      double[]getRanks​(double[] quantiles, + QuantileSearchCriteria searchCrit) +
      Gets an array of normalized ranks corresponding to the given array of quantiles and the given + search criterion.
      +
      doublegetRankUpperBound​(double rank) +
      Gets the upper bound of the rank confidence interval in which the true rank of the + given rank exists.
      +
      intgetSerializedSizeBytes() +
      Returns the current number of bytes this Sketch would require if serialized.
      +
      DoublesSortedViewgetSortedView() +
      Gets the sorted view of this sketch
      +
      static intgetUpdatableStorageBytes​(int k, + long n) +
      Returns the number of bytes a sketch would require to store in updatable form.
      +
      abstract booleanhasMemory() +
      Returns true if this sketch's data structure is backed by Memory or WritableMemory.
      +
      static DoublesSketchheapify​(org.apache.datasketches.memory.Memory srcMem) +
      Heapify takes the sketch image in Memory and instantiates an on-heap Sketch.
      +
      abstract booleanisDirect() +
      Returns true if this sketch's data structure is off-heap (a.k.a., Direct or Native memory).
      +
      booleanisEmpty() +
      Returns true if this sketch is empty.
      +
      booleanisEstimationMode() +
      Returns true if this sketch is in estimation mode.
      +
      abstract booleanisReadOnly() +
      Returns true if this sketch is read only.
      +
      booleanisSameResource​(org.apache.datasketches.memory.Memory that) +
      Returns true if the backing resource of this is identical with the backing resource + of that.
      +
      QuantilesDoublesSketchIteratoriterator() +
      Gets the iterator for this sketch, which is not sorted.
      +
      voidputMemory​(org.apache.datasketches.memory.WritableMemory dstMem) +
      Puts the current sketch into the given Memory in compact form if there is sufficient space, + otherwise, it throws an error.
      +
      voidputMemory​(org.apache.datasketches.memory.WritableMemory dstMem, + boolean compact) +
      Puts the current sketch into the given Memory if there is sufficient space, otherwise, + throws an error.
      +
      abstract voidreset() +
      Resets this sketch to the empty state.
      +
      byte[]toByteArray() +
      Returns a byte array representation of this sketch.
      +
      byte[]toByteArray​(boolean compact) +
      Serialize this sketch in a byte array form.
      +
      StringtoString() +
      Returns a summary of the key parameters of the sketch.
      +
      StringtoString​(boolean sketchSummary, + boolean dataDetail) +
      Returns summary information about this sketch.
      +
      static StringtoString​(byte[] byteArr) +
      Returns a human readable string of the preamble of a byte array image of a DoublesSketch.
      +
      static StringtoString​(org.apache.datasketches.memory.Memory mem) +
      Returns a human readable string of the preamble of a Memory image of a DoublesSketch.
      +
      static DoublesSketchwrap​(org.apache.datasketches.memory.Memory srcMem) +
      Wrap this sketch around the given Memory image of a DoublesSketch, compact or updatable.
      +
      + + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        builder

        +
        public static final DoublesSketchBuilder builder()
        +
        Returns a new builder
        +
        +
        Returns:
        +
        a new builder
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static DoublesSketch heapify​(org.apache.datasketches.memory.Memory srcMem)
        +
        Heapify takes the sketch image in Memory and instantiates an on-heap Sketch. + The resulting sketch will not retain any link to the source Memory.
        +
        +
        Parameters:
        +
        srcMem - a Memory image of a Sketch. + See Memory
        +
        Returns:
        +
        a heap-based Sketch based on the given Memory
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static DoublesSketch wrap​(org.apache.datasketches.memory.Memory srcMem)
        +
        Wrap this sketch around the given Memory image of a DoublesSketch, compact or updatable. + A DirectUpdateDoublesSketch can only wrap an updatable array, and a + DirectCompactDoublesSketch can only wrap a compact array.
        +
        +
        Parameters:
        +
        srcMem - the given Memory image of a DoublesSketch that may have data,
        +
        Returns:
        +
        a sketch that wraps the given srcMem
        +
        +
      • +
      + + + +
        +
      • +

        getCDF

        +
        public double[] getCDF​(double[] splitPoints,
        +                       QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesDoublesAPI
        +
        Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(false) function.

        +
        +
        Specified by:
        +
        getCDF in interface QuantilesDoublesAPI
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 overlapping intervals. + +

        The start of each interval is below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and the end of the interval + is the rank or cumulative probability corresponding to the split point.

        + +

        The (m+1)th interval represents 100% of the distribution represented by the sketch + and consistent with the definition of a cumulative probability distribution, thus the (m+1)th + rank or probability in the returned array is always 1.0.

        + +

        If a split point exactly equals a retained item of the sketch and the search criterion is:

        + +
          +
        • INCLUSIVE, the resulting cumulative probability will include that item.
        • +
        • EXCLUSIVE, the resulting cumulative probability will not include the weight of that split point.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
        +
        +
      • +
      + + + +
        +
      • +

        getMaxItem

        +
        public abstract double getMaxItem()
        +
        Description copied from interface: QuantilesDoublesAPI
        +
        Returns the maximum item of the stream. This is provided for convenience and may be different from the + item returned by getQuantile(1.0).
        +
        +
        Specified by:
        +
        getMaxItem in interface QuantilesDoublesAPI
        +
        Returns:
        +
        the maximum item of the stream
        +
        +
      • +
      + + + +
        +
      • +

        getMinItem

        +
        public abstract double getMinItem()
        +
        Description copied from interface: QuantilesDoublesAPI
        +
        Returns the minimum item of the stream. This is provided for convenience and may be different from the + item returned by getQuantile(0.0).
        +
        +
        Specified by:
        +
        getMinItem in interface QuantilesDoublesAPI
        +
        Returns:
        +
        the minimum item of the stream
        +
        +
      • +
      + + + +
        +
      • +

        getPMF

        +
        public double[] getPMF​(double[] splitPoints,
        +                       QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesDoublesAPI
        +
        Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(true) function.

        +
        +
        Specified by:
        +
        getPMF in interface QuantilesDoublesAPI
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 consecutive, non-overlapping intervals. + +

        Each interval except for the end intervals starts with a split point and ends with the next split + point in sequence.

        + +

        The first interval starts below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and ends with the first split point

        + +

        The last (m+1)th interval starts with the last split point and ends after the last + item retained by the sketch corresponding to a rank or probability of 1.0.

        + +

        The sum of the probability masses of all (m+1) intervals is 1.0.

        + +

        If the search criterion is:

        + +
          +
        • INCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will include that item. If the lower split point equals an item retained by the sketch, the interval will exclude + that item.
        • +
        • EXCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will exclude that item. If the lower split point equals an item retained by the sketch, the interval will include + that item.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        public double getQuantile​(double rank,
        +                          QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesDoublesAPI
        +
        Gets the approximate quantile of the given normalized rank and the given search criterion.
        +
        +
        Specified by:
        +
        getQuantile in interface QuantilesDoublesAPI
        +
        Parameters:
        +
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        searchCrit - If INCLUSIVE, the given rank includes all quantiles ≤ + the quantile directly corresponding to the given rank. + If EXCLUSIVE, he given rank includes all quantiles < + the quantile directly corresponding to the given rank.
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantiles

        +
        public double[] getQuantiles​(double[] ranks,
        +                             QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesDoublesAPI
        +
        Gets an array of quantiles from the given array of normalized ranks.
        +
        +
        Specified by:
        +
        getQuantiles in interface QuantilesDoublesAPI
        +
        Parameters:
        +
        ranks - the given array of normalized ranks, each of which must be + in the interval [0.0,1.0].
        +
        searchCrit - if INCLUSIVE, the given ranks include all quantiles ≤ + the quantile directly corresponding to each rank.
        +
        Returns:
        +
        an array of quantiles corresponding to the given array of normalized ranks.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantileLowerBound

        +
        public double getQuantileLowerBound​(double rank)
        +
        Gets the lower bound of the quantile confidence interval in which the quantile of the + given rank exists. + +

        Although it is possible to estimate the probability that the true quantile + exists within the quantile confidence interval specified by the upper and lower quantile bounds, + it is not possible to guarantee the width of the quantile confidence interval + as an additive or multiplicative percent of the true quantile.

        + The approximate probability that the true quantile is within the confidence interval + specified by the upper and lower quantile bounds for this sketch is 0.99.
        +
        +
        Specified by:
        +
        getQuantileLowerBound in interface QuantilesDoublesAPI
        +
        Parameters:
        +
        rank - the given normalized rank
        +
        Returns:
        +
        the lower bound of the quantile confidence interval in which the quantile of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantileUpperBound

        +
        public double getQuantileUpperBound​(double rank)
        +
        Gets the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists. + +

        Although it is possible to estimate the probability that the true quantile + exists within the quantile confidence interval specified by the upper and lower quantile bounds, + it is not possible to guarantee the width of the quantile interval + as an additive or multiplicative percent of the true quantile.

        + The approximate probability that the true quantile is within the confidence interval + specified by the upper and lower quantile bounds for this sketch is 0.99.
        +
        +
        Specified by:
        +
        getQuantileUpperBound in interface QuantilesDoublesAPI
        +
        Parameters:
        +
        rank - the given normalized rank
        +
        Returns:
        +
        the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getRank

        +
        public double getRank​(double quantile,
        +                      QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesDoublesAPI
        +
        Gets the normalized rank corresponding to the given a quantile.
        +
        +
        Specified by:
        +
        getRank in interface QuantilesDoublesAPI
        +
        Parameters:
        +
        quantile - the given quantile
        +
        searchCrit - if INCLUSIVE the given quantile is included into the rank.
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getRankLowerBound

        +
        public double getRankLowerBound​(double rank)
        +
        Gets the lower bound of the rank confidence interval in which the true rank of the + given rank exists. + The approximate probability that the true rank is within the confidence interval + specified by the upper and lower rank bounds for this sketch is 0.99.
        +
        +
        Specified by:
        +
        getRankLowerBound in interface QuantilesAPI
        +
        Parameters:
        +
        rank - the given normalized rank.
        +
        Returns:
        +
        the lower bound of the rank confidence interval in which the true rank of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getRankUpperBound

        +
        public double getRankUpperBound​(double rank)
        +
        Gets the upper bound of the rank confidence interval in which the true rank of the + given rank exists. + The approximate probability that the true rank is within the confidence interval + specified by the upper and lower rank bounds for this sketch is 0.99.
        +
        +
        Specified by:
        +
        getRankUpperBound in interface QuantilesAPI
        +
        Parameters:
        +
        rank - the given normalized rank.
        +
        Returns:
        +
        the upper bound of the rank confidence interval in which the true rank of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getRanks

        +
        public double[] getRanks​(double[] quantiles,
        +                         QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesDoublesAPI
        +
        Gets an array of normalized ranks corresponding to the given array of quantiles and the given + search criterion.
        +
        +
        Specified by:
        +
        getRanks in interface QuantilesDoublesAPI
        +
        Parameters:
        +
        quantiles - the given array of quantiles
        +
        searchCrit - if INCLUSIVE, the given quantiles include the rank directly corresponding to each quantile.
        +
        Returns:
        +
        an array of normalized ranks corresponding to the given array of quantiles.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getK

        +
        public int getK()
        +
        Description copied from interface: QuantilesAPI
        +
        Gets the user configured parameter k, which controls the accuracy of the sketch + and its memory space usage.
        +
        +
        Specified by:
        +
        getK in interface QuantilesAPI
        +
        Returns:
        +
        the user configured parameter k, which controls the accuracy of the sketch + and its memory space usage.
        +
        +
      • +
      + + + +
        +
      • +

        getN

        +
        public abstract long getN()
        +
        Description copied from interface: QuantilesAPI
        +
        Gets the length of the input stream offered to the sketch..
        +
        +
        Specified by:
        +
        getN in interface QuantilesAPI
        +
        Returns:
        +
        the length of the input stream offered to the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getNormalizedRankError

        +
        public double getNormalizedRankError​(boolean pmf)
        +
        Gets the approximate rank error of this sketch normalized as a fraction between zero and one. + The epsilon returned is a best fit to 99 percent confidence empirically measured max error + in thousands of trials.
        +
        +
        Parameters:
        +
        pmf - if true, returns the "double-sided" normalized rank error for the getPMF() function. + Otherwise, it is the "single-sided" normalized rank error for all the other queries.
        +
        Returns:
        +
        if pmf is true, returns the normalized rank error for the getPMF() function. + Otherwise, it is the "single-sided" normalized rank error for all the other queries.
        +
        +
      • +
      + + + +
        +
      • +

        getNormalizedRankError

        +
        public static double getNormalizedRankError​(int k,
        +                                            boolean pmf)
        +
        Gets the normalized rank error given k and pmf. + Static method version of the getNormalizedRankError(boolean). + The epsilon returned is a best fit to 99 percent confidence empirically measured max error + in thousands of trials.
        +
        +
        Parameters:
        +
        k - the configuration parameter
        +
        pmf - if true, returns the "double-sided" normalized rank error for the getPMF() function. + Otherwise, it is the "single-sided" normalized rank error for all the other queries.
        +
        Returns:
        +
        if pmf is true, the normalized rank error for the getPMF() function. + Otherwise, it is the "single-sided" normalized rank error for all the other queries.
        +
        +
      • +
      + + + +
        +
      • +

        getKFromEpsilon

        +
        public static int getKFromEpsilon​(double epsilon,
        +                                  boolean pmf)
        +
        Gets the approximate k to use given epsilon, the normalized rank error.
        +
        +
        Parameters:
        +
        epsilon - the normalized rank error between zero and one.
        +
        pmf - if true, this function returns k assuming the input epsilon + is the desired "double-sided" epsilon for the getPMF() function. Otherwise, this function + returns k assuming the input epsilon is the desired "single-sided" + epsilon for all the other queries.
        +
        Returns:
        +
        k given epsilon.
        +
        +
      • +
      + + + +
        +
      • +

        hasMemory

        +
        public abstract boolean hasMemory()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch's data structure is backed by Memory or WritableMemory.
        +
        +
        Specified by:
        +
        hasMemory in interface QuantilesAPI
        +
        Returns:
        +
        true if this sketch's data structure is backed by Memory or WritableMemory.
        +
        +
      • +
      + + + +
        +
      • +

        isDirect

        +
        public abstract boolean isDirect()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch's data structure is off-heap (a.k.a., Direct or Native memory).
        +
        +
        Specified by:
        +
        isDirect in interface QuantilesAPI
        +
        Returns:
        +
        true if this sketch's data structure is off-heap (a.k.a., Direct or Native memory).
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch is empty.
        +
        +
        Specified by:
        +
        isEmpty in interface QuantilesAPI
        +
        Returns:
        +
        true if this sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        isEstimationMode

        +
        public boolean isEstimationMode()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch is in estimation mode.
        +
        +
        Specified by:
        +
        isEstimationMode in interface QuantilesAPI
        +
        Returns:
        +
        true if this sketch is in estimation mode.
        +
        +
      • +
      + + + +
        +
      • +

        isReadOnly

        +
        public abstract boolean isReadOnly()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch is read only.
        +
        +
        Specified by:
        +
        isReadOnly in interface QuantilesAPI
        +
        Returns:
        +
        true if this sketch is read only.
        +
        +
      • +
      + + + +
        +
      • +

        isSameResource

        +
        public boolean isSameResource​(org.apache.datasketches.memory.Memory that)
        +
        Returns true if the backing resource of this is identical with the backing resource + of that. The capacities must be the same. If this is a region, + the region offset must also be the same.
        +
        +
        Parameters:
        +
        that - A different non-null object
        +
        Returns:
        +
        true if the backing resource of this is the same as the backing resource + of that.
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray()
        +
        Description copied from interface: QuantilesDoublesAPI
        +
        Returns a byte array representation of this sketch.
        +
        +
        Specified by:
        +
        toByteArray in interface QuantilesDoublesAPI
        +
        Returns:
        +
        a byte array representation of this sketch.
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray​(boolean compact)
        +
        Serialize this sketch in a byte array form.
        +
        +
        Parameters:
        +
        compact - if true the sketch will be serialized in compact form. + DirectCompactDoublesSketch can wrap() only a compact byte array; + DirectUpdateDoublesSketch can wrap() only a updatable byte array.
        +
        Returns:
        +
        this sketch in a byte array form.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns a summary of the key parameters of the sketch.
        +
        +
        Specified by:
        +
        toString in interface QuantilesAPI
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        a summary of the key parameters of the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString​(boolean sketchSummary,
        +                       boolean dataDetail)
        +
        Returns summary information about this sketch. Used for debugging.
        +
        +
        Parameters:
        +
        sketchSummary - if true includes sketch summary
        +
        dataDetail - if true includes data detail
        +
        Returns:
        +
        summary information about the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString​(byte[] byteArr)
        +
        Returns a human readable string of the preamble of a byte array image of a DoublesSketch.
        +
        +
        Parameters:
        +
        byteArr - the given byte array
        +
        Returns:
        +
        a human readable string of the preamble of a byte array image of a DoublesSketch.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString​(org.apache.datasketches.memory.Memory mem)
        +
        Returns a human readable string of the preamble of a Memory image of a DoublesSketch.
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        Returns:
        +
        a human readable string of the preamble of a Memory image of a DoublesSketch.
        +
        +
      • +
      + + + +
        +
      • +

        downSample

        +
        public DoublesSketch downSample​(DoublesSketch srcSketch,
        +                                int smallerK,
        +                                org.apache.datasketches.memory.WritableMemory dstMem)
        +
        From an source sketch, create a new sketch that must have a smaller K. + The original sketch is not modified.
        +
        +
        Parameters:
        +
        srcSketch - the sourcing sketch
        +
        smallerK - the new sketch's K that must be smaller than this K. + It is required that this.getK() = smallerK * 2^(nonnegative integer).
        +
        dstMem - the destination Memory. It must not overlap the Memory of this sketch. + If null, a heap sketch will be returned, otherwise it will be off-heap.
        +
        Returns:
        +
        the new sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getNumRetained

        +
        public int getNumRetained()
        +
        Description copied from interface: QuantilesAPI
        +
        Gets the number of quantiles retained by the sketch.
        +
        +
        Specified by:
        +
        getNumRetained in interface QuantilesAPI
        +
        Returns:
        +
        the number of quantiles retained by the sketch
        +
        +
      • +
      + + + +
        +
      • +

        getCurrentCompactSerializedSizeBytes

        +
        public int getCurrentCompactSerializedSizeBytes()
        +
        Returns the current number of bytes this sketch would require to store in the compact Memory Format.
        +
        +
        Returns:
        +
        the current number of bytes this sketch would require to store in the compact Memory Format.
        +
        +
      • +
      + + + +
        +
      • +

        getCompactSerialiedSizeBytes

        +
        public static int getCompactSerialiedSizeBytes​(int k,
        +                                               long n)
        +
        Returns the number of bytes a DoublesSketch would require to store in compact form + given k and n. The compact form is not updatable.
        +
        +
        Parameters:
        +
        k - the size configuration parameter for the sketch
        +
        n - the number of quantiles input into the sketch
        +
        Returns:
        +
        the number of bytes required to store this sketch in compact form.
        +
        +
      • +
      + + + +
        +
      • +

        getSerializedSizeBytes

        +
        public int getSerializedSizeBytes()
        +
        Description copied from interface: QuantilesDoublesAPI
        +
        Returns the current number of bytes this Sketch would require if serialized.
        +
        +
        Specified by:
        +
        getSerializedSizeBytes in interface QuantilesDoublesAPI
        +
        Returns:
        +
        the number of bytes this sketch would require if serialized.
        +
        +
      • +
      + + + +
        +
      • +

        getCurrentUpdatableSerializedSizeBytes

        +
        public int getCurrentUpdatableSerializedSizeBytes()
        +
        Returns the current number of bytes this sketch would require to store in the updatable Memory Format.
        +
        +
        Returns:
        +
        the current number of bytes this sketch would require to store in the updatable Memory Format.
        +
        +
      • +
      + + + +
        +
      • +

        getUpdatableStorageBytes

        +
        public static int getUpdatableStorageBytes​(int k,
        +                                           long n)
        +
        Returns the number of bytes a sketch would require to store in updatable form. + This uses roughly 2X the storage of the compact form + given k and n.
        +
        +
        Parameters:
        +
        k - the size configuration parameter for the sketch
        +
        n - the number of quantiles input into the sketch
        +
        Returns:
        +
        the number of bytes this sketch would require to store in updatable form.
        +
        +
      • +
      + + + +
        +
      • +

        putMemory

        +
        public void putMemory​(org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Puts the current sketch into the given Memory in compact form if there is sufficient space, + otherwise, it throws an error.
        +
        +
        Parameters:
        +
        dstMem - the given memory.
        +
        +
      • +
      + + + +
        +
      • +

        putMemory

        +
        public void putMemory​(org.apache.datasketches.memory.WritableMemory dstMem,
        +                      boolean compact)
        +
        Puts the current sketch into the given Memory if there is sufficient space, otherwise, + throws an error.
        +
        +
        Parameters:
        +
        dstMem - the given memory.
        +
        compact - if true, compacts and sorts the base buffer, which optimizes merge + performance at the cost of slightly increased serialization time.
        +
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        reset

        +
        public abstract void reset()
        +
        Resets this sketch to the empty state. + If the sketch is read only this does nothing. + +

        The parameter k will not change.

        +

        The parameter k will not change.

        +
        +
        Specified by:
        +
        reset in interface QuantilesAPI
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/DoublesSketchBuilder.html b/docs/5.0.2/org/apache/datasketches/quantiles/DoublesSketchBuilder.html new file mode 100644 index 000000000..453df5a85 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/DoublesSketchBuilder.html @@ -0,0 +1,419 @@ + + + + + +DoublesSketchBuilder (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class DoublesSketchBuilder

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.quantiles.DoublesSketchBuilder
    • +
    +
  • +
+
+
    +
  • +
    +
    public class DoublesSketchBuilder
    +extends Object
    +
    For building a new quantiles DoublesSketch.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DoublesSketchBuilder

        +
        public DoublesSketchBuilder()
        +
        Constructor for a new DoublesSketchBuilder. The default configuration is +
          +
        • k: 128. This produces a normalized rank error of about 1.7%
        • +
        • Memory: null
        • +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setK

        +
        public DoublesSketchBuilder setK​(int k)
        +
        Sets the parameter k that determines the accuracy and size of the sketch.
        +
        +
        Parameters:
        +
        k - determines the accuracy and size of the sketch. + It is recommended that k be a power of 2 to enable unioning of sketches with + different k. It is only possible to union from + larger k to smaller k.
        +
        Returns:
        +
        this builder
        +
        +
      • +
      + + + +
        +
      • +

        getK

        +
        public int getK()
        +
        Gets the current configured k
        +
        +
        Returns:
        +
        the current configured k
        +
        +
      • +
      + + + +
        +
      • +

        build

        +
        public UpdateDoublesSketch build()
        +
        Returns an UpdateDoublesSketch with the current configuration of this Builder.
        +
        +
        Returns:
        +
        a UpdateDoublesSketch
        +
        +
      • +
      + + + +
        +
      • +

        build

        +
        public UpdateDoublesSketch build​(org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Returns a quantiles UpdateDoublesSketch with the current configuration of this builder + and the specified backing destination Memory store.
        +
        +
        Parameters:
        +
        dstMem - destination memory for use by the sketch
        +
        Returns:
        +
        an UpdateDoublesSketch
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Creates a human readable string that describes the current configuration of this builder.
        +
        +
        Overrides:
        +
        toString in class Object
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/DoublesSketchIterator.html b/docs/5.0.2/org/apache/datasketches/quantiles/DoublesSketchIterator.html new file mode 100644 index 000000000..81d7da466 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/DoublesSketchIterator.html @@ -0,0 +1,338 @@ + + + + + +DoublesSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class DoublesSketchIterator

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.quantiles.DoublesSketchIterator
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getQuantile

        +
        public double getQuantile()
        +
        Description copied from interface: QuantilesDoublesSketchIterator
        +
        Gets the double quantile at the current index. + +

        Don't call this before calling next() for the first time + or after getting false from next().

        +
        +
        Specified by:
        +
        getQuantile in interface QuantilesDoublesSketchIterator
        +
        Returns:
        +
        the double quantile at the current index.
        +
        +
      • +
      + + + +
        +
      • +

        getWeight

        +
        public long getWeight()
        +
        Description copied from interface: QuantilesSketchIterator
        +
        Gets the natural weight at the current index. + +

        Don't call this before calling next() for the first time + or after getting false from next().

        +
        +
        Specified by:
        +
        getWeight in interface QuantilesSketchIterator
        +
        Returns:
        +
        the natural weight at the current index.
        +
        +
      • +
      + + + +
        +
      • +

        next

        +
        public boolean next()
        +
        Description copied from interface: QuantilesSketchIterator
        +
        Advances the index and checks if it is valid. + The state of this iterator is undefined before the first call of this method.
        +
        +
        Specified by:
        +
        next in interface QuantilesSketchIterator
        +
        Returns:
        +
        true if the next index is valid.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/DoublesSketchSortedView.html b/docs/5.0.2/org/apache/datasketches/quantiles/DoublesSketchSortedView.html new file mode 100644 index 000000000..cc1234ca1 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/DoublesSketchSortedView.html @@ -0,0 +1,555 @@ + + + + + +DoublesSketchSortedView (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class DoublesSketchSortedView

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.quantiles.DoublesSketchSortedView
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    DoublesSortedView, SortedView
    +
    +
    +
    public final class DoublesSketchSortedView
    +extends Object
    +implements DoublesSortedView
    +
    The SortedView of the Classic Quantiles DoublesSketch.
    +
    +
    Author:
    +
    Alexander Saydakov, Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DoublesSketchSortedView

        +
        public DoublesSketchSortedView​(DoublesSketch sketch)
        +
        Constructs this Sorted View given the sketch
        +
        +
        Parameters:
        +
        sketch - the given Classic Quantiles DoublesSketch
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getCumulativeWeights

        +
        public long[] getCumulativeWeights()
        +
        Description copied from interface: SortedView
        +
        Returns the array of cumulative weights from the sketch. + Also known as the natural ranks, which are the Natural Numbers on the interval [1, N].
        +
        +
        Specified by:
        +
        getCumulativeWeights in interface SortedView
        +
        Returns:
        +
        the array of cumulative weights (or natural ranks).
        +
        +
      • +
      + + + +
        +
      • +

        getMaxItem

        +
        public double getMaxItem()
        +
        Description copied from interface: DoublesSortedView
        +
        Returns the maximum item of the stream. This may be distinct from the largest item retained by the + sketch algorithm.
        +
        +
        Specified by:
        +
        getMaxItem in interface DoublesSortedView
        +
        Returns:
        +
        the maximum item of the stream
        +
        +
      • +
      + + + +
        +
      • +

        getMinItem

        +
        public double getMinItem()
        +
        Description copied from interface: DoublesSortedView
        +
        Returns the minimum item of the stream. This may be distinct from the smallest item retained by the + sketch algorithm.
        +
        +
        Specified by:
        +
        getMinItem in interface DoublesSortedView
        +
        Returns:
        +
        the minimum item of the stream
        +
        +
      • +
      + + + +
        +
      • +

        getN

        +
        public long getN()
        +
        Description copied from interface: SortedView
        +
        Returns the total number of items presented to the sourcing sketch.
        +
        +
        Specified by:
        +
        getN in interface SortedView
        +
        Returns:
        +
        the total number of items presented to the sourcing sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        public double getQuantile​(double rank,
        +                          QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: DoublesSortedView
        +
        Gets the approximate quantile of the given normalized rank and the given search criterion.
        +
        +
        Specified by:
        +
        getQuantile in interface DoublesSortedView
        +
        Parameters:
        +
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        searchCrit - If INCLUSIVE, the given rank includes all quantiles ≤ + the quantile directly corresponding to the given rank. + If EXCLUSIVE, he given rank includes all quantiles < + the quantile directly corresponding to the given rank.
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getRank

        +
        public double getRank​(double quantile,
        +                      QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: DoublesSortedView
        +
        Gets the normalized rank corresponding to the given a quantile.
        +
        +
        Specified by:
        +
        getRank in interface DoublesSortedView
        +
        Parameters:
        +
        quantile - the given quantile
        +
        searchCrit - if INCLUSIVE the given quantile is included into the rank.
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantiles

        +
        public double[] getQuantiles()
        +
        Description copied from interface: DoublesSortedView
        +
        Returns an array of all retained quantiles by the sketch.
        +
        +
        Specified by:
        +
        getQuantiles in interface DoublesSortedView
        +
        Returns:
        +
        an array of all retained quantiles by the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        Description copied from interface: SortedView
        +
        Returns true if this sorted view is empty.
        +
        +
        Specified by:
        +
        isEmpty in interface SortedView
        +
        Returns:
        +
        true if this sorted view is empty.
        +
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/DoublesUnion.html b/docs/5.0.2/org/apache/datasketches/quantiles/DoublesUnion.html new file mode 100644 index 000000000..c6e10879d --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/DoublesUnion.html @@ -0,0 +1,791 @@ + + + + + +DoublesUnion (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class DoublesUnion

+
+
+ +
+
    +
  • +
    +
    public abstract class DoublesUnion
    +extends Object
    +
    The API for Union operations for quantiles DoublesSketches
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      DoublesUnion() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static DoublesUnionBuilderbuilder() +
      Returns a new UnionBuilder
      +
      abstract intgetEffectiveK() +
      Returns the effective k of this Union.
      +
      abstract intgetMaxK() +
      Returns the configured maxK of this Union.
      +
      abstract UpdateDoublesSketchgetResult() +
      Gets the result of this Union as an UpdateDoublesSketch, which enables further update + operations on the resulting sketch.
      +
      abstract UpdateDoublesSketchgetResult​(org.apache.datasketches.memory.WritableMemory dstMem) +
      Places the result of this Union into the provided memory as an UpdateDoublesSketch, + which enables further update operations on the resulting sketch.
      +
      abstract UpdateDoublesSketchgetResultAndReset() +
      Gets the result of this Union as an UpdateDoublesSketch, which enables further update + operations on the resulting sketch.
      +
      abstract booleanhasMemory() +
      Returns true if this union's data structure is backed by Memory or WritableMemory.
      +
      static DoublesUnionheapify​(org.apache.datasketches.memory.Memory srcMem) +
      Returns a Heap Union object that has been initialized with the data from the given memory + image of a sketch.
      +
      static DoublesUnionheapify​(DoublesSketch sketch) +
      Returns a Heap Union object that has been initialized with the data from the given sketch.
      +
      abstract booleanisDirect() +
      Returns true if this union is off-heap (direct)
      +
      abstract booleanisEmpty() +
      Returns true if this union is empty
      +
      abstract booleanisSameResource​(org.apache.datasketches.memory.Memory that) +
      Returns true if the backing resource of this is identical with the backing resource + of that.
      +
      abstract voidreset() +
      Resets this Union to a virgin state.
      +
      abstract byte[]toByteArray() +
      Serialize this union to a byte array.
      +
      abstract StringtoString() +
      Returns summary information about the backing sketch.
      +
      abstract StringtoString​(boolean sketchSummary, + boolean dataDetail) +
      Returns summary information about the backing sketch.
      +
      abstract voidunion​(org.apache.datasketches.memory.Memory mem) +
      Iterative union operation, which means this method can be repeatedly called.
      +
      abstract voidunion​(DoublesSketch sketchIn) +
      Iterative union operation, which means this method can be repeatedly called.
      +
      abstract voidupdate​(double dataItem) +
      Update this union with the given double (or float) data Item.
      +
      static DoublesUnionwrap​(org.apache.datasketches.memory.Memory mem) +
      Returns a read-only Union object that wraps off-heap data of the given memory image of + a sketch.
      +
      static DoublesUnionwrap​(org.apache.datasketches.memory.WritableMemory mem) +
      Returns an updatable Union object that wraps off-heap data of the given memory image of + a sketch.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DoublesUnion

        +
        public DoublesUnion()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        builder

        +
        public static DoublesUnionBuilder builder()
        +
        Returns a new UnionBuilder
        +
        +
        Returns:
        +
        a new UnionBuilder
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static DoublesUnion heapify​(DoublesSketch sketch)
        +
        Returns a Heap Union object that has been initialized with the data from the given sketch.
        +
        +
        Parameters:
        +
        sketch - A DoublesSketch to be used as a source of data only and will not be modified.
        +
        Returns:
        +
        a DoublesUnion object
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static DoublesUnion heapify​(org.apache.datasketches.memory.Memory srcMem)
        +
        Returns a Heap Union object that has been initialized with the data from the given memory + image of a sketch.
        +
        +
        Parameters:
        +
        srcMem - A memory image of a DoublesSketch to be used as a source of data, + but will not be modified.
        +
        Returns:
        +
        a Union object
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static DoublesUnion wrap​(org.apache.datasketches.memory.Memory mem)
        +
        Returns a read-only Union object that wraps off-heap data of the given memory image of + a sketch. The data structures of the Union remain off-heap.
        +
        +
        Parameters:
        +
        mem - A memory region to be used as the data structure for the sketch + and will be modified.
        +
        Returns:
        +
        a Union object
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static DoublesUnion wrap​(org.apache.datasketches.memory.WritableMemory mem)
        +
        Returns an updatable Union object that wraps off-heap data of the given memory image of + a sketch. The data structures of the Union remain off-heap.
        +
        +
        Parameters:
        +
        mem - A memory region to be used as the data structure for the sketch + and will be modified.
        +
        Returns:
        +
        a Union object
        +
        +
      • +
      + + + +
        +
      • +

        hasMemory

        +
        public abstract boolean hasMemory()
        +
        Returns true if this union's data structure is backed by Memory or WritableMemory.
        +
        +
        Returns:
        +
        true if this union's data structure is backed by Memory or WritableMemory.
        +
        +
      • +
      + + + +
        +
      • +

        isDirect

        +
        public abstract boolean isDirect()
        +
        Returns true if this union is off-heap (direct)
        +
        +
        Returns:
        +
        true if this union is off-heap (direct)
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public abstract boolean isEmpty()
        +
        Returns true if this union is empty
        +
        +
        Returns:
        +
        true if this union is empty
        +
        +
      • +
      + + + +
        +
      • +

        getMaxK

        +
        public abstract int getMaxK()
        +
        Returns the configured maxK of this Union.
        +
        +
        Returns:
        +
        the configured maxK of this Union.
        +
        +
      • +
      + + + +
        +
      • +

        getEffectiveK

        +
        public abstract int getEffectiveK()
        +
        Returns the effective k of this Union.
        +
        +
        Returns:
        +
        the effective k of this Union.
        +
        +
      • +
      + + + +
        +
      • +

        union

        +
        public abstract void union​(DoublesSketch sketchIn)
        +
        Iterative union operation, which means this method can be repeatedly called. + Merges the given sketch into this union object. + The given sketch is not modified. + It is required that the ratio of the two K's be a power of 2. + This is easily satisfied if each of the K's are already a power of 2. + If the given sketch is null or empty it is ignored. + +

        It is required that the results of the union operation, which can be obtained at any time, + is obtained from getResult().

        +
        +
        Parameters:
        +
        sketchIn - the sketch to be merged into this one.
        +
        +
      • +
      + + + +
        +
      • +

        union

        +
        public abstract void union​(org.apache.datasketches.memory.Memory mem)
        +
        Iterative union operation, which means this method can be repeatedly called. + Merges the given Memory image of a DoublesSketch into this union object. + The given Memory object is not modified and a link to it is not retained. + It is required that the ratio of the two K's be a power of 2. + This is easily satisfied if each of the K's are already a power of 2. + If the given sketch is null or empty it is ignored. + +

        It is required that the results of the union operation, which can be obtained at any time, + is obtained from getResult().

        +
        +
        Parameters:
        +
        mem - Memory image of sketch to be merged
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public abstract void update​(double dataItem)
        +
        Update this union with the given double (or float) data Item.
        +
        +
        Parameters:
        +
        dataItem - The given double datum.
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public abstract UpdateDoublesSketch getResult()
        +
        Gets the result of this Union as an UpdateDoublesSketch, which enables further update + operations on the resulting sketch. The Union state has not been changed, which allows + further union operations.
        +
        +
        Returns:
        +
        the result of this Union operation
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public abstract UpdateDoublesSketch getResult​(org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Places the result of this Union into the provided memory as an UpdateDoublesSketch, + which enables further update operations on the resulting sketch. The Union state has not + been changed, which allows further union operations.
        +
        +
        Parameters:
        +
        dstMem - the destination memory for the result
        +
        Returns:
        +
        the result of this Union operation
        +
        +
      • +
      + + + +
        +
      • +

        getResultAndReset

        +
        public abstract UpdateDoublesSketch getResultAndReset()
        +
        Gets the result of this Union as an UpdateDoublesSketch, which enables further update + operations on the resulting sketch. The Union is reset to the virgin state.
        +
        +
        Returns:
        +
        the result of this Union operation and reset.
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public abstract void reset()
        +
        Resets this Union to a virgin state.
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public abstract byte[] toByteArray()
        +
        Serialize this union to a byte array. Result is an UpdateDoublesSketch, serialized in an + unordered, non-compact form. The resulting byte[] can be heapified or wrapped as either a + sketch or a union.
        +
        +
        Returns:
        +
        byte array of this union
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public abstract String toString()
        +
        Returns summary information about the backing sketch.
        +
        +
        Overrides:
        +
        toString in class Object
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public abstract String toString​(boolean sketchSummary,
        +                                boolean dataDetail)
        +
        Returns summary information about the backing sketch. Used for debugging.
        +
        +
        Parameters:
        +
        sketchSummary - if true includes sketch summary
        +
        dataDetail - if true includes data detail
        +
        Returns:
        +
        summary information about the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        isSameResource

        +
        public abstract boolean isSameResource​(org.apache.datasketches.memory.Memory that)
        +
        Returns true if the backing resource of this is identical with the backing resource + of that. The capacities must be the same. If this is a region, + the region offset must also be the same.
        +
        +
        Parameters:
        +
        that - A different non-null object
        +
        Returns:
        +
        true if the backing resource of this is the same as the backing resource + of that.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/DoublesUnionBuilder.html b/docs/5.0.2/org/apache/datasketches/quantiles/DoublesUnionBuilder.html new file mode 100644 index 000000000..f022009d5 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/DoublesUnionBuilder.html @@ -0,0 +1,400 @@ + + + + + +DoublesUnionBuilder (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class DoublesUnionBuilder

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.quantiles.DoublesUnionBuilder
    • +
    +
  • +
+
+
    +
  • +
    +
    public class DoublesUnionBuilder
    +extends Object
    +
    For building a new DoublesSketch Union operation.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DoublesUnionBuilder

        +
        public DoublesUnionBuilder()
        +
        Constructor for a new DoublesUnionBuilder. The default configuration is +
          +
        • k: 128. This produces a normalized rank error of about 1.7%
        • +
        • Memory: null
        • +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setMaxK

        +
        public DoublesUnionBuilder setMaxK​(int maxK)
        +
        Sets the parameter masK that determines the maximum size of the sketch that + results from a union and its accuracy.
        +
        +
        Parameters:
        +
        maxK - determines the accuracy and size of the union and is a maximum. + The effective k can be smaller due to unions with smaller k sketches. + It is recommended that maxK be a power of 2 to enable unioning of sketches with + different k.
        +
        Returns:
        +
        this builder
        +
        +
      • +
      + + + +
        +
      • +

        getMaxK

        +
        public int getMaxK()
        +
        Gets the current configured maxK
        +
        +
        Returns:
        +
        the current configured maxK
        +
        +
      • +
      + + + +
        +
      • +

        build

        +
        public DoublesUnion build()
        +
        Returns a new empty Union object with the current configuration of this Builder.
        +
        +
        Returns:
        +
        a Union object
        +
        +
      • +
      + + + +
        +
      • +

        build

        +
        public DoublesUnion build​(org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Returns a new empty Union object with the current configuration of this Builder + and the specified backing destination Memory store.
        +
        +
        Parameters:
        +
        dstMem - the destination memory
        +
        Returns:
        +
        a Union object
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/ItemsSketch.html b/docs/5.0.2/org/apache/datasketches/quantiles/ItemsSketch.html new file mode 100644 index 000000000..6a7463934 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/ItemsSketch.html @@ -0,0 +1,1494 @@ + + + + + +ItemsSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ItemsSketch<T>

+
+
+ +
+
    +
  • +
    +
    Type Parameters:
    +
    T - The sketch data type
    +
    +
    +
    All Implemented Interfaces:
    +
    PartitioningFeature<T>, QuantilesAPI, QuantilesGenericAPI<T>
    +
    +
    +
    public final class ItemsSketch<T>
    +extends Object
    +implements QuantilesGenericAPI<T>, PartitioningFeature<T>
    +
    This is an implementation of the Low Discrepancy Mergeable Quantiles Sketch, using generic items, + described in section 3.2 of the journal version of the paper "Mergeable Summaries" + by Agarwal, Cormode, Huang, Phillips, Wei, and Yi: + +

    Reference:

    + +

    A k of 128 produces a normalized, rank error of about 1.7%. + For example, the median returned from getQuantile(0.5) will be between the actual quantiles + from the hypothetically sorted array of input quantiles at normalized ranks of 0.483 and 0.517, with + a confidence of about 99%.

    + +

    The size of an ItemsSketch is very dependent on the size of the generic Items input into the sketch, + so there is no comparable size table as there is for the DoublesSketch.

    +
    +
    See Also:
    +
    QuantilesAPI
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      ItemsSketch<T>downSample​(int newK) +
      From an existing sketch, this creates a new sketch that can have a smaller K.
      +
      double[]getCDF​(T[] splitPoints, + QuantileSearchCriteria searchCrit) +
      Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints.
      +
      static <T> ItemsSketch<T>getInstance​(Class<T> clazz, + int k, + Comparator<? super T> comparator) +
      Obtains a new instance of an ItemsSketch.
      +
      static <T> ItemsSketch<T>getInstance​(Class<T> clazz, + Comparator<? super T> comparator) +
      Obtains a new instance of an ItemsSketch using the DEFAULT_K.
      +
      static <T> ItemsSketch<T>getInstance​(Class<T> clazz, + org.apache.datasketches.memory.Memory srcMem, + Comparator<? super T> comparator, + ArrayOfItemsSerDe<T> serDe) +
      Heapifies the given srcMem, which must be a Memory image of a ItemsSketch
      +
      intgetK() +
      Gets the user configured parameter k, which controls the accuracy of the sketch + and its memory space usage.
      +
      static intgetKFromEpsilon​(double epsilon, + boolean pmf) +
      Gets the approximate k to use given epsilon, the normalized rank error.
      +
      TgetMaxItem() +
      Returns the maximum item of the stream.
      +
      TgetMinItem() +
      Returns the minimum item of the stream.
      +
      longgetN() +
      Gets the length of the input stream offered to the sketch..
      +
      doublegetNormalizedRankError​(boolean pmf) +
      Gets the approximate rank error of this sketch normalized as a fraction between zero and one.
      +
      static doublegetNormalizedRankError​(int k, + boolean pmf) +
      Gets the normalized rank error given k and pmf.
      +
      intgetNumRetained() +
      Gets the number of quantiles retained by the sketch.
      +
      GenericPartitionBoundaries<T>getPartitionBoundaries​(int numEquallySized, + QuantileSearchCriteria searchCrit) +
      This method returns an instance of + GenericPartitionBoundaries which provides + sufficient information for the user to create the given number of equally sized partitions, where "equally sized" + refers to an approximately equal number of items per partition.
      +
      double[]getPMF​(T[] splitPoints, + QuantileSearchCriteria searchCrit) +
      Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints.
      +
      TgetQuantile​(double rank, + QuantileSearchCriteria searchCrit) +
      Gets the approximate quantile of the given normalized rank and the given search criterion.
      +
      TgetQuantileLowerBound​(double rank) +
      Gets the lower bound of the quantile confidence interval in which the quantile of the + given rank exists.
      +
      T[]getQuantiles​(double[] ranks, + QuantileSearchCriteria searchCrit) +
      Gets an array of quantiles from the given array of normalized ranks.
      +
      TgetQuantileUpperBound​(double rank) +
      Gets the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists.
      +
      doublegetRank​(T quantile, + QuantileSearchCriteria searchCrit) +
      Gets the normalized rank corresponding to the given a quantile.
      +
      doublegetRankLowerBound​(double rank) +
      Gets the lower bound of the rank confidence interval in which the true rank of the + given rank exists.
      +
      double[]getRanks​(T[] quantiles, + QuantileSearchCriteria searchCrit) +
      Gets an array of normalized ranks corresponding to the given array of quantiles and the given + search criterion.
      +
      doublegetRankUpperBound​(double rank) +
      Gets the upper bound of the rank confidence interval in which the true rank of the + given rank exists.
      +
      Class<T>getSketchType() 
      ItemsSketchSortedView<T>getSortedView() +
      Gets the sorted view of this sketch
      +
      booleanhasMemory() +
      Returns true if this sketch's data structure is backed by Memory or WritableMemory.
      +
      booleanisDirect() +
      Returns true if this sketch's data structure is off-heap (a.k.a., Direct or Native memory).
      +
      booleanisEmpty() +
      Returns true if this sketch is empty.
      +
      booleanisEstimationMode() +
      Returns true if this sketch is in estimation mode.
      +
      booleanisReadOnly() +
      Returns true if this sketch is read only.
      +
      QuantilesGenericSketchIterator<T>iterator() +
      Gets the iterator for this sketch, which is not sorted.
      +
      voidputMemory​(org.apache.datasketches.memory.WritableMemory dstMem, + ArrayOfItemsSerDe<T> serDe) +
      Puts the current sketch into the given Memory if there is sufficient space.
      +
      voidreset() +
      Resets this sketch to the empty state.
      +
      byte[]toByteArray​(boolean ordered, + ArrayOfItemsSerDe<T> serDe) +
      Serialize this sketch to a byte array form.
      +
      byte[]toByteArray​(ArrayOfItemsSerDe<T> serDe) +
      Serialize this sketch to a byte array form.
      +
      StringtoString​(boolean sketchSummary, + boolean dataDetail) +
      Returns summary information about this sketch.
      +
      static StringtoString​(byte[] byteArr) +
      Returns a human readable string of the preamble of a byte array image of an ItemsSketch.
      +
      static StringtoString​(org.apache.datasketches.memory.Memory mem) +
      Returns a human readable string of the preamble of a Memory image of an ItemsSketch.
      +
      voidupdate​(T item) +
      Updates this sketch with the given item.
      +
      + + + + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        rand

        +
        public static final Random rand
        +
        Setting the seed makes the results of the sketch deterministic if the input items are + received in exactly the same order. This is only useful when performing test comparisons, + otherwise, it is not recommended.
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getInstance

        +
        public static <T> ItemsSketch<T> getInstance​(Class<T> clazz,
        +                                             Comparator<? super T> comparator)
        +
        Obtains a new instance of an ItemsSketch using the DEFAULT_K.
        +
        +
        Type Parameters:
        +
        T - The sketch data type
        +
        Parameters:
        +
        clazz - the given class of T
        +
        comparator - to compare items
        +
        Returns:
        +
        an ItemSketch<T>.
        +
        +
      • +
      + + + +
        +
      • +

        getInstance

        +
        public static <T> ItemsSketch<T> getInstance​(Class<T> clazz,
        +                                             int k,
        +                                             Comparator<? super T> comparator)
        +
        Obtains a new instance of an ItemsSketch.
        +
        +
        Type Parameters:
        +
        T - The sketch data type
        +
        Parameters:
        +
        clazz - the given class of T
        +
        k - Parameter that controls space usage of sketch and accuracy of estimates. + Must be greater than 2 and less than 65536 and a power of 2.
        +
        comparator - to compare items
        +
        Returns:
        +
        an ItemSketch<T>.
        +
        +
      • +
      + + + +
        +
      • +

        getInstance

        +
        public static <T> ItemsSketch<T> getInstance​(Class<T> clazz,
        +                                             org.apache.datasketches.memory.Memory srcMem,
        +                                             Comparator<? super T> comparator,
        +                                             ArrayOfItemsSerDe<T> serDe)
        +
        Heapifies the given srcMem, which must be a Memory image of a ItemsSketch
        +
        +
        Type Parameters:
        +
        T - The sketch data type
        +
        Parameters:
        +
        clazz - the given class of T
        +
        srcMem - a Memory image of a sketch. + See Memory
        +
        comparator - to compare items
        +
        serDe - an instance of ArrayOfItemsSerDe
        +
        Returns:
        +
        a ItemSketch<T> on the Java heap.
        +
        +
      • +
      + + + + + +
        +
      • +

        getCDF

        +
        public double[] getCDF​(T[] splitPoints,
        +                       QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesGenericAPI
        +
        Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(false) function.

        +
        +
        Specified by:
        +
        getCDF in interface QuantilesGenericAPI<T>
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 overlapping intervals. + +

        The start of each interval is below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and the end of the interval + is the rank or cumulative probability corresponding to the split point.

        + +

        The (m+1)th interval represents 100% of the distribution represented by the sketch + and consistent with the definition of a cumulative probability distribution, thus the (m+1)th + rank or probability in the returned array is always 1.0.

        + +

        If a split point exactly equals a retained item of the sketch and the search criterion is:

        + +
          +
        • INCLUSIVE, the resulting cumulative probability will include that item.
        • +
        • EXCLUSIVE, the resulting cumulative probability will not include the weight of that split point.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
        +
        +
      • +
      + + + +
        +
      • +

        getSketchType

        +
        public Class<T> getSketchType()
        +
        +
        Returns:
        +
        the sketch item type
        +
        +
      • +
      + + + +
        +
      • +

        getMaxItem

        +
        public T getMaxItem()
        +
        Description copied from interface: QuantilesGenericAPI
        +
        Returns the maximum item of the stream. This may be distinct from the largest item retained by the + sketch algorithm.
        +
        +
        Specified by:
        +
        getMaxItem in interface QuantilesGenericAPI<T>
        +
        Returns:
        +
        the maximum item of the stream
        +
        +
      • +
      + + + +
        +
      • +

        getMinItem

        +
        public T getMinItem()
        +
        Description copied from interface: QuantilesGenericAPI
        +
        Returns the minimum item of the stream. This may be distinct from the smallest item retained by the + sketch algorithm.
        +
        +
        Specified by:
        +
        getMinItem in interface QuantilesGenericAPI<T>
        +
        Returns:
        +
        the minimum item of the stream
        +
        +
      • +
      + + + +
        +
      • +

        getPartitionBoundaries

        +
        public GenericPartitionBoundaries<T> getPartitionBoundaries​(int numEquallySized,
        +                                                            QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: PartitioningFeature
        +
        This method returns an instance of + GenericPartitionBoundaries which provides + sufficient information for the user to create the given number of equally sized partitions, where "equally sized" + refers to an approximately equal number of items per partition.
        +
        +
        Specified by:
        +
        getPartitionBoundaries in interface PartitioningFeature<T>
        +
        Parameters:
        +
        numEquallySized - an integer that specifies the number of equally sized partitions between + getMinItem() and + getMaxItem(). + This must be a positive integer greater than zero. +
          +
        • A 1 will return: minItem, maxItem.
        • +
        • A 2 will return: minItem, median quantile, maxItem.
        • +
        • Etc.
        • +
        +
        searchCrit - If INCLUSIVE, all the returned quantiles are the upper boundaries of the equally sized partitions + with the exception of the lowest returned quantile, which is the lowest boundary of the lowest ranked partition. + If EXCLUSIVE, all the returned quantiles are the lower boundaries of the equally sized partitions + with the exception of the highest returned quantile, which is the upper boundary of the highest ranked partition.
        +
        Returns:
        +
        an instance of GenericPartitionBoundaries.
        +
        +
      • +
      + + + + + +
        +
      • +

        getPMF

        +
        public double[] getPMF​(T[] splitPoints,
        +                       QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesGenericAPI
        +
        Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(true) function.

        +
        +
        Specified by:
        +
        getPMF in interface QuantilesGenericAPI<T>
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 consecutive, non-overlapping intervals. + +

        Each interval except for the end intervals starts with a split point and ends with the next split + point in sequence.

        + +

        The first interval starts below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and ends with the first split point

        + +

        The last (m+1)th interval starts with the last split point and ends after the last + item retained by the sketch corresponding to a rank or probability of 1.0.

        + +

        The sum of the probability masses of all (m+1) intervals is 1.0.

        + +

        If the search criterion is:

        + +
          +
        • INCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will include that item. If the lower split point equals an item retained by the sketch, the interval will exclude + that item.
        • +
        • EXCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will exclude that item. If the lower split point equals an item retained by the sketch, the interval will include + that item.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        public T getQuantile​(double rank,
        +                     QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesGenericAPI
        +
        Gets the approximate quantile of the given normalized rank and the given search criterion.
        +
        +
        Specified by:
        +
        getQuantile in interface QuantilesGenericAPI<T>
        +
        Parameters:
        +
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        searchCrit - If INCLUSIVE, the given rank includes all quantiles ≤ + the quantile directly corresponding to the given rank. + If EXCLUSIVE, he given rank includes all quantiles < + the quantile directly corresponding to the given rank.
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantileLowerBound

        +
        public T getQuantileLowerBound​(double rank)
        +
        Description copied from interface: QuantilesGenericAPI
        +
        Gets the lower bound of the quantile confidence interval in which the quantile of the + given rank exists. + +

        Although it is possible to estimate the probability that the true quantile + exists within the quantile confidence interval specified by the upper and lower quantile bounds, + it is not possible to guarantee the width of the quantile confidence interval + as an additive or multiplicative percent of the true quantile.

        +
        +
        Specified by:
        +
        getQuantileLowerBound in interface QuantilesGenericAPI<T>
        +
        Parameters:
        +
        rank - the given normalized rank
        +
        Returns:
        +
        the lower bound of the quantile confidence interval in which the quantile of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantileUpperBound

        +
        public T getQuantileUpperBound​(double rank)
        +
        Description copied from interface: QuantilesGenericAPI
        +
        Gets the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists. + +

        Although it is possible to estimate the probability that the true quantile + exists within the quantile confidence interval specified by the upper and lower quantile bounds, + it is not possible to guarantee the width of the quantile interval + as an additive or multiplicative percent of the true quantile.

        +
        +
        Specified by:
        +
        getQuantileUpperBound in interface QuantilesGenericAPI<T>
        +
        Parameters:
        +
        rank - the given normalized rank
        +
        Returns:
        +
        the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantiles

        +
        public T[] getQuantiles​(double[] ranks,
        +                        QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesGenericAPI
        +
        Gets an array of quantiles from the given array of normalized ranks.
        +
        +
        Specified by:
        +
        getQuantiles in interface QuantilesGenericAPI<T>
        +
        Parameters:
        +
        ranks - the given array of normalized ranks, each of which must be + in the interval [0.0,1.0].
        +
        searchCrit - if INCLUSIVE, the given ranks include all quantiles ≤ + the quantile directly corresponding to each rank.
        +
        Returns:
        +
        an array of quantiles corresponding to the given array of normalized ranks.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + + + +
        +
      • +

        getRank

        +
        public double getRank​(T quantile,
        +                      QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesGenericAPI
        +
        Gets the normalized rank corresponding to the given a quantile.
        +
        +
        Specified by:
        +
        getRank in interface QuantilesGenericAPI<T>
        +
        Parameters:
        +
        quantile - the given quantile
        +
        searchCrit - if INCLUSIVE the given quantile is included into the rank.
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getRankLowerBound

        +
        public double getRankLowerBound​(double rank)
        +
        Description copied from interface: QuantilesAPI
        +
        Gets the lower bound of the rank confidence interval in which the true rank of the + given rank exists.
        +
        +
        Specified by:
        +
        getRankLowerBound in interface QuantilesAPI
        +
        Parameters:
        +
        rank - the given normalized rank.
        +
        Returns:
        +
        the lower bound of the rank confidence interval in which the true rank of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getRankUpperBound

        +
        public double getRankUpperBound​(double rank)
        +
        Description copied from interface: QuantilesAPI
        +
        Gets the upper bound of the rank confidence interval in which the true rank of the + given rank exists.
        +
        +
        Specified by:
        +
        getRankUpperBound in interface QuantilesAPI
        +
        Parameters:
        +
        rank - the given normalized rank.
        +
        Returns:
        +
        the upper bound of the rank confidence interval in which the true rank of the + given rank exists.
        +
        +
      • +
      + + + + + +
        +
      • +

        getRanks

        +
        public double[] getRanks​(T[] quantiles,
        +                         QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesGenericAPI
        +
        Gets an array of normalized ranks corresponding to the given array of quantiles and the given + search criterion.
        +
        +
        Specified by:
        +
        getRanks in interface QuantilesGenericAPI<T>
        +
        Parameters:
        +
        quantiles - the given array of quantiles
        +
        searchCrit - if INCLUSIVE, the given quantiles include the rank directly corresponding to each quantile.
        +
        Returns:
        +
        an array of normalized ranks corresponding to the given array of quantiles.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getK

        +
        public int getK()
        +
        Description copied from interface: QuantilesAPI
        +
        Gets the user configured parameter k, which controls the accuracy of the sketch + and its memory space usage.
        +
        +
        Specified by:
        +
        getK in interface QuantilesAPI
        +
        Returns:
        +
        the user configured parameter k, which controls the accuracy of the sketch + and its memory space usage.
        +
        +
      • +
      + + + +
        +
      • +

        getN

        +
        public long getN()
        +
        Description copied from interface: QuantilesAPI
        +
        Gets the length of the input stream offered to the sketch..
        +
        +
        Specified by:
        +
        getN in interface QuantilesAPI
        +
        Returns:
        +
        the length of the input stream offered to the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getNormalizedRankError

        +
        public double getNormalizedRankError​(boolean pmf)
        +
        Gets the approximate rank error of this sketch normalized as a fraction between zero and one.
        +
        +
        Parameters:
        +
        pmf - if true, returns the "double-sided" normalized rank error for the getPMF() function. + Otherwise, it is the "single-sided" normalized rank error for all the other queries.
        +
        Returns:
        +
        if pmf is true, returns the normalized rank error for the getPMF() function. + Otherwise, it is the "single-sided" normalized rank error for all the other queries.
        +
        +
      • +
      + + + +
        +
      • +

        getNormalizedRankError

        +
        public static double getNormalizedRankError​(int k,
        +                                            boolean pmf)
        +
        Gets the normalized rank error given k and pmf. + Static method version of the getNormalizedRankError(boolean).
        +
        +
        Parameters:
        +
        k - the configuration parameter
        +
        pmf - if true, returns the "double-sided" normalized rank error for the getPMF() function. + Otherwise, it is the "single-sided" normalized rank error for all the other queries.
        +
        Returns:
        +
        if pmf is true, the normalized rank error for the getPMF() function. + Otherwise, it is the "single-sided" normalized rank error for all the other queries.
        +
        +
      • +
      + + + +
        +
      • +

        getKFromEpsilon

        +
        public static int getKFromEpsilon​(double epsilon,
        +                                  boolean pmf)
        +
        Gets the approximate k to use given epsilon, the normalized rank error.
        +
        +
        Parameters:
        +
        epsilon - the normalized rank error between zero and one.
        +
        pmf - if true, this function returns k assuming the input epsilon + is the desired "double-sided" epsilon for the getPMF() function. Otherwise, this function + returns k assuming the input epsilon is the desired "single-sided" + epsilon for all the other queries.
        +
        Returns:
        +
        k given epsilon.
        +
        +
      • +
      + + + +
        +
      • +

        hasMemory

        +
        public boolean hasMemory()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch's data structure is backed by Memory or WritableMemory.
        +
        +
        Specified by:
        +
        hasMemory in interface QuantilesAPI
        +
        Returns:
        +
        true if this sketch's data structure is backed by Memory or WritableMemory.
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch is empty.
        +
        +
        Specified by:
        +
        isEmpty in interface QuantilesAPI
        +
        Returns:
        +
        true if this sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        isDirect

        +
        public boolean isDirect()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch's data structure is off-heap (a.k.a., Direct or Native memory).
        +
        +
        Specified by:
        +
        isDirect in interface QuantilesAPI
        +
        Returns:
        +
        true if this sketch's data structure is off-heap (a.k.a., Direct or Native memory).
        +
        +
      • +
      + + + +
        +
      • +

        isEstimationMode

        +
        public boolean isEstimationMode()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch is in estimation mode.
        +
        +
        Specified by:
        +
        isEstimationMode in interface QuantilesAPI
        +
        Returns:
        +
        true if this sketch is in estimation mode.
        +
        +
      • +
      + + + +
        +
      • +

        isReadOnly

        +
        public boolean isReadOnly()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch is read only.
        +
        +
        Specified by:
        +
        isReadOnly in interface QuantilesAPI
        +
        Returns:
        +
        true if this sketch is read only.
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Description copied from interface: QuantilesAPI
        +
        Resets this sketch to the empty state. + If the sketch is read only this does nothing. + +

        The parameter k will not change.

        +
        +
        Specified by:
        +
        reset in interface QuantilesAPI
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray​(ArrayOfItemsSerDe<T> serDe)
        +
        Serialize this sketch to a byte array form.
        +
        +
        Parameters:
        +
        serDe - an instance of ArrayOfItemsSerDe
        +
        Returns:
        +
        byte array of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray​(boolean ordered,
        +                          ArrayOfItemsSerDe<T> serDe)
        +
        Serialize this sketch to a byte array form.
        +
        +
        Parameters:
        +
        ordered - if true the base buffer will be ordered (default == false).
        +
        serDe - an instance of ArrayOfItemsSerDe
        +
        Returns:
        +
        this sketch in a byte array form.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString​(boolean sketchSummary,
        +                       boolean dataDetail)
        +
        Returns summary information about this sketch. Used for debugging.
        +
        +
        Parameters:
        +
        sketchSummary - if true includes sketch summary
        +
        dataDetail - if true includes data detail
        +
        Returns:
        +
        summary information about the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString​(byte[] byteArr)
        +
        Returns a human readable string of the preamble of a byte array image of an ItemsSketch.
        +
        +
        Parameters:
        +
        byteArr - the given byte array
        +
        Returns:
        +
        a human readable string of the preamble of a byte array image of an ItemsSketch.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString​(org.apache.datasketches.memory.Memory mem)
        +
        Returns a human readable string of the preamble of a Memory image of an ItemsSketch.
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        Returns:
        +
        a human readable string of the preamble of a Memory image of an ItemsSketch.
        +
        +
      • +
      + + + +
        +
      • +

        downSample

        +
        public ItemsSketch<T> downSample​(int newK)
        +
        From an existing sketch, this creates a new sketch that can have a smaller K. + The original sketch is not modified.
        +
        +
        Parameters:
        +
        newK - the new K that must be smaller than current K. + It is required that this.getK() = newK * 2^(nonnegative integer).
        +
        Returns:
        +
        the new sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getNumRetained

        +
        public int getNumRetained()
        +
        Description copied from interface: QuantilesAPI
        +
        Gets the number of quantiles retained by the sketch.
        +
        +
        Specified by:
        +
        getNumRetained in interface QuantilesAPI
        +
        Returns:
        +
        the number of quantiles retained by the sketch
        +
        +
      • +
      + + + +
        +
      • +

        putMemory

        +
        public void putMemory​(org.apache.datasketches.memory.WritableMemory dstMem,
        +                      ArrayOfItemsSerDe<T> serDe)
        +
        Puts the current sketch into the given Memory if there is sufficient space. + Otherwise, throws an error.
        +
        +
        Parameters:
        +
        dstMem - the given memory.
        +
        serDe - an instance of ArrayOfItemsSerDe
        +
        +
      • +
      + + + + + + + + + +
        +
      • +

        update

        +
        public void update​(T item)
        +
        Description copied from interface: QuantilesGenericAPI
        +
        Updates this sketch with the given item.
        +
        +
        Specified by:
        +
        update in interface QuantilesGenericAPI<T>
        +
        Parameters:
        +
        item - from a stream of items. Nulls are ignored.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/ItemsSketchIterator.html b/docs/5.0.2/org/apache/datasketches/quantiles/ItemsSketchIterator.html new file mode 100644 index 000000000..cc556da62 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/ItemsSketchIterator.html @@ -0,0 +1,342 @@ + + + + + +ItemsSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ItemsSketchIterator<T>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.quantiles.ItemsSketchIterator<T>
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getQuantile

        +
        public T getQuantile()
        +
        Description copied from interface: QuantilesGenericSketchIterator
        +
        Gets the generic quantile at the current index. + +

        Don't call this before calling next() for the first time + or after getting false from next().

        +
        +
        Specified by:
        +
        getQuantile in interface QuantilesGenericSketchIterator<T>
        +
        Returns:
        +
        the generic quantile at the current index.
        +
        +
      • +
      + + + +
        +
      • +

        getWeight

        +
        public long getWeight()
        +
        Description copied from interface: QuantilesSketchIterator
        +
        Gets the natural weight at the current index. + +

        Don't call this before calling next() for the first time + or after getting false from next().

        +
        +
        Specified by:
        +
        getWeight in interface QuantilesSketchIterator
        +
        Returns:
        +
        the natural weight at the current index.
        +
        +
      • +
      + + + +
        +
      • +

        next

        +
        public boolean next()
        +
        Description copied from interface: QuantilesSketchIterator
        +
        Advances the index and checks if it is valid. + The state of this iterator is undefined before the first call of this method.
        +
        +
        Specified by:
        +
        next in interface QuantilesSketchIterator
        +
        Returns:
        +
        true if the next index is valid.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/ItemsSketchSortedView.html b/docs/5.0.2/org/apache/datasketches/quantiles/ItemsSketchSortedView.html new file mode 100644 index 000000000..31c01bf11 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/ItemsSketchSortedView.html @@ -0,0 +1,699 @@ + + + + + +ItemsSketchSortedView (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ItemsSketchSortedView<T>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.quantiles.ItemsSketchSortedView<T>
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        getCDF

        +
        public double[] getCDF​(T[] splitPoints,
        +                       QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: GenericSortedView
        +
        Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints. + +

        If the sketch is empty this returns null.

        + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(false) function.

        +
        +
        Specified by:
        +
        getCDF in interface GenericSortedView<T>
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 overlapping intervals. + +

        The start of each interval is below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and the end of the interval + is the rank or cumulative probability corresponding to the split point.

        + +

        The (m+1)th interval represents 100% of the distribution represented by the sketch + and consistent with the definition of a cumulative probability distribution, thus the (m+1)th + rank or probability in the returned array is always 1.0.

        + +

        If a split point exactly equals a retained item of the sketch and the search criterion is:

        + +
          +
        • INCLUSIVE, the resulting cumulative probability will include that item.
        • +
        • EXCLUSIVE, the resulting cumulative probability will not include the weight of that split point.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
        +
        +
      • +
      + + + +
        +
      • +

        getCumulativeWeights

        +
        public long[] getCumulativeWeights()
        +
        Description copied from interface: SortedView
        +
        Returns the array of cumulative weights from the sketch. + Also known as the natural ranks, which are the Natural Numbers on the interval [1, N].
        +
        +
        Specified by:
        +
        getCumulativeWeights in interface SortedView
        +
        Returns:
        +
        the array of cumulative weights (or natural ranks).
        +
        +
      • +
      + + + +
        +
      • +

        getMaxItem

        +
        public T getMaxItem()
        +
        Description copied from interface: GenericSortedView
        +
        Returns the maximum item of the stream. This may be distinct from the largest item retained by the + sketch algorithm.
        +
        +
        Specified by:
        +
        getMaxItem in interface GenericSortedView<T>
        +
        Returns:
        +
        the maximum item of the stream
        +
        +
      • +
      + + + +
        +
      • +

        getMinItem

        +
        public T getMinItem()
        +
        Description copied from interface: GenericSortedView
        +
        Returns the minimum item of the stream. This may be distinct from the smallest item retained by the + sketch algorithm.
        +
        +
        Specified by:
        +
        getMinItem in interface GenericSortedView<T>
        +
        Returns:
        +
        the minimum item of the stream
        +
        +
      • +
      + + + +
        +
      • +

        getN

        +
        public long getN()
        +
        Description copied from interface: SortedView
        +
        Returns the total number of items presented to the sourcing sketch.
        +
        +
        Specified by:
        +
        getN in interface SortedView
        +
        Returns:
        +
        the total number of items presented to the sourcing sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getPartitionBoundaries

        +
        public GenericPartitionBoundaries<T> getPartitionBoundaries​(int numEquallySized,
        +                                                            QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: PartitioningFeature
        +
        This method returns an instance of + GenericPartitionBoundaries which provides + sufficient information for the user to create the given number of equally sized partitions, where "equally sized" + refers to an approximately equal number of items per partition.
        +
        +
        Specified by:
        +
        getPartitionBoundaries in interface PartitioningFeature<T>
        +
        Parameters:
        +
        numEquallySized - an integer that specifies the number of equally sized partitions between + getMinItem() and + getMaxItem(). + This must be a positive integer greater than zero. +
          +
        • A 1 will return: minItem, maxItem.
        • +
        • A 2 will return: minItem, median quantile, maxItem.
        • +
        • Etc.
        • +
        +
        searchCrit - If INCLUSIVE, all the returned quantiles are the upper boundaries of the equally sized partitions + with the exception of the lowest returned quantile, which is the lowest boundary of the lowest ranked partition. + If EXCLUSIVE, all the returned quantiles are the lower boundaries of the equally sized partitions + with the exception of the highest returned quantile, which is the upper boundary of the highest ranked partition.
        +
        Returns:
        +
        an instance of GenericPartitionBoundaries.
        +
        +
      • +
      + + + + + +
        +
      • +

        getPMF

        +
        public double[] getPMF​(T[] splitPoints,
        +                       QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: GenericSortedView
        +
        Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(true) function.

        +
        +
        Specified by:
        +
        getPMF in interface GenericSortedView<T>
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 consecutive, non-overlapping intervals. + +

        Each interval except for the end intervals starts with a split point and ends with the next split + point in sequence.

        + +

        The first interval starts below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and ends with the first split point

        + +

        The last (m+1)th interval starts with the last split point and ends after the last + item retained by the sketch corresponding to a rank or probability of 1.0.

        + +

        The sum of the probability masses of all (m+1) intervals is 1.0.

        + +

        If the search criterion is:

        + +
          +
        • INCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will include that item. If the lower split point equals an item retained by the sketch, the interval will exclude + that item.
        • +
        • EXCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will exclude that item. If the lower split point equals an item retained by the sketch, the interval will include + that item.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        public T getQuantile​(double rank,
        +                     QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: GenericSortedView
        +
        Gets the approximate quantile of the given normalized rank and the given search criterion.
        +
        +
        Specified by:
        +
        getQuantile in interface GenericSortedView<T>
        +
        Parameters:
        +
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        searchCrit - If INCLUSIVE, the given rank includes all quantiles ≤ + the quantile directly corresponding to the given rank. + If EXCLUSIVE, he given rank includes all quantiles < + the quantile directly corresponding to the given rank.
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getQuantiles

        +
        public T[] getQuantiles()
        +
        Description copied from interface: GenericSortedView
        +
        Returns the full array of quantiles.
        +
        +
        Specified by:
        +
        getQuantiles in interface GenericSortedView<T>
        +
        Returns:
        +
        the full array of quantiles.
        +
        +
      • +
      + + + + + +
        +
      • +

        getRank

        +
        public double getRank​(T quantile,
        +                      QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: GenericSortedView
        +
        Gets the normalized rank corresponding to the given a quantile.
        +
        +
        Specified by:
        +
        getRank in interface GenericSortedView<T>
        +
        Parameters:
        +
        quantile - the given quantile
        +
        searchCrit - if INCLUSIVE the given quantile is included into the rank.
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        Description copied from interface: SortedView
        +
        Returns true if this sorted view is empty.
        +
        +
        Specified by:
        +
        isEmpty in interface SortedView
        +
        Returns:
        +
        true if this sorted view is empty.
        +
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/ItemsUnion.html b/docs/5.0.2/org/apache/datasketches/quantiles/ItemsUnion.html new file mode 100644 index 000000000..ebfc15e98 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/ItemsUnion.html @@ -0,0 +1,687 @@ + + + + + +ItemsUnion (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ItemsUnion<T>

+
+
+ +
+
    +
  • +
    +
    Type Parameters:
    +
    T - type of item
    +
    +
    +
    public final class ItemsUnion<T>
    +extends Object
    +
    The API for Union operations for generic ItemsSketches
    +
    +
    Author:
    +
    Lee Rhodes, Alexander Saydakov
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getInstance

        +
        public static <T> ItemsUnion<T> getInstance​(Class<T> clazz,
        +                                            Comparator<? super T> comparator)
        +
        Create an instance of ItemsUnion with the default k
        +
        +
        Type Parameters:
        +
        T - The sketch data type
        +
        Parameters:
        +
        clazz - The sketch class type
        +
        comparator - to compare items
        +
        Returns:
        +
        an instance of ItemsUnion
        +
        +
      • +
      + + + +
        +
      • +

        getInstance

        +
        public static <T> ItemsUnion<T> getInstance​(Class<T> clazz,
        +                                            int maxK,
        +                                            Comparator<? super T> comparator)
        +
        Create an instance of ItemsUnion
        +
        +
        Type Parameters:
        +
        T - The sketch data type
        +
        Parameters:
        +
        clazz - The sketch class type
        +
        maxK - determines the accuracy and size of the union and is a maximum. + The effective k can be smaller due to unions with smaller k sketches. + It is recommended that maxK be a power of 2 to enable unioning of sketches with a + different k.
        +
        comparator - to compare items
        +
        Returns:
        +
        an instance of ItemsUnion
        +
        +
      • +
      + + + +
        +
      • +

        getInstance

        +
        public static <T> ItemsUnion<T> getInstance​(Class<T> clazz,
        +                                            org.apache.datasketches.memory.Memory srcMem,
        +                                            Comparator<? super T> comparator,
        +                                            ArrayOfItemsSerDe<T> serDe)
        +
        Heapify the given srcMem into a Union object.
        +
        +
        Type Parameters:
        +
        T - The sketch data type
        +
        Parameters:
        +
        clazz - The sketch class type + A reference to srcMem will not be maintained internally.
        +
        srcMem - the given srcMem.
        +
        comparator - to compare items
        +
        serDe - an instance of ArrayOfItemsSerDe
        +
        Returns:
        +
        an instance of ItemsUnion
        +
        +
      • +
      + + + +
        +
      • +

        getInstance

        +
        public static <T> ItemsUnion<T> getInstance​(ItemsSketch<T> sketch)
        +
        Create an instance of ItemsUnion based on ItemsSketch
        +
        +
        Type Parameters:
        +
        T - The sketch data type
        +
        Parameters:
        +
        sketch - the basis of the union
        +
        Returns:
        +
        an instance of ItemsUnion
        +
        +
      • +
      + + + +
        +
      • +

        union

        +
        public void union​(ItemsSketch<T> sketchIn)
        +
        Iterative union operation, which means this method can be repeatedly called. + Merges the given sketch into this union object. + The given sketch is not modified. + It is required that the ratio of the two K's be a power of 2. + This is easily satisfied if each of the K's are already a power of 2. + If the given sketch is null or empty it is ignored. + +

        It is required that the results of the union operation, which can be obtained at any time, + is obtained from getResult().

        +
        +
        Parameters:
        +
        sketchIn - the sketch to be merged into this one.
        +
        +
      • +
      + + + +
        +
      • +

        union

        +
        public void union​(org.apache.datasketches.memory.Memory srcMem,
        +                  ArrayOfItemsSerDe<T> serDe)
        +
        Iterative union operation, which means this method can be repeatedly called. + Merges the given Memory image of a ItemsSketch into this union object. + The given Memory object is not modified and a link to it is not retained. + It is required that the ratio of the two K's be a power of 2. + This is easily satisfied if each of the K's are already a power of 2. + If the given sketch is null or empty it is ignored. + +

        It is required that the results of the union operation, which can be obtained at any time, + is obtained from getResult().

        +
        +
        Parameters:
        +
        srcMem - Memory image of sketch to be merged
        +
        serDe - an instance of ArrayOfItemsSerDe
        +
        +
      • +
      + + + + + +
        +
      • +

        update

        +
        public void update​(T dataItem)
        +
        Update this union with the given dataItem.
        +
        +
        Parameters:
        +
        dataItem - The given datum.
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public ItemsSketch<T> getResult()
        +
        Gets the result of this Union operation as a copy of the internal state. + This enables further union update operations on this state.
        +
        +
        Returns:
        +
        the result of this Union operation
        +
        +
      • +
      + + + +
        +
      • +

        getResultAndReset

        +
        public ItemsSketch<T> getResultAndReset()
        +
        Gets the result of this Union operation (without a copy) and resets this Union to the + virgin state.
        +
        +
        Returns:
        +
        the result of this Union operation and reset.
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Resets this Union to a virgin state. + Keeps maxK, comparator and clazz
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        Returns true if this union is empty
        +
        +
        Returns:
        +
        true if this union is empty
        +
        +
      • +
      + + + +
        +
      • +

        isDirect

        +
        public boolean isDirect()
        +
        Returns true if this union is direct
        +
        +
        Returns:
        +
        true if this union is direct
        +
        +
      • +
      + + + +
        +
      • +

        getMaxK

        +
        public int getMaxK()
        +
        Returns the configured maxK of this Union.
        +
        +
        Returns:
        +
        the configured maxK of this Union.
        +
        +
      • +
      + + + +
        +
      • +

        getEffectiveK

        +
        public int getEffectiveK()
        +
        Returns the effective k of this Union.
        +
        +
        Returns:
        +
        the effective k of this Union.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Returns summary information about the backing sketch.
        +
        +
        Overrides:
        +
        toString in class Object
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString​(boolean sketchSummary,
        +                       boolean dataDetail)
        +
        Returns summary information about the backing sketch. Used for debugging.
        +
        +
        Parameters:
        +
        sketchSummary - if true includes sketch summary
        +
        dataDetail - if true includes data detail
        +
        Returns:
        +
        summary information about the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray​(ArrayOfItemsSerDe<T> serDe)
        +
        Serialize this union to a byte array. Result is an ItemsSketch, serialized in an + unordered, non-compact form. The resulting byte[] can be passed to getInstance for either a + sketch or union.
        +
        +
        Parameters:
        +
        serDe - an instance of ArrayOfItemsSerDe
        +
        Returns:
        +
        byte array of this union
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/UpdateDoublesSketch.html b/docs/5.0.2/org/apache/datasketches/quantiles/UpdateDoublesSketch.html new file mode 100644 index 000000000..7aee6fa42 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/UpdateDoublesSketch.html @@ -0,0 +1,397 @@ + + + + + +UpdateDoublesSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class UpdateDoublesSketch

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        wrap

        +
        public static UpdateDoublesSketch wrap​(org.apache.datasketches.memory.WritableMemory srcMem)
        +
        Wrap this sketch around the given non-compact Memory image of a DoublesSketch.
        +
        +
        Parameters:
        +
        srcMem - the given Memory image of a DoublesSketch that may have data,
        +
        Returns:
        +
        a sketch that wraps the given srcMem
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public abstract void update​(double item)
        +
        Updates this sketch with the given double data item
        +
        +
        Parameters:
        +
        item - an item from a stream of items. NaNs are ignored.
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static UpdateDoublesSketch heapify​(org.apache.datasketches.memory.Memory srcMem)
        +
      • +
      + + + +
        +
      • +

        compact

        +
        public CompactDoublesSketch compact()
        +
        +
        Returns:
        +
        a CompactDoublesSketch of this class
        +
        +
      • +
      + + + +
        +
      • +

        compact

        +
        public CompactDoublesSketch compact​(org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Returns a compact version of this sketch. If passing in a Memory object, the compact sketch + will use that direct memory; otherwise, an on-heap sketch will be returned.
        +
        +
        Parameters:
        +
        dstMem - An optional target memory to hold the sketch.
        +
        Returns:
        +
        A compact version of this sketch
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/class-use/ClassicUtil.html b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/ClassicUtil.html new file mode 100644 index 000000000..19b16f611 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/ClassicUtil.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.quantiles.ClassicUtil (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantiles.ClassicUtil

+
+
No usage of org.apache.datasketches.quantiles.ClassicUtil
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/class-use/CompactDoublesSketch.html b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/CompactDoublesSketch.html new file mode 100644 index 000000000..b900bbc28 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/CompactDoublesSketch.html @@ -0,0 +1,208 @@ + + + + + +Uses of Class org.apache.datasketches.quantiles.CompactDoublesSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantiles.CompactDoublesSketch

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/class-use/DoublesSketch.html b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/DoublesSketch.html new file mode 100644 index 000000000..4fb1da91a --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/DoublesSketch.html @@ -0,0 +1,284 @@ + + + + + +Uses of Class org.apache.datasketches.quantiles.DoublesSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantiles.DoublesSketch

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/class-use/DoublesSketchBuilder.html b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/DoublesSketchBuilder.html new file mode 100644 index 000000000..c9b183687 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/DoublesSketchBuilder.html @@ -0,0 +1,205 @@ + + + + + +Uses of Class org.apache.datasketches.quantiles.DoublesSketchBuilder (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantiles.DoublesSketchBuilder

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/class-use/DoublesSketchIterator.html b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/DoublesSketchIterator.html new file mode 100644 index 000000000..1008c02cb --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/DoublesSketchIterator.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.quantiles.DoublesSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantiles.DoublesSketchIterator

+
+
No usage of org.apache.datasketches.quantiles.DoublesSketchIterator
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/class-use/DoublesSketchSortedView.html b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/DoublesSketchSortedView.html new file mode 100644 index 000000000..9808348e0 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/DoublesSketchSortedView.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.quantiles.DoublesSketchSortedView (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantiles.DoublesSketchSortedView

+
+
No usage of org.apache.datasketches.quantiles.DoublesSketchSortedView
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/class-use/DoublesUnion.html b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/DoublesUnion.html new file mode 100644 index 000000000..7f920bb17 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/DoublesUnion.html @@ -0,0 +1,237 @@ + + + + + +Uses of Class org.apache.datasketches.quantiles.DoublesUnion (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantiles.DoublesUnion

+
+
+
    +
  • + + + + + + + + + + + + +
    Packages that use DoublesUnion 
    PackageDescription
    org.apache.datasketches.quantiles +
    The quantiles package contains stochastic streaming algorithms that enable single-pass + analysis of the distribution of a stream of quantiles.
    +
    +
  • +
  • +
      +
    • +
      + + +

      Uses of DoublesUnion in org.apache.datasketches.quantiles

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.quantiles that return DoublesUnion 
      Modifier and TypeMethodDescription
      DoublesUnionDoublesUnionBuilder.build() +
      Returns a new empty Union object with the current configuration of this Builder.
      +
      DoublesUnionDoublesUnionBuilder.build​(org.apache.datasketches.memory.WritableMemory dstMem) +
      Returns a new empty Union object with the current configuration of this Builder + and the specified backing destination Memory store.
      +
      static DoublesUnionDoublesUnion.heapify​(org.apache.datasketches.memory.Memory srcMem) +
      Returns a Heap Union object that has been initialized with the data from the given memory + image of a sketch.
      +
      static DoublesUnionDoublesUnion.heapify​(DoublesSketch sketch) +
      Returns a Heap Union object that has been initialized with the data from the given sketch.
      +
      static DoublesUnionDoublesUnion.wrap​(org.apache.datasketches.memory.Memory mem) +
      Returns a read-only Union object that wraps off-heap data of the given memory image of + a sketch.
      +
      static DoublesUnionDoublesUnion.wrap​(org.apache.datasketches.memory.WritableMemory mem) +
      Returns an updatable Union object that wraps off-heap data of the given memory image of + a sketch.
      +
      +
      +
    • +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/class-use/DoublesUnionBuilder.html b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/DoublesUnionBuilder.html new file mode 100644 index 000000000..0092db972 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/DoublesUnionBuilder.html @@ -0,0 +1,206 @@ + + + + + +Uses of Class org.apache.datasketches.quantiles.DoublesUnionBuilder (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantiles.DoublesUnionBuilder

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/class-use/ItemsSketch.html b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/ItemsSketch.html new file mode 100644 index 000000000..a46366e42 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/ItemsSketch.html @@ -0,0 +1,264 @@ + + + + + +Uses of Class org.apache.datasketches.quantiles.ItemsSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantiles.ItemsSketch

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/class-use/ItemsSketchIterator.html b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/ItemsSketchIterator.html new file mode 100644 index 000000000..ed1ff054e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/ItemsSketchIterator.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.quantiles.ItemsSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantiles.ItemsSketchIterator

+
+
No usage of org.apache.datasketches.quantiles.ItemsSketchIterator
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/class-use/ItemsSketchSortedView.html b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/ItemsSketchSortedView.html new file mode 100644 index 000000000..1af855c90 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/ItemsSketchSortedView.html @@ -0,0 +1,196 @@ + + + + + +Uses of Class org.apache.datasketches.quantiles.ItemsSketchSortedView (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantiles.ItemsSketchSortedView

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/class-use/ItemsUnion.html b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/ItemsUnion.html new file mode 100644 index 000000000..e7a9b39e7 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/ItemsUnion.html @@ -0,0 +1,225 @@ + + + + + +Uses of Class org.apache.datasketches.quantiles.ItemsUnion (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantiles.ItemsUnion

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/class-use/UpdateDoublesSketch.html b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/UpdateDoublesSketch.html new file mode 100644 index 000000000..37bb53d98 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/class-use/UpdateDoublesSketch.html @@ -0,0 +1,242 @@ + + + + + +Uses of Class org.apache.datasketches.quantiles.UpdateDoublesSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantiles.UpdateDoublesSketch

+
+
+
    +
  • + + + + + + + + + + + + +
    Packages that use UpdateDoublesSketch 
    PackageDescription
    org.apache.datasketches.quantiles +
    The quantiles package contains stochastic streaming algorithms that enable single-pass + analysis of the distribution of a stream of quantiles.
    +
    +
  • +
  • +
      +
    • +
      + + +

      Uses of UpdateDoublesSketch in org.apache.datasketches.quantiles

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.quantiles that return UpdateDoublesSketch 
      Modifier and TypeMethodDescription
      UpdateDoublesSketchDoublesSketchBuilder.build() +
      Returns an UpdateDoublesSketch with the current configuration of this Builder.
      +
      UpdateDoublesSketchDoublesSketchBuilder.build​(org.apache.datasketches.memory.WritableMemory dstMem) +
      Returns a quantiles UpdateDoublesSketch with the current configuration of this builder + and the specified backing destination Memory store.
      +
      abstract UpdateDoublesSketchDoublesUnion.getResult() +
      Gets the result of this Union as an UpdateDoublesSketch, which enables further update + operations on the resulting sketch.
      +
      abstract UpdateDoublesSketchDoublesUnion.getResult​(org.apache.datasketches.memory.WritableMemory dstMem) +
      Places the result of this Union into the provided memory as an UpdateDoublesSketch, + which enables further update operations on the resulting sketch.
      +
      abstract UpdateDoublesSketchDoublesUnion.getResultAndReset() +
      Gets the result of this Union as an UpdateDoublesSketch, which enables further update + operations on the resulting sketch.
      +
      static UpdateDoublesSketchUpdateDoublesSketch.heapify​(org.apache.datasketches.memory.Memory srcMem) 
      static UpdateDoublesSketchUpdateDoublesSketch.wrap​(org.apache.datasketches.memory.WritableMemory srcMem) +
      Wrap this sketch around the given non-compact Memory image of a DoublesSketch.
      +
      +
      +
    • +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/package-summary.html b/docs/5.0.2/org/apache/datasketches/quantiles/package-summary.html new file mode 100644 index 000000000..0fcafaaf2 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/package-summary.html @@ -0,0 +1,255 @@ + + + + + +org.apache.datasketches.quantiles (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches.quantiles

+
+
+
+ + +

The quantiles package contains stochastic streaming algorithms that enable single-pass + analysis of the distribution of a stream of quantiles. +

+
+
See Also:
+
DoublesSketch, +ItemsSketch
+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    ClassicUtil +
    Utilities for the classic quantiles sketches and independent of the type.
    +
    CompactDoublesSketch +
    Compact sketches are inherently read ony.
    +
    DoublesSketch +
    This is an implementation of the Low Discrepancy Mergeable Quantiles Sketch, using doubles, + described in section 3.2 of the journal version of the paper "Mergeable Summaries" + by Agarwal, Cormode, Huang, Phillips, Wei, and Yi:
    +
    DoublesSketchBuilder +
    For building a new quantiles DoublesSketch.
    +
    DoublesSketchIterator +
    Iterator over DoublesSketch.
    +
    DoublesSketchSortedView +
    The SortedView of the Classic Quantiles DoublesSketch.
    +
    DoublesUnion +
    The API for Union operations for quantiles DoublesSketches
    +
    DoublesUnionBuilder +
    For building a new DoublesSketch Union operation.
    +
    ItemsSketch<T> +
    This is an implementation of the Low Discrepancy Mergeable Quantiles Sketch, using generic items, + described in section 3.2 of the journal version of the paper "Mergeable Summaries" + by Agarwal, Cormode, Huang, Phillips, Wei, and Yi:
    +
    ItemsSketchIterator<T> +
    Iterator over ItemsSketch.
    +
    ItemsSketchSortedView<T> +
    The SortedView of the Classic Quantiles ItemsSketch.
    +
    ItemsUnion<T> +
    The API for Union operations for generic ItemsSketches
    +
    UpdateDoublesSketch 
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/package-tree.html b/docs/5.0.2/org/apache/datasketches/quantiles/package-tree.html new file mode 100644 index 000000000..90da216ba --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/package-tree.html @@ -0,0 +1,179 @@ + + + + + +org.apache.datasketches.quantiles Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches.quantiles

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantiles/package-use.html b/docs/5.0.2/org/apache/datasketches/quantiles/package-use.html new file mode 100644 index 000000000..6caf2433e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantiles/package-use.html @@ -0,0 +1,239 @@ + + + + + +Uses of Package org.apache.datasketches.quantiles (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches.quantiles

+
+
+
    +
  • + + + + + + + + + + + + +
    Packages that use org.apache.datasketches.quantiles 
    PackageDescription
    org.apache.datasketches.quantiles +
    The quantiles package contains stochastic streaming algorithms that enable single-pass + analysis of the distribution of a stream of quantiles.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Classes in org.apache.datasketches.quantiles used by org.apache.datasketches.quantiles 
    ClassDescription
    CompactDoublesSketch +
    Compact sketches are inherently read ony.
    +
    DoublesSketch +
    This is an implementation of the Low Discrepancy Mergeable Quantiles Sketch, using doubles, + described in section 3.2 of the journal version of the paper "Mergeable Summaries" + by Agarwal, Cormode, Huang, Phillips, Wei, and Yi:
    +
    DoublesSketchBuilder +
    For building a new quantiles DoublesSketch.
    +
    DoublesUnion +
    The API for Union operations for quantiles DoublesSketches
    +
    DoublesUnionBuilder +
    For building a new DoublesSketch Union operation.
    +
    ItemsSketch +
    This is an implementation of the Low Discrepancy Mergeable Quantiles Sketch, using generic items, + described in section 3.2 of the journal version of the paper "Mergeable Summaries" + by Agarwal, Cormode, Huang, Phillips, Wei, and Yi:
    +
    ItemsSketchSortedView +
    The SortedView of the Classic Quantiles ItemsSketch.
    +
    ItemsUnion +
    The API for Union operations for generic ItemsSketches
    +
    UpdateDoublesSketch 
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/BinarySearch.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/BinarySearch.html new file mode 100644 index 000000000..d08de3255 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/BinarySearch.html @@ -0,0 +1,397 @@ + + + + + +BinarySearch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class BinarySearch

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.quantilescommon.BinarySearch
    • +
    +
  • +
+
+
    +
  • +
    +
    public final class BinarySearch
    +extends Object
    +
    Contains common equality binary search algorithms.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      BinarySearch() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static intfind​(double[] arr, + int low, + int high, + double v) +
      Binary Search for the index of the exact double value in the given search range.
      +
      static intfind​(float[] arr, + int low, + int high, + float v) +
      Binary Search for the index of the exact float value in the given search range.
      +
      static intfind​(long[] arr, + int low, + int high, + long v) +
      Binary Search for the index of the exact long value in the given search range.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        BinarySearch

        +
        public BinarySearch()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        find

        +
        public static int find​(float[] arr,
        +                       int low,
        +                       int high,
        +                       float v)
        +
        Binary Search for the index of the exact float value in the given search range. + If -1 is returned there are no values in the search range that equals the given value.
        +
        +
        Parameters:
        +
        arr - The given ordered array to search.
        +
        low - the index of the lowest value of the search range
        +
        high - the index of the highest value of the search range
        +
        v - the value to search for
        +
        Returns:
        +
        return the index of the value, if found, otherwise, return -1;
        +
        +
      • +
      + + + +
        +
      • +

        find

        +
        public static int find​(double[] arr,
        +                       int low,
        +                       int high,
        +                       double v)
        +
        Binary Search for the index of the exact double value in the given search range. + If -1 is returned there are no values in the search range that equals the given value.
        +
        +
        Parameters:
        +
        arr - The given ordered array to search.
        +
        low - the index of the lowest value of the search range
        +
        high - the index of the highest value of the search range
        +
        v - the value to search for
        +
        Returns:
        +
        return the index of the value, if found, otherwise, return -1;
        +
        +
      • +
      + + + +
        +
      • +

        find

        +
        public static int find​(long[] arr,
        +                       int low,
        +                       int high,
        +                       long v)
        +
        Binary Search for the index of the exact long value in the given search range. + If -1 is returned there are no values in the search range that equals the given value.
        +
        +
        Parameters:
        +
        arr - The given ordered array to search.
        +
        low - the index of the lowest value of the search range
        +
        high - the index of the highest value of the search range
        +
        v - the value to search for
        +
        Returns:
        +
        return the index of the value, if found, otherwise, return -1;
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/DoublesSortedView.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/DoublesSortedView.html new file mode 100644 index 000000000..fd98eca1e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/DoublesSortedView.html @@ -0,0 +1,531 @@ + + + + + +DoublesSortedView (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface DoublesSortedView

+
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and TypeMethodDescription
      default double[]getCDF​(double[] splitPoints, + QuantileSearchCriteria searchCrit) +
      Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints.
      +
      doublegetMaxItem() +
      Returns the maximum item of the stream.
      +
      doublegetMinItem() +
      Returns the minimum item of the stream.
      +
      default double[]getPMF​(double[] splitPoints, + QuantileSearchCriteria searchCrit) +
      Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints.
      +
      doublegetQuantile​(double rank, + QuantileSearchCriteria searchCrit) +
      Gets the approximate quantile of the given normalized rank and the given search criterion.
      +
      double[]getQuantiles() +
      Returns an array of all retained quantiles by the sketch.
      +
      doublegetRank​(double quantile, + QuantileSearchCriteria searchCrit) +
      Gets the normalized rank corresponding to the given a quantile.
      +
      DoublesSortedViewIteratoriterator() +
      Returns an iterator for this Sorted View.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getCDF

        +
        default double[] getCDF​(double[] splitPoints,
        +                        QuantileSearchCriteria searchCrit)
        +
        Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(false) function.

        +
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 overlapping intervals. + +

        The start of each interval is below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and the end of the interval + is the rank or cumulative probability corresponding to the split point.

        + +

        The (m+1)th interval represents 100% of the distribution represented by the sketch + and consistent with the definition of a cumulative probability distribution, thus the (m+1)th + rank or probability in the returned array is always 1.0.

        + +

        If a split point exactly equals a retained item of the sketch and the search criterion is:

        + +
          +
        • INCLUSIVE, the resulting cumulative probability will include that item.
        • +
        • EXCLUSIVE, the resulting cumulative probability will not include the weight of that split point.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getMaxItem

        +
        double getMaxItem()
        +
        Returns the maximum item of the stream. This may be distinct from the largest item retained by the + sketch algorithm.
        +
        +
        Returns:
        +
        the maximum item of the stream
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getMinItem

        +
        double getMinItem()
        +
        Returns the minimum item of the stream. This may be distinct from the smallest item retained by the + sketch algorithm.
        +
        +
        Returns:
        +
        the minimum item of the stream
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getPMF

        +
        default double[] getPMF​(double[] splitPoints,
        +                        QuantileSearchCriteria searchCrit)
        +
        Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(true) function.

        +
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 consecutive, non-overlapping intervals. + +

        Each interval except for the end intervals starts with a split point and ends with the next split + point in sequence.

        + +

        The first interval starts below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and ends with the first split point

        + +

        The last (m+1)th interval starts with the last split point and ends after the last + item retained by the sketch corresponding to a rank or probability of 1.0.

        + +

        The sum of the probability masses of all (m+1) intervals is 1.0.

        + +

        If the search criterion is:

        + +
          +
        • INCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will include that item. If the lower split point equals an item retained by the sketch, the interval will exclude + that item.
        • +
        • EXCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will exclude that item. If the lower split point equals an item retained by the sketch, the interval will include + that item.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        double getQuantile​(double rank,
        +                   QuantileSearchCriteria searchCrit)
        +
        Gets the approximate quantile of the given normalized rank and the given search criterion.
        +
        +
        Parameters:
        +
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        searchCrit - If INCLUSIVE, the given rank includes all quantiles ≤ + the quantile directly corresponding to the given rank. + If EXCLUSIVE, he given rank includes all quantiles < + the quantile directly corresponding to the given rank.
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantiles

        +
        double[] getQuantiles()
        +
        Returns an array of all retained quantiles by the sketch.
        +
        +
        Returns:
        +
        an array of all retained quantiles by the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getRank

        +
        double getRank​(double quantile,
        +               QuantileSearchCriteria searchCrit)
        +
        Gets the normalized rank corresponding to the given a quantile.
        +
        +
        Parameters:
        +
        quantile - the given quantile
        +
        searchCrit - if INCLUSIVE the given quantile is included into the rank.
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/DoublesSortedViewIterator.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/DoublesSortedViewIterator.html new file mode 100644 index 000000000..a127500b1 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/DoublesSortedViewIterator.html @@ -0,0 +1,349 @@ + + + + + +DoublesSortedViewIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class DoublesSortedViewIterator

+
+
+ +
+
    +
  • +
    +
    public final class DoublesSortedViewIterator
    +extends SortedViewIterator
    +
    Iterator over quantile sketches of primitive type double.
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DoublesSortedViewIterator

        +
        public DoublesSortedViewIterator​(double[] quantiles,
        +                                 long[] cumWeights)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getQuantile

        +
        public double getQuantile()
        +
        Gets the quantile at the current index. + +

        Don't call this before calling next() for the first time + or after getting false from next().

        +
        +
        Returns:
        +
        the quantile at the current index.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/FloatsSortedView.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/FloatsSortedView.html new file mode 100644 index 000000000..e140a0017 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/FloatsSortedView.html @@ -0,0 +1,531 @@ + + + + + +FloatsSortedView (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface FloatsSortedView

+
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and TypeMethodDescription
      default double[]getCDF​(float[] splitPoints, + QuantileSearchCriteria searchCrit) +
      Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints.
      +
      floatgetMaxItem() +
      Returns the maximum item of the stream.
      +
      floatgetMinItem() +
      Returns the minimum item of the stream.
      +
      default double[]getPMF​(float[] splitPoints, + QuantileSearchCriteria searchCrit) +
      Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints.
      +
      floatgetQuantile​(double rank, + QuantileSearchCriteria searchCrit) +
      Gets the approximate quantile of the given normalized rank and the given search criterion.
      +
      float[]getQuantiles() +
      Returns an array of all retained quantiles by the sketch.
      +
      doublegetRank​(float quantile, + QuantileSearchCriteria searchCrit) +
      Gets the normalized rank corresponding to the given a quantile.
      +
      FloatsSortedViewIteratoriterator() +
      Returns an iterator for this Sorted View.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getCDF

        +
        default double[] getCDF​(float[] splitPoints,
        +                        QuantileSearchCriteria searchCrit)
        +
        Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(false) function.

        +
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 overlapping intervals. + +

        The start of each interval is below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and the end of the interval + is the rank or cumulative probability corresponding to the split point.

        + +

        The (m+1)th interval represents 100% of the distribution represented by the sketch + and consistent with the definition of a cumulative probability distribution, thus the (m+1)th + rank or probability in the returned array is always 1.0.

        + +

        If a split point exactly equals a retained item of the sketch and the search criterion is:

        + +
          +
        • INCLUSIVE, the resulting cumulative probability will include that item.
        • +
        • EXCLUSIVE, the resulting cumulative probability will not include the weight of that split point.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getMaxItem

        +
        float getMaxItem()
        +
        Returns the maximum item of the stream. This may be distinct from the largest item retained by the + sketch algorithm.
        +
        +
        Returns:
        +
        the maximum item of the stream
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getMinItem

        +
        float getMinItem()
        +
        Returns the minimum item of the stream. This may be distinct from the smallest item retained by the + sketch algorithm.
        +
        +
        Returns:
        +
        the minimum item of the stream
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getPMF

        +
        default double[] getPMF​(float[] splitPoints,
        +                        QuantileSearchCriteria searchCrit)
        +
        Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(true) function.

        +
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 consecutive, non-overlapping intervals. + +

        Each interval except for the end intervals starts with a split point and ends with the next split + point in sequence.

        + +

        The first interval starts below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and ends with the first split point

        + +

        The last (m+1)th interval starts with the last split point and ends after the last + item retained by the sketch corresponding to a rank or probability of 1.0.

        + +

        The sum of the probability masses of all (m+1) intervals is 1.0.

        + +

        If the search criterion is:

        + +
          +
        • INCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will include that item. If the lower split point equals an item retained by the sketch, the interval will exclude + that item.
        • +
        • EXCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will exclude that item. If the lower split point equals an item retained by the sketch, the interval will include + that item.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        float getQuantile​(double rank,
        +                  QuantileSearchCriteria searchCrit)
        +
        Gets the approximate quantile of the given normalized rank and the given search criterion.
        +
        +
        Parameters:
        +
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        searchCrit - If INCLUSIVE, the given rank includes all quantiles ≤ + the quantile directly corresponding to the given rank. + If EXCLUSIVE, he given rank includes all quantiles < + the quantile directly corresponding to the given rank.
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantiles

        +
        float[] getQuantiles()
        +
        Returns an array of all retained quantiles by the sketch.
        +
        +
        Returns:
        +
        an array of all retained quantiles by the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getRank

        +
        double getRank​(float quantile,
        +               QuantileSearchCriteria searchCrit)
        +
        Gets the normalized rank corresponding to the given a quantile.
        +
        +
        Parameters:
        +
        quantile - the given quantile
        +
        searchCrit - if INCLUSIVE the given quantile is included into the rank.
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/FloatsSortedViewIterator.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/FloatsSortedViewIterator.html new file mode 100644 index 000000000..049c40436 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/FloatsSortedViewIterator.html @@ -0,0 +1,349 @@ + + + + + +FloatsSortedViewIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class FloatsSortedViewIterator

+
+
+ +
+
    +
  • +
    +
    public final class FloatsSortedViewIterator
    +extends SortedViewIterator
    +
    Iterator over quantile sketches of primitive type float.
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        FloatsSortedViewIterator

        +
        public FloatsSortedViewIterator​(float[] quantiles,
        +                                long[] cumWeights)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getQuantile

        +
        public float getQuantile()
        +
        Gets the quantile at the current index. + +

        Don't call this before calling next() for the first time + or after getting false from next().

        +
        +
        Returns:
        +
        the quantile at the current index.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/GenericInequalitySearch.Inequality.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/GenericInequalitySearch.Inequality.html new file mode 100644 index 000000000..96de9b7d7 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/GenericInequalitySearch.Inequality.html @@ -0,0 +1,492 @@ + + + + + +GenericInequalitySearch.Inequality (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum GenericInequalitySearch.Inequality

+
+
+ +
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Enum Constants 
      Enum ConstantDescription
      EQ +
      Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the adjacent pair of + values {A,B} such that A ≤ V ≤ B.
      +
      GE +
      Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the lowest adjacent pair of + values {A,B} such that A < V ≤ B.
      + Let low = index of the lowest value in the range.
      + Let high = index of the highest value in the range.
      +
      GT +
      Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the lowest adjacent pair of + values {A,B} such that A ≤ V < B.
      + Let low = index of the lowest value in the range.
      + Let high = index of the highest value in the range.
      +
      LE +
      Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the highest adjacent pair of + values {A,B} such that A ≤ V < B.
      + Let low = index of the lowest value in the range.
      + Let high = index of the highest value in the range.
      +
      LT +
      Given a sorted array of increasing values arr[] and a key value v, + this criterion instructs the binary search algorithm to find the highest adjacent pair of + values {A,B} such that A < v ≤ B.
      + Let low = index of the lowest value in the range.
      + Let high = index of the highest value in the range.
      +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        LT

        +
        public static final GenericInequalitySearch.Inequality LT
        +
        Given a sorted array of increasing values arr[] and a key value v, + this criterion instructs the binary search algorithm to find the highest adjacent pair of + values {A,B} such that A < v ≤ B.
        + Let low = index of the lowest value in the range.
        + Let high = index of the highest value in the range. + +

        If v > arr[high], return arr[high].
        + If v ≤ arr[low], return -1.
        + Else return index of A.

        +
      • +
      + + + +
        +
      • +

        LE

        +
        public static final GenericInequalitySearch.Inequality LE
        +
        Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the highest adjacent pair of + values {A,B} such that A ≤ V < B.
        + Let low = index of the lowest value in the range.
        + Let high = index of the highest value in the range. + +

        If v ≥ arr[high], return arr[high].
        + If v < arr[low], return -1.
        + Else return index of A.

        +
      • +
      + + + +
        +
      • +

        EQ

        +
        public static final GenericInequalitySearch.Inequality EQ
        +
        Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the adjacent pair of + values {A,B} such that A ≤ V ≤ B. + The returned value from the binary search algorithm will be the index of A or B, + if one of them is equal to V, or -1 if V is not equal to either one.
        +
      • +
      + + + +
        +
      • +

        GE

        +
        public static final GenericInequalitySearch.Inequality GE
        +
        Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the lowest adjacent pair of + values {A,B} such that A < V ≤ B.
        + Let low = index of the lowest value in the range.
        + Let high = index of the highest value in the range. + +

        If v ≤ arr[low], return arr[low].
        + If v > arr[high], return -1.
        + Else return index of B.

        +
      • +
      + + + +
        +
      • +

        GT

        +
        public static final GenericInequalitySearch.Inequality GT
        +
        Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the lowest adjacent pair of + values {A,B} such that A ≤ V < B.
        + Let low = index of the lowest value in the range.
        + Let high = index of the highest value in the range. + +

        If v < arr[low], return arr[low].
        + If v ≥ arr[high], return -1.
        + Else return index of B.

        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static GenericInequalitySearch.Inequality[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (GenericInequalitySearch.Inequality c : GenericInequalitySearch.Inequality.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static GenericInequalitySearch.Inequality valueOf​(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/GenericInequalitySearch.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/GenericInequalitySearch.html new file mode 100644 index 000000000..d50d98089 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/GenericInequalitySearch.html @@ -0,0 +1,388 @@ + + + + + +GenericInequalitySearch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class GenericInequalitySearch

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.quantilescommon.GenericInequalitySearch
    • +
    +
  • +
+
+
    +
  • +
    +
    public final class GenericInequalitySearch
    +extends Object
    +
    This provides efficient, unique and unambiguous binary searching for inequality comparison criteria + for ordered arrays of values that may include duplicate values. The inequality criteria include + <, ≤, ==, ≥, >. All the inequality criteria use the same search algorithm. + (Although == is not an inequality, it is included for convenience.) + +

    In order to make the searching unique and unambiguous, we modified the traditional binary + search algorithm to search for adjacent pairs of values {A, B} in the values array + instead of just a single value, where a and b are the array indices of two + adjacent values in the array. For all the search criteria, when the algorithm has narrowed the + search down to a single value or adjacent pair of values, the resolve() method provides the + final result of the search. If there is no valid value in the array that satisfies the search + criterion, the algorithm will return -1 to the caller.

    + +

    Given a sorted array of values arr[] and a search key value v, the algorithms for + the searching criteria are given with each enum criterion.

    +
    +
    Author:
    +
    Lee Rhodes
    +
    See Also:
    +
    + Sketching Quantiles and Ranks Tutorial
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GenericInequalitySearch

        +
        public GenericInequalitySearch()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        find

        +
        public static <T> int find​(T[] arr,
        +                           int low,
        +                           int high,
        +                           T v,
        +                           GenericInequalitySearch.Inequality crit,
        +                           Comparator<T> comparator)
        +
        Binary Search for the index of the generic value in the given search range that satisfies + the given Inequality criterion. + If -1 is returned there are no values in the search range that satisfy the inequality.
        +
        +
        Type Parameters:
        +
        T - The generic type of value to be used in the search process.
        +
        Parameters:
        +
        arr - the given array of comparable values that must be sorted. + The array must not be null or empty and the values of the array must not be null (or NaN) + in the range [low, high].
        +
        low - the lowest index of the lowest value in the search range, inclusive.
        +
        high - the highest index of the highest value in the search range, inclusive.
        +
        v - the value to search for. It must not be null (or NaN).
        +
        crit - one of the Inequality criteria: LT, LE, EQ, GE, GT. It must not be null.
        +
        comparator - for the type T. + It must not be null. It must return: -1 if A < B, 0 if A == B, and +1 if A > B.
        +
        Returns:
        +
        the index of the value in the given search range that satisfies the Inequality criterion.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/GenericPartitionBoundaries.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/GenericPartitionBoundaries.html new file mode 100644 index 000000000..e7e1fca8a --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/GenericPartitionBoundaries.html @@ -0,0 +1,555 @@ + + + + + +GenericPartitionBoundaries (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class GenericPartitionBoundaries<T>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.quantilescommon.GenericPartitionBoundaries<T>
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + + + +
        +
      • +

        GenericPartitionBoundaries

        +
        public GenericPartitionBoundaries​(long totalN,
        +                                  T[] boundaries,
        +                                  long[] natRanks,
        +                                  double[] normRanks,
        +                                  T maxItem,
        +                                  T minItem,
        +                                  QuantileSearchCriteria searchCrit)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getN

        +
        public long getN()
        +
        Description copied from interface: PartitionBoundaries
        +
        Gets the length of the input stream offered to the underlying sketch.
        +
        +
        Specified by:
        +
        getN in interface PartitionBoundaries
        +
        Returns:
        +
        the length of the input stream offered to the underlying sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getBoundaries

        +
        public T[] getBoundaries()
        +
        Gets an ordered array of boundaries that sequentially define the upper and lower boundaries of partitions. + These partitions are to be constructed by an external process. Each boundary is essentially a reference and + should uniquely identify an item or a set of identical items from the original stream of data fed to the + originating sketch. + +

        Assume boundaries array has size N + 1. Let the indicies be sequentially numbered from 0 to N. + The number of partitions is always one less than the size of the boundaries array. + Let the the partitions be sequentially numbered from 1 to N. + +

        If these results were computed using QuantileSearchCriteria.INCLUSIVE then these sequential boundaries + are to be interpreted as follows: +

          +
        • Partition 1: include all items ≥ index 0 and ≤ index 1.
        • +
        • Partition 2: include all items > index 1 and ≤ index 2.
        • +
        • Partition N: include all items > index N-1 and ≤ index N.
        • +
        + +

        If these results were computed using QuantileSearchCriteria.EXCLUSIVE then these sequential boundaries + are to be interpreted as follows: +

          +
        • Partition 1: include all items ≥ index 0 and < index 1.
        • +
        • Partition 2: include all items ≥ index 1 and < index 2.
        • +
        • Partition N: include all items ≥ index N-1 and ≤ index N.
        • +
        +
        +
        Returns:
        +
        an array of boundaries that sequentially define the upper and lower boundaries of partitions.
        +
        +
      • +
      + + + +
        +
      • +

        getNaturalRanks

        +
        public long[] getNaturalRanks()
        +
        Description copied from interface: PartitionBoundaries
        +
        Gets an ordered array of natural ranks of the associated array of partition boundaries utilizing + a specified search criterion. Natural ranks are integral values on the interval [1, N]
        +
        +
        Specified by:
        +
        getNaturalRanks in interface PartitionBoundaries
        +
        Returns:
        +
        an array of natural ranks.
        +
        +
      • +
      + + + +
        +
      • +

        getNormalizedRanks

        +
        public double[] getNormalizedRanks()
        +
        Description copied from interface: PartitionBoundaries
        +
        Gets an ordered array of normalized ranks of the associated array of partition boundaries utilizing + a specified search criterion. Normalized ranks are double values on the interval [0.0, 1.0].
        +
        +
        Specified by:
        +
        getNormalizedRanks in interface PartitionBoundaries
        +
        Returns:
        +
        an array of normalized ranks.
        +
        +
      • +
      + + + +
        +
      • +

        getNumDeltaItems

        +
        public long[] getNumDeltaItems()
        +
        Description copied from interface: PartitionBoundaries
        +
        Gets the number of items to be included for each partition as an array. + The count at index 0 is 0. The number of items included in the first partition, defined by the boundaries at + index 0 and index 1, is at index 1 in this array, etc.
        +
        +
        Specified by:
        +
        getNumDeltaItems in interface PartitionBoundaries
        +
        Returns:
        +
        the number of items to be included for each partition as an array.
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getMaxItem

        +
        public T getMaxItem()
        +
        Returns the maximum item of the stream. This may be distinct from the largest item retained by the + sketch algorithm.
        +
        +
        Returns:
        +
        the maximum item of the stream
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getMinItem

        +
        public T getMinItem()
        +
        Returns the minimum item of the stream. This may be distinct from the smallest item retained by the + sketch algorithm.
        +
        +
        Returns:
        +
        the minimum item of the stream
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/GenericSortedView.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/GenericSortedView.html new file mode 100644 index 000000000..cd78a169e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/GenericSortedView.html @@ -0,0 +1,572 @@ + + + + + +GenericSortedView (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface GenericSortedView<T>

+
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and TypeMethodDescription
      double[]getCDF​(T[] splitPoints, + QuantileSearchCriteria searchCrit) +
      Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints.
      +
      TgetMaxItem() +
      Returns the maximum item of the stream.
      +
      TgetMinItem() +
      Returns the minimum item of the stream.
      +
      double[]getPMF​(T[] splitPoints, + QuantileSearchCriteria searchCrit) +
      Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints.
      +
      TgetQuantile​(double rank, + QuantileSearchCriteria searchCrit) +
      Gets the approximate quantile of the given normalized rank and the given search criterion.
      +
      T[]getQuantiles() +
      Returns the full array of quantiles.
      +
      doublegetRank​(T quantile, + QuantileSearchCriteria searchCrit) +
      Gets the normalized rank corresponding to the given a quantile.
      +
      GenericSortedViewIterator<T>iterator() +
      Returns an iterator for this Sorted View.
      +
      static <T> voidvalidateItems​(T[] items, + Comparator<? super T> comparator) +
      Checks the sequential validity of the given array of generic items.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        getCDF

        +
        double[] getCDF​(T[] splitPoints,
        +                QuantileSearchCriteria searchCrit)
        +
        Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints. + +

        If the sketch is empty this returns null.

        + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(false) function.

        +
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 overlapping intervals. + +

        The start of each interval is below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and the end of the interval + is the rank or cumulative probability corresponding to the split point.

        + +

        The (m+1)th interval represents 100% of the distribution represented by the sketch + and consistent with the definition of a cumulative probability distribution, thus the (m+1)th + rank or probability in the returned array is always 1.0.

        + +

        If a split point exactly equals a retained item of the sketch and the search criterion is:

        + +
          +
        • INCLUSIVE, the resulting cumulative probability will include that item.
        • +
        • EXCLUSIVE, the resulting cumulative probability will not include the weight of that split point.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getMaxItem

        +
        T getMaxItem()
        +
        Returns the maximum item of the stream. This may be distinct from the largest item retained by the + sketch algorithm.
        +
        +
        Returns:
        +
        the maximum item of the stream
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getMinItem

        +
        T getMinItem()
        +
        Returns the minimum item of the stream. This may be distinct from the smallest item retained by the + sketch algorithm.
        +
        +
        Returns:
        +
        the minimum item of the stream
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + + + +
        +
      • +

        getPMF

        +
        double[] getPMF​(T[] splitPoints,
        +                QuantileSearchCriteria searchCrit)
        +
        Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(true) function.

        +
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 consecutive, non-overlapping intervals. + +

        Each interval except for the end intervals starts with a split point and ends with the next split + point in sequence.

        + +

        The first interval starts below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and ends with the first split point

        + +

        The last (m+1)th interval starts with the last split point and ends after the last + item retained by the sketch corresponding to a rank or probability of 1.0.

        + +

        The sum of the probability masses of all (m+1) intervals is 1.0.

        + +

        If the search criterion is:

        + +
          +
        • INCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will include that item. If the lower split point equals an item retained by the sketch, the interval will exclude + that item.
        • +
        • EXCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will exclude that item. If the lower split point equals an item retained by the sketch, the interval will include + that item.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        T getQuantile​(double rank,
        +              QuantileSearchCriteria searchCrit)
        +
        Gets the approximate quantile of the given normalized rank and the given search criterion.
        +
        +
        Parameters:
        +
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        searchCrit - If INCLUSIVE, the given rank includes all quantiles ≤ + the quantile directly corresponding to the given rank. + If EXCLUSIVE, he given rank includes all quantiles < + the quantile directly corresponding to the given rank.
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantiles

        +
        T[] getQuantiles()
        +
        Returns the full array of quantiles.
        +
        +
        Returns:
        +
        the full array of quantiles.
        +
        +
      • +
      + + + + + +
        +
      • +

        getRank

        +
        double getRank​(T quantile,
        +               QuantileSearchCriteria searchCrit)
        +
        Gets the normalized rank corresponding to the given a quantile.
        +
        +
        Parameters:
        +
        quantile - the given quantile
        +
        searchCrit - if INCLUSIVE the given quantile is included into the rank.
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + + + + + + + +
        +
      • +

        validateItems

        +
        static <T> void validateItems​(T[] items,
        +                              Comparator<? super T> comparator)
        +
        Checks the sequential validity of the given array of generic items. + They must be unique, monotonically increasing and not null.
        +
        +
        Type Parameters:
        +
        T - the data type
        +
        Parameters:
        +
        items - given array of generic items
        +
        comparator - the comparator for generic item data type T
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/GenericSortedViewIterator.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/GenericSortedViewIterator.html new file mode 100644 index 000000000..3f174f7c3 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/GenericSortedViewIterator.html @@ -0,0 +1,355 @@ + + + + + +GenericSortedViewIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class GenericSortedViewIterator<T>

+
+
+ +
+
    +
  • +
    +
    Type Parameters:
    +
    T - The generic quantile type
    +
    +
    +
    public class GenericSortedViewIterator<T>
    +extends SortedViewIterator
    +
    Iterator over quantile sketches of generic type.
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + + + +
        +
      • +

        GenericSortedViewIterator

        +
        public GenericSortedViewIterator​(T[] quantiles,
        +                                 long[] cumWeights)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getQuantile

        +
        public T getQuantile()
        +
        Gets the quantile at the current index. + +

        Don't call this before calling next() for the first time + or after getting false from next().

        +
        +
        Returns:
        +
        the quantile at the current index.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/InequalitySearch.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/InequalitySearch.html new file mode 100644 index 000000000..accbaf307 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/InequalitySearch.html @@ -0,0 +1,807 @@ + + + + + +InequalitySearch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum InequalitySearch

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Serializable, Comparable<InequalitySearch>
    +
    +
    +
    public enum InequalitySearch
    +extends Enum<InequalitySearch>
    +
    This provides efficient, unique and unambiguous binary searching for inequality comparison criteria + for ordered arrays of values that may include duplicate values. The inequality criteria include + <, ≤, ==, ≥, >. All the inequality criteria use the same search algorithm. + (Although == is not an inequality, it is included for convenience.) + +

    In order to make the searching unique and unambiguous, we modified the traditional binary + search algorithm to search for adjacent pairs of values {A, B} in the values array + instead of just a single value, where a and b are the array indices of two + adjacent values in the array. For all the search criteria, when the algorithm has narrowed the + search down to a single value or adjacent pair of values, the resolve() method provides the + final result of the search. If there is no valid value in the array that satisfies the search + criterion, the algorithm will return -1 to the caller.

    + +

    Given a sorted array of values arr[] and a search key value v, the algorithms for + the searching criteria are given with each enum criterion.

    +
    +
    Author:
    +
    Lee Rhodes
    +
    See Also:
    +
    + Sketching Quantiles and Ranks Tutorial
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Enum Constants 
      Enum ConstantDescription
      EQ +
      Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the adjacent pair of + values {A,B} such that A ≤ V ≤ B.
      +
      GE +
      Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the lowest adjacent pair of + values {A,B} such that A < V ≤ B.
      + Let low = index of the lowest value in the range.
      + Let high = index of the highest value in the range.
      +
      GT +
      Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the lowest adjacent pair of + values {A,B} such that A ≤ V < B.
      + Let low = index of the lowest value in the range.
      + Let high = index of the highest value in the range.
      +
      LE +
      Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the highest adjacent pair of + values {A,B} such that A ≤ V < B.
      + Let low = index of the lowest value in the range.
      + Let high = index of the highest value in the range.
      +
      LT +
      Given a sorted array of increasing values arr[] and a key value v, + this criterion instructs the binary search algorithm to find the highest adjacent pair of + values {A,B} such that A < v ≤ B.
      + Let low = index of the lowest value in the range.
      + Let high = index of the highest value in the range.
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and TypeMethodDescription
      abstract Stringdesc​(double[] arr, + int low, + int high, + double v, + int idx) +
      Optional call that describes the details of the results of the search.
      +
      abstract Stringdesc​(float[] arr, + int low, + int high, + float v, + int idx) +
      Optional call that describes the details of the results of the search.
      +
      abstract Stringdesc​(long[] arr, + int low, + int high, + double v, + int idx) +
      Optional call that describes the details of the results of the search.
      +
      abstract Stringdesc​(long[] arr, + int low, + int high, + long v, + int idx) +
      Optional call that describes the details of the results of the search.
      +
      static intfind​(double[] arr, + int low, + int high, + double v, + InequalitySearch crit) +
      Binary Search for the index of the double value in the given search range that satisfies + the given InequalitySearch criterion.
      +
      static intfind​(float[] arr, + int low, + int high, + float v, + InequalitySearch crit) +
      Binary Search for the index of the float value in the given search range that satisfies + the given InequalitySearch criterion.
      +
      static intfind​(long[] arr, + int low, + int high, + double v, + InequalitySearch crit) +
      Binary Search for the index of the double value in the given search range that satisfies + the given InequalitySearch criterion.
      +
      static intfind​(long[] arr, + int low, + int high, + long v, + InequalitySearch crit) +
      Binary Search for the index of the long value in the given search range that satisfies + the given InequalitySearch criterion.
      +
      static InequalitySearchvalueOf​(String name) +
      Returns the enum constant of this type with the specified name.
      +
      static InequalitySearch[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      + + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        LT

        +
        public static final InequalitySearch LT
        +
        Given a sorted array of increasing values arr[] and a key value v, + this criterion instructs the binary search algorithm to find the highest adjacent pair of + values {A,B} such that A < v ≤ B.
        + Let low = index of the lowest value in the range.
        + Let high = index of the highest value in the range. + +

        If v > arr[high], return arr[high].
        + If v ≤ arr[low], return -1.
        + Else return index of A.

        +
      • +
      + + + +
        +
      • +

        LE

        +
        public static final InequalitySearch LE
        +
        Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the highest adjacent pair of + values {A,B} such that A ≤ V < B.
        + Let low = index of the lowest value in the range.
        + Let high = index of the highest value in the range. + +

        If v ≥ arr[high], return arr[high].
        + If v < arr[low], return -1.
        + Else return index of A.

        +
      • +
      + + + +
        +
      • +

        EQ

        +
        public static final InequalitySearch EQ
        +
        Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the adjacent pair of + values {A,B} such that A ≤ V ≤ B. + The returned value from the binary search algorithm will be the index of A or B, + if one of them is equal to V, or -1 if V is not equal to either one.
        +
      • +
      + + + +
        +
      • +

        GE

        +
        public static final InequalitySearch GE
        +
        Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the lowest adjacent pair of + values {A,B} such that A < V ≤ B.
        + Let low = index of the lowest value in the range.
        + Let high = index of the highest value in the range. + +

        If v ≤ arr[low], return arr[low].
        + If v > arr[high], return -1.
        + Else return index of B.

        +
      • +
      + + + +
        +
      • +

        GT

        +
        public static final InequalitySearch GT
        +
        Given a sorted array of increasing values arr[] and a key value V, + this criterion instructs the binary search algorithm to find the lowest adjacent pair of + values {A,B} such that A ≤ V < B.
        + Let low = index of the lowest value in the range.
        + Let high = index of the highest value in the range. + +

        If v < arr[low], return arr[low].
        + If v ≥ arr[high], return -1.
        + Else return index of B.

        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static InequalitySearch[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (InequalitySearch c : InequalitySearch.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static InequalitySearch valueOf​(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        desc

        +
        public abstract String desc​(double[] arr,
        +                            int low,
        +                            int high,
        +                            double v,
        +                            int idx)
        +
        Optional call that describes the details of the results of the search. + Used primarily for debugging.
        +
        +
        Parameters:
        +
        arr - The underlying sorted array of values
        +
        low - the low index of the range
        +
        high - the high index of the range
        +
        v - the value to search for
        +
        idx - the resolved index from the search
        +
        Returns:
        +
        the descriptive string.
        +
        +
      • +
      + + + +
        +
      • +

        desc

        +
        public abstract String desc​(float[] arr,
        +                            int low,
        +                            int high,
        +                            float v,
        +                            int idx)
        +
        Optional call that describes the details of the results of the search. + Used primarily for debugging.
        +
        +
        Parameters:
        +
        arr - The underlying sorted array of values
        +
        low - the low index of the range
        +
        high - the high index of the range
        +
        v - the value to search for
        +
        idx - the resolved index from the search
        +
        Returns:
        +
        the descriptive string.
        +
        +
      • +
      + + + +
        +
      • +

        desc

        +
        public abstract String desc​(long[] arr,
        +                            int low,
        +                            int high,
        +                            long v,
        +                            int idx)
        +
        Optional call that describes the details of the results of the search. + Used primarily for debugging.
        +
        +
        Parameters:
        +
        arr - The underlying sorted array of values
        +
        low - the low index of the range
        +
        high - the high index of the range
        +
        v - the value to search for
        +
        idx - the resolved index from the search
        +
        Returns:
        +
        the descriptive string.
        +
        +
      • +
      + + + +
        +
      • +

        desc

        +
        public abstract String desc​(long[] arr,
        +                            int low,
        +                            int high,
        +                            double v,
        +                            int idx)
        +
        Optional call that describes the details of the results of the search. + Used primarily for debugging.
        +
        +
        Parameters:
        +
        arr - The underlying sorted array of values
        +
        low - the low index of the range
        +
        high - the high index of the range
        +
        v - the value to search for
        +
        idx - the resolved index from the search
        +
        Returns:
        +
        the descriptive string.
        +
        +
      • +
      + + + +
        +
      • +

        find

        +
        public static int find​(double[] arr,
        +                       int low,
        +                       int high,
        +                       double v,
        +                       InequalitySearch crit)
        +
        Binary Search for the index of the double value in the given search range that satisfies + the given InequalitySearch criterion. + If -1 is returned there are no values in the search range that satisfy the criterion.
        +
        +
        Parameters:
        +
        arr - the given array of comparable values that must be sorted with increasing values. + The array must not be null and the values of the array must not be NaN in the range [low, high].
        +
        low - the lowest index of the lowest value in the search range, inclusive.
        +
        high - the highest index of the highest value in the search range, inclusive.
        +
        v - the value to search for. It must not be NaN.
        +
        crit - one of the InequalitySearch criteria: LT, LE, EQ, GT, GE. It must not be null.
        +
        Returns:
        +
        the index of the value in the given search range that satisfies the InequalitySearch criterion
        +
        +
      • +
      + + + +
        +
      • +

        find

        +
        public static int find​(float[] arr,
        +                       int low,
        +                       int high,
        +                       float v,
        +                       InequalitySearch crit)
        +
        Binary Search for the index of the float value in the given search range that satisfies + the given InequalitySearch criterion. + If -1 is returned there are no values in the search range that satisfy the criterion.
        +
        +
        Parameters:
        +
        arr - the given array that must be sorted. + It must not be null and must not contain any NaN values in the range {low, high} inclusive.
        +
        low - the lowest index of the lowest value in the search range, inclusive.
        +
        high - the highest index of the highest value in the search range, inclusive.
        +
        v - the value to search for. It must not be NaN.
        +
        crit - one of LT, LE, EQ, GT, GE
        +
        Returns:
        +
        the index of the value in the given search range that satisfies the criterion
        +
        +
      • +
      + + + +
        +
      • +

        find

        +
        public static int find​(long[] arr,
        +                       int low,
        +                       int high,
        +                       long v,
        +                       InequalitySearch crit)
        +
        Binary Search for the index of the long value in the given search range that satisfies + the given InequalitySearch criterion. + If -1 is returned there are no values in the search range that satisfy the criterion.
        +
        +
        Parameters:
        +
        arr - the given array that must be sorted.
        +
        low - the lowest index of the lowest value in the search range, inclusive.
        +
        high - the highest index of the highest value in the search range, inclusive.
        +
        v - the value to search for.
        +
        crit - one of LT, LE, EQ, GT, GE
        +
        Returns:
        +
        the index of the value in the given search range that satisfies the criterion
        +
        +
      • +
      + + + +
        +
      • +

        find

        +
        public static int find​(long[] arr,
        +                       int low,
        +                       int high,
        +                       double v,
        +                       InequalitySearch crit)
        +
        Binary Search for the index of the double value in the given search range that satisfies + the given InequalitySearch criterion. + If -1 is returned there are no values in the search range that satisfy the criterion.
        +
        +
        Parameters:
        +
        arr - the given array that must be sorted.
        +
        low - the lowest index of the lowest value in the search range, inclusive.
        +
        high - the highest index of the highest value in the search range, inclusive.
        +
        v - the value to search for.
        +
        crit - one of LT, LE, EQ, GT, GE
        +
        Returns:
        +
        the index of the value in the given search range that satisfies the criterion
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/PartitionBoundaries.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/PartitionBoundaries.html new file mode 100644 index 000000000..d56c1dc54 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/PartitionBoundaries.html @@ -0,0 +1,375 @@ + + + + + +PartitionBoundaries (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface PartitionBoundaries

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    GenericPartitionBoundaries
    +
    +
    +
    public interface PartitionBoundaries
    +
    This defines a set of results computed from the getParitionBoundaries() function and + encapsulates the basic methods needed to construct actual partitions based on generic items.
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethodDescription
      longgetN() +
      Gets the length of the input stream offered to the underlying sketch.
      +
      long[]getNaturalRanks() +
      Gets an ordered array of natural ranks of the associated array of partition boundaries utilizing + a specified search criterion.
      +
      double[]getNormalizedRanks() +
      Gets an ordered array of normalized ranks of the associated array of partition boundaries utilizing + a specified search criterion.
      +
      long[]getNumDeltaItems() +
      Gets the number of items to be included for each partition as an array.
      +
      intgetNumPartitions() +
      Gets the number of partitions
      +
      QuantileSearchCriteriagetSearchCriteria() +
      Gets the search criteria specified for the source sketch
      +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getN

        +
        long getN()
        +
        Gets the length of the input stream offered to the underlying sketch.
        +
        +
        Returns:
        +
        the length of the input stream offered to the underlying sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getNaturalRanks

        +
        long[] getNaturalRanks()
        +
        Gets an ordered array of natural ranks of the associated array of partition boundaries utilizing + a specified search criterion. Natural ranks are integral values on the interval [1, N]
        +
        +
        Returns:
        +
        an array of natural ranks.
        +
        +
      • +
      + + + +
        +
      • +

        getNormalizedRanks

        +
        double[] getNormalizedRanks()
        +
        Gets an ordered array of normalized ranks of the associated array of partition boundaries utilizing + a specified search criterion. Normalized ranks are double values on the interval [0.0, 1.0].
        +
        +
        Returns:
        +
        an array of normalized ranks.
        +
        +
      • +
      + + + +
        +
      • +

        getNumDeltaItems

        +
        long[] getNumDeltaItems()
        +
        Gets the number of items to be included for each partition as an array. + The count at index 0 is 0. The number of items included in the first partition, defined by the boundaries at + index 0 and index 1, is at index 1 in this array, etc.
        +
        +
        Returns:
        +
        the number of items to be included for each partition as an array.
        +
        +
      • +
      + + + +
        +
      • +

        getNumPartitions

        +
        int getNumPartitions()
        +
        Gets the number of partitions
        +
        +
        Returns:
        +
        the number of partitions
        +
        +
      • +
      + + + +
        +
      • +

        getSearchCriteria

        +
        QuantileSearchCriteria getSearchCriteria()
        +
        Gets the search criteria specified for the source sketch
        +
        +
        Returns:
        +
        The search criteria specified for the source sketch
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/PartitioningFeature.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/PartitioningFeature.html new file mode 100644 index 000000000..38ce01767 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/PartitioningFeature.html @@ -0,0 +1,332 @@ + + + + + +PartitioningFeature (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface PartitioningFeature<T>

+
+
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        getPartitionBoundaries

        +
        GenericPartitionBoundaries<T> getPartitionBoundaries​(int numEquallySized,
        +                                                     QuantileSearchCriteria searchCrit)
        +
        This method returns an instance of + GenericPartitionBoundaries which provides + sufficient information for the user to create the given number of equally sized partitions, where "equally sized" + refers to an approximately equal number of items per partition.
        +
        +
        Parameters:
        +
        numEquallySized - an integer that specifies the number of equally sized partitions between + getMinItem() and + getMaxItem(). + This must be a positive integer greater than zero. +
          +
        • A 1 will return: minItem, maxItem.
        • +
        • A 2 will return: minItem, median quantile, maxItem.
        • +
        • Etc.
        • +
        +
        searchCrit - If INCLUSIVE, all the returned quantiles are the upper boundaries of the equally sized partitions + with the exception of the lowest returned quantile, which is the lowest boundary of the lowest ranked partition. + If EXCLUSIVE, all the returned quantiles are the lower boundaries of the equally sized partitions + with the exception of the highest returned quantile, which is the upper boundary of the highest ranked partition.
        +
        Returns:
        +
        an instance of GenericPartitionBoundaries.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        IllegalArgumentException - if numEquallySized is less than 1.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantileSearchCriteria.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantileSearchCriteria.html new file mode 100644 index 000000000..70080ff0b --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantileSearchCriteria.html @@ -0,0 +1,415 @@ + + + + + +QuantileSearchCriteria (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum QuantileSearchCriteria

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        INCLUSIVE

        +
        public static final QuantileSearchCriteria INCLUSIVE
        +
        Definition of INCLUSIVE getQuantile(r) search:
        + Given rank r, return the quantile of the smallest rank that is + strictly greater than or equal to r. + +

        Definition of INCLUSIVE getRank(q) search:
        + Given quantile q, return the rank, r, of the largest quantile that is + less than or equal to q.

        +
      • +
      + + + +
        +
      • +

        EXCLUSIVE

        +
        public static final QuantileSearchCriteria EXCLUSIVE
        +
        Definition of EXCLUSIVE getQuantile(r) search:
        + Given rank r, return the quantile of the smallest rank that is + strictly greater than r. + +

        However, if the given rank is is equal to 1.0, or there is no quantile that satisfies this criterion + the method will return a NaN or null.

        + +

        Definition of EXCLUSIVE getRank(q) search:
        + Given quantile q, return the rank, r, of the largest quantile that is + strictly less than q.

        + +

        If there is no quantile value that is strictly less than q, + the method will return a rank of zero.

        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static QuantileSearchCriteria[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (QuantileSearchCriteria c : QuantileSearchCriteria.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static QuantileSearchCriteria valueOf​(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesAPI.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesAPI.html new file mode 100644 index 000000000..f736570fd --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesAPI.html @@ -0,0 +1,810 @@ + + + + + +QuantilesAPI (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface QuantilesAPI

+
+
+
+
    +
  • +
    +
    All Known Subinterfaces:
    +
    QuantilesDoublesAPI, QuantilesFloatsAPI, QuantilesGenericAPI<T>
    +
    +
    +
    All Known Implementing Classes:
    +
    CompactDoublesSketch, DoublesSketch, ItemsSketch, KllDoublesSketch, KllFloatsSketch, KllItemsSketch, KllSketch, ReqSketch, UpdateDoublesSketch
    +
    +
    +
    public interface QuantilesAPI
    +

    This is a stochastic streaming sketch that enables near-real time analysis of the + approximate distribution of items from a very large stream in a single pass, requiring only + that the items are comparable. + The analysis is obtained using the getQuantile() function or the + inverse functions getRank(), getPMF() (the Probability Mass Function), and getCDF() + (the Cumulative Distribution Function).

    + +

    Given an input stream of N items, the natural rank of any specific + item is defined as its index (1 to N) in the hypothetical sorted stream of all + N input items.

    + +

    The normalized rank (rank) of any specific item is defined as its + natural rank divided by N, which is a number in the interval [0.0, 1.0]. + In the Javadocs for all the quantile sketches natural rank is seldom used + so any reference to just rank should be interpreted as normalized rank.

    + +

    Inputs into a quantile sketch are called "items" that can be either generic or specific + primitives, like float or double depending on the sketch implementation. + In order to keep its size small, sketches don't retain all the items offered and retain only + a small fraction of all the items, thus purging most of the items. The items retained are + then sorted and associated with a rank. At this point we call the retained items quantiles. + Thus, all quantiles are items, but only a few items become quantiles. Depending on the context + the two terms can be interchangeable.

    + +

    All quantile sketches are configured with a parameter k, which affects the size of + the sketch and its estimation error.

    + +

    In the research literature, the estimation error is commonly called epsilon + (or eps) and is a fraction between zero and one. + Larger sizes of k result in a smaller epsilon, but also a larger sketch. + The epsilon error is always with respect to the rank domain. Estimating the confidence interval + in the quantile domain can be done by first computing the error in the rank domain and then + translating that to the quantile domain. The sketch provides methods to assist with that.

    + +

    The relationship between the normalized rank and the corresponding quantiles can be viewed + as a two dimensional monotonic plot with the normalized rank on one axis and the + corresponding quantiles on the other axis. Let q := quantile and r := rank then both + q = getQuantile(r) and r = getRank(q) are monotonically increasing functions. + If the y-axis is used for the rank domain and the x-axis for the quantile domain, + then y = getRank(x) is also the single point Cumulative Distribution Function (CDF).

    + +

    The functions getQuantile() translate ranks into corresponding quantiles. + The functions getRank(), getCDF(), and getPMF() (Probability Mass Function) + perform the opposite operation and translate quantiles into ranks (or cumulative probabilities, + or probability masses, depending on the context).

    + +

    As an example, consider a large stream of one million items such as packet sizes coming into a network node. + The absolute rank of any specific item size is simply its index in the hypothetical sorted + array of such items. + The normalized rank is the natural rank divided by the stream size, or N, + in this case one million. + The quantile corresponding to the normalized rank of 0.5 represents the 50th percentile or median + of the distribution, obtained from getQuantile(0.5). Similarly, the 95th percentile is obtained from + getQuantile(0.95).

    + +

    From the min and max quantiles, for example, say 1 and 1000 bytes, + you can obtain the PMF from getPMF(100, 500, 900) that will result in an array of + 4 probability masses such as {.4, .3, .2, .1}, which means that +

      +
    • 40% of the mass was < 100,
    • +
    • 30% of the mass was ≥ 100 and < 500,
    • +
    • 20% of the mass was ≥ 500 and < 900, and
    • +
    • 10% of the mass was ≥ 900.
    • +
    + A frequency histogram can be obtained by simply multiplying these probability masses by getN(), + which is the total count of items received. + The getCDF() works similarly, but produces the cumulative distribution instead. + +

    The accuracy of this sketch is a function of the configured k, which also affects + the overall size of the sketch. Accuracy of this quantile sketch is always with respect to + the normalized rank. + +

    The getPMF() function has about 13 to 47% worse rank error (depending + on k) than the other queries because the mass of each "bin" of the PMF has + "double-sided" error from the upper and lower edges of the bin as a result of a subtraction + of random variables where the errors from the two edges can sometimes add.

    + +

    A getQuantile(rank) query has the following probabilistic guarantees:

    +
      +
    • Let q = getQuantile(r) where r is the rank between zero and one.
    • +
    • The quantile q will be a quantile from the input stream.
    • +
    • Let trueRank be the true rank of q derived from the hypothetical sorted + stream of all N quantiles.
    • +
    • Let eps = getNormalizedRankError(false)[*].
    • +
    • Then r - eps ≤ trueRank ≤ r + eps. + Note that the error is on the rank, not the quantile.
    • +
    + +

    A getRank(quantile) query has the following probabilistic guarantees:

    +
      +
    • Let r = getRank(q) where q is a quantile between the min and max quantiles of + the input stream.
    • +
    • Let trueRank be the true rank of q derived from the hypothetical sorted + stream of all N quantiles.
    • +
    • Let eps = getNormalizedRankError(false)[*].
    • +
    • Then r - eps ≤ trueRank ≤ r + eps.
    • +
    + +

    A getPMF() query has the following probabilistic guarantees:

    +
      +
    • Let {r1, r2, ..., rm+1} + = getPMF(v1, v2, ..., vm) where + q1, q2, ..., qm are monotonically increasing quantiles + supplied by the user that are part of the monotonic sequence + q0 = min, q1, q2, ..., qm, qm+1 = max, + and where min and max are the actual minimum and maximum quantiles of the input + stream automatically included in the sequence by the getPMF(...) function. + +
    • Let ri = massi = estimated mass between + vi-1 and qi where q0 = min + and qm+1 = max.
    • + +
    • Let trueMass be the true mass between the quantiles of qi, + qi+1 derived from the hypothetical sorted stream of all N quantiles.
    • +
    • Let eps = getNormalizedRankError(true)[*].
    • +
    • Then mass - eps ≤ trueMass ≤ mass + eps.
    • +
    • r1 includes the mass of all points between min = q0 and + q1.
    • +
    • rm+1 includes the mass of all points between qm and + max = qm+1.
    • +
    + +

    A getCDF(...) query has the following probabilistic guarantees:

    +
      +
    • Let {r1, r2, ..., rm+1} + = getCDF(q1, q2, ..., qm) where + q1, q2, ..., qm) are monotonically increasing quantiles + supplied by the user that are part of the monotonic sequence + {q0 = min, q1, q2, ..., qm, qm+1 = max}, + and where min and max are the actual minimum and maximum quantiles of the input + stream automatically included in the sequence by the getCDF(...) function. + +
    • Let ri = massi = estimated mass between + q0 = min and qi.
    • + +
    • Let trueMass be the true mass between the true ranks of qi, + qi+1 derived from the hypothetical sorted stream of all N quantiles.
    • +
    • Let eps = getNormalizedRankError(true)[*].
    • +
    • then mass - eps ≤ trueMass ≤ mass + eps.
    • +
    • r1 includes the mass of all points between min = q0 and + q1.
    • +
    • rm+1 includes the mass of all points between min = q0 and + max = qm+1.
    • +
    + +

    Because errors are independent, we can make some estimates of the size of the confidence bounds + for the quantile returned from a call to getQuantile(), but not error bounds. + These confidence bounds may be quite large for certain distributions.

    + +
      +
    • Let q = getQuantile(r), the estimated quantile of rank r.
    • +
    • Let eps = getNormalizedRankError(false)[*].
    • +
    • Let qlo = estimated quantile of rank (r - eps).
    • +
    • Let qhi = estimated quantile of rank (r + eps).
    • +
    • Then qlo ≤ q ≤ qhi.
    • +
    + +

    This sketch is order and distribution insensitive

    + +

    This algorithm intentionally inserts randomness into the sampling process for items that + ultimately get retained in the sketch. Thus, the results produced by this algorithm are not + deterministic. For example, if the same stream is inserted into two different instances of this + sketch, the answers obtained from the two sketches should be close, but may not be be identical.

    + +

    Similarly, there may be directional inconsistencies. For example, if a quantile obtained + from getQuantile(rank) is input into the reverse query + getRank(quantile), the resulting rank should be close, but may not exactly equal the original rank.

    + +

    Please visit our website: DataSketches Home Page + and specific Javadocs for more information.

    + +

    [*] Note that obtaining epsilon may require using a similar function but with more parameters + based on the specific sketch implementation.

    +
    +
    Author:
    +
    Lee Rhodes, Kevin Lang, Alexander Saydakov
    +
    See Also:
    +
    + Sketching Quantiles and Ranks, Tutorial, +QuantileSearchCriteria
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethodDescription
      intgetK() +
      Gets the user configured parameter k, which controls the accuracy of the sketch + and its memory space usage.
      +
      longgetN() +
      Gets the length of the input stream offered to the sketch..
      +
      intgetNumRetained() +
      Gets the number of quantiles retained by the sketch.
      +
      doublegetRankLowerBound​(double rank) +
      Gets the lower bound of the rank confidence interval in which the true rank of the + given rank exists.
      +
      doublegetRankUpperBound​(double rank) +
      Gets the upper bound of the rank confidence interval in which the true rank of the + given rank exists.
      +
      booleanhasMemory() +
      Returns true if this sketch's data structure is backed by Memory or WritableMemory.
      +
      booleanisDirect() +
      Returns true if this sketch's data structure is off-heap (a.k.a., Direct or Native memory).
      +
      booleanisEmpty() +
      Returns true if this sketch is empty.
      +
      booleanisEstimationMode() +
      Returns true if this sketch is in estimation mode.
      +
      booleanisReadOnly() +
      Returns true if this sketch is read only.
      +
      voidreset() +
      Resets this sketch to the empty state.
      +
      StringtoString() +
      Returns a summary of the key parameters of the sketch.
      +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getK

        +
        int getK()
        +
        Gets the user configured parameter k, which controls the accuracy of the sketch + and its memory space usage.
        +
        +
        Returns:
        +
        the user configured parameter k, which controls the accuracy of the sketch + and its memory space usage.
        +
        +
      • +
      + + + +
        +
      • +

        getN

        +
        long getN()
        +
        Gets the length of the input stream offered to the sketch..
        +
        +
        Returns:
        +
        the length of the input stream offered to the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getNumRetained

        +
        int getNumRetained()
        +
        Gets the number of quantiles retained by the sketch.
        +
        +
        Returns:
        +
        the number of quantiles retained by the sketch
        +
        +
      • +
      + + + +
        +
      • +

        getRankLowerBound

        +
        double getRankLowerBound​(double rank)
        +
        Gets the lower bound of the rank confidence interval in which the true rank of the + given rank exists.
        +
        +
        Parameters:
        +
        rank - the given normalized rank.
        +
        Returns:
        +
        the lower bound of the rank confidence interval in which the true rank of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getRankUpperBound

        +
        double getRankUpperBound​(double rank)
        +
        Gets the upper bound of the rank confidence interval in which the true rank of the + given rank exists.
        +
        +
        Parameters:
        +
        rank - the given normalized rank.
        +
        Returns:
        +
        the upper bound of the rank confidence interval in which the true rank of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        hasMemory

        +
        boolean hasMemory()
        +
        Returns true if this sketch's data structure is backed by Memory or WritableMemory.
        +
        +
        Returns:
        +
        true if this sketch's data structure is backed by Memory or WritableMemory.
        +
        +
      • +
      + + + +
        +
      • +

        isDirect

        +
        boolean isDirect()
        +
        Returns true if this sketch's data structure is off-heap (a.k.a., Direct or Native memory).
        +
        +
        Returns:
        +
        true if this sketch's data structure is off-heap (a.k.a., Direct or Native memory).
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        boolean isEmpty()
        +
        Returns true if this sketch is empty.
        +
        +
        Returns:
        +
        true if this sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        isEstimationMode

        +
        boolean isEstimationMode()
        +
        Returns true if this sketch is in estimation mode.
        +
        +
        Returns:
        +
        true if this sketch is in estimation mode.
        +
        +
      • +
      + + + +
        +
      • +

        isReadOnly

        +
        boolean isReadOnly()
        +
        Returns true if this sketch is read only.
        +
        +
        Returns:
        +
        true if this sketch is read only.
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        void reset()
        +
        Resets this sketch to the empty state. + If the sketch is read only this does nothing. + +

        The parameter k will not change.

        +
      • +
      + + + +
        +
      • +

        toString

        +
        String toString()
        +
        Returns a summary of the key parameters of the sketch.
        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        a summary of the key parameters of the sketch.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesDoublesAPI.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesDoublesAPI.html new file mode 100644 index 000000000..7667540a7 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesDoublesAPI.html @@ -0,0 +1,889 @@ + + + + + +QuantilesDoublesAPI (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface QuantilesDoublesAPI

+
+
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getCDF

        +
        default double[] getCDF​(double[] splitPoints)
        +
        This is equivalent to getCDF(splitPoints, INCLUSIVE)
        +
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items.
        +
        Returns:
        +
        a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getCDF

        +
        double[] getCDF​(double[] splitPoints,
        +                QuantileSearchCriteria searchCrit)
        +
        Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(false) function.

        +
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 overlapping intervals. + +

        The start of each interval is below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and the end of the interval + is the rank or cumulative probability corresponding to the split point.

        + +

        The (m+1)th interval represents 100% of the distribution represented by the sketch + and consistent with the definition of a cumulative probability distribution, thus the (m+1)th + rank or probability in the returned array is always 1.0.

        + +

        If a split point exactly equals a retained item of the sketch and the search criterion is:

        + +
          +
        • INCLUSIVE, the resulting cumulative probability will include that item.
        • +
        • EXCLUSIVE, the resulting cumulative probability will not include the weight of that split point.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getMaxItem

        +
        double getMaxItem()
        +
        Returns the maximum item of the stream. This is provided for convenience and may be different from the + item returned by getQuantile(1.0).
        +
        +
        Returns:
        +
        the maximum item of the stream
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getMinItem

        +
        double getMinItem()
        +
        Returns the minimum item of the stream. This is provided for convenience and may be different from the + item returned by getQuantile(0.0).
        +
        +
        Returns:
        +
        the minimum item of the stream
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getPMF

        +
        default double[] getPMF​(double[] splitPoints)
        +
        This is equivalent to getPMF(splitPoints, INCLUSIVE)
        +
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items.
        +
        Returns:
        +
        a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getPMF

        +
        double[] getPMF​(double[] splitPoints,
        +                QuantileSearchCriteria searchCrit)
        +
        Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(true) function.

        +
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 consecutive, non-overlapping intervals. + +

        Each interval except for the end intervals starts with a split point and ends with the next split + point in sequence.

        + +

        The first interval starts below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and ends with the first split point

        + +

        The last (m+1)th interval starts with the last split point and ends after the last + item retained by the sketch corresponding to a rank or probability of 1.0.

        + +

        The sum of the probability masses of all (m+1) intervals is 1.0.

        + +

        If the search criterion is:

        + +
          +
        • INCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will include that item. If the lower split point equals an item retained by the sketch, the interval will exclude + that item.
        • +
        • EXCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will exclude that item. If the lower split point equals an item retained by the sketch, the interval will include + that item.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        default double getQuantile​(double rank)
        +
        This is equivalent to getQuantile(rank, INCLUSIVE)
        +
        +
        Parameters:
        +
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        double getQuantile​(double rank,
        +                   QuantileSearchCriteria searchCrit)
        +
        Gets the approximate quantile of the given normalized rank and the given search criterion.
        +
        +
        Parameters:
        +
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        searchCrit - If INCLUSIVE, the given rank includes all quantiles ≤ + the quantile directly corresponding to the given rank. + If EXCLUSIVE, he given rank includes all quantiles < + the quantile directly corresponding to the given rank.
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantileLowerBound

        +
        double getQuantileLowerBound​(double rank)
        +
        Gets the lower bound of the quantile confidence interval in which the quantile of the + given rank exists. + +

        Although it is possible to estimate the probability that the true quantile + exists within the quantile confidence interval specified by the upper and lower quantile bounds, + it is not possible to guarantee the width of the quantile confidence interval + as an additive or multiplicative percent of the true quantile.

        +
        +
        Parameters:
        +
        rank - the given normalized rank
        +
        Returns:
        +
        the lower bound of the quantile confidence interval in which the quantile of the + given rank exists.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantileUpperBound

        +
        double getQuantileUpperBound​(double rank)
        +
        Gets the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists. + +

        Although it is possible to estimate the probability that the true quantile + exists within the quantile confidence interval specified by the upper and lower quantile bounds, + it is not possible to guarantee the width of the quantile interval + as an additive or multiplicative percent of the true quantile.

        +
        +
        Parameters:
        +
        rank - the given normalized rank
        +
        Returns:
        +
        the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantiles

        +
        default double[] getQuantiles​(double[] ranks)
        +
        This is equivalent to getQuantiles(ranks, INCLUSIVE)
        +
        +
        Parameters:
        +
        ranks - the given array of normalized ranks, each of which must be + in the interval [0.0,1.0].
        +
        Returns:
        +
        an array of quantiles corresponding to the given array of normalized ranks.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantiles

        +
        double[] getQuantiles​(double[] ranks,
        +                      QuantileSearchCriteria searchCrit)
        +
        Gets an array of quantiles from the given array of normalized ranks.
        +
        +
        Parameters:
        +
        ranks - the given array of normalized ranks, each of which must be + in the interval [0.0,1.0].
        +
        searchCrit - if INCLUSIVE, the given ranks include all quantiles ≤ + the quantile directly corresponding to each rank.
        +
        Returns:
        +
        an array of quantiles corresponding to the given array of normalized ranks.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getRank

        +
        default double getRank​(double quantile)
        +
        This is equivalent to getRank(quantile, INCLUSIVE)
        +
        +
        Parameters:
        +
        quantile - the given quantile
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getRank

        +
        double getRank​(double quantile,
        +               QuantileSearchCriteria searchCrit)
        +
        Gets the normalized rank corresponding to the given a quantile.
        +
        +
        Parameters:
        +
        quantile - the given quantile
        +
        searchCrit - if INCLUSIVE the given quantile is included into the rank.
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getRanks

        +
        default double[] getRanks​(double[] quantiles)
        +
        This is equivalent to getRanks(quantiles, INCLUSIVE)
        +
        +
        Parameters:
        +
        quantiles - the given array of quantiles
        +
        Returns:
        +
        an array of normalized ranks corresponding to the given array of quantiles.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getRanks

        +
        double[] getRanks​(double[] quantiles,
        +                  QuantileSearchCriteria searchCrit)
        +
        Gets an array of normalized ranks corresponding to the given array of quantiles and the given + search criterion.
        +
        +
        Parameters:
        +
        quantiles - the given array of quantiles
        +
        searchCrit - if INCLUSIVE, the given quantiles include the rank directly corresponding to each quantile.
        +
        Returns:
        +
        an array of normalized ranks corresponding to the given array of quantiles.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getSerializedSizeBytes

        +
        int getSerializedSizeBytes()
        +
        Returns the current number of bytes this Sketch would require if serialized.
        +
        +
        Returns:
        +
        the number of bytes this sketch would require if serialized.
        +
        +
      • +
      + + + +
        +
      • +

        getSortedView

        +
        DoublesSortedView getSortedView()
        +
        Gets the sorted view of this sketch
        +
        +
        Returns:
        +
        the sorted view of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        iterator

        +
        QuantilesDoublesSketchIterator iterator()
        +
        Gets the iterator for this sketch, which is not sorted.
        +
        +
        Returns:
        +
        the iterator for this sketch
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        byte[] toByteArray()
        +
        Returns a byte array representation of this sketch.
        +
        +
        Returns:
        +
        a byte array representation of this sketch.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        void update​(double item)
        +
        Updates this sketch with the given item.
        +
        +
        Parameters:
        +
        item - from a stream of quantiles. NaNs are ignored.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesDoublesSketchIterator.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesDoublesSketchIterator.html new file mode 100644 index 000000000..c3e426d46 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesDoublesSketchIterator.html @@ -0,0 +1,284 @@ + + + + + +QuantilesDoublesSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface QuantilesDoublesSketchIterator

+
+
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getQuantile

        +
        double getQuantile()
        +
        Gets the double quantile at the current index. + +

        Don't call this before calling next() for the first time + or after getting false from next().

        +
        +
        Returns:
        +
        the double quantile at the current index.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesFloatsAPI.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesFloatsAPI.html new file mode 100644 index 000000000..213ee933c --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesFloatsAPI.html @@ -0,0 +1,889 @@ + + + + + +QuantilesFloatsAPI (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface QuantilesFloatsAPI

+
+
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getCDF

        +
        default double[] getCDF​(float[] splitPoints)
        +
        This is equivalent to getCDF(splitPoints, INCLUSIVE)
        +
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items.
        +
        Returns:
        +
        a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getCDF

        +
        double[] getCDF​(float[] splitPoints,
        +                QuantileSearchCriteria searchCrit)
        +
        Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(false) function.

        +
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 overlapping intervals. + +

        The start of each interval is below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and the end of the interval + is the rank or cumulative probability corresponding to the split point.

        + +

        The (m+1)th interval represents 100% of the distribution represented by the sketch + and consistent with the definition of a cumulative probability distribution, thus the (m+1)th + rank or probability in the returned array is always 1.0.

        + +

        If a split point exactly equals a retained item of the sketch and the search criterion is:

        + +
          +
        • INCLUSIVE, the resulting cumulative probability will include that item.
        • +
        • EXCLUSIVE, the resulting cumulative probability will not include the weight of that split point.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getMaxItem

        +
        float getMaxItem()
        +
        Returns the maximum item of the stream. This is provided for convenience, but may be different from the largest + item retained by the sketch algorithm.
        +
        +
        Returns:
        +
        the maximum item of the stream
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getMinItem

        +
        float getMinItem()
        +
        Returns the minimum item of the stream. This is provided for convenience, but is distinct from the smallest + item retained by the sketch algorithm.
        +
        +
        Returns:
        +
        the minimum item of the stream
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getPMF

        +
        default double[] getPMF​(float[] splitPoints)
        +
        This is equivalent to getPMF(splitPoints, INCLUSIVE)
        +
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items.
        +
        Returns:
        +
        a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getPMF

        +
        double[] getPMF​(float[] splitPoints,
        +                QuantileSearchCriteria searchCrit)
        +
        Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(true) function.

        +
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 consecutive, non-overlapping intervals. + +

        Each interval except for the end intervals starts with a split point and ends with the next split + point in sequence.

        + +

        The first interval starts below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and ends with the first split point

        + +

        The last (m+1)th interval starts with the last split point and ends after the last + item retained by the sketch corresponding to a rank or probability of 1.0.

        + +

        The sum of the probability masses of all (m+1) intervals is 1.0.

        + +

        If the search criterion is:

        + +
          +
        • INCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will include that item. If the lower split point equals an item retained by the sketch, the interval will exclude + that item.
        • +
        • EXCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will exclude that item. If the lower split point equals an item retained by the sketch, the interval will include + that item.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        default float getQuantile​(double rank)
        +
        This is equivalent to getQuantile(rank, INCLUSIVE)
        +
        +
        Parameters:
        +
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        float getQuantile​(double rank,
        +                  QuantileSearchCriteria searchCrit)
        +
        Gets the approximate quantile of the given normalized rank and the given search criterion.
        +
        +
        Parameters:
        +
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        searchCrit - If INCLUSIVE, the given rank includes all quantiles ≤ + the quantile directly corresponding to the given rank. + If EXCLUSIVE, he given rank includes all quantiles < + the quantile directly corresponding to the given rank.
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantileLowerBound

        +
        float getQuantileLowerBound​(double rank)
        +
        Gets the lower bound of the quantile confidence interval in which the quantile of the + given rank exists. + +

        Although it is possible to estimate the probability that the true quantile + exists within the quantile confidence interval specified by the upper and lower quantile bounds, + it is not possible to guarantee the width of the quantile confidence interval + as an additive or multiplicative percent of the true quantile.

        +
        +
        Parameters:
        +
        rank - the given normalized rank
        +
        Returns:
        +
        the lower bound of the quantile confidence interval in which the quantile of the + given rank exists.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantileUpperBound

        +
        float getQuantileUpperBound​(double rank)
        +
        Gets the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists. + +

        Although it is possible to estimate the probability that the true quantile + exists within the quantile confidence interval specified by the upper and lower quantile bounds, + it is not possible to guarantee the width of the quantile interval + as an additive or multiplicative percent of the true quantile.

        +
        +
        Parameters:
        +
        rank - the given normalized rank
        +
        Returns:
        +
        the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantiles

        +
        default float[] getQuantiles​(double[] ranks)
        +
        This is equivalent to getQuantiles(ranks, INCLUSIVE)
        +
        +
        Parameters:
        +
        ranks - the given array of normalized ranks, each of which must be + in the interval [0.0,1.0].
        +
        Returns:
        +
        an array of quantiles corresponding to the given array of normalized ranks.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantiles

        +
        float[] getQuantiles​(double[] ranks,
        +                     QuantileSearchCriteria searchCrit)
        +
        Gets an array of quantiles from the given array of normalized ranks.
        +
        +
        Parameters:
        +
        ranks - the given array of normalized ranks, each of which must be + in the interval [0.0,1.0].
        +
        searchCrit - if INCLUSIVE, the given ranks include all quantiles ≤ + the quantile directly corresponding to each rank.
        +
        Returns:
        +
        an array of quantiles corresponding to the given array of normalized ranks.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getRank

        +
        default double getRank​(float quantile)
        +
        This is equivalent to getRank(quantile, INCLUSIVE)
        +
        +
        Parameters:
        +
        quantile - the given quantile
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getRank

        +
        double getRank​(float quantile,
        +               QuantileSearchCriteria searchCrit)
        +
        Gets the normalized rank corresponding to the given a quantile.
        +
        +
        Parameters:
        +
        quantile - the given quantile
        +
        searchCrit - if INCLUSIVE the given quantile is included into the rank.
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getRanks

        +
        default double[] getRanks​(float[] quantiles)
        +
        This is equivalent to getRanks(quantiles, INCLUSIVE)
        +
        +
        Parameters:
        +
        quantiles - the given array of quantiles
        +
        Returns:
        +
        an array of normalized ranks corresponding to the given array of quantiles.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getRanks

        +
        double[] getRanks​(float[] quantiles,
        +                  QuantileSearchCriteria searchCrit)
        +
        Gets an array of normalized ranks corresponding to the given array of quantiles and the given + search criterion.
        +
        +
        Parameters:
        +
        quantiles - the given array of quantiles
        +
        searchCrit - if INCLUSIVE, the given quantiles include the rank directly corresponding to each quantile.
        +
        Returns:
        +
        an array of normalized ranks corresponding to the given array of quantiles.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getSerializedSizeBytes

        +
        int getSerializedSizeBytes()
        +
        Returns the current number of bytes this Sketch would require if serialized.
        +
        +
        Returns:
        +
        the number of bytes this sketch would require if serialized.
        +
        +
      • +
      + + + +
        +
      • +

        getSortedView

        +
        FloatsSortedView getSortedView()
        +
        Gets the sorted view of this sketch
        +
        +
        Returns:
        +
        the sorted view of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        iterator

        +
        QuantilesFloatsSketchIterator iterator()
        +
        Gets the iterator for this sketch, which is not sorted.
        +
        +
        Returns:
        +
        the iterator for this sketch
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        byte[] toByteArray()
        +
        Returns a byte array representation of this sketch.
        +
        +
        Returns:
        +
        a byte array representation of this sketch.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        void update​(float item)
        +
        Updates this sketch with the given item.
        +
        +
        Parameters:
        +
        item - from a stream of quantiles. NaNs are ignored.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesFloatsSketchIterator.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesFloatsSketchIterator.html new file mode 100644 index 000000000..32dc639b5 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesFloatsSketchIterator.html @@ -0,0 +1,284 @@ + + + + + +QuantilesFloatsSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface QuantilesFloatsSketchIterator

+
+
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getQuantile

        +
        float getQuantile()
        +
        Gets the float quantile at the current index. + +

        Don't call this before calling next() for the first time + or after getting false from next().

        +
        +
        Returns:
        +
        the float quantile at the current index.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesGenericAPI.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesGenericAPI.html new file mode 100644 index 000000000..812889698 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesGenericAPI.html @@ -0,0 +1,869 @@ + + + + + +QuantilesGenericAPI (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface QuantilesGenericAPI<T>

+
+
+
+
    +
  • +
    +
    Type Parameters:
    +
    T - The given item type
    +
    +
    +
    All Superinterfaces:
    +
    QuantilesAPI
    +
    +
    +
    All Known Implementing Classes:
    +
    ItemsSketch, KllItemsSketch
    +
    +
    +
    public interface QuantilesGenericAPI<T>
    +extends QuantilesAPI
    +
    The Quantiles API for item type generic.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    See Also:
    +
    QuantilesAPI
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        getCDF

        +
        default double[] getCDF​(T[] splitPoints)
        +
        This is equivalent to getCDF(splitPoints, INCLUSIVE)
        +
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items.
        +
        Returns:
        +
        a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + + + +
        +
      • +

        getCDF

        +
        double[] getCDF​(T[] splitPoints,
        +                QuantileSearchCriteria searchCrit)
        +
        Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(false) function.

        +
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 overlapping intervals. + +

        The start of each interval is below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and the end of the interval + is the rank or cumulative probability corresponding to the split point.

        + +

        The (m+1)th interval represents 100% of the distribution represented by the sketch + and consistent with the definition of a cumulative probability distribution, thus the (m+1)th + rank or probability in the returned array is always 1.0.

        + +

        If a split point exactly equals a retained item of the sketch and the search criterion is:

        + +
          +
        • INCLUSIVE, the resulting cumulative probability will include that item.
        • +
        • EXCLUSIVE, the resulting cumulative probability will not include the weight of that split point.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getMaxItem

        +
        T getMaxItem()
        +
        Returns the maximum item of the stream. This may be distinct from the largest item retained by the + sketch algorithm.
        +
        +
        Returns:
        +
        the maximum item of the stream
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getMinItem

        +
        T getMinItem()
        +
        Returns the minimum item of the stream. This may be distinct from the smallest item retained by the + sketch algorithm.
        +
        +
        Returns:
        +
        the minimum item of the stream
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + + + +
        +
      • +

        getPMF

        +
        default double[] getPMF​(T[] splitPoints)
        +
        This is equivalent to getPMF(splitPoints, INCLUSIVE)
        +
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items.
        +
        Returns:
        +
        a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + + + +
        +
      • +

        getPMF

        +
        double[] getPMF​(T[] splitPoints,
        +                QuantileSearchCriteria searchCrit)
        +
        Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(true) function.

        +
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 consecutive, non-overlapping intervals. + +

        Each interval except for the end intervals starts with a split point and ends with the next split + point in sequence.

        + +

        The first interval starts below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and ends with the first split point

        + +

        The last (m+1)th interval starts with the last split point and ends after the last + item retained by the sketch corresponding to a rank or probability of 1.0.

        + +

        The sum of the probability masses of all (m+1) intervals is 1.0.

        + +

        If the search criterion is:

        + +
          +
        • INCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will include that item. If the lower split point equals an item retained by the sketch, the interval will exclude + that item.
        • +
        • EXCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will exclude that item. If the lower split point equals an item retained by the sketch, the interval will include + that item.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        default T getQuantile​(double rank)
        +
        This is equivalent to getQuantile(rank, INCLUSIVE)
        +
        +
        Parameters:
        +
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        T getQuantile​(double rank,
        +              QuantileSearchCriteria searchCrit)
        +
        Gets the approximate quantile of the given normalized rank and the given search criterion.
        +
        +
        Parameters:
        +
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        searchCrit - If INCLUSIVE, the given rank includes all quantiles ≤ + the quantile directly corresponding to the given rank. + If EXCLUSIVE, he given rank includes all quantiles < + the quantile directly corresponding to the given rank.
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantileLowerBound

        +
        T getQuantileLowerBound​(double rank)
        +
        Gets the lower bound of the quantile confidence interval in which the quantile of the + given rank exists. + +

        Although it is possible to estimate the probability that the true quantile + exists within the quantile confidence interval specified by the upper and lower quantile bounds, + it is not possible to guarantee the width of the quantile confidence interval + as an additive or multiplicative percent of the true quantile.

        +
        +
        Parameters:
        +
        rank - the given normalized rank
        +
        Returns:
        +
        the lower bound of the quantile confidence interval in which the quantile of the + given rank exists.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantileUpperBound

        +
        T getQuantileUpperBound​(double rank)
        +
        Gets the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists. + +

        Although it is possible to estimate the probability that the true quantile + exists within the quantile confidence interval specified by the upper and lower quantile bounds, + it is not possible to guarantee the width of the quantile interval + as an additive or multiplicative percent of the true quantile.

        +
        +
        Parameters:
        +
        rank - the given normalized rank
        +
        Returns:
        +
        the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantiles

        +
        default T[] getQuantiles​(double[] ranks)
        +
        This is equivalent to getQuantiles(ranks, INCLUSIVE)
        +
        +
        Parameters:
        +
        ranks - the given array of normalized ranks, each of which must be + in the interval [0.0,1.0].
        +
        Returns:
        +
        an array of quantiles corresponding to the given array of normalized ranks.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantiles

        +
        T[] getQuantiles​(double[] ranks,
        +                 QuantileSearchCriteria searchCrit)
        +
        Gets an array of quantiles from the given array of normalized ranks.
        +
        +
        Parameters:
        +
        ranks - the given array of normalized ranks, each of which must be + in the interval [0.0,1.0].
        +
        searchCrit - if INCLUSIVE, the given ranks include all quantiles ≤ + the quantile directly corresponding to each rank.
        +
        Returns:
        +
        an array of quantiles corresponding to the given array of normalized ranks.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + + + +
        +
      • +

        getRank

        +
        default double getRank​(T quantile)
        +
        This is equivalent to getRank(T quantile, INCLUSIVE)
        +
        +
        Parameters:
        +
        quantile - the given quantile
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + + + +
        +
      • +

        getRank

        +
        double getRank​(T quantile,
        +               QuantileSearchCriteria searchCrit)
        +
        Gets the normalized rank corresponding to the given a quantile.
        +
        +
        Parameters:
        +
        quantile - the given quantile
        +
        searchCrit - if INCLUSIVE the given quantile is included into the rank.
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + + + +
        +
      • +

        getRanks

        +
        default double[] getRanks​(T[] quantiles)
        +
        This is equivalent to getRanks(quantiles, INCLUSIVE)
        +
        +
        Parameters:
        +
        quantiles - the given array of quantiles
        +
        Returns:
        +
        an array of normalized ranks corresponding to the given array of quantiles.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        +
      • +
      + + + + + +
        +
      • +

        getRanks

        +
        double[] getRanks​(T[] quantiles,
        +                  QuantileSearchCriteria searchCrit)
        +
        Gets an array of normalized ranks corresponding to the given array of quantiles and the given + search criterion.
        +
        +
        Parameters:
        +
        quantiles - the given array of quantiles
        +
        searchCrit - if INCLUSIVE, the given quantiles include the rank directly corresponding to each quantile.
        +
        Returns:
        +
        an array of normalized ranks corresponding to the given array of quantiles.
        +
        Throws:
        +
        IllegalArgumentException - if sketch is empty.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getSortedView

        +
        GenericSortedView<T> getSortedView()
        +
        Gets the sorted view of this sketch
        +
        +
        Returns:
        +
        the sorted view of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        iterator

        +
        QuantilesGenericSketchIterator<T> iterator()
        +
        Gets the iterator for this sketch, which is not sorted.
        +
        +
        Returns:
        +
        the iterator for this sketch
        +
        +
      • +
      + + + + + +
        +
      • +

        update

        +
        void update​(T item)
        +
        Updates this sketch with the given item.
        +
        +
        Parameters:
        +
        item - from a stream of items. Nulls are ignored.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesGenericSketchIterator.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesGenericSketchIterator.html new file mode 100644 index 000000000..c53f7e584 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesGenericSketchIterator.html @@ -0,0 +1,288 @@ + + + + + +QuantilesGenericSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface QuantilesGenericSketchIterator<T>

+
+
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getQuantile

        +
        T getQuantile()
        +
        Gets the generic quantile at the current index. + +

        Don't call this before calling next() for the first time + or after getting false from next().

        +
        +
        Returns:
        +
        the generic quantile at the current index.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesSketchIterator.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesSketchIterator.html new file mode 100644 index 000000000..60d7fe77f --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesSketchIterator.html @@ -0,0 +1,305 @@ + + + + + +QuantilesSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface QuantilesSketchIterator

+
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethodDescription
      longgetWeight() +
      Gets the natural weight at the current index.
      +
      booleannext() +
      Advances the index and checks if it is valid.
      +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getWeight

        +
        long getWeight()
        +
        Gets the natural weight at the current index. + +

        Don't call this before calling next() for the first time + or after getting false from next().

        +
        +
        Returns:
        +
        the natural weight at the current index.
        +
        +
      • +
      + + + +
        +
      • +

        next

        +
        boolean next()
        +
        Advances the index and checks if it is valid. + The state of this iterator is undefined before the first call of this method.
        +
        +
        Returns:
        +
        true if the next index is valid.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesUtil.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesUtil.html new file mode 100644 index 000000000..02c7e5f00 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/QuantilesUtil.html @@ -0,0 +1,548 @@ + + + + + +QuantilesUtil (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class QuantilesUtil

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.quantilescommon.QuantilesUtil
    • +
    +
  • +
+
+
    +
  • +
    +
    public final class QuantilesUtil
    +extends Object
    +
    Utilities for the quantiles sketches.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      static doubletailRoundingFactor 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static voidcheckDoublesSplitPointsOrder​(double[] values) +
      Checks the sequential validity of the given array of double values.
      +
      static voidcheckFloatsSplitPointsOrder​(float[] values) +
      Checks the sequential validity of the given array of float values.
      +
      static voidcheckNormalizedRankBounds​(double nRank) +
      Checks that the given normalized rank: 0 ≤ nRank ≤ 1.0.
      +
      static double[]equallySpacedDoubles​(int num) +
      Returns an array of (num + 1) values that define equally sized intervals between 0.0, inclusive, and 1.0, + inclusive.
      +
      static long[]equallySpacedLongs​(long min, + long max, + int num) +
      Returns an array of (num + 1) longs that define, approximately, equally spaced intervals between the given + max, inclusive, and min, inclusive.
      +
      static double[]evenlyLogSpaced​(double value1, + double value2, + int num) +
      Returns a double array of values between min and max inclusive where the log of the + returned values are evenly spaced.
      +
      static double[]evenlySpacedDoubles​(double value1, + double value2, + int num) +
      Returns a double array of evenly spaced values between value1, inclusive, and value2 inclusive.
      +
      static float[]evenlySpacedFloats​(float value1, + float value2, + int num) +
      Returns a float array of evenly spaced values between value1, inclusive, and value2 inclusive.
      +
      static doublegetNaturalRank​(double normalizedRank, + long totalN, + QuantileSearchCriteria searchCrit) 
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        checkNormalizedRankBounds

        +
        public static final void checkNormalizedRankBounds​(double nRank)
        +
        Checks that the given normalized rank: 0 ≤ nRank ≤ 1.0.
        +
        +
        Parameters:
        +
        nRank - the given normalized rank.
        +
        +
      • +
      + + + +
        +
      • +

        checkDoublesSplitPointsOrder

        +
        public static final void checkDoublesSplitPointsOrder​(double[] values)
        +
        Checks the sequential validity of the given array of double values. + They must be unique, monotonically increasing and not NaN.
        +
        +
        Parameters:
        +
        values - the given array of double values
        +
        +
      • +
      + + + +
        +
      • +

        checkFloatsSplitPointsOrder

        +
        public static final void checkFloatsSplitPointsOrder​(float[] values)
        +
        Checks the sequential validity of the given array of float values. + They must be unique, monotonically increasing and not NaN.
        +
        +
        Parameters:
        +
        values - the given array of double values
        +
        +
      • +
      + + + +
        +
      • +

        equallySpacedDoubles

        +
        public static double[] equallySpacedDoubles​(int num)
        +
        Returns an array of (num + 1) values that define equally sized intervals between 0.0, inclusive, and 1.0, + inclusive. The end points 0.0 and 1.0 are part of the returned array. + +

        For example, if num == 2, three values will be returned: 0.0, .5, and 1, where the two equally sized regions + are {0.0,0.5}, and {0.5, 1.0}.

        +
        +
        Parameters:
        +
        num - the total number of equally sized intervals between 0.0, inclusive and 1.0, inclusive. + Must be 1 or greater.
        +
        Returns:
        +
        a double array of values that define (num + 1) equally sized intervals between 0.0, inclusive and 1.0, + inclusive.
        +
        Throws:
        +
        IllegalArgumentException - if num is less than 1.
        +
        +
      • +
      + + + +
        +
      • +

        equallySpacedLongs

        +
        public static long[] equallySpacedLongs​(long min,
        +                                        long max,
        +                                        int num)
        +
        Returns an array of (num + 1) longs that define, approximately, equally spaced intervals between the given + max, inclusive, and min, inclusive. The end points max and min are part of the + returned array. Because the range of the values may not exactly divide into num intervals, + the size of these intervals may vary by plus or minus one.
        +
        +
        Parameters:
        +
        min - the lowest positive valued (or zero) number of the range
        +
        max - the highest positive valued number of the range. max must be greater than min
        +
        num - Number of requested intervals. Must be greater or equal to one, and less than or equal to + max - min.
        +
        Returns:
        +
        an array of (num + 1) longs that are approximately equally spaced between the given min and max.
        +
        +
      • +
      + + + +
        +
      • +

        evenlySpacedFloats

        +
        public static float[] evenlySpacedFloats​(float value1,
        +                                         float value2,
        +                                         int num)
        +
        Returns a float array of evenly spaced values between value1, inclusive, and value2 inclusive. + If value2 > value1, the resulting sequence will be increasing. + If value2 < value1, the resulting sequence will be decreasing.
        +
        +
        Parameters:
        +
        value1 - will be in index 0 of the returned array
        +
        value2 - will be in the highest index of the returned array
        +
        num - the total number of values including value1 and value2. Must be 2 or greater.
        +
        Returns:
        +
        a float array of evenly spaced values between value1, inclusive, and value2 inclusive.
        +
        +
      • +
      + + + +
        +
      • +

        evenlySpacedDoubles

        +
        public static double[] evenlySpacedDoubles​(double value1,
        +                                           double value2,
        +                                           int num)
        +
        Returns a double array of evenly spaced values between value1, inclusive, and value2 inclusive. + If value2 > value1, the resulting sequence will be increasing. + If value2 < value1, the resulting sequence will be decreasing.
        +
        +
        Parameters:
        +
        value1 - will be in index 0 of the returned array
        +
        value2 - will be in the highest index of the returned array
        +
        num - the total number of values including value1 and value2. Must be 2 or greater.
        +
        Returns:
        +
        a float array of evenly spaced values between value1, inclusive, and value2 inclusive.
        +
        +
      • +
      + + + +
        +
      • +

        evenlyLogSpaced

        +
        public static double[] evenlyLogSpaced​(double value1,
        +                                       double value2,
        +                                       int num)
        +
        Returns a double array of values between min and max inclusive where the log of the + returned values are evenly spaced. + If value2 > value1, the resulting sequence will be increasing. + If value2 < value1, the resulting sequence will be decreasing.
        +
        +
        Parameters:
        +
        value1 - will be in index 0 of the returned array, and must be greater than zero.
        +
        value2 - will be in the highest index of the returned array, and must be greater than zero.
        +
        num - the total number of values including value1 and value2. Must be 2 or greater
        +
        Returns:
        +
        a double array of exponentially spaced values between value1 and value2 inclusive.
        +
        +
      • +
      + + + +
        +
      • +

        getNaturalRank

        +
        public static double getNaturalRank​(double normalizedRank,
        +                                    long totalN,
        +                                    QuantileSearchCriteria searchCrit)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/SortedView.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/SortedView.html new file mode 100644 index 000000000..5847c5d33 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/SortedView.html @@ -0,0 +1,343 @@ + + + + + +SortedView (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface SortedView

+
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethodDescription
      long[]getCumulativeWeights() +
      Returns the array of cumulative weights from the sketch.
      +
      longgetN() +
      Returns the total number of items presented to the sourcing sketch.
      +
      booleanisEmpty() +
      Returns true if this sorted view is empty.
      +
      SortedViewIteratoriterator() +
      Returns an iterator for this Sorted View.
      +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getCumulativeWeights

        +
        long[] getCumulativeWeights()
        +
        Returns the array of cumulative weights from the sketch. + Also known as the natural ranks, which are the Natural Numbers on the interval [1, N].
        +
        +
        Returns:
        +
        the array of cumulative weights (or natural ranks).
        +
        +
      • +
      + + + +
        +
      • +

        getN

        +
        long getN()
        +
        Returns the total number of items presented to the sourcing sketch.
        +
        +
        Returns:
        +
        the total number of items presented to the sourcing sketch.
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        boolean isEmpty()
        +
        Returns true if this sorted view is empty.
        +
        +
        Returns:
        +
        true if this sorted view is empty.
        +
        +
      • +
      + + + +
        +
      • +

        iterator

        +
        SortedViewIterator iterator()
        +
        Returns an iterator for this Sorted View.
        +
        +
        Returns:
        +
        an iterator for this Sorted View.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/SortedViewIterator.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/SortedViewIterator.html new file mode 100644 index 000000000..151ec8d19 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/SortedViewIterator.html @@ -0,0 +1,471 @@ + + + + + +SortedViewIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SortedViewIterator

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.quantilescommon.SortedViewIterator
    • +
    +
  • +
+
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    DoublesSortedViewIterator, FloatsSortedViewIterator, GenericSortedViewIterator
    +
    +
    +
    public class SortedViewIterator
    +extends Object
    +
    This is the base interface for the SortedViewIterator hierarchy used with a SortedView obtained + from a quantile-type sketch. This provides an ordered iterator over the retained quantiles of + the associated quantile-type sketch. + +

    Prototype example of the recommended iteration loop:

    +
    
    +   SortedViewIterator itr = sketch.getSortedView().iterator();
    +   while (itr.next()) {
    +     long weight = itr.getWeight();
    +     ...
    +   }
    + 
    +
    +
    Author:
    +
    Alexander Saydakov, Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        cumWeights

        +
        protected final long[] cumWeights
        +
      • +
      + + + +
        +
      • +

        totalN

        +
        protected long totalN
        +
      • +
      + + + +
        +
      • +

        index

        +
        protected int index
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getNaturalRank

        +
        public long getNaturalRank​(QuantileSearchCriteria searchCrit)
        +
        Gets the natural rank at the current index (or previous index) based on the chosen search criterion. + This is also referred to as the "cumulative weight". The natural rank is a number in the range [1, N], + where N (getN()) is the total number of items fed to the sketch. + +

        Don't call this before calling next() for the first time + or after getting false from next().

        +
        +
        Parameters:
        +
        searchCrit - if INCLUSIVE, includes the weight of the item at the current index in the computation of + the natural rank. + Otherwise, it will return the natural rank of the previous index.
        +
        Returns:
        +
        the natural rank at the current index (or previous index) based on the chosen search criterion.
        +
        +
      • +
      + + + +
        +
      • +

        getN

        +
        public long getN()
        +
        Gets the total count of all items presented to the sketch.
        +
        +
        Returns:
        +
        the total count of all items presented to the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getNormalizedRank

        +
        public double getNormalizedRank​(QuantileSearchCriteria searchCrit)
        +
        Gets the normalized rank at the current index (or previous index) + based on the chosen search criterion. Where normalized rank = natural rank / N (getN()) + and is a fraction in the range (0,1.0]. + +

        Don't call this before calling next() for the first time + or after getting false from next().

        +
        +
        Parameters:
        +
        searchCrit - if INCLUSIVE, includes the normalized rank at the current index. + Otherwise, returns the normalized rank of the previous index.
        +
        Returns:
        +
        the normalized rank at the current index (or previous index) + based on the chosen search criterion.
        +
        +
      • +
      + + + +
        +
      • +

        getWeight

        +
        public long getWeight()
        +
        Gets the weight contribution of the item at the current index. + +

        Don't call this before calling next() for the first time + or after getting false from next().

        +
        +
        Returns:
        +
        the weight contribution of the item at the current index.
        +
        +
      • +
      + + + +
        +
      • +

        next

        +
        public boolean next()
        +
        Advances the index and checks if it is valid. + The state of this iterator is undefined before the first call of this method.
        +
        +
        Returns:
        +
        true if the next index is valid.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/BinarySearch.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/BinarySearch.html new file mode 100644 index 000000000..00aaf827b --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/BinarySearch.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.quantilescommon.BinarySearch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantilescommon.BinarySearch

+
+
No usage of org.apache.datasketches.quantilescommon.BinarySearch
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/DoublesSortedView.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/DoublesSortedView.html new file mode 100644 index 000000000..d2420f81e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/DoublesSortedView.html @@ -0,0 +1,290 @@ + + + + + +Uses of Interface org.apache.datasketches.quantilescommon.DoublesSortedView (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.quantilescommon.DoublesSortedView

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/DoublesSortedViewIterator.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/DoublesSortedViewIterator.html new file mode 100644 index 000000000..9d8f63cc2 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/DoublesSortedViewIterator.html @@ -0,0 +1,254 @@ + + + + + +Uses of Class org.apache.datasketches.quantilescommon.DoublesSortedViewIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantilescommon.DoublesSortedViewIterator

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/FloatsSortedView.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/FloatsSortedView.html new file mode 100644 index 000000000..e936474c2 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/FloatsSortedView.html @@ -0,0 +1,289 @@ + + + + + +Uses of Interface org.apache.datasketches.quantilescommon.FloatsSortedView (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.quantilescommon.FloatsSortedView

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/FloatsSortedViewIterator.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/FloatsSortedViewIterator.html new file mode 100644 index 000000000..e079df4c5 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/FloatsSortedViewIterator.html @@ -0,0 +1,253 @@ + + + + + +Uses of Class org.apache.datasketches.quantilescommon.FloatsSortedViewIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantilescommon.FloatsSortedViewIterator

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/GenericInequalitySearch.Inequality.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/GenericInequalitySearch.Inequality.html new file mode 100644 index 000000000..a8a67fce4 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/GenericInequalitySearch.Inequality.html @@ -0,0 +1,229 @@ + + + + + +Uses of Class org.apache.datasketches.quantilescommon.GenericInequalitySearch.Inequality (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantilescommon.GenericInequalitySearch.Inequality

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/GenericInequalitySearch.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/GenericInequalitySearch.html new file mode 100644 index 000000000..1dcc3c40b --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/GenericInequalitySearch.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.quantilescommon.GenericInequalitySearch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantilescommon.GenericInequalitySearch

+
+
No usage of org.apache.datasketches.quantilescommon.GenericInequalitySearch
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/GenericPartitionBoundaries.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/GenericPartitionBoundaries.html new file mode 100644 index 000000000..5a4d4dd0f --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/GenericPartitionBoundaries.html @@ -0,0 +1,325 @@ + + + + + +Uses of Class org.apache.datasketches.quantilescommon.GenericPartitionBoundaries (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantilescommon.GenericPartitionBoundaries

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/GenericSortedView.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/GenericSortedView.html new file mode 100644 index 000000000..7a87d3b4b --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/GenericSortedView.html @@ -0,0 +1,260 @@ + + + + + +Uses of Interface org.apache.datasketches.quantilescommon.GenericSortedView (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.quantilescommon.GenericSortedView

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/GenericSortedViewIterator.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/GenericSortedViewIterator.html new file mode 100644 index 000000000..bbd916218 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/GenericSortedViewIterator.html @@ -0,0 +1,254 @@ + + + + + +Uses of Class org.apache.datasketches.quantilescommon.GenericSortedViewIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantilescommon.GenericSortedViewIterator

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/InequalitySearch.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/InequalitySearch.html new file mode 100644 index 000000000..c7ef02bb7 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/InequalitySearch.html @@ -0,0 +1,264 @@ + + + + + +Uses of Class org.apache.datasketches.quantilescommon.InequalitySearch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantilescommon.InequalitySearch

+
+
+
    +
  • + + + + + + + + + + + + +
    Packages that use InequalitySearch 
    PackageDescription
    org.apache.datasketches.quantilescommon +
    This package contains common tools and methods for the quantiles, kll and + req packages.
    +
    +
  • +
  • +
      +
    • +
      + + +

      Uses of InequalitySearch in org.apache.datasketches.quantilescommon

      + + + + + + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.quantilescommon that return InequalitySearch 
      Modifier and TypeMethodDescription
      static InequalitySearchInequalitySearch.valueOf​(String name) +
      Returns the enum constant of this type with the specified name.
      +
      static InequalitySearch[]InequalitySearch.values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.quantilescommon with parameters of type InequalitySearch 
      Modifier and TypeMethodDescription
      static intInequalitySearch.find​(double[] arr, + int low, + int high, + double v, + InequalitySearch crit) +
      Binary Search for the index of the double value in the given search range that satisfies + the given InequalitySearch criterion.
      +
      static intInequalitySearch.find​(float[] arr, + int low, + int high, + float v, + InequalitySearch crit) +
      Binary Search for the index of the float value in the given search range that satisfies + the given InequalitySearch criterion.
      +
      static intInequalitySearch.find​(long[] arr, + int low, + int high, + double v, + InequalitySearch crit) +
      Binary Search for the index of the double value in the given search range that satisfies + the given InequalitySearch criterion.
      +
      static intInequalitySearch.find​(long[] arr, + int low, + int high, + long v, + InequalitySearch crit) +
      Binary Search for the index of the long value in the given search range that satisfies + the given InequalitySearch criterion.
      +
      +
      +
    • +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/PartitionBoundaries.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/PartitionBoundaries.html new file mode 100644 index 000000000..98c1784fe --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/PartitionBoundaries.html @@ -0,0 +1,198 @@ + + + + + +Uses of Interface org.apache.datasketches.quantilescommon.PartitionBoundaries (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.quantilescommon.PartitionBoundaries

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/PartitioningFeature.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/PartitioningFeature.html new file mode 100644 index 000000000..ee0361cef --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/PartitioningFeature.html @@ -0,0 +1,282 @@ + + + + + +Uses of Interface org.apache.datasketches.quantilescommon.PartitioningFeature (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.quantilescommon.PartitioningFeature

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantileSearchCriteria.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantileSearchCriteria.html new file mode 100644 index 000000000..4941993b1 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantileSearchCriteria.html @@ -0,0 +1,995 @@ + + + + + +Uses of Class org.apache.datasketches.quantilescommon.QuantileSearchCriteria (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantilescommon.QuantileSearchCriteria

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesAPI.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesAPI.html new file mode 100644 index 000000000..1c72f1656 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesAPI.html @@ -0,0 +1,350 @@ + + + + + +Uses of Interface org.apache.datasketches.quantilescommon.QuantilesAPI (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.quantilescommon.QuantilesAPI

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesDoublesAPI.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesDoublesAPI.html new file mode 100644 index 000000000..51ead84c8 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesDoublesAPI.html @@ -0,0 +1,243 @@ + + + + + +Uses of Interface org.apache.datasketches.quantilescommon.QuantilesDoublesAPI (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.quantilescommon.QuantilesDoublesAPI

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesDoublesSketchIterator.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesDoublesSketchIterator.html new file mode 100644 index 000000000..225b72520 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesDoublesSketchIterator.html @@ -0,0 +1,290 @@ + + + + + +Uses of Interface org.apache.datasketches.quantilescommon.QuantilesDoublesSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.quantilescommon.QuantilesDoublesSketchIterator

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesFloatsAPI.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesFloatsAPI.html new file mode 100644 index 000000000..0bda3497a --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesFloatsAPI.html @@ -0,0 +1,230 @@ + + + + + +Uses of Interface org.apache.datasketches.quantilescommon.QuantilesFloatsAPI (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.quantilescommon.QuantilesFloatsAPI

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesFloatsSketchIterator.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesFloatsSketchIterator.html new file mode 100644 index 000000000..d3e00f6d4 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesFloatsSketchIterator.html @@ -0,0 +1,289 @@ + + + + + +Uses of Interface org.apache.datasketches.quantilescommon.QuantilesFloatsSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.quantilescommon.QuantilesFloatsSketchIterator

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesGenericAPI.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesGenericAPI.html new file mode 100644 index 000000000..11613843c --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesGenericAPI.html @@ -0,0 +1,268 @@ + + + + + +Uses of Interface org.apache.datasketches.quantilescommon.QuantilesGenericAPI (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.quantilescommon.QuantilesGenericAPI

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesGenericSketchIterator.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesGenericSketchIterator.html new file mode 100644 index 000000000..af1e69258 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesGenericSketchIterator.html @@ -0,0 +1,290 @@ + + + + + +Uses of Interface org.apache.datasketches.quantilescommon.QuantilesGenericSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.quantilescommon.QuantilesGenericSketchIterator

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesSketchIterator.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesSketchIterator.html new file mode 100644 index 000000000..4115c6f0c --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesSketchIterator.html @@ -0,0 +1,333 @@ + + + + + +Uses of Interface org.apache.datasketches.quantilescommon.QuantilesSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.quantilescommon.QuantilesSketchIterator

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesUtil.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesUtil.html new file mode 100644 index 000000000..3c29d3a88 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/QuantilesUtil.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.quantilescommon.QuantilesUtil (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantilescommon.QuantilesUtil

+
+
No usage of org.apache.datasketches.quantilescommon.QuantilesUtil
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/SortedView.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/SortedView.html new file mode 100644 index 000000000..ed4b3225d --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/SortedView.html @@ -0,0 +1,325 @@ + + + + + +Uses of Interface org.apache.datasketches.quantilescommon.SortedView (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.quantilescommon.SortedView

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/SortedViewIterator.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/SortedViewIterator.html new file mode 100644 index 000000000..773b38a1e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/class-use/SortedViewIterator.html @@ -0,0 +1,229 @@ + + + + + +Uses of Class org.apache.datasketches.quantilescommon.SortedViewIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.quantilescommon.SortedViewIterator

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/package-summary.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/package-summary.html new file mode 100644 index 000000000..dd9555cf9 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/package-summary.html @@ -0,0 +1,348 @@ + + + + + +org.apache.datasketches.quantilescommon (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches.quantilescommon

+
+
+
+ + +
This package contains common tools and methods for the quantiles, kll and + req packages.
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    DoublesSortedView +
    The Sorted View for quantile sketches of primitive type double.
    +
    FloatsSortedView +
    The Sorted View for quantiles of primitive type float.
    +
    GenericSortedView<T> +
    The Sorted View for quantiles of generic type.
    +
    PartitionBoundaries +
    This defines a set of results computed from the getParitionBoundaries() function and + encapsulates the basic methods needed to construct actual partitions based on generic items.
    +
    PartitioningFeature<T> +
    This enables the special functions for performing efficient partitioning of massive data.
    +
    QuantilesAPI +
    This is a stochastic streaming sketch that enables near-real time analysis of the + approximate distribution of items from a very large stream in a single pass, requiring only + that the items are comparable.
    +
    QuantilesDoublesAPI +
    The Quantiles API for item type double.
    +
    QuantilesDoublesSketchIterator +
    The quantiles sketch iterator for primitive type double.
    +
    QuantilesFloatsAPI +
    The Quantiles API for item type float.
    +
    QuantilesFloatsSketchIterator +
    The quantiles sketch iterator for primitive type float.
    +
    QuantilesGenericAPI<T> +
    The Quantiles API for item type generic.
    +
    QuantilesGenericSketchIterator<T> +
    The quantiles sketch iterator for generic types.
    +
    QuantilesSketchIterator +
    This is the base interface for the SketchIterator hierarchy used for viewing the + non-ordered quantiles retained by a sketch.
    +
    SortedView +
    This is the base interface for the Sorted View interface hierarchy and defines the methods that are type independent.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    BinarySearch +
    Contains common equality binary search algorithms.
    +
    DoublesSortedViewIterator +
    Iterator over quantile sketches of primitive type double.
    +
    FloatsSortedViewIterator +
    Iterator over quantile sketches of primitive type float.
    +
    GenericInequalitySearch +
    This provides efficient, unique and unambiguous binary searching for inequality comparison criteria + for ordered arrays of values that may include duplicate values.
    +
    GenericPartitionBoundaries<T> +
    Implements PartitionBoundaries
    +
    GenericSortedViewIterator<T> +
    Iterator over quantile sketches of generic type.
    +
    QuantilesUtil +
    Utilities for the quantiles sketches.
    +
    SortedViewIterator +
    This is the base interface for the SortedViewIterator hierarchy used with a SortedView obtained + from a quantile-type sketch.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    GenericInequalitySearch.Inequality +
    The enumerator of inequalities
    +
    InequalitySearch +
    This provides efficient, unique and unambiguous binary searching for inequality comparison criteria + for ordered arrays of values that may include duplicate values.
    +
    QuantileSearchCriteria +
    These search criteria are used by the KLL, REQ and Classic Quantiles sketches in the DataSketches library.
    +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/package-tree.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/package-tree.html new file mode 100644 index 000000000..4021f06e8 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/package-tree.html @@ -0,0 +1,218 @@ + + + + + +org.apache.datasketches.quantilescommon Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches.quantilescommon

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+

Interface Hierarchy

+ +
+
+

Enum Hierarchy

+ +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/quantilescommon/package-use.html b/docs/5.0.2/org/apache/datasketches/quantilescommon/package-use.html new file mode 100644 index 000000000..d6ad71fab --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/quantilescommon/package-use.html @@ -0,0 +1,646 @@ + + + + + +Uses of Package org.apache.datasketches.quantilescommon (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches.quantilescommon

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/req/ReqDebug.html b/docs/5.0.2/org/apache/datasketches/req/ReqDebug.html new file mode 100644 index 000000000..0025b841f --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/req/ReqDebug.html @@ -0,0 +1,450 @@ + + + + + +ReqDebug (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface ReqDebug

+
+
+
+
    +
  • +
    +
    public interface ReqDebug
    +
    The signaling interface that allows comprehensive analysis of the ReqSketch and ReqCompactor + while eliminating code clutter in the main classes. The implementation of this interface can be + found in the test tree.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        emitStart

        +
        void emitStart​(ReqSketch sk)
        +
        Emit the start signal
        +
        +
        Parameters:
        +
        sk - the sketch
        +
        +
      • +
      + + + +
        +
      • +

        emitStartCompress

        +
        void emitStartCompress()
        +
        Emit Start Compress
        +
      • +
      + + + +
        +
      • +

        emitCompressDone

        +
        void emitCompressDone()
        +
        Emit compress done.
        +
      • +
      + + + +
        +
      • +

        emitAllHorizList

        +
        void emitAllHorizList()
        +
        Emit all horizontal lists
        +
      • +
      + + + +
        +
      • +

        emitMustAddCompactor

        +
        void emitMustAddCompactor()
        +
        Emit Must add compactor
        +
      • +
      + + + +
        +
      • +

        emitCompactingStart

        +
        void emitCompactingStart​(byte lgWeight)
        +
        Emit Compaction Start.
        +
        +
        Parameters:
        +
        lgWeight - compactor lgWeight or height
        +
        +
      • +
      + + + +
        +
      • +

        emitNewCompactor

        +
        void emitNewCompactor​(byte lgWeight)
        +
        Emit new compactor configuration
        +
        +
        Parameters:
        +
        lgWeight - the log weight
        +
        +
      • +
      + + + +
        +
      • +

        emitAdjSecSizeNumSec

        +
        void emitAdjSecSizeNumSec​(byte lgWeight)
        +
        Emit adjusting section size and number of sections.
        +
        +
        Parameters:
        +
        lgWeight - the log weight
        +
        +
      • +
      + + + +
        +
      • +

        emitCompactionDetail

        +
        void emitCompactionDetail​(int compactionStart,
        +                          int compactionEnd,
        +                          int secsToCompact,
        +                          int promoteLen,
        +                          boolean coin)
        +
        Emit Compaction details.
        +
        +
        Parameters:
        +
        compactionStart - the offset of compaction start
        +
        compactionEnd - the offset of compaction end
        +
        secsToCompact - the number of sections to compact
        +
        promoteLen - the length of the promotion field
        +
        coin - the state of the random coin.
        +
        +
      • +
      + + + +
        +
      • +

        emitCompactionDone

        +
        void emitCompactionDone​(byte lgWeight)
        +
        Emit compaction done and number of compactions so far.
        +
        +
        Parameters:
        +
        lgWeight - the log weight
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/req/ReqSketch.html b/docs/5.0.2/org/apache/datasketches/req/ReqSketch.html new file mode 100644 index 000000000..687f320b2 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/req/ReqSketch.html @@ -0,0 +1,1351 @@ + + + + + +ReqSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ReqSketch

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    QuantilesAPI, QuantilesFloatsAPI
    +
    +
    +
    public final class ReqSketch
    +extends Object
    +
    This Relative Error Quantiles Sketch is the Java implementation based on the paper + "Relative Error Streaming Quantiles" by Graham Cormode, Zohar Karnin, Edo Liberty, + Justin Thaler, Pavel Veselý, and loosely derived from a Python prototype written by Pavel Veselý. + +

    Reference: https://arxiv.org/abs/2004.01668

    + +

    This implementation differs from the algorithm described in the paper in the following:

    + +
      +
    • The algorithm requires no upper bound on the stream length. + Instead, each relative-compactor counts the number of compaction operations performed + so far (via variable state). Initially, the relative-compactor starts with INIT_NUMBER_OF_SECTIONS. + Each time the number of compactions (variable state) exceeds 2^{numSections - 1}, we double + numSections. Note that after merging the sketch with another one variable state may not correspond + to the number of compactions performed at a particular level, however, since the state variable + never exceeds the number of compactions, the guarantees of the sketch remain valid.
    • + +
    • The size of each section (variable k and sectionSize in the code and parameter k in + the paper) is initialized with a number set by the user via variable k. + When the number of sections doubles, we decrease sectionSize by a factor of sqrt(2). + This is applied at each level separately. Thus, when we double the number of sections, the + nominal compactor size increases by a factor of approx. sqrt(2) (+/- rounding).
    • + +
    • The merge operation here does not perform "special compactions", which are used in the paper + to allow for a tight mathematical analysis of the sketch.
    • +
    + +

    This implementation provides a number of capabilities not discussed in the paper or provided + in the Python prototype.

    + +
    • The Python prototype only implemented high accuracy for low ranks. This implementation + provides the user with the ability to choose either high rank accuracy or low rank accuracy at + the time of sketch construction.
    • +
    • The Python prototype only implemented a comparison criterion of "INCLUSIVE". This implementation + allows the user to switch back and forth between the "INCLUSIVE" criterion and the "EXCLUSIVE" criterion.
    • +
    • This implementation provides extensive debug visibility into the operation of the sketch with + two levels of detail output. This is not only useful for debugging, but is a powerful tool to + help users understand how the sketch works.
    • +
    +
    +
    Author:
    +
    Edo Liberty, Pavel Vesely, Lee Rhodes
    +
    See Also:
    +
    QuantilesAPI
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static ReqSketchBuilderbuilder() +
      Returns a new ReqSketchBuilder
      +
      double[]getCDF​(float[] splitPoints, + QuantileSearchCriteria searchCrit) +
      Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints.
      +
      booleangetHighRankAccuracyMode() +
      If true, the high ranks are prioritized for better accuracy.
      +
      intgetK() +
      Gets the user configured parameter k, which controls the accuracy of the sketch + and its memory space usage.
      +
      floatgetMaxItem() +
      Returns the maximum item of the stream.
      +
      floatgetMinItem() +
      Returns the minimum item of the stream.
      +
      longgetN() +
      Gets the length of the input stream offered to the sketch..
      +
      intgetNumRetained() +
      Gets the number of quantiles retained by the sketch.
      +
      double[]getPMF​(float[] splitPoints, + QuantileSearchCriteria searchCrit) +
      Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints.
      +
      floatgetQuantile​(double normRank, + QuantileSearchCriteria searchCrit) +
      Gets the approximate quantile of the given normalized rank and the given search criterion.
      +
      floatgetQuantileLowerBound​(double rank) +
      Gets the lower bound of the quantile confidence interval in which the quantile of the + given rank exists.
      +
      floatgetQuantileLowerBound​(double rank, + int numStdDev) 
      float[]getQuantiles​(double[] normRanks, + QuantileSearchCriteria searchCrit) +
      Gets an array of quantiles from the given array of normalized ranks.
      +
      floatgetQuantileUpperBound​(double rank) +
      Gets the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists.
      +
      floatgetQuantileUpperBound​(double rank, + int numStdDev) 
      doublegetRank​(float quantile, + QuantileSearchCriteria searchCrit) +
      Gets the normalized rank corresponding to the given a quantile.
      +
      doublegetRankLowerBound​(double rank) +
      Gets the lower bound of the rank confidence interval in which the true rank of the + given rank exists.
      +
      doublegetRankLowerBound​(double rank, + int numStdDev) +
      Gets an approximate lower bound rank of the given normalized rank.
      +
      double[]getRanks​(float[] quantiles, + QuantileSearchCriteria searchCrit) +
      Gets an array of normalized ranks corresponding to the given array of quantiles and the given + search criterion.
      +
      doublegetRankUpperBound​(double rank) +
      Gets the upper bound of the rank confidence interval in which the true rank of the + given rank exists.
      +
      doublegetRankUpperBound​(double rank, + int numStdDev) +
      Gets an approximate upper bound rank of the given rank.
      +
      static doublegetRSE​(int k, + double rank, + boolean hra, + long totalN) +
      Returns an a priori estimate of relative standard error (RSE, expressed as a number in [0,1]).
      +
      intgetSerializedSizeBytes() +
      Returns the current number of bytes this Sketch would require if serialized.
      +
      FloatsSortedViewgetSortedView() +
      Gets the sorted view of this sketch
      +
      booleanhasMemory() +
      Returns true if this sketch's data structure is backed by Memory or WritableMemory.
      +
      static ReqSketchheapify​(org.apache.datasketches.memory.Memory mem) +
      Returns an ReqSketch on the heap from a Memory image of the sketch.
      +
      booleanisDirect() +
      Returns true if this sketch's data structure is off-heap (a.k.a., Direct or Native memory).
      +
      booleanisEmpty() +
      Returns true if this sketch is empty.
      +
      booleanisEstimationMode() +
      Returns true if this sketch is in estimation mode.
      +
      booleanisReadOnly() +
      Returns true if this sketch is read only.
      +
      QuantilesFloatsSketchIteratoriterator() +
      Gets the iterator for this sketch, which is not sorted.
      +
      ReqSketchmerge​(ReqSketch other) +
      Merge other sketch into this one.
      +
      voidreset() +
      Resets this sketch to the empty state.
      +
      byte[]toByteArray() +
      Returns a byte array representation of this sketch.
      +
      StringtoString() +
      Returns a summary of the key parameters of the sketch.
      +
      voidupdate​(float item) +
      Updates this sketch with the given item.
      +
      StringviewCompactorDetail​(String fmt, + boolean allData) +
      A detailed, human readable view of the sketch compactors and their data.
      +
      + + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        builder

        +
        public static final ReqSketchBuilder builder()
        +
        Returns a new ReqSketchBuilder
        +
        +
        Returns:
        +
        a new ReqSketchBuilder
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static ReqSketch heapify​(org.apache.datasketches.memory.Memory mem)
        +
        Returns an ReqSketch on the heap from a Memory image of the sketch.
        +
        +
        Parameters:
        +
        mem - The Memory object holding a valid image of an ReqSketch
        +
        Returns:
        +
        an ReqSketch on the heap from a Memory image of the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getK

        +
        public int getK()
        +
        Description copied from interface: QuantilesAPI
        +
        Gets the user configured parameter k, which controls the accuracy of the sketch + and its memory space usage.
        +
        +
        Specified by:
        +
        getK in interface QuantilesAPI
        +
        Returns:
        +
        the user configured parameter k, which controls the accuracy of the sketch + and its memory space usage.
        +
        +
      • +
      + + + +
        +
      • +

        getCDF

        +
        public double[] getCDF​(float[] splitPoints,
        +                       QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesFloatsAPI
        +
        Returns an approximation to the Cumulative Distribution Function (CDF) of the input stream + as a monotonically increasing array of double ranks (or cumulative probabilities) on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(false) function.

        +
        +
        Specified by:
        +
        getCDF in interface QuantilesFloatsAPI
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 overlapping intervals. + +

        The start of each interval is below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and the end of the interval + is the rank or cumulative probability corresponding to the split point.

        + +

        The (m+1)th interval represents 100% of the distribution represented by the sketch + and consistent with the definition of a cumulative probability distribution, thus the (m+1)th + rank or probability in the returned array is always 1.0.

        + +

        If a split point exactly equals a retained item of the sketch and the search criterion is:

        + +
          +
        • INCLUSIVE, the resulting cumulative probability will include that item.
        • +
        • EXCLUSIVE, the resulting cumulative probability will not include the weight of that split point.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a discrete CDF array of m+1 double ranks (or cumulative probabilities) on the interval [0.0, 1.0].
        +
        +
      • +
      + + + +
        +
      • +

        getHighRankAccuracyMode

        +
        public boolean getHighRankAccuracyMode()
        +
        If true, the high ranks are prioritized for better accuracy. Otherwise + the low ranks are prioritized for better accuracy. This state is chosen during sketch + construction.
        +
        +
        Returns:
        +
        the high ranks accuracy state.
        +
        +
      • +
      + + + +
        +
      • +

        getMaxItem

        +
        public float getMaxItem()
        +
        Description copied from interface: QuantilesFloatsAPI
        +
        Returns the maximum item of the stream. This is provided for convenience, but may be different from the largest + item retained by the sketch algorithm.
        +
        +
        Specified by:
        +
        getMaxItem in interface QuantilesFloatsAPI
        +
        Returns:
        +
        the maximum item of the stream
        +
        +
      • +
      + + + +
        +
      • +

        getMinItem

        +
        public float getMinItem()
        +
        Description copied from interface: QuantilesFloatsAPI
        +
        Returns the minimum item of the stream. This is provided for convenience, but is distinct from the smallest + item retained by the sketch algorithm.
        +
        +
        Specified by:
        +
        getMinItem in interface QuantilesFloatsAPI
        +
        Returns:
        +
        the minimum item of the stream
        +
        +
      • +
      + + + +
        +
      • +

        getN

        +
        public long getN()
        +
        Description copied from interface: QuantilesAPI
        +
        Gets the length of the input stream offered to the sketch..
        +
        +
        Specified by:
        +
        getN in interface QuantilesAPI
        +
        Returns:
        +
        the length of the input stream offered to the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getPMF

        +
        public double[] getPMF​(float[] splitPoints,
        +                       QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesFloatsAPI
        +
        Returns an approximation to the Probability Mass Function (PMF) of the input stream + as an array of probability masses as doubles on the interval [0.0, 1.0], + given a set of splitPoints. + +

        The resulting approximations have a probabilistic guarantee that can be obtained from the + getNormalizedRankError(true) function.

        +
        +
        Specified by:
        +
        getPMF in interface QuantilesFloatsAPI
        +
        Parameters:
        +
        splitPoints - an array of m unique, monotonically increasing items + (of the same type as the input items) + that divide the item input domain into m+1 consecutive, non-overlapping intervals. + +

        Each interval except for the end intervals starts with a split point and ends with the next split + point in sequence.

        + +

        The first interval starts below the lowest item retained by the sketch + corresponding to a zero rank or zero probability, and ends with the first split point

        + +

        The last (m+1)th interval starts with the last split point and ends after the last + item retained by the sketch corresponding to a rank or probability of 1.0.

        + +

        The sum of the probability masses of all (m+1) intervals is 1.0.

        + +

        If the search criterion is:

        + +
          +
        • INCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will include that item. If the lower split point equals an item retained by the sketch, the interval will exclude + that item.
        • +
        • EXCLUSIVE, and the upper split point of an interval equals an item retained by the sketch, the interval + will exclude that item. If the lower split point equals an item retained by the sketch, the interval will include + that item.
        • +
        + +

        It is not recommended to include either the minimum or maximum items of the input stream.

        +
        searchCrit - the desired search criteria.
        +
        Returns:
        +
        a PMF array of m+1 probability masses as doubles on the interval [0.0, 1.0].
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        public float getQuantile​(double normRank,
        +                         QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesFloatsAPI
        +
        Gets the approximate quantile of the given normalized rank and the given search criterion.
        +
        +
        Specified by:
        +
        getQuantile in interface QuantilesFloatsAPI
        +
        Parameters:
        +
        normRank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        searchCrit - If INCLUSIVE, the given rank includes all quantiles ≤ + the quantile directly corresponding to the given rank. + If EXCLUSIVE, he given rank includes all quantiles < + the quantile directly corresponding to the given rank.
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantiles

        +
        public float[] getQuantiles​(double[] normRanks,
        +                            QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesFloatsAPI
        +
        Gets an array of quantiles from the given array of normalized ranks.
        +
        +
        Specified by:
        +
        getQuantiles in interface QuantilesFloatsAPI
        +
        Parameters:
        +
        normRanks - the given array of normalized ranks, each of which must be + in the interval [0.0,1.0].
        +
        searchCrit - if INCLUSIVE, the given ranks include all quantiles ≤ + the quantile directly corresponding to each rank.
        +
        Returns:
        +
        an array of quantiles corresponding to the given array of normalized ranks.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantileLowerBound

        +
        public float getQuantileLowerBound​(double rank)
        +
        Gets the lower bound of the quantile confidence interval in which the quantile of the + given rank exists. + +

        Although it is possible to estimate the probability that the true quantile + exists within the quantile confidence interval specified by the upper and lower quantile bounds, + it is not possible to guarantee the width of the quantile confidence interval + as an additive or multiplicative percent of the true quantile.

        + The approximate probability that the true quantile is within the confidence interval + specified by the upper and lower quantile bounds for this sketch is 0.95.
        +
        +
        Specified by:
        +
        getQuantileLowerBound in interface QuantilesFloatsAPI
        +
        Parameters:
        +
        rank - the given normalized rank
        +
        Returns:
        +
        the lower bound of the quantile confidence interval in which the quantile of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantileLowerBound

        +
        public float getQuantileLowerBound​(double rank,
        +                                   int numStdDev)
        +
      • +
      + + + +
        +
      • +

        getQuantileUpperBound

        +
        public float getQuantileUpperBound​(double rank)
        +
        Gets the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists. + +

        Although it is possible to estimate the probability that the true quantile + exists within the quantile confidence interval specified by the upper and lower quantile bounds, + it is not possible to guarantee the width of the quantile interval + as an additive or multiplicative percent of the true quantile.

        + The approximate probability that the true quantile is within the confidence interval + specified by the upper and lower quantile bounds for this sketch is 0.95.
        +
        +
        Specified by:
        +
        getQuantileUpperBound in interface QuantilesFloatsAPI
        +
        Parameters:
        +
        rank - the given normalized rank
        +
        Returns:
        +
        the upper bound of the quantile confidence interval in which the true quantile of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantileUpperBound

        +
        public float getQuantileUpperBound​(double rank,
        +                                   int numStdDev)
        +
      • +
      + + + +
        +
      • +

        getRank

        +
        public double getRank​(float quantile,
        +                      QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesFloatsAPI
        +
        Gets the normalized rank corresponding to the given a quantile.
        +
        +
        Specified by:
        +
        getRank in interface QuantilesFloatsAPI
        +
        Parameters:
        +
        quantile - the given quantile
        +
        searchCrit - if INCLUSIVE the given quantile is included into the rank.
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getRankLowerBound

        +
        public double getRankLowerBound​(double rank)
        +
        Gets the lower bound of the rank confidence interval in which the true rank of the + given rank exists. + The approximate probability that the true rank is within the confidence interval + specified by the upper and lower rank bounds for this sketch is 0.95.
        +
        +
        Parameters:
        +
        rank - the given normalized rank.
        +
        Returns:
        +
        the lower bound of the rank confidence interval in which the true rank of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getRankLowerBound

        +
        public double getRankLowerBound​(double rank,
        +                                int numStdDev)
        +
        Gets an approximate lower bound rank of the given normalized rank.
        +
        +
        Parameters:
        +
        rank - the given rank, a number between 0 and 1.0.
        +
        numStdDev - the number of standard deviations. Must be 1, 2, or 3.
        +
        Returns:
        +
        an approximate lower bound rank.
        +
        +
      • +
      + + + +
        +
      • +

        getRanks

        +
        public double[] getRanks​(float[] quantiles,
        +                         QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: QuantilesFloatsAPI
        +
        Gets an array of normalized ranks corresponding to the given array of quantiles and the given + search criterion.
        +
        +
        Specified by:
        +
        getRanks in interface QuantilesFloatsAPI
        +
        Parameters:
        +
        quantiles - the given array of quantiles
        +
        searchCrit - if INCLUSIVE, the given quantiles include the rank directly corresponding to each quantile.
        +
        Returns:
        +
        an array of normalized ranks corresponding to the given array of quantiles.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getRankUpperBound

        +
        public double getRankUpperBound​(double rank)
        +
        Gets the upper bound of the rank confidence interval in which the true rank of the + given rank exists. + The approximate probability that the true rank is within the confidence interval + specified by the upper and lower rank bounds for this sketch is 0.95.
        +
        +
        Parameters:
        +
        rank - the given normalized rank.
        +
        Returns:
        +
        the upper bound of the rank confidence interval in which the true rank of the + given rank exists.
        +
        +
      • +
      + + + +
        +
      • +

        getRankUpperBound

        +
        public double getRankUpperBound​(double rank,
        +                                int numStdDev)
        +
        Gets an approximate upper bound rank of the given rank.
        +
        +
        Parameters:
        +
        rank - the given rank, a number between 0 and 1.0.
        +
        numStdDev - the number of standard deviations. Must be 1, 2, or 3.
        +
        Returns:
        +
        an approximate upper bound rank.
        +
        +
      • +
      + + + +
        +
      • +

        getNumRetained

        +
        public int getNumRetained()
        +
        Description copied from interface: QuantilesAPI
        +
        Gets the number of quantiles retained by the sketch.
        +
        +
        Specified by:
        +
        getNumRetained in interface QuantilesAPI
        +
        Returns:
        +
        the number of quantiles retained by the sketch
        +
        +
      • +
      + + + +
        +
      • +

        getSerializedSizeBytes

        +
        public int getSerializedSizeBytes()
        +
        Description copied from interface: QuantilesFloatsAPI
        +
        Returns the current number of bytes this Sketch would require if serialized.
        +
        +
        Specified by:
        +
        getSerializedSizeBytes in interface QuantilesFloatsAPI
        +
        Returns:
        +
        the number of bytes this sketch would require if serialized.
        +
        +
      • +
      + + + + + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch is empty.
        +
        +
        Specified by:
        +
        isEmpty in interface QuantilesAPI
        +
        Returns:
        +
        true if this sketch is empty.
        +
        +
      • +
      + + + +
        +
      • +

        isEstimationMode

        +
        public boolean isEstimationMode()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch is in estimation mode.
        +
        +
        Specified by:
        +
        isEstimationMode in interface QuantilesAPI
        +
        Returns:
        +
        true if this sketch is in estimation mode.
        +
        +
      • +
      + + + + + + + +
        +
      • +

        merge

        +
        public ReqSketch merge​(ReqSketch other)
        +
        Merge other sketch into this one. The other sketch is not modified.
        +
        +
        Parameters:
        +
        other - sketch to be merged into this one.
        +
        Returns:
        +
        this
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Resets this sketch to the empty state. + If the sketch is read only this does nothing. + +

        The parameter k will not change.

        +

        The parameters k, highRankAccuracy, and reqDebug will not change.

        +
        +
        Specified by:
        +
        reset in interface QuantilesAPI
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray()
        +
        Description copied from interface: QuantilesFloatsAPI
        +
        Returns a byte array representation of this sketch.
        +
        +
        Specified by:
        +
        toByteArray in interface QuantilesFloatsAPI
        +
        Returns:
        +
        a byte array representation of this sketch.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns a summary of the key parameters of the sketch.
        +
        +
        Specified by:
        +
        toString in interface QuantilesAPI
        +
        Returns:
        +
        a summary of the key parameters of the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(float item)
        +
        Description copied from interface: QuantilesFloatsAPI
        +
        Updates this sketch with the given item.
        +
        +
        Specified by:
        +
        update in interface QuantilesFloatsAPI
        +
        Parameters:
        +
        item - from a stream of quantiles. NaNs are ignored.
        +
        +
      • +
      + + + +
        +
      • +

        viewCompactorDetail

        +
        public String viewCompactorDetail​(String fmt,
        +                                  boolean allData)
        +
        A detailed, human readable view of the sketch compactors and their data. + Each compactor string is prepended by the compactor lgWeight, the current number of retained + quantiles of the compactor and the current nominal capacity of the compactor.
        +
        +
        Parameters:
        +
        fmt - the format string for the quantiles; example: "%4.0f".
        +
        allData - all the retained quantiles for the sketch will be output by + compactor level. Otherwise, just a summary will be output.
        +
        Returns:
        +
        a detailed view of the compactors and their data
        +
        +
      • +
      + + + +
        +
      • +

        getRSE

        +
        public static double getRSE​(int k,
        +                            double rank,
        +                            boolean hra,
        +                            long totalN)
        +
        Returns an a priori estimate of relative standard error (RSE, expressed as a number in [0,1]). + Derived from Lemma 12 in https://arxiv.org/abs/2004.01668v2, but the constant factors were + adjusted based on empirical measurements.
        +
        +
        Parameters:
        +
        k - the given size of k
        +
        rank - the given normalized rank, a number in [0,1].
        +
        hra - if true High Rank Accuracy mode is being selected, otherwise, Low Rank Accuracy.
        +
        totalN - an estimate of the total number of items submitted to the sketch.
        +
        Returns:
        +
        an a priori estimate of relative standard error (RSE, expressed as a number in [0,1]).
        +
        +
      • +
      + + + +
        +
      • +

        hasMemory

        +
        public boolean hasMemory()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch's data structure is backed by Memory or WritableMemory.
        +
        +
        Specified by:
        +
        hasMemory in interface QuantilesAPI
        +
        Returns:
        +
        true if this sketch's data structure is backed by Memory or WritableMemory.
        +
        +
      • +
      + + + +
        +
      • +

        isDirect

        +
        public boolean isDirect()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch's data structure is off-heap (a.k.a., Direct or Native memory).
        +
        +
        Specified by:
        +
        isDirect in interface QuantilesAPI
        +
        Returns:
        +
        true if this sketch's data structure is off-heap (a.k.a., Direct or Native memory).
        +
        +
      • +
      + + + +
        +
      • +

        isReadOnly

        +
        public boolean isReadOnly()
        +
        Description copied from interface: QuantilesAPI
        +
        Returns true if this sketch is read only.
        +
        +
        Specified by:
        +
        isReadOnly in interface QuantilesAPI
        +
        Returns:
        +
        true if this sketch is read only.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/req/ReqSketchBuilder.html b/docs/5.0.2/org/apache/datasketches/req/ReqSketchBuilder.html new file mode 100644 index 000000000..f9a6d4568 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/req/ReqSketchBuilder.html @@ -0,0 +1,472 @@ + + + + + +ReqSketchBuilder (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ReqSketchBuilder

+
+
+ +
+
    +
  • +
    +
    public class ReqSketchBuilder
    +extends Object
    +
    For building a new ReqSketch
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ReqSketchBuilder

        +
        public ReqSketchBuilder()
        +
        Constructor for the ReqSketchBuilder.
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        build

        +
        public ReqSketch build()
        +
        Returns a new ReqSketch with the current configuration of the builder.
        +
        +
        Returns:
        +
        a new ReqSketch
        +
        +
      • +
      + + + +
        +
      • +

        getHighRankAccuracy

        +
        public boolean getHighRankAccuracy()
        +
        Gets the builder configured High Rank Accuracy.
        +
        +
        Returns:
        +
        the builder configured High Rank Accuracy.
        +
        +
      • +
      + + + +
        +
      • +

        getK

        +
        public int getK()
        +
        Gets the builder configured k.
        +
        +
        Returns:
        +
        the builder configured k.
        +
        +
      • +
      + + + +
        +
      • +

        getReqDebug

        +
        public ReqDebug getReqDebug()
        +
        Gets the builder configured ReqDebug
        +
        +
        Returns:
        +
        the builder configured ReqDebug, or null.
        +
        +
      • +
      + + + +
        +
      • +

        setHighRankAccuracy

        +
        public ReqSketchBuilder setHighRankAccuracy​(boolean hra)
        +
        This sets the parameter highRankAccuracy.
        +
        +
        Parameters:
        +
        hra - See ReqSketch#ReqSketch(int, boolean, ReqDebug)
        +
        Returns:
        +
        this
        +
        +
      • +
      + + + +
        +
      • +

        setK

        +
        public ReqSketchBuilder setK​(int k)
        +
        This sets the parameter k.
        +
        +
        Parameters:
        +
        k - See ReqSketch#ReqSketch(int, boolean, ReqDebug)
        +
        Returns:
        +
        this
        +
        +
      • +
      + + + +
        +
      • +

        setReqDebug

        +
        public ReqSketchBuilder setReqDebug​(ReqDebug reqDebug)
        +
        This sets the parameter reqDebug.
        +
        +
        Parameters:
        +
        reqDebug - See ReqSketch#ReqSketch(int, boolean, ReqDebug)
        +
        Returns:
        +
        this
        +
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/req/ReqSketchIterator.html b/docs/5.0.2/org/apache/datasketches/req/ReqSketchIterator.html new file mode 100644 index 000000000..b9cc82ff3 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/req/ReqSketchIterator.html @@ -0,0 +1,342 @@ + + + + + +ReqSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ReqSketchIterator

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getQuantile

        +
        public float getQuantile()
        +
        Description copied from interface: QuantilesFloatsSketchIterator
        +
        Gets the float quantile at the current index. + +

        Don't call this before calling next() for the first time + or after getting false from next().

        +
        +
        Specified by:
        +
        getQuantile in interface QuantilesFloatsSketchIterator
        +
        Returns:
        +
        the float quantile at the current index.
        +
        +
      • +
      + + + +
        +
      • +

        getWeight

        +
        public long getWeight()
        +
        Description copied from interface: QuantilesSketchIterator
        +
        Gets the natural weight at the current index. + +

        Don't call this before calling next() for the first time + or after getting false from next().

        +
        +
        Specified by:
        +
        getWeight in interface QuantilesSketchIterator
        +
        Returns:
        +
        the natural weight at the current index.
        +
        +
      • +
      + + + +
        +
      • +

        next

        +
        public boolean next()
        +
        Description copied from interface: QuantilesSketchIterator
        +
        Advances the index and checks if it is valid. + The state of this iterator is undefined before the first call of this method.
        +
        +
        Specified by:
        +
        next in interface QuantilesSketchIterator
        +
        Returns:
        +
        true if the next index is valid.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/req/ReqSketchSortedView.html b/docs/5.0.2/org/apache/datasketches/req/ReqSketchSortedView.html new file mode 100644 index 000000000..ca0b68dde --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/req/ReqSketchSortedView.html @@ -0,0 +1,555 @@ + + + + + +ReqSketchSortedView (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ReqSketchSortedView

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ReqSketchSortedView

        +
        public ReqSketchSortedView​(ReqSketch sketch)
        +
        Constructs this Sorted View given the sketch
        +
        +
        Parameters:
        +
        sketch - the given ReqSketch
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getCumulativeWeights

        +
        public long[] getCumulativeWeights()
        +
        Description copied from interface: SortedView
        +
        Returns the array of cumulative weights from the sketch. + Also known as the natural ranks, which are the Natural Numbers on the interval [1, N].
        +
        +
        Specified by:
        +
        getCumulativeWeights in interface SortedView
        +
        Returns:
        +
        the array of cumulative weights (or natural ranks).
        +
        +
      • +
      + + + +
        +
      • +

        getMaxItem

        +
        public float getMaxItem()
        +
        Description copied from interface: FloatsSortedView
        +
        Returns the maximum item of the stream. This may be distinct from the largest item retained by the + sketch algorithm.
        +
        +
        Specified by:
        +
        getMaxItem in interface FloatsSortedView
        +
        Returns:
        +
        the maximum item of the stream
        +
        +
      • +
      + + + +
        +
      • +

        getMinItem

        +
        public float getMinItem()
        +
        Description copied from interface: FloatsSortedView
        +
        Returns the minimum item of the stream. This may be distinct from the smallest item retained by the + sketch algorithm.
        +
        +
        Specified by:
        +
        getMinItem in interface FloatsSortedView
        +
        Returns:
        +
        the minimum item of the stream
        +
        +
      • +
      + + + +
        +
      • +

        getN

        +
        public long getN()
        +
        Description copied from interface: SortedView
        +
        Returns the total number of items presented to the sourcing sketch.
        +
        +
        Specified by:
        +
        getN in interface SortedView
        +
        Returns:
        +
        the total number of items presented to the sourcing sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getQuantile

        +
        public float getQuantile​(double rank,
        +                         QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: FloatsSortedView
        +
        Gets the approximate quantile of the given normalized rank and the given search criterion.
        +
        +
        Specified by:
        +
        getQuantile in interface FloatsSortedView
        +
        Parameters:
        +
        rank - the given normalized rank, a double in the range [0.0, 1.0].
        +
        searchCrit - If INCLUSIVE, the given rank includes all quantiles ≤ + the quantile directly corresponding to the given rank. + If EXCLUSIVE, he given rank includes all quantiles < + the quantile directly corresponding to the given rank.
        +
        Returns:
        +
        the approximate quantile given the normalized rank.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        getQuantiles

        +
        public float[] getQuantiles()
        +
        Description copied from interface: FloatsSortedView
        +
        Returns an array of all retained quantiles by the sketch.
        +
        +
        Specified by:
        +
        getQuantiles in interface FloatsSortedView
        +
        Returns:
        +
        an array of all retained quantiles by the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getRank

        +
        public double getRank​(float quantile,
        +                      QuantileSearchCriteria searchCrit)
        +
        Description copied from interface: FloatsSortedView
        +
        Gets the normalized rank corresponding to the given a quantile.
        +
        +
        Specified by:
        +
        getRank in interface FloatsSortedView
        +
        Parameters:
        +
        quantile - the given quantile
        +
        searchCrit - if INCLUSIVE the given quantile is included into the rank.
        +
        Returns:
        +
        the normalized rank corresponding to the given quantile.
        +
        See Also:
        +
        QuantileSearchCriteria
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        Description copied from interface: SortedView
        +
        Returns true if this sorted view is empty.
        +
        +
        Specified by:
        +
        isEmpty in interface SortedView
        +
        Returns:
        +
        true if this sorted view is empty.
        +
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/req/class-use/ReqDebug.html b/docs/5.0.2/org/apache/datasketches/req/class-use/ReqDebug.html new file mode 100644 index 000000000..885d0c212 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/req/class-use/ReqDebug.html @@ -0,0 +1,214 @@ + + + + + +Uses of Interface org.apache.datasketches.req.ReqDebug (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.req.ReqDebug

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/req/class-use/ReqSketch.html b/docs/5.0.2/org/apache/datasketches/req/class-use/ReqSketch.html new file mode 100644 index 000000000..e12562057 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/req/class-use/ReqSketch.html @@ -0,0 +1,246 @@ + + + + + +Uses of Class org.apache.datasketches.req.ReqSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.req.ReqSketch

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/req/class-use/ReqSketchBuilder.html b/docs/5.0.2/org/apache/datasketches/req/class-use/ReqSketchBuilder.html new file mode 100644 index 000000000..7f1d2f78e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/req/class-use/ReqSketchBuilder.html @@ -0,0 +1,218 @@ + + + + + +Uses of Class org.apache.datasketches.req.ReqSketchBuilder (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.req.ReqSketchBuilder

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/req/class-use/ReqSketchIterator.html b/docs/5.0.2/org/apache/datasketches/req/class-use/ReqSketchIterator.html new file mode 100644 index 000000000..fc85e9536 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/req/class-use/ReqSketchIterator.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.req.ReqSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.req.ReqSketchIterator

+
+
No usage of org.apache.datasketches.req.ReqSketchIterator
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/req/class-use/ReqSketchSortedView.html b/docs/5.0.2/org/apache/datasketches/req/class-use/ReqSketchSortedView.html new file mode 100644 index 000000000..f397f4ce1 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/req/class-use/ReqSketchSortedView.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.req.ReqSketchSortedView (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.req.ReqSketchSortedView

+
+
No usage of org.apache.datasketches.req.ReqSketchSortedView
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/req/package-summary.html b/docs/5.0.2/org/apache/datasketches/req/package-summary.html new file mode 100644 index 000000000..34263d728 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/req/package-summary.html @@ -0,0 +1,216 @@ + + + + + +org.apache.datasketches.req (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches.req

+
+
+
+ + +
This package is for the implementation of the Relative Error Quantiles sketch algorithm.
+
+
See Also:
+
ReqSketch
+
+
+
    +
  • + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    ReqDebug +
    The signaling interface that allows comprehensive analysis of the ReqSketch and ReqCompactor + while eliminating code clutter in the main classes.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    ReqSketch +
    This Relative Error Quantiles Sketch is the Java implementation based on the paper + "Relative Error Streaming Quantiles" by Graham Cormode, Zohar Karnin, Edo Liberty, + Justin Thaler, Pavel Veselý, and loosely derived from a Python prototype written by Pavel Veselý.
    +
    ReqSketchBuilder +
    For building a new ReqSketch
    +
    ReqSketchIterator +
    Iterator over all retained items of the ReqSketch.
    +
    ReqSketchSortedView +
    The SortedView of the ReqSketch.
    +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/req/package-tree.html b/docs/5.0.2/org/apache/datasketches/req/package-tree.html new file mode 100644 index 000000000..2c13310dc --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/req/package-tree.html @@ -0,0 +1,173 @@ + + + + + +org.apache.datasketches.req Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches.req

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+

Interface Hierarchy

+
    +
  • org.apache.datasketches.req.ReqDebug
  • +
+
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/req/package-use.html b/docs/5.0.2/org/apache/datasketches/req/package-use.html new file mode 100644 index 000000000..58f14c9f1 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/req/package-use.html @@ -0,0 +1,203 @@ + + + + + +Uses of Package org.apache.datasketches.req (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches.req

+
+
+
    +
  • + + + + + + + + + + + + +
    Packages that use org.apache.datasketches.req 
    PackageDescription
    org.apache.datasketches.req +
    This package is for the implementation of the Relative Error Quantiles sketch algorithm.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + + + +
    Classes in org.apache.datasketches.req used by org.apache.datasketches.req 
    ClassDescription
    ReqDebug +
    The signaling interface that allows comprehensive analysis of the ReqSketch and ReqCompactor + while eliminating code clutter in the main classes.
    +
    ReqSketch +
    This Relative Error Quantiles Sketch is the Java implementation based on the paper + "Relative Error Streaming Quantiles" by Graham Cormode, Zohar Karnin, Edo Liberty, + Justin Thaler, Pavel Veselý, and loosely derived from a Python prototype written by Pavel Veselý.
    +
    ReqSketchBuilder +
    For building a new ReqSketch
    +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/ReservoirItemsSketch.html b/docs/5.0.2/org/apache/datasketches/sampling/ReservoirItemsSketch.html new file mode 100644 index 000000000..e33be8490 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/ReservoirItemsSketch.html @@ -0,0 +1,663 @@ + + + + + +ReservoirItemsSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ReservoirItemsSketch<T>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.sampling.ReservoirItemsSketch<T>
    • +
    +
  • +
+
+
    +
  • +
    +
    Type Parameters:
    +
    T - The type of object held in the reservoir.
    +
    +
    +
    public final class ReservoirItemsSketch<T>
    +extends Object
    +
    This sketch provides a reservoir sample over an input stream of items. The sketch contains a + uniform random sample of unweighted items from the stream.
    +
    +
    Author:
    +
    Jon Malkin, Kevin Lang
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      SampleSubsetSummaryestimateSubsetSum​(Predicate<T> predicate) +
      Computes an estimated subset sum from the entire stream for objects matching a given + predicate.
      +
      intgetK() +
      Returns the sketch's value of k, the maximum number of samples stored in the + reservoir.
      +
      longgetN() +
      Returns the number of items processed from the input stream
      +
      intgetNumSamples() +
      Returns the current number of items in the reservoir, which may be smaller than the + reservoir capacity.
      +
      T[]getSamples() +
      Returns a copy of the items in the reservoir, or null if empty.
      +
      T[]getSamples​(Class<?> clazz) +
      Returns a copy of the items in the reservoir as members of Class clazz, or null + if empty.
      +
      static <T> ReservoirItemsSketch<T>heapify​(org.apache.datasketches.memory.Memory srcMem, + ArrayOfItemsSerDe<T> serDe) +
      Returns a sketch instance of this class from the given srcMem, + which must be a Memory representation of this sketch class.
      +
      static <T> ReservoirItemsSketch<T>newInstance​(int k) +
      Construct a mergeable sampling sketch with up to k samples using the default resize + factor (8).
      +
      static <T> ReservoirItemsSketch<T>newInstance​(int k, + ResizeFactor rf) +
      Construct a mergeable sampling sketch with up to k samples using a specified resize factor.
      +
      voidreset() +
      Resets this sketch to the empty state, but retains the original value of k.
      +
      byte[]toByteArray​(ArrayOfItemsSerDe<? super T> serDe) +
      Returns a byte array representation of this sketch.
      +
      byte[]toByteArray​(ArrayOfItemsSerDe<? super T> serDe, + Class<?> clazz) +
      Returns a byte array representation of this sketch.
      +
      StringtoString() +
      Returns a human-readable summary of the sketch, without items.
      +
      static StringtoString​(byte[] byteArr) +
      Returns a human readable string of the preamble of a byte array image of a ReservoirItemsSketch.
      +
      static StringtoString​(org.apache.datasketches.memory.Memory mem) +
      Returns a human readable string of the preamble of a Memory image of a ReservoirItemsSketch.
      +
      voidupdate​(T item) +
      Randomly decide whether or not to include an item in the sample set.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        newInstance

        +
        public static <T> ReservoirItemsSketch<T> newInstance​(int k)
        +
        Construct a mergeable sampling sketch with up to k samples using the default resize + factor (8).
        +
        +
        Type Parameters:
        +
        T - The type of object held in the reservoir.
        +
        Parameters:
        +
        k - Maximum size of sampling. Allocated size may be smaller until reservoir fills. + Unlike many sketches in this package, this value does not need to be a + power of 2.
        +
        Returns:
        +
        A ReservoirLongsSketch initialized with maximum size k and the default resize factor.
        +
        +
      • +
      + + + +
        +
      • +

        newInstance

        +
        public static <T> ReservoirItemsSketch<T> newInstance​(int k,
        +                                                      ResizeFactor rf)
        +
        Construct a mergeable sampling sketch with up to k samples using a specified resize factor.
        +
        +
        Type Parameters:
        +
        T - The type of object held in the reservoir.
        +
        Parameters:
        +
        k - Maximum size of sampling. Allocated size may be smaller until reservoir fills. + Unlike many sketches in this package, this value does not need to be a + power of 2.
        +
        rf - See Resize Factor
        +
        Returns:
        +
        A ReservoirLongsSketch initialized with maximum size k and resize factor rf.
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static <T> ReservoirItemsSketch<T> heapify​(org.apache.datasketches.memory.Memory srcMem,
        +                                                  ArrayOfItemsSerDe<T> serDe)
        +
        Returns a sketch instance of this class from the given srcMem, + which must be a Memory representation of this sketch class.
        +
        +
        Type Parameters:
        +
        T - The type of item this sketch contains
        +
        Parameters:
        +
        srcMem - a Memory representation of a sketch of this class. + See Memory
        +
        serDe - An instance of ArrayOfItemsSerDe
        +
        Returns:
        +
        a sketch instance of this class
        +
        +
      • +
      + + + +
        +
      • +

        getK

        +
        public int getK()
        +
        Returns the sketch's value of k, the maximum number of samples stored in the + reservoir. The current number of items in the sketch may be lower.
        +
        +
        Returns:
        +
        k, the maximum number of samples in the reservoir
        +
        +
      • +
      + + + +
        +
      • +

        getN

        +
        public long getN()
        +
        Returns the number of items processed from the input stream
        +
        +
        Returns:
        +
        n, the number of stream items the sketch has seen
        +
        +
      • +
      + + + +
        +
      • +

        getNumSamples

        +
        public int getNumSamples()
        +
        Returns the current number of items in the reservoir, which may be smaller than the + reservoir capacity.
        +
        +
        Returns:
        +
        the number of items currently in the reservoir
        +
        +
      • +
      + + + + + +
        +
      • +

        update

        +
        public void update​(T item)
        +
        Randomly decide whether or not to include an item in the sample set.
        +
        +
        Parameters:
        +
        item - a unit-weight (equivalently, unweighted) item of the set being sampled from
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Resets this sketch to the empty state, but retains the original value of k.
        +
      • +
      + + + +
        +
      • +

        getSamples

        +
        public T[] getSamples()
        +
        Returns a copy of the items in the reservoir, or null if empty. The returned array length + may be smaller than the reservoir capacity. + +

        In order to allocate an array of generic type T, uses the class of the first item in + the array. This method method may throw an ArrayAssignmentException if the + reservoir stores instances of a polymorphic base class.

        +
        +
        Returns:
        +
        A copy of the reservoir array
        +
        +
      • +
      + + + +
        +
      • +

        getSamples

        +
        public T[] getSamples​(Class<?> clazz)
        +
        Returns a copy of the items in the reservoir as members of Class clazz, or null + if empty. The returned array length may be smaller than the reservoir capacity. + +

        This method allocates an array of class clazz, which must either match or + extend T. This method should be used when objects in the array are all instances of T but + are not necessarily instances of the base class.

        +
        +
        Parameters:
        +
        clazz - A class to which the items are cast before returning
        +
        Returns:
        +
        A copy of the reservoir array
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Returns a human-readable summary of the sketch, without items.
        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        A string version of the sketch summary
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString​(byte[] byteArr)
        +
        Returns a human readable string of the preamble of a byte array image of a ReservoirItemsSketch.
        +
        +
        Parameters:
        +
        byteArr - the given byte array
        +
        Returns:
        +
        a human readable string of the preamble of a byte array image of a ReservoirItemsSketch.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString​(org.apache.datasketches.memory.Memory mem)
        +
        Returns a human readable string of the preamble of a Memory image of a ReservoirItemsSketch.
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        Returns:
        +
        a human readable string of the preamble of a Memory image of a ReservoirItemsSketch.
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray​(ArrayOfItemsSerDe<? super T> serDe)
        +
        Returns a byte array representation of this sketch. May fail for polymorphic item types.
        +
        +
        Parameters:
        +
        serDe - An instance of ArrayOfItemsSerDe
        +
        Returns:
        +
        a byte array representation of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray​(ArrayOfItemsSerDe<? super T> serDe,
        +                          Class<?> clazz)
        +
        Returns a byte array representation of this sketch. Copies contents into an array of the + specified class for serialization to allow for polymorphic types.
        +
        +
        Parameters:
        +
        serDe - An instance of ArrayOfItemsSerDe
        +
        clazz - The class represented by <T>
        +
        Returns:
        +
        a byte array representation of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        estimateSubsetSum

        +
        public SampleSubsetSummary estimateSubsetSum​(Predicate<T> predicate)
        +
        Computes an estimated subset sum from the entire stream for objects matching a given + predicate. Provides a lower bound, estimate, and upper bound using a target of 2 standard + deviations. + +

        This is technically a heuristic method, and tries to err on the conservative side.

        +
        +
        Parameters:
        +
        predicate - A predicate to use when identifying items.
        +
        Returns:
        +
        A summary object containing the estimate, upper and lower bounds, and the total + sketch weight.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/ReservoirItemsUnion.html b/docs/5.0.2/org/apache/datasketches/sampling/ReservoirItemsUnion.html new file mode 100644 index 000000000..6a987658e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/ReservoirItemsUnion.html @@ -0,0 +1,547 @@ + + + + + +ReservoirItemsUnion (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ReservoirItemsUnion<T>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.sampling.ReservoirItemsUnion<T>
    • +
    +
  • +
+
+
    +
  • +
    +
    Type Parameters:
    +
    T - The specific Java type for this sketch
    +
    +
    +
    public final class ReservoirItemsUnion<T>
    +extends Object
    +
    Class to union reservoir samples of generic items. + +

    For efficiency reasons, the unioning process picks one of the two sketches to use as the + base. As a result, we provide only a stateful union. Using the same approach for a merge would + result in unpredictable side effects on the underlying sketches.

    + +

    A union object is created with a maximum value of k, represented using the + ReservoirSize class. The unioning process may cause the actual number of samples to fall below + that maximum value, but never to exceed it. The result of a union will be a reservoir where + each item from the global input has a uniform probability of selection, but there are no + claims about higher order statistics. For instance, in general all possible permutations of + the global input are not equally likely.

    + +

    If taking the union of two reservoirs of different sizes, the output sample will contain no more + than MIN(k_1, k_2) samples.

    +
    +
    Author:
    +
    Jon Malkin, Kevin Lang
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        newInstance

        +
        public static <T> ReservoirItemsUnion<T> newInstance​(int maxK)
        +
        Creates an empty Union with a maximum reservoir capacity of size k.
        +
        +
        Type Parameters:
        +
        T - The type of item this sketch contains
        +
        Parameters:
        +
        maxK - The maximum allowed reservoir capacity for any sketches in the union
        +
        Returns:
        +
        A new ReservoirItemsUnion
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static <T> ReservoirItemsUnion<T> heapify​(org.apache.datasketches.memory.Memory srcMem,
        +                                                 ArrayOfItemsSerDe<T> serDe)
        +
        Instantiates a Union from Memory
        +
        +
        Type Parameters:
        +
        T - The type of item this sketch contains
        +
        Parameters:
        +
        srcMem - Memory object containing a serialized union
        +
        serDe - An instance of ArrayOfItemsSerDe
        +
        Returns:
        +
        A ReservoirItemsUnion created from the provided Memory
        +
        +
      • +
      + + + +
        +
      • +

        getMaxK

        +
        public int getMaxK()
        +
        Returns the maximum allowed reservoir capacity in this union. The current reservoir capacity + may be lower.
        +
        +
        Returns:
        +
        The maximum allowed reservoir capacity in this union.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(ReservoirItemsSketch<T> sketchIn)
        +
        Union the given sketch. This method can be repeatedly called. If the given sketch is null it is + interpreted as an empty sketch.
        +
        +
        Parameters:
        +
        sketchIn - The incoming sketch.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(org.apache.datasketches.memory.Memory mem,
        +                   ArrayOfItemsSerDe<T> serDe)
        +
        Union the given Memory image of the sketch. + +

        This method can be repeatedly called. If the given sketch is null it is interpreted as an + empty sketch.

        +
        +
        Parameters:
        +
        mem - Memory image of sketch to be merged
        +
        serDe - An instance of ArrayOfItemsSerDe
        +
        +
      • +
      + + + + + +
        +
      • +

        update

        +
        public void update​(T datum)
        +
        Present this union with a single item to be added to the union.
        +
        +
        Parameters:
        +
        datum - The given datum of type T.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(long n,
        +                   int k,
        +                   ArrayList<T> input)
        +
        Present this union with raw elements of a sketch. Useful when operating in a distributed + environment like Pig Latin scripts, where an explicit SerDe may be overly complicated but + keeping raw values is simple. Values are not copied and the input array may be + modified.
        +
        +
        Parameters:
        +
        n - Total items seen
        +
        k - Reservoir size
        +
        input - Reservoir samples
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public ReservoirItemsSketch<T> getResult()
        +
        Returns a sketch representing the current state of the union.
        +
        +
        Returns:
        +
        The result of any unions already processed.
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray​(ArrayOfItemsSerDe<T> serDe)
        +
        Returns a byte array representation of this union
        +
        +
        Parameters:
        +
        serDe - An instance of ArrayOfItemsSerDe
        +
        Returns:
        +
        a byte array representation of this union
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Returns a human-readable summary of the sketch, without items.
        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        A string version of the sketch summary
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray​(ArrayOfItemsSerDe<T> serDe,
        +                          Class<?> clazz)
        +
        Returns a byte array representation of this union. This method should be used when the array + elements are subclasses of a common base class.
        +
        +
        Parameters:
        +
        serDe - An instance of ArrayOfItemsSerDe
        +
        clazz - A class to which the items are cast before serialization
        +
        Returns:
        +
        a byte array representation of this union
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/ReservoirLongsSketch.html b/docs/5.0.2/org/apache/datasketches/sampling/ReservoirLongsSketch.html new file mode 100644 index 000000000..be50c57e5 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/ReservoirLongsSketch.html @@ -0,0 +1,584 @@ + + + + + +ReservoirLongsSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ReservoirLongsSketch

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.sampling.ReservoirLongsSketch
    • +
    +
  • +
+
+
    +
  • +
    +
    public final class ReservoirLongsSketch
    +extends Object
    +
    This sketch provides a reservoir sample over an input stream of longs. The sketch + contains a uniform random sample of items from the stream.
    +
    +
    Author:
    +
    Jon Malkin, Kevin Lang
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      SampleSubsetSummaryestimateSubsetSum​(Predicate<Long> predicate) +
      Computes an estimated subset sum from the entire stream for objects matching a given + predicate.
      +
      intgetK() +
      Returns the sketch's value of k, the maximum number of samples stored in the reservoir.
      +
      longgetN() +
      Returns the number of items processed from the input stream
      +
      intgetNumSamples() +
      Returns the current number of items in the reservoir, which may be smaller than the reservoir + capacity.
      +
      long[]getSamples() +
      Returns a copy of the items in the reservoir.
      +
      static ReservoirLongsSketchheapify​(org.apache.datasketches.memory.Memory srcMem) +
      Returns a sketch instance of this class from the given srcMem, which must be a Memory + representation of this sketch class.
      +
      static ReservoirLongsSketchnewInstance​(int k) +
      Construct a mergeable reservoir sampling sketch with up to k samples using the default resize + factor (8).
      +
      static ReservoirLongsSketchnewInstance​(int k, + ResizeFactor rf) +
      Construct a mergeable reservoir sampling sketch with up to k samples using the default resize + factor (8).
      +
      voidreset() +
      Resets this sketch to the empty state, but retains the original value of k.
      +
      byte[]toByteArray() +
      Returns a byte array representation of this sketch
      +
      StringtoString() +
      Returns a human-readable summary of the sketch, without items.
      +
      static StringtoString​(byte[] byteArr) +
      Returns a human readable string of the preamble of a byte array image of a ReservoirLongsSketch.
      +
      static StringtoString​(org.apache.datasketches.memory.Memory mem) +
      Returns a human readable string of the preamble of a Memory image of a ReservoirLongsSketch.
      +
      voidupdate​(long item) +
      Randomly decide whether or not to include an item in the sample set.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        newInstance

        +
        public static ReservoirLongsSketch newInstance​(int k)
        +
        Construct a mergeable reservoir sampling sketch with up to k samples using the default resize + factor (8).
        +
        +
        Parameters:
        +
        k - Maximum size of sampling. Allocated size may be smaller until sampling fills. Unlike + many sketches in this package, this value does not need to be a power of 2.
        +
        Returns:
        +
        A ReservoirLongsSketch initialized with maximum size k and the default resize factor.
        +
        +
      • +
      + + + +
        +
      • +

        newInstance

        +
        public static ReservoirLongsSketch newInstance​(int k,
        +                                               ResizeFactor rf)
        +
        Construct a mergeable reservoir sampling sketch with up to k samples using the default resize + factor (8).
        +
        +
        Parameters:
        +
        k - Maximum size of sampling. Allocated size may be smaller until sampling fills. Unlike + many sketches in this package, this value does not need to be a power of 2.
        +
        rf - See Resize Factor
        +
        Returns:
        +
        A ReservoirLongsSketch initialized with maximum size k and ResizeFactor rf.
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static ReservoirLongsSketch heapify​(org.apache.datasketches.memory.Memory srcMem)
        +
        Returns a sketch instance of this class from the given srcMem, which must be a Memory + representation of this sketch class.
        +
        +
        Parameters:
        +
        srcMem - a Memory representation of a sketch of this class. See Memory
        +
        Returns:
        +
        a sketch instance of this class
        +
        +
      • +
      + + + +
        +
      • +

        getK

        +
        public int getK()
        +
        Returns the sketch's value of k, the maximum number of samples stored in the reservoir. + The current number of items in the sketch may be lower.
        +
        +
        Returns:
        +
        k, the maximum number of samples in the reservoir
        +
        +
      • +
      + + + +
        +
      • +

        getN

        +
        public long getN()
        +
        Returns the number of items processed from the input stream
        +
        +
        Returns:
        +
        n, the number of stream items the sketch has seen
        +
        +
      • +
      + + + +
        +
      • +

        getNumSamples

        +
        public int getNumSamples()
        +
        Returns the current number of items in the reservoir, which may be smaller than the reservoir + capacity.
        +
        +
        Returns:
        +
        the number of items currently in the reservoir
        +
        +
      • +
      + + + +
        +
      • +

        getSamples

        +
        public long[] getSamples()
        +
        Returns a copy of the items in the reservoir. The returned array length may be smaller than the + reservoir capacity.
        +
        +
        Returns:
        +
        A copy of the reservoir array
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(long item)
        +
        Randomly decide whether or not to include an item in the sample set.
        +
        +
        Parameters:
        +
        item - a unit-weight (equivalently, unweighted) item of the set being sampled from
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Resets this sketch to the empty state, but retains the original value of k.
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Returns a human-readable summary of the sketch, without items.
        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        A string version of the sketch summary
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString​(byte[] byteArr)
        +
        Returns a human readable string of the preamble of a byte array image of a ReservoirLongsSketch.
        +
        +
        Parameters:
        +
        byteArr - the given byte array
        +
        Returns:
        +
        a human readable string of the preamble of a byte array image of a ReservoirLongsSketch.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString​(org.apache.datasketches.memory.Memory mem)
        +
        Returns a human readable string of the preamble of a Memory image of a ReservoirLongsSketch.
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        Returns:
        +
        a human readable string of the preamble of a Memory image of a ReservoirLongsSketch.
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray()
        +
        Returns a byte array representation of this sketch
        +
        +
        Returns:
        +
        a byte array representation of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        estimateSubsetSum

        +
        public SampleSubsetSummary estimateSubsetSum​(Predicate<Long> predicate)
        +
        Computes an estimated subset sum from the entire stream for objects matching a given + predicate. Provides a lower bound, estimate, and upper bound using a target of 2 standard + deviations. + +

        This is technically a heuristic method, and tries to err on the conservative side.

        +
        +
        Parameters:
        +
        predicate - A predicate to use when identifying items.
        +
        Returns:
        +
        A summary object containing the estimate, upper and lower bounds, and the total + sketch weight.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/ReservoirLongsUnion.html b/docs/5.0.2/org/apache/datasketches/sampling/ReservoirLongsUnion.html new file mode 100644 index 000000000..bf2409a34 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/ReservoirLongsUnion.html @@ -0,0 +1,478 @@ + + + + + +ReservoirLongsUnion (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ReservoirLongsUnion

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.sampling.ReservoirLongsUnion
    • +
    +
  • +
+
+
    +
  • +
    +
    public final class ReservoirLongsUnion
    +extends Object
    +
    Class to union reservoir samples of longs. + +

    + For efficiency reasons, the unioning process picks one of the two sketches to use as the base. As + a result, we provide only a stateful union. Using the same approach for a merge would result in + unpredictable side effects on the underlying sketches. +

    + +

    + A union object is created with a maximum value of k, represented using the ReservoirSize + class. The unioning process may cause the actual number of samples to fall below that maximum + value, but never to exceed it. The result of a union will be a reservoir where each item from the + global input has a uniform probability of selection, but there are no claims about higher order + statistics. For instance, in general all possible permutations of the global input are not + equally likely. +

    +
    +
    Author:
    +
    Jon Malkin, Kevin Lang
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        newInstance

        +
        public static ReservoirLongsUnion newInstance​(int maxK)
        +
        Creates an empty Union with a maximum reservoir capacity of size k.
        +
        +
        Parameters:
        +
        maxK - The maximum allowed reservoir capacity for any sketches in the union
        +
        Returns:
        +
        A new ReservoirLongsUnion
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static ReservoirLongsUnion heapify​(org.apache.datasketches.memory.Memory srcMem)
        +
        Instantiates a Union from Memory
        +
        +
        Parameters:
        +
        srcMem - Memory object containing a serialized union
        +
        Returns:
        +
        A ReservoirLongsUnion created from the provided Memory
        +
        +
      • +
      + + + +
        +
      • +

        getMaxK

        +
        public int getMaxK()
        +
        Returns the maximum allowed reservoir capacity in this union. The current reservoir capacity + may be lower.
        +
        +
        Returns:
        +
        The maximum allowed reservoir capacity in this union.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(ReservoirLongsSketch sketchIn)
        +
        Union the given sketch. +

        + This method can be repeatedly called. If the given sketch is null it is interpreted as an empty + sketch. +

        +
        +
        Parameters:
        +
        sketchIn - The incoming sketch.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(org.apache.datasketches.memory.Memory mem)
        +
        Union the given Memory image of the sketch. + +

        + This method can be repeatedly called. If the given sketch is null it is interpreted as an empty + sketch. +

        +
        +
        Parameters:
        +
        mem - Memory image of sketch to be merged
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(long datum)
        +
        Present this union with a long.
        +
        +
        Parameters:
        +
        datum - The given long datum.
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public ReservoirLongsSketch getResult()
        +
        Returns a sketch representing the current state of the union.
        +
        +
        Returns:
        +
        The result of any unions already processed.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Returns a human-readable summary of the sketch, without items.
        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        A string version of the sketch summary
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray()
        +
        Returns a byte array representation of this union
        +
        +
        Returns:
        +
        a byte array representation of this union
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/SampleSubsetSummary.html b/docs/5.0.2/org/apache/datasketches/sampling/SampleSubsetSummary.html new file mode 100644 index 000000000..7d4841dc9 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/SampleSubsetSummary.html @@ -0,0 +1,330 @@ + + + + + +SampleSubsetSummary (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SampleSubsetSummary

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.sampling.SampleSubsetSummary
    • +
    +
  • +
+
+
    +
  • +
    +
    public class SampleSubsetSummary
    +extends Object
    +
    A simple object o capture the results of a subset sum query on a sampling sketch.
    +
    +
    Author:
    +
    Jon Malkin
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getLowerBound

        +
        public double getLowerBound()
        +
        +
        Returns:
        +
        the Lower Bound
        +
        +
      • +
      + + + +
        +
      • +

        getTotalSketchWeight

        +
        public double getTotalSketchWeight()
        +
        +
        Returns:
        +
        the total sketch weight
        +
        +
      • +
      + + + +
        +
      • +

        getUpperBound

        +
        public double getUpperBound()
        +
        +
        Returns:
        +
        the Upper Bound
        +
        +
      • +
      + + + +
        +
      • +

        getEstimate

        +
        public double getEstimate()
        +
        +
        Returns:
        +
        the unique count estimate
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/VarOptItemsSamples.VarOptItemsIterator.html b/docs/5.0.2/org/apache/datasketches/sampling/VarOptItemsSamples.VarOptItemsIterator.html new file mode 100644 index 000000000..85e04dc47 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/VarOptItemsSamples.VarOptItemsIterator.html @@ -0,0 +1,306 @@ + + + + + +VarOptItemsSamples.VarOptItemsIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class VarOptItemsSamples.VarOptItemsIterator

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.sampling.VarOptItemsSamples.VarOptItemsIterator
    • +
    +
  • +
+
+ +
+
+ +
+
+ +
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/VarOptItemsSamples.WeightedSample.html b/docs/5.0.2/org/apache/datasketches/sampling/VarOptItemsSamples.WeightedSample.html new file mode 100644 index 000000000..43dcea0db --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/VarOptItemsSamples.WeightedSample.html @@ -0,0 +1,300 @@ + + + + + +VarOptItemsSamples.WeightedSample (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class VarOptItemsSamples.WeightedSample

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.sampling.VarOptItemsSamples.WeightedSample
    • +
    +
  • +
+
+
    +
  • +
    +
    Enclosing class:
    +
    VarOptItemsSamples<T>
    +
    +
    +
    public final class VarOptItemsSamples.WeightedSample
    +extends Object
    +
    A convenience class to allow easy iterator access to a VarOpt sample.
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getItem

        +
        public T getItem()
        +
        Accesses the iterator's current object
        +
        +
        Returns:
        +
        An item from the sketch's data sample
        +
        +
      • +
      + + + +
        +
      • +

        getWeight

        +
        public double getWeight()
        +
        Accesses the iterator's current weight value
        +
        +
        Returns:
        +
        A weight from the sketch's data sample
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/VarOptItemsSamples.html b/docs/5.0.2/org/apache/datasketches/sampling/VarOptItemsSamples.html new file mode 100644 index 000000000..443d587ef --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/VarOptItemsSamples.html @@ -0,0 +1,482 @@ + + + + + +VarOptItemsSamples (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class VarOptItemsSamples<T>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.sampling.VarOptItemsSamples<T>
    • +
    +
  • +
+
+
    +
  • +
    +
    Type Parameters:
    +
    T - an item of type T
    +
    +
    +
    All Implemented Interfaces:
    +
    Iterable<VarOptItemsSamples.WeightedSample>
    +
    +
    +
    public class VarOptItemsSamples<T>
    +extends Object
    +implements Iterable<VarOptItemsSamples.WeightedSample>
    +
    This class provides access to the samples contained in a VarOptItemsSketch. It provides two + mechanisms for access: +
      +
    • An Iterator over WeightedSample objects which can can be used to + access both the items and weights in the sample, and which avoids copying data from the + sketch.
    • +
    • Getter methods to obtain items or weights as arrays, or individual items. These + methods create a (shallow) copy of data from the sketch on the first call to any get + method.
    • +
    + +

    If using getters with a sketch storing heterogeneous items from a polymorphic base class, you + must call setClass() prior to calling one of the getter methods. This is not + necessary if using the iterator.

    + +

    The class also implements Iterable to allow the use of forEach loops for + convenience.

    +
    +
    Author:
    +
    Jon Malkin
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        setClass

        +
        public void setClass​(Class<?> clazz)
        +
        Specifies the class to use when copying the item array from the sketch. This method is + required if the sketch stores heterogeneous item types of some base class, for instance a + sketch over Numbers.
        +
        +
        Parameters:
        +
        clazz - The class to use when creating the item array result
        +
        +
      • +
      + + + +
        +
      • +

        getNumSamples

        +
        public int getNumSamples()
        +
        Returns the length Copies items and weights from the sketch, if necessary, and returns the + length of + any + resulting array. The result will be 0 for an empty sketch.
        +
        +
        Returns:
        +
        The number of items and weights in the sketch
        +
        +
      • +
      + + + +
        +
      • +

        items

        +
        public T[] items()
        +
        Returns a shallow copy of the array of sample items contained in the sketch. If this is the + first getter call, copies data arrays from the sketch.
        +
        +
        Returns:
        +
        The number of samples contained in the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        items

        +
        public T items​(int i)
        +
        Returns a single item from the samples contained in the sketch. Does not perform bounds + checking on the input. If this is the first getter call, copies data arrays from the sketch.
        +
        +
        Parameters:
        +
        i - An index into the list of samples
        +
        Returns:
        +
        The sample at array position i
        +
        +
      • +
      + + + +
        +
      • +

        weights

        +
        public double[] weights()
        +
        Returns a copy of the array of weights contained in the sketch. If this is the first + getter call, copies data arrays from the sketch.
        +
        +
        Returns:
        +
        The number of samples contained in the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        weights

        +
        public double weights​(int i)
        +
        Returns a single weight from the samples contained in the sketch. Does not perform bounds + checking on the input. If this is the first getter call, copies data arrays from the sketch.
        +
        +
        Parameters:
        +
        i - An index into the list of weights
        +
        Returns:
        +
        The weight at array position i
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/VarOptItemsSketch.html b/docs/5.0.2/org/apache/datasketches/sampling/VarOptItemsSketch.html new file mode 100644 index 000000000..7fb6b38c8 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/VarOptItemsSketch.html @@ -0,0 +1,634 @@ + + + + + +VarOptItemsSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class VarOptItemsSketch<T>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.sampling.VarOptItemsSketch<T>
    • +
    +
  • +
+
+
    +
  • +
    +
    Type Parameters:
    +
    T - The type of object held in the sketch.
    +
    +
    +
    public final class VarOptItemsSketch<T>
    +extends Object
    +
    This sketch provides a variance optimal sample over an input stream of weighted items. The + sketch can be used to compute subset sums over predicates, producing estimates with optimal + variance for a given sketch size. + +

    Using this sketch with uniformly constant item weights (e.g. 1.0) will produce a standard + reservoir sample over the steam.

    +
    +
    Author:
    +
    Jon Malkin, Kevin Lang
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      SampleSubsetSummaryestimateSubsetSum​(Predicate<T> predicate) +
      Computes an estimated subset sum from the entire stream for objects matching a given + predicate.
      +
      intgetK() +
      Returns the sketch's value of k, the maximum number of samples stored in the + sketch.
      +
      longgetN() +
      Returns the number of items processed from the input stream
      +
      intgetNumSamples() +
      Returns the current number of items in the sketch, which may be smaller than the + sketch capacity.
      +
      VarOptItemsSamples<T>getSketchSamples() +
      Gets a result iterator object.
      +
      static <T> VarOptItemsSketch<T>heapify​(org.apache.datasketches.memory.Memory srcMem, + ArrayOfItemsSerDe<T> serDe) +
      Returns a sketch instance of this class from the given srcMem, + which must be a Memory representation of this sketch class.
      +
      static <T> VarOptItemsSketch<T>newInstance​(int k) +
      Construct a varopt sampling sketch with up to k samples using the default resize factor (8).
      +
      static <T> VarOptItemsSketch<T>newInstance​(int k, + ResizeFactor rf) +
      Construct a varopt sampling sketch with up to k samples using the specified resize factor.
      +
      voidreset() +
      Resets this sketch to the empty state, but retains the original value of k.
      +
      byte[]toByteArray​(ArrayOfItemsSerDe<? super T> serDe) +
      Returns a byte array representation of this sketch.
      +
      byte[]toByteArray​(ArrayOfItemsSerDe<? super T> serDe, + Class<?> clazz) +
      Returns a byte array representation of this sketch.
      +
      StringtoString() +
      Returns a human-readable summary of the sketch.
      +
      static StringtoString​(byte[] byteArr) +
      Returns a human readable string of the preamble of a byte array image of a VarOptItemsSketch.
      +
      static StringtoString​(org.apache.datasketches.memory.Memory mem) +
      Returns a human readable string of the preamble of a Memory image of a VarOptItemsSketch.
      +
      voidupdate​(T item, + double weight) +
      Randomly decide whether or not to include an item in the sample set.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        newInstance

        +
        public static <T> VarOptItemsSketch<T> newInstance​(int k)
        +
        Construct a varopt sampling sketch with up to k samples using the default resize factor (8).
        +
        +
        Type Parameters:
        +
        T - The type of object held in the sketch.
        +
        Parameters:
        +
        k - Maximum size of sampling. Allocated size may be smaller until sketch fills. + Unlike many sketches in this package, this value does not need to be a + power of 2.
        +
        Returns:
        +
        A VarOptItemsSketch initialized with maximum size k and resize factor rf.
        +
        +
      • +
      + + + +
        +
      • +

        newInstance

        +
        public static <T> VarOptItemsSketch<T> newInstance​(int k,
        +                                                   ResizeFactor rf)
        +
        Construct a varopt sampling sketch with up to k samples using the specified resize factor.
        +
        +
        Type Parameters:
        +
        T - The type of object held in the sketch.
        +
        Parameters:
        +
        k - Maximum size of sampling. Allocated size may be smaller until sketch fills. + Unlike many sketches in this package, this value does not need to be a + power of 2. The maximum size is Integer.MAX_VALUE-1.
        +
        rf - See Resize Factor
        +
        Returns:
        +
        A VarOptItemsSketch initialized with maximum size k and resize factor rf.
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static <T> VarOptItemsSketch<T> heapify​(org.apache.datasketches.memory.Memory srcMem,
        +                                               ArrayOfItemsSerDe<T> serDe)
        +
        Returns a sketch instance of this class from the given srcMem, + which must be a Memory representation of this sketch class.
        +
        +
        Type Parameters:
        +
        T - The type of item this sketch contains
        +
        Parameters:
        +
        srcMem - a Memory representation of a sketch of this class. + See Memory
        +
        serDe - An instance of ArrayOfItemsSerDe
        +
        Returns:
        +
        a sketch instance of this class
        +
        +
      • +
      + + + +
        +
      • +

        getK

        +
        public int getK()
        +
        Returns the sketch's value of k, the maximum number of samples stored in the + sketch. The current number of items in the sketch may be lower.
        +
        +
        Returns:
        +
        k, the maximum number of samples in the sketch
        +
        +
      • +
      + + + +
        +
      • +

        getN

        +
        public long getN()
        +
        Returns the number of items processed from the input stream
        +
        +
        Returns:
        +
        n, the number of stream items the sketch has seen
        +
        +
      • +
      + + + +
        +
      • +

        getNumSamples

        +
        public int getNumSamples()
        +
        Returns the current number of items in the sketch, which may be smaller than the + sketch capacity.
        +
        +
        Returns:
        +
        the number of items currently in the sketch
        +
        +
      • +
      + + + +
        +
      • +

        getSketchSamples

        +
        public VarOptItemsSamples<T> getSketchSamples()
        +
        Gets a result iterator object.
        +
        +
        Returns:
        +
        An object with an iterator over the results
        +
        +
      • +
      + + + + + +
        +
      • +

        update

        +
        public void update​(T item,
        +                   double weight)
        +
        Randomly decide whether or not to include an item in the sample set.
        +
        +
        Parameters:
        +
        item - an item of the set being sampled from
        +
        weight - a strictly positive weight associated with the item
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Resets this sketch to the empty state, but retains the original value of k.
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Returns a human-readable summary of the sketch.
        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        A string version of the sketch summary
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString​(byte[] byteArr)
        +
        Returns a human readable string of the preamble of a byte array image of a VarOptItemsSketch.
        +
        +
        Parameters:
        +
        byteArr - the given byte array
        +
        Returns:
        +
        a human readable string of the preamble of a byte array image of a VarOptItemsSketch.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString​(org.apache.datasketches.memory.Memory mem)
        +
        Returns a human readable string of the preamble of a Memory image of a VarOptItemsSketch.
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        Returns:
        +
        a human readable string of the preamble of a Memory image of a VarOptItemsSketch.
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray​(ArrayOfItemsSerDe<? super T> serDe)
        +
        Returns a byte array representation of this sketch. May fail for polymorphic item types.
        +
        +
        Parameters:
        +
        serDe - An instance of ArrayOfItemsSerDe
        +
        Returns:
        +
        a byte array representation of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray​(ArrayOfItemsSerDe<? super T> serDe,
        +                          Class<?> clazz)
        +
        Returns a byte array representation of this sketch. Copies contents into an array of the + specified class for serialization to allow for polymorphic types.
        +
        +
        Parameters:
        +
        serDe - An instance of ArrayOfItemsSerDe
        +
        clazz - The class represented by <T>
        +
        Returns:
        +
        a byte array representation of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        estimateSubsetSum

        +
        public SampleSubsetSummary estimateSubsetSum​(Predicate<T> predicate)
        +
        Computes an estimated subset sum from the entire stream for objects matching a given + predicate. Provides a lower bound, estimate, and upper bound using a target of 2 standard + deviations. + +

        This is technically a heuristic method, and tries to err on the conservative side.

        +
        +
        Parameters:
        +
        predicate - A predicate to use when identifying items.
        +
        Returns:
        +
        A summary object containing the estimate, upper and lower bounds, and the total + sketch weight.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/VarOptItemsUnion.html b/docs/5.0.2/org/apache/datasketches/sampling/VarOptItemsUnion.html new file mode 100644 index 000000000..a32537720 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/VarOptItemsUnion.html @@ -0,0 +1,498 @@ + + + + + +VarOptItemsUnion (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class VarOptItemsUnion<T>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.sampling.VarOptItemsUnion<T>
    • +
    +
  • +
+
+
    +
  • +
    +
    Type Parameters:
    +
    T - Type of items
    +
    +
    +
    public final class VarOptItemsUnion<T>
    +extends Object
    +
    Provides a unioning operation over varopt sketches. This union allows the sample size k to float, + possibly increasing or decreasing as warranted by the available data.
    +
    +
    Author:
    +
    Jon Malkin, Kevin Lang
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        newInstance

        +
        public static <T> VarOptItemsUnion<T> newInstance​(int maxK)
        +
        Creates an empty Union with a maximum capacity of size k.
        +
        +
        Type Parameters:
        +
        T - The type of item this union contains
        +
        Parameters:
        +
        maxK - The maximum allowed capacity of the unioned result
        +
        Returns:
        +
        A new VarOptItemsUnion
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static <T> VarOptItemsUnion<T> heapify​(org.apache.datasketches.memory.Memory srcMem,
        +                                              ArrayOfItemsSerDe<T> serDe)
        +
        Instantiates a Union from Memory
        +
        +
        Type Parameters:
        +
        T - The type of item this sketch contains
        +
        Parameters:
        +
        srcMem - Memory object containing a serialized union
        +
        serDe - An instance of ArrayOfItemsSerDe
        +
        Returns:
        +
        A VarOptItemsUnion created from the provided Memory
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(VarOptItemsSketch<T> sketchIn)
        +
        Union the given sketch. + +

        This method can be repeatedly called.

        +
        +
        Parameters:
        +
        sketchIn - The sketch to be merged
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(org.apache.datasketches.memory.Memory mem,
        +                   ArrayOfItemsSerDe<T> serDe)
        +
        Union the given Memory image of the sketch. + +

        This method can be repeatedly called.

        +
        +
        Parameters:
        +
        mem - Memory image of sketch to be merged
        +
        serDe - An instance of ArrayOfItemsSerDe
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(ReservoirItemsSketch<T> reservoirIn)
        +
        Union a reservoir sketch. The reservoir sample is treated as if all items were added with a + weight of 1.0.
        +
        +
        Parameters:
        +
        reservoirIn - The reservoir sketch to be merged
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public VarOptItemsSketch<T> getResult()
        +
        Gets the varopt sketch resulting from the union of any input sketches.
        +
        +
        Returns:
        +
        A varopt sketch
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Resets this sketch to the empty state, but retains the original value of max k.
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Returns a human-readable summary of the sketch, without items.
        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        A string version of the sketch summary
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray​(ArrayOfItemsSerDe<T> serDe)
        +
        Returns a byte array representation of this union
        +
        +
        Parameters:
        +
        serDe - An instance of ArrayOfItemsSerDe
        +
        Returns:
        +
        a byte array representation of this union
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray​(ArrayOfItemsSerDe<T> serDe,
        +                          Class<?> clazz)
        +
        Returns a byte array representation of this union. This method should be used when the array + elements are subclasses of a common base class.
        +
        +
        Parameters:
        +
        serDe - An instance of ArrayOfItemsSerDe
        +
        clazz - A class to which the items are cast before serialization
        +
        Returns:
        +
        a byte array representation of this union
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/class-use/ReservoirItemsSketch.html b/docs/5.0.2/org/apache/datasketches/sampling/class-use/ReservoirItemsSketch.html new file mode 100644 index 000000000..b63a426b9 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/class-use/ReservoirItemsSketch.html @@ -0,0 +1,247 @@ + + + + + +Uses of Class org.apache.datasketches.sampling.ReservoirItemsSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.sampling.ReservoirItemsSketch

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/class-use/ReservoirItemsUnion.html b/docs/5.0.2/org/apache/datasketches/sampling/class-use/ReservoirItemsUnion.html new file mode 100644 index 000000000..a8d1e3b58 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/class-use/ReservoirItemsUnion.html @@ -0,0 +1,206 @@ + + + + + +Uses of Class org.apache.datasketches.sampling.ReservoirItemsUnion (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.sampling.ReservoirItemsUnion

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/class-use/ReservoirLongsSketch.html b/docs/5.0.2/org/apache/datasketches/sampling/class-use/ReservoirLongsSketch.html new file mode 100644 index 000000000..7c06be6fe --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/class-use/ReservoirLongsSketch.html @@ -0,0 +1,240 @@ + + + + + +Uses of Class org.apache.datasketches.sampling.ReservoirLongsSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.sampling.ReservoirLongsSketch

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/class-use/ReservoirLongsUnion.html b/docs/5.0.2/org/apache/datasketches/sampling/class-use/ReservoirLongsUnion.html new file mode 100644 index 000000000..8b4230292 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/class-use/ReservoirLongsUnion.html @@ -0,0 +1,205 @@ + + + + + +Uses of Class org.apache.datasketches.sampling.ReservoirLongsUnion (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.sampling.ReservoirLongsUnion

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/class-use/SampleSubsetSummary.html b/docs/5.0.2/org/apache/datasketches/sampling/class-use/SampleSubsetSummary.html new file mode 100644 index 000000000..22e44eb4d --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/class-use/SampleSubsetSummary.html @@ -0,0 +1,215 @@ + + + + + +Uses of Class org.apache.datasketches.sampling.SampleSubsetSummary (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.sampling.SampleSubsetSummary

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/class-use/VarOptItemsSamples.VarOptItemsIterator.html b/docs/5.0.2/org/apache/datasketches/sampling/class-use/VarOptItemsSamples.VarOptItemsIterator.html new file mode 100644 index 000000000..1b475049c --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/class-use/VarOptItemsSamples.VarOptItemsIterator.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.sampling.VarOptItemsSamples.VarOptItemsIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.sampling.VarOptItemsSamples.VarOptItemsIterator

+
+
No usage of org.apache.datasketches.sampling.VarOptItemsSamples.VarOptItemsIterator
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/class-use/VarOptItemsSamples.WeightedSample.html b/docs/5.0.2/org/apache/datasketches/sampling/class-use/VarOptItemsSamples.WeightedSample.html new file mode 100644 index 000000000..7c563fb7c --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/class-use/VarOptItemsSamples.WeightedSample.html @@ -0,0 +1,211 @@ + + + + + +Uses of Class org.apache.datasketches.sampling.VarOptItemsSamples.WeightedSample (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.sampling.VarOptItemsSamples.WeightedSample

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/class-use/VarOptItemsSamples.html b/docs/5.0.2/org/apache/datasketches/sampling/class-use/VarOptItemsSamples.html new file mode 100644 index 000000000..4235b1830 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/class-use/VarOptItemsSamples.html @@ -0,0 +1,198 @@ + + + + + +Uses of Class org.apache.datasketches.sampling.VarOptItemsSamples (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.sampling.VarOptItemsSamples

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/class-use/VarOptItemsSketch.html b/docs/5.0.2/org/apache/datasketches/sampling/class-use/VarOptItemsSketch.html new file mode 100644 index 000000000..66dbb3ba3 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/class-use/VarOptItemsSketch.html @@ -0,0 +1,239 @@ + + + + + +Uses of Class org.apache.datasketches.sampling.VarOptItemsSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.sampling.VarOptItemsSketch

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/class-use/VarOptItemsUnion.html b/docs/5.0.2/org/apache/datasketches/sampling/class-use/VarOptItemsUnion.html new file mode 100644 index 000000000..070cc7dca --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/class-use/VarOptItemsUnion.html @@ -0,0 +1,206 @@ + + + + + +Uses of Class org.apache.datasketches.sampling.VarOptItemsUnion (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.sampling.VarOptItemsUnion

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/package-summary.html b/docs/5.0.2/org/apache/datasketches/sampling/package-summary.html new file mode 100644 index 000000000..060df4475 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/package-summary.html @@ -0,0 +1,226 @@ + + + + + +org.apache.datasketches.sampling (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches.sampling

+
+
+
+ + +

This package is dedicated to streaming algorithms that enable fixed size, uniform sampling of + weighted and unweighted items from a stream.

+ +

These sketches are mergeable and can be serialized and deserialized to/from a compact + form.

+
+
See Also:
+
ReservoirItemsSketch, +ReservoirLongsSketch, +VarOptItemsSketch
+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    ReservoirItemsSketch<T> +
    This sketch provides a reservoir sample over an input stream of items.
    +
    ReservoirItemsUnion<T> +
    Class to union reservoir samples of generic items.
    +
    ReservoirLongsSketch +
    This sketch provides a reservoir sample over an input stream of longs.
    +
    ReservoirLongsUnion +
    Class to union reservoir samples of longs.
    +
    SampleSubsetSummary +
    A simple object o capture the results of a subset sum query on a sampling sketch.
    +
    VarOptItemsSamples<T> +
    This class provides access to the samples contained in a VarOptItemsSketch.
    +
    VarOptItemsSketch<T> +
    This sketch provides a variance optimal sample over an input stream of weighted items.
    +
    VarOptItemsUnion<T> +
    Provides a unioning operation over varopt sketches.
    +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/package-tree.html b/docs/5.0.2/org/apache/datasketches/sampling/package-tree.html new file mode 100644 index 000000000..f8a08491b --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/package-tree.html @@ -0,0 +1,173 @@ + + + + + +org.apache.datasketches.sampling Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches.sampling

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/sampling/package-use.html b/docs/5.0.2/org/apache/datasketches/sampling/package-use.html new file mode 100644 index 000000000..61f1c1c35 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/sampling/package-use.html @@ -0,0 +1,237 @@ + + + + + +Uses of Package org.apache.datasketches.sampling (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches.sampling

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/AnotB.html b/docs/5.0.2/org/apache/datasketches/theta/AnotB.html new file mode 100644 index 000000000..1345cfb6c --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/AnotB.html @@ -0,0 +1,595 @@ + + + + + +AnotB (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class AnotB

+
+
+ +
+
    +
  • +
    +
    public abstract class AnotB
    +extends SetOperation
    +
    Computes a set difference, A-AND-NOT-B, of two theta sketches. + This class includes both stateful and stateless operations. + +

    The stateful operation is as follows:

    +
    
    + AnotB anotb = SetOperationBuilder.buildAnotB();
    +
    + anotb.setA(Sketch skA); //The first argument.
    + anotb.notB(Sketch skB); //The second (subtraction) argument.
    + anotb.notB(Sketch skC); // ...any number of additional subtractions...
    + anotb.getResult(false); //Get an interim result.
    + anotb.notB(Sketch skD); //Additional subtractions.
    + anotb.getResult(true);  //Final result and resets the AnotB operator.
    + 
    + +

    The stateless operation is as follows:

    +
    
    + AnotB anotb = SetOperationBuilder.buildAnotB();
    +
    + CompactSketch csk = anotb.aNotB(Sketch skA, Sketch skB);
    + 
    + +

    Calling the setA operation a second time essentially clears the internal state and loads + the new sketch.

    + +

    The stateless and stateful operations are independent of each other with the exception of + sharing the same update hash seed loaded as the default seed or specified by the user as an + argument to the builder.

    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        AnotB

        +
        public AnotB()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getFamily

        +
        public Family getFamily()
        +
        Description copied from class: SetOperation
        +
        Gets the Family of this SetOperation
        +
        +
        Specified by:
        +
        getFamily in class SetOperation
        +
        Returns:
        +
        the Family of this SetOperation
        +
        +
      • +
      + + + +
        +
      • +

        setA

        +
        public abstract void setA​(Sketch skA)
        +
        This is part of a multistep, stateful AnotB operation and sets the given Theta sketch as the + first argument A of A-AND-NOT-B. This overwrites the internal state of this + AnotB operator with the contents of the given sketch. + This sets the stage for multiple following notB steps. + +

        An input argument of null will throw an exception.

        + +

        Rationale: In mathematics a "null set" is a set with no members, which we call an empty set. + That is distinctly different from the java null, which represents a nonexistent object. + In most cases it is a programming error due to some object that was not properly initialized. + With a null as the first argument, we cannot know what the user's intent is. + Since it is very likely that a null is a programming error, we throw a an exception.

        + +

        An empty input argument will set the internal state to empty.

        + +

        Rationale: An empty set is a mathematically legal concept. Although it makes any subsequent, + valid argument for B irrelevant, we must allow this and assume the user knows what they are + doing.

        + +

        Performing getResult(boolean) just after this step will return a compact form of + the given argument.

        +
        +
        Parameters:
        +
        skA - The incoming sketch for the first argument, A.
        +
        +
      • +
      + + + +
        +
      • +

        notB

        +
        public abstract void notB​(Sketch skB)
        +
        This is part of a multistep, stateful AnotB operation and sets the given Theta sketch as the + second (or n+1th) argument B of A-AND-NOT-B. + Performs an AND NOT operation with the existing internal state of this AnotB operator. + +

        An input argument of null or empty is ignored.

        + +

        Rationale: A null for the second or following arguments is more tolerable because + A NOT null is still A even if we don't know exactly what the null represents. It + clearly does not have any content that overlaps with A. Also, because this can be part of + a multistep operation with multiple notB steps. Other following steps can still produce + a valid result.

        + +

        Use getResult(boolean) to obtain the result.

        +
        +
        Parameters:
        +
        skB - The incoming Theta sketch for the second (or following) argument B.
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public abstract CompactSketch getResult​(boolean reset)
        +
        Gets the result of the multistep, stateful operation AnotB that have been executed with calls + to setA(Sketch) and (notB(Sketch) or + notB(org.apache.datasketches.theta.Sketch)).
        +
        +
        Parameters:
        +
        reset - If true, clears this operator to the empty state after this result is + returned. Set this to false if you wish to obtain an intermediate result.
        +
        Returns:
        +
        the result of this operation as an ordered, on-heap CompactSketch.
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public abstract CompactSketch getResult​(boolean dstOrdered,
        +                                        org.apache.datasketches.memory.WritableMemory dstMem,
        +                                        boolean reset)
        +
        Gets the result of the multistep, stateful operation AnotB that have been executed with calls + to setA(Sketch) and (notB(Sketch) or + notB(org.apache.datasketches.theta.Sketch)).
        +
        +
        Parameters:
        +
        dstOrdered - If true, the result will be an ordered CompactSketch. + See Destination Ordered.
        +
        dstMem - if not null the given Memory will be the target location of the result. + See Destination Memory.
        +
        reset - If true, clears this operator to the empty state after this result is + returned. Set this to false if you wish to obtain an intermediate result.
        +
        Returns:
        +
        the result of this operation as a CompactSketch in the given dstMem.
        +
        +
      • +
      + + + +
        +
      • +

        aNotB

        +
        public CompactSketch aNotB​(Sketch skA,
        +                           Sketch skB)
        +
        Perform A-and-not-B set operation on the two given sketches and return the result as an + ordered CompactSketch on the heap. + +

        This a stateless operation and has no impact on the internal state of this operator. + Thus, this is not an accumulating update and does not interact with the setA(Sketch), + notB(Sketch), getResult(boolean), or + getResult(boolean, WritableMemory, boolean) methods.

        + +

        If either argument is null an exception is thrown.

        + +

        Rationale: In mathematics a "null set" is a set with no members, which we call an empty set. + That is distinctly different from the java null, which represents a nonexistent object. + In most cases null is a programming error due to a non-initialized object.

        + +

        With a null as the first argument we cannot know what the user's intent is and throw an + exception. With a null as the second argument for this method we must return a result and + there is no following possible viable arguments for the second argument so we thrown an + exception.

        +
        +
        Parameters:
        +
        skA - The incoming sketch for the first argument. It must not be null.
        +
        skB - The incoming sketch for the second argument. It must not be null.
        +
        Returns:
        +
        an ordered CompactSketch on the heap
        +
        +
      • +
      + + + +
        +
      • +

        aNotB

        +
        public abstract CompactSketch aNotB​(Sketch skA,
        +                                    Sketch skB,
        +                                    boolean dstOrdered,
        +                                    org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Perform A-and-not-B set operation on the two given sketches and return the result as a + CompactSketch. + +

        This a stateless operation and has no impact on the internal state of this operator. + Thus, this is not an accumulating update and does not interact with the setA(Sketch), + notB(Sketch), getResult(boolean), or + getResult(boolean, WritableMemory, boolean) methods.

        + +

        If either argument is null an exception is thrown.

        + +

        Rationale: In mathematics a "null set" is a set with no members, which we call an empty set. + That is distinctly different from the java null, which represents a nonexistent object. + In most cases null is a programming error due to a non-initialized object.

        + +

        With a null as the first argument we cannot know what the user's intent is and throw an + exception. With a null as the second argument for this method we must return a result and + there is no following possible viable arguments for the second argument so we thrown an + exception.

        +
        +
        Parameters:
        +
        skA - The incoming sketch for the first argument. It must not be null.
        +
        skB - The incoming sketch for the second argument. It must not be null.
        +
        dstOrdered - See Destination Ordered.
        +
        dstMem - See Destination Memory.
        +
        Returns:
        +
        the result as a CompactSketch.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/BitPacking.html b/docs/5.0.2/org/apache/datasketches/theta/BitPacking.html new file mode 100644 index 000000000..43e86be52 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/BitPacking.html @@ -0,0 +1,339 @@ + + + + + +BitPacking (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class BitPacking

+
+
+ +
+
    +
  • +
    +
    public class BitPacking
    +extends Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        BitPacking

        +
        public BitPacking()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        packBits

        +
        public static void packBits​(long value,
        +                            int bits,
        +                            byte[] buffer,
        +                            int bufOffset,
        +                            int bitOffset)
        +
      • +
      + + + +
        +
      • +

        unpackBits

        +
        public static void unpackBits​(long[] value,
        +                              int index,
        +                              int bits,
        +                              byte[] buffer,
        +                              int bufOffset,
        +                              int bitOffset)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/CompactSketch.html b/docs/5.0.2/org/apache/datasketches/theta/CompactSketch.html new file mode 100644 index 000000000..a4df34ea9 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/CompactSketch.html @@ -0,0 +1,606 @@ + + + + + +CompactSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class CompactSketch

+
+
+ +
+
    +
  • +
    +
    public abstract class CompactSketch
    +extends Sketch
    +
    The parent class of all the CompactSketches. CompactSketches are never created directly. + They are created as a result of the compact() method of an UpdateSketch, a result of a + getResult() of a SetOperation, or from a heapify method. + +

    A CompactSketch is the simplest form of a Theta Sketch. It consists of a compact list + (i.e., no intervening spaces) of hash values, which may be ordered or not, a value for theta + and a seed hash. A CompactSketch is immutable (read-only), + and the space required when stored is only the space required for the hash values and 8 to 24 + bytes of preamble. An empty CompactSketch consumes only 8 bytes.

    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CompactSketch

        +
        public CompactSketch()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        heapify

        +
        public static CompactSketch heapify​(org.apache.datasketches.memory.Memory srcMem)
        +
        Heapify takes a CompactSketch image in Memory and instantiates an on-heap CompactSketch. + +

        The resulting sketch will not retain any link to the source Memory and all of its data will be + copied to the heap CompactSketch.

        + +

        This method assumes that the sketch image was created with the correct hash seed, so it is not checked. + The resulting on-heap CompactSketch will be given the seedHash derived from the given sketch image. + However, Serial Version 1 sketch images do not have a seedHash field, + so the resulting heapified CompactSketch will be given the hash of the DEFAULT_UPDATE_SEED.

        +
        +
        Parameters:
        +
        srcMem - an image of a CompactSketch. + See Memory.
        +
        Returns:
        +
        a CompactSketch on the heap.
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static CompactSketch heapify​(org.apache.datasketches.memory.Memory srcMem,
        +                                    long expectedSeed)
        +
        Heapify takes a CompactSketch image in Memory and instantiates an on-heap CompactSketch. + +

        The resulting sketch will not retain any link to the source Memory and all of its data will be + copied to the heap CompactSketch.

        + +

        This method checks if the given expectedSeed was used to create the source Memory image. + However, SerialVersion 1 sketch images cannot be checked as they don't have a seedHash field, + so the resulting heapified CompactSketch will be given the hash of the expectedSeed.

        +
        +
        Parameters:
        +
        srcMem - an image of a CompactSketch that was created using the given expectedSeed. + See Memory.
        +
        expectedSeed - the seed used to validate the given Memory image. + See Update Hash Seed.
        +
        Returns:
        +
        a CompactSketch on the heap.
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static CompactSketch wrap​(org.apache.datasketches.memory.Memory srcMem)
        +
        Wrap takes the CompactSketch image in given Memory and refers to it directly. + There is no data copying onto the java heap. + The wrap operation enables fast read-only merging and access to all the public read-only API. + +

        Only "Direct" Serialization Version 3 (i.e, OpenSource) sketches that have + been explicitly stored as direct sketches can be wrapped. + Wrapping earlier serial version sketches will result in a heapify operation. + These early versions were never designed to "wrap".

        + +

        Wrapping any subclass of this class that is empty or contains only a single item will + result in heapified forms of empty and single item sketch respectively. + This is actually faster and consumes less overall memory.

        + +

        This method assumes that the sketch image was created with the correct hash seed, so it is not checked. + However, Serial Version 1 sketch images do not have a seedHash field, + so the resulting on-heap CompactSketch will be given the hash of the DEFAULT_UPDATE_SEED.

        +
        +
        Parameters:
        +
        srcMem - an image of a Sketch. + See Memory.
        +
        Returns:
        +
        a CompactSketch backed by the given Memory except as above.
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static CompactSketch wrap​(org.apache.datasketches.memory.Memory srcMem,
        +                                 long expectedSeed)
        +
        Wrap takes the sketch image in the given Memory and refers to it directly. + There is no data copying onto the java heap. + The wrap operation enables fast read-only merging and access to all the public read-only API. + +

        Only "Direct" Serialization Version 3 (i.e, OpenSource) sketches that have + been explicitly stored as direct sketches can be wrapped. + Wrapping earlier serial version sketches will result in a heapify operation. + These early versions were never designed to "wrap".

        + +

        Wrapping any subclass of this class that is empty or contains only a single item will + result in heapified forms of empty and single item sketch respectively. + This is actually faster and consumes less overall memory.

        + +

        This method checks if the given expectedSeed was used to create the source Memory image. + However, SerialVersion 1 sketches cannot be checked as they don't have a seedHash field, + so the resulting heapified CompactSketch will be given the hash of the expectedSeed.

        +
        +
        Parameters:
        +
        srcMem - an image of a Sketch that was created using the given expectedSeed. + See Memory
        +
        expectedSeed - the seed used to validate the given Memory image. + See Update Hash Seed.
        +
        Returns:
        +
        a CompactSketch backed by the given Memory except as above.
        +
        +
      • +
      + + + +
        +
      • +

        compact

        +
        public abstract CompactSketch compact​(boolean dstOrdered,
        +                                      org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Description copied from class: Sketch
        +
        Convert this sketch to a CompactSketch. + +

        If this sketch is a type of UpdateSketch, the compacting process converts the hash table + of the UpdateSketch to a simple list of the valid hash values. + Any hash values of zero or equal-to or greater than theta will be discarded. + The number of valid values remaining in the CompactSketch depends on a number of factors, + but may be larger or smaller than Nominal Entries (or k). + It will never exceed 2k. + If it is critical to always limit the size to no more than k, + then rebuild() should be called on the UpdateSketch prior to calling this method.

        + +

        A CompactSketch is always immutable.

        + +

        A new CompactSketch object is created:

        +
        • if dstMem != null
        • +
        • if dstMem == null and this.hasMemory() == true
        • +
        • if dstMem == null and this has more than 1 item and this.isOrdered() == false + and dstOrdered == true.
        • +
        + +

        Otherwise, this operation returns this.

        +
        +
        Specified by:
        +
        compact in class Sketch
        +
        Parameters:
        +
        dstOrdered - assumed true if this sketch is empty or has only one value + See Destination Ordered
        +
        dstMem - See Destination Memory.
        +
        Returns:
        +
        this sketch as a CompactSketch.
        +
        +
      • +
      + + + +
        +
      • +

        getCompactBytes

        +
        public int getCompactBytes()
        +
        Description copied from class: Sketch
        +
        Returns the number of storage bytes required for this Sketch if its current state were + compacted. It this sketch is already in the compact form this is equivalent to + calling Sketch.getCurrentBytes().
        +
        +
        Specified by:
        +
        getCompactBytes in class Sketch
        +
        Returns:
        +
        number of compact bytes
        +
        +
      • +
      + + + +
        +
      • +

        getFamily

        +
        public Family getFamily()
        +
        Description copied from class: Sketch
        +
        Returns the Family that this sketch belongs to
        +
        +
        Specified by:
        +
        getFamily in class Sketch
        +
        Returns:
        +
        the Family that this sketch belongs to
        +
        +
      • +
      + + + +
        +
      • +

        isCompact

        +
        public boolean isCompact()
        +
        Description copied from class: Sketch
        +
        Returns true if this sketch is in compact form.
        +
        +
        Specified by:
        +
        isCompact in class Sketch
        +
        Returns:
        +
        true if this sketch is in compact form.
        +
        +
      • +
      + + + +
        +
      • +

        toByteArrayCompressed

        +
        public byte[] toByteArrayCompressed()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/HashIterator.html b/docs/5.0.2/org/apache/datasketches/theta/HashIterator.html new file mode 100644 index 000000000..c8f23a37c --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/HashIterator.html @@ -0,0 +1,285 @@ + + + + + +HashIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface HashIterator

+
+
+
+
    +
  • +
    +
    public interface HashIterator
    +
    This is used to iterate over the retained hash values of the Theta sketch.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethodDescription
      longget() +
      Gets the hash value
      +
      booleannext() +
      Returns true at the next hash value in sequence.
      +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        get

        +
        long get()
        +
        Gets the hash value
        +
        +
        Returns:
        +
        the hash value
        +
        +
      • +
      + + + +
        +
      • +

        next

        +
        boolean next()
        +
        Returns true at the next hash value in sequence. + If false, the iteration is done.
        +
        +
        Returns:
        +
        true at the next hash value in sequence.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/Intersection.html b/docs/5.0.2/org/apache/datasketches/theta/Intersection.html new file mode 100644 index 000000000..b90387858 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/Intersection.html @@ -0,0 +1,595 @@ + + + + + +Intersection (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Intersection

+
+
+ +
+
    +
  • +
    +
    public abstract class Intersection
    +extends SetOperation
    +
    The API for intersection operations
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Intersection

        +
        public Intersection()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getFamily

        +
        public Family getFamily()
        +
        Description copied from class: SetOperation
        +
        Gets the Family of this SetOperation
        +
        +
        Specified by:
        +
        getFamily in class SetOperation
        +
        Returns:
        +
        the Family of this SetOperation
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public CompactSketch getResult()
        +
        Gets the result of this operation as an ordered CompactSketch on the Java heap. + This does not disturb the underlying data structure of this intersection. + The intersect(Sketch) method must have been called at least once, otherwise an + exception will be thrown. This is because a virgin Intersection object represents the + Universal Set, which has an infinite number of values.
        +
        +
        Returns:
        +
        the result of this operation as an ordered CompactSketch on the Java heap
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public abstract CompactSketch getResult​(boolean dstOrdered,
        +                                        org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Gets the result of this operation as a CompactSketch in the given dstMem. + This does not disturb the underlying data structure of this intersection. + The intersect(Sketch) method must have been called at least once, otherwise an + exception will be thrown. This is because a virgin Intersection object represents the + Universal Set, which has an infinite number of values. + +

        Note that presenting an intersection with an empty sketch sets the internal + state of the intersection to empty = true, and current count = 0. This is consistent with + the mathematical definition of the intersection of any set with the empty set is + always empty.

        + +

        Presenting an intersection with a null argument will throw an exception.

        +
        +
        Parameters:
        +
        dstOrdered - See Destination Ordered
        +
        dstMem - See Destination Memory.
        +
        Returns:
        +
        the result of this operation as a CompactSketch stored in the given dstMem, + which can be either on or off-heap..
        +
        +
      • +
      + + + +
        +
      • +

        hasResult

        +
        public abstract boolean hasResult()
        +
        Returns true if there is a valid intersection result available
        +
        +
        Returns:
        +
        true if there is a valid intersection result available
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public abstract void reset()
        +
        Resets this Intersection for stateful operations only. + The seed remains intact, otherwise reverts to + the Universal Set: theta = 1.0, no retained data and empty = false.
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public abstract byte[] toByteArray()
        +
        Serialize this intersection to a byte array form.
        +
        +
        Returns:
        +
        byte array of this intersection
        +
        +
      • +
      + + + +
        +
      • +

        intersect

        +
        public abstract void intersect​(Sketch sketchIn)
        +
        Intersect the given sketch with the internal state. + This method can be repeatedly called. + If the given sketch is null the internal state becomes the empty sketch. + Theta will become the minimum of thetas seen so far.
        +
        +
        Parameters:
        +
        sketchIn - the given sketch
        +
        +
      • +
      + + + +
        +
      • +

        intersect

        +
        public CompactSketch intersect​(Sketch a,
        +                               Sketch b)
        +
        Perform intersect set operation on the two given sketch arguments and return the result as an + ordered CompactSketch on the heap.
        +
        +
        Parameters:
        +
        a - The first sketch argument
        +
        b - The second sketch argument
        +
        Returns:
        +
        an ordered CompactSketch on the heap
        +
        +
      • +
      + + + +
        +
      • +

        intersect

        +
        public abstract CompactSketch intersect​(Sketch a,
        +                                        Sketch b,
        +                                        boolean dstOrdered,
        +                                        org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Perform intersect set operation on the two given sketches and return the result as a + CompactSketch.
        +
        +
        Parameters:
        +
        a - The first sketch argument
        +
        b - The second sketch argument
        +
        dstOrdered - See Destination Ordered.
        +
        dstMem - See Destination Memory.
        +
        Returns:
        +
        the result as a CompactSketch.
        +
        +
      • +
      + + + +
        +
      • +

        getMaxLgArrLongs

        +
        protected static int getMaxLgArrLongs​(org.apache.datasketches.memory.Memory dstMem)
        +
        Returns the maximum lgArrLongs given the capacity of the Memory.
        +
        +
        Parameters:
        +
        dstMem - the given Memory
        +
        Returns:
        +
        the maximum lgArrLongs given the capacity of the Memory
        +
        +
      • +
      + + + +
        +
      • +

        checkMinSizeMemory

        +
        protected static void checkMinSizeMemory​(org.apache.datasketches.memory.Memory mem)
        +
      • +
      + + + +
        +
      • +

        memChecks

        +
        protected static void memChecks​(org.apache.datasketches.memory.Memory srcMem)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/JaccardSimilarity.html b/docs/5.0.2/org/apache/datasketches/theta/JaccardSimilarity.html new file mode 100644 index 000000000..470ad56ac --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/JaccardSimilarity.html @@ -0,0 +1,429 @@ + + + + + +JaccardSimilarity (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class JaccardSimilarity

+
+
+ +
+
    +
  • +
    +
    public final class JaccardSimilarity
    +extends Object
    +
    Jaccard similarity of two Theta Sketches.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JaccardSimilarity

        +
        public JaccardSimilarity()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        jaccard

        +
        public static double[] jaccard​(Sketch sketchA,
        +                               Sketch sketchB)
        +
        Computes the Jaccard similarity index with upper and lower bounds. The Jaccard similarity index + J(A,B) = (A ^ B)/(A U B) is used to measure how similar the two sketches are to each + other. If J = 1.0, the sketches are considered equal. If J = 0, the two sketches are + distinct from each other. A Jaccard of .95 means the overlap between the two + populations is 95% of the union of the two populations. + +

        Note: For very large pairs of sketches, where the configured nominal entries of the sketches + are 2^25 or 2^26, this method may produce unpredictable results.

        +
        +
        Parameters:
        +
        sketchA - given sketch A
        +
        sketchB - given sketch B
        +
        Returns:
        +
        a double array {LowerBound, Estimate, UpperBound} of the Jaccard index. + The Upper and Lower bounds are for a confidence interval of 95.4% or +/- 2 standard deviations.
        +
        +
      • +
      + + + +
        +
      • +

        exactlyEqual

        +
        public static boolean exactlyEqual​(Sketch sketchA,
        +                                   Sketch sketchB)
        +
        Returns true if the two given sketches have exactly the same hash values and the same + theta values. Thus, they are equivalent.
        +
        +
        Parameters:
        +
        sketchA - the given sketch A
        +
        sketchB - the given sketch B
        +
        Returns:
        +
        true if the two given sketches have exactly the same hash values and the same + theta values.
        +
        +
      • +
      + + + +
        +
      • +

        similarityTest

        +
        public static boolean similarityTest​(Sketch measured,
        +                                     Sketch expected,
        +                                     double threshold)
        +
        Tests similarity of a measured Sketch against an expected Sketch. + Computes the lower bound of the Jaccard index JLB of the measured and + expected sketches. + if JLB ≥ threshold, then the sketches are considered to be + similar with a confidence of 97.7%.
        +
        +
        Parameters:
        +
        measured - the sketch to be tested
        +
        expected - the reference sketch that is considered to be correct.
        +
        threshold - a real value between zero and one.
        +
        Returns:
        +
        if true, the similarity of the two sketches is greater than the given threshold + with at least 97.7% confidence.
        +
        +
      • +
      + + + +
        +
      • +

        dissimilarityTest

        +
        public static boolean dissimilarityTest​(Sketch measured,
        +                                        Sketch expected,
        +                                        double threshold)
        +
        Tests dissimilarity of a measured Sketch against an expected Sketch. + Computes the upper bound of the Jaccard index JUB of the measured and + expected sketches. + if JUB ≤ threshold, then the sketches are considered to be + dissimilar with a confidence of 97.7%.
        +
        +
        Parameters:
        +
        measured - the sketch to be tested
        +
        expected - the reference sketch that is considered to be correct.
        +
        threshold - a real value between zero and one.
        +
        Returns:
        +
        if true, the dissimilarity of the two sketches is greater than the given threshold + with at least 97.7% confidence.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/SetOperation.html b/docs/5.0.2/org/apache/datasketches/theta/SetOperation.html new file mode 100644 index 000000000..dbd47ec7e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/SetOperation.html @@ -0,0 +1,599 @@ + + + + + +SetOperation (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SetOperation

+
+
+ +
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    AnotB, Intersection, Union
    +
    +
    +
    public abstract class SetOperation
    +extends Object
    +
    The parent API for all Set Operations
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static SetOperationBuilderbuilder() +
      Makes a new builder
      +
      abstract FamilygetFamily() +
      Gets the Family of this SetOperation
      +
      static intgetMaxAnotBResultBytes​(int nomEntries) +
      Returns the maximum number of bytes for the returned CompactSketch, given the + value of nomEntries of the first sketch A of AnotB.
      +
      static intgetMaxIntersectionBytes​(int nomEntries) +
      Returns the maximum required storage bytes given a nomEntries parameter for Intersection + operations
      +
      static intgetMaxUnionBytes​(int nomEntries) +
      Returns the maximum required storage bytes given a nomEntries parameter for Union operations
      +
      static SetOperationheapify​(org.apache.datasketches.memory.Memory srcMem) +
      Heapify takes the SetOperations image in Memory and instantiates an on-heap + SetOperation using the + Default Update Seed.
      +
      static SetOperationheapify​(org.apache.datasketches.memory.Memory srcMem, + long expectedSeed) +
      Heapify takes the SetOperation image in Memory and instantiates an on-heap + SetOperation using the given expectedSeed.
      +
      abstract booleanisSameResource​(org.apache.datasketches.memory.Memory that) +
      Returns true if the backing resource of this is identical with the backing resource + of that.
      +
      static SetOperationwrap​(org.apache.datasketches.memory.Memory srcMem) +
      Wrap takes the SetOperation image in Memory and refers to it directly.
      +
      static SetOperationwrap​(org.apache.datasketches.memory.Memory srcMem, + long expectedSeed) +
      Wrap takes the SetOperation image in Memory and refers to it directly.
      +
      static SetOperationwrap​(org.apache.datasketches.memory.WritableMemory srcMem) +
      Wrap takes the SetOperation image in Memory and refers to it directly.
      +
      static SetOperationwrap​(org.apache.datasketches.memory.WritableMemory srcMem, + long expectedSeed) +
      Wrap takes the SetOperation image in Memory and refers to it directly.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        builder

        +
        public static final SetOperationBuilder builder()
        +
        Makes a new builder
        +
        +
        Returns:
        +
        a new builder
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static SetOperation heapify​(org.apache.datasketches.memory.Memory srcMem)
        +
        Heapify takes the SetOperations image in Memory and instantiates an on-heap + SetOperation using the + Default Update Seed. + The resulting SetOperation will not retain any link to the source Memory. + +

        Note: Only certain set operators during stateful operations can be serialized and thus + heapified.

        +
        +
        Parameters:
        +
        srcMem - an image of a SetOperation where the image seed hash matches the default seed hash. + See Memory
        +
        Returns:
        +
        a Heap-based SetOperation from the given Memory
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static SetOperation heapify​(org.apache.datasketches.memory.Memory srcMem,
        +                                   long expectedSeed)
        +
        Heapify takes the SetOperation image in Memory and instantiates an on-heap + SetOperation using the given expectedSeed. + The resulting SetOperation will not retain any link to the source Memory. + +

        Note: Only certain set operators during stateful operations can be serialized and thus + heapified.

        +
        +
        Parameters:
        +
        srcMem - an image of a SetOperation where the hash of the given expectedSeed matches the image seed hash. + See Memory
        +
        expectedSeed - the seed used to validate the given Memory image. + See Update Hash Seed.
        +
        Returns:
        +
        a Heap-based SetOperation from the given Memory
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static SetOperation wrap​(org.apache.datasketches.memory.Memory srcMem)
        +
        Wrap takes the SetOperation image in Memory and refers to it directly. + There is no data copying onto the java heap. + This method assumes the + Default Update Seed. + +

        Note: Only certain set operators during stateful operations can be serialized and thus + wrapped.

        +
        +
        Parameters:
        +
        srcMem - an image of a SetOperation where the image seed hash matches the default seed hash. + See Memory
        +
        Returns:
        +
        a SetOperation backed by the given Memory
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static SetOperation wrap​(org.apache.datasketches.memory.Memory srcMem,
        +                                long expectedSeed)
        +
        Wrap takes the SetOperation image in Memory and refers to it directly. + There is no data copying onto the java heap. + +

        Note: Only certain set operators during stateful operations can be serialized and thus + wrapped.

        +
        +
        Parameters:
        +
        srcMem - an image of a SetOperation where the hash of the given expectedSeed matches the image seed hash. + See Memory
        +
        expectedSeed - the seed used to validate the given Memory image. + See Update Hash Seed.
        +
        Returns:
        +
        a SetOperation backed by the given Memory
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static SetOperation wrap​(org.apache.datasketches.memory.WritableMemory srcMem)
        +
        Wrap takes the SetOperation image in Memory and refers to it directly. + There is no data copying onto the java heap. + This method assumes the + Default Update Seed. + +

        Note: Only certain set operators during stateful operations can be serialized and thus + wrapped.

        +
        +
        Parameters:
        +
        srcMem - an image of a SetOperation where the image seed hash matches the default seed hash. + See Memory
        +
        Returns:
        +
        a SetOperation backed by the given Memory
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static SetOperation wrap​(org.apache.datasketches.memory.WritableMemory srcMem,
        +                                long expectedSeed)
        +
        Wrap takes the SetOperation image in Memory and refers to it directly. + There is no data copying onto the java heap. + +

        Note: Only certain set operators during stateful operations can be serialized and thus + wrapped.

        +
        +
        Parameters:
        +
        srcMem - an image of a SetOperation where the hash of the given expectedSeed matches the image seed hash. + See Memory
        +
        expectedSeed - the seed used to validate the given Memory image. + See Update Hash Seed.
        +
        Returns:
        +
        a SetOperation backed by the given Memory
        +
        +
      • +
      + + + +
        +
      • +

        getMaxUnionBytes

        +
        public static int getMaxUnionBytes​(int nomEntries)
        +
        Returns the maximum required storage bytes given a nomEntries parameter for Union operations
        +
        +
        Parameters:
        +
        nomEntries - Nominal Entries + This will become the ceiling power of 2 if it is not.
        +
        Returns:
        +
        the maximum required storage bytes given a nomEntries parameter
        +
        +
      • +
      + + + +
        +
      • +

        getMaxIntersectionBytes

        +
        public static int getMaxIntersectionBytes​(int nomEntries)
        +
        Returns the maximum required storage bytes given a nomEntries parameter for Intersection + operations
        +
        +
        Parameters:
        +
        nomEntries - Nominal Entries + This will become the ceiling power of 2 if it is not.
        +
        Returns:
        +
        the maximum required storage bytes given a nomEntries parameter
        +
        +
      • +
      + + + +
        +
      • +

        getMaxAnotBResultBytes

        +
        public static int getMaxAnotBResultBytes​(int nomEntries)
        +
        Returns the maximum number of bytes for the returned CompactSketch, given the + value of nomEntries of the first sketch A of AnotB.
        +
        +
        Parameters:
        +
        nomEntries - this value must be a power of 2.
        +
        Returns:
        +
        the maximum number of bytes.
        +
        +
      • +
      + + + +
        +
      • +

        getFamily

        +
        public abstract Family getFamily()
        +
        Gets the Family of this SetOperation
        +
        +
        Returns:
        +
        the Family of this SetOperation
        +
        +
      • +
      + + + +
        +
      • +

        isSameResource

        +
        public abstract boolean isSameResource​(org.apache.datasketches.memory.Memory that)
        +
        Returns true if the backing resource of this is identical with the backing resource + of that. The capacities must be the same. If this is a region, + the region offset must also be the same. + +

        Note: Only certain set operators during stateful operations can be serialized. + Only when they are stored into Memory will this be relevant.

        +
        +
        Parameters:
        +
        that - A different non-null object
        +
        Returns:
        +
        true if the backing resource of this is the same as the backing resource + of that.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/SetOperationBuilder.html b/docs/5.0.2/org/apache/datasketches/theta/SetOperationBuilder.html new file mode 100644 index 000000000..8a956a0b0 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/SetOperationBuilder.html @@ -0,0 +1,752 @@ + + + + + +SetOperationBuilder (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SetOperationBuilder

+
+
+ +
+
    +
  • +
    +
    public class SetOperationBuilder
    +extends Object
    +
    For building a new SetOperation.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SetOperationBuilder

        +
        public SetOperationBuilder()
        +
        Constructor for building a new SetOperation. The default configuration is +
          +
        • Max Nominal Entries (max K): + 4096
        • +
        • Seed: 9001L
        • +
        • ResizeFactor.X8
        • +
        • Input Sampling Probability: 1.0
        • +
        • Memory: null
        • +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setNominalEntries

        +
        public SetOperationBuilder setNominalEntries​(int nomEntries)
        +
        Sets the Maximum Nominal Entries (max K) for this set operation. The effective value of K of the result of a + Set Operation can be less than max K, but never greater. + The minimum value is 16 and the maximum value is 67,108,864, which is 2^26.
        +
        +
        Parameters:
        +
        nomEntries - Nominal Entres + This will become the ceiling power of 2 if it is not a power of 2.
        +
        Returns:
        +
        this SetOperationBuilder
        +
        +
      • +
      + + + +
        +
      • +

        setLogNominalEntries

        +
        public SetOperationBuilder setLogNominalEntries​(int lgNomEntries)
        +
        Alternative method of setting the Nominal Entries for this set operation from the log_base2 value. + The minimum value is 4 and the maximum value is 26. + Be aware that set operations as large as this maximum value may not have been + thoroughly characterized for performance.
        +
        +
        Parameters:
        +
        lgNomEntries - the log_base2 Nominal Entries.
        +
        Returns:
        +
        this SetOperationBuilder
        +
        +
      • +
      + + + +
        +
      • +

        getLgNominalEntries

        +
        public int getLgNominalEntries()
        +
        Returns Log-base 2 Nominal Entries
        +
        +
        Returns:
        +
        Log-base 2 Nominal Entries
        +
        +
      • +
      + + + +
        +
      • +

        setSeed

        +
        public SetOperationBuilder setSeed​(long seed)
        +
        Sets the long seed value that is require by the hashing function.
        +
        +
        Parameters:
        +
        seed - See seed
        +
        Returns:
        +
        this SetOperationBuilder
        +
        +
      • +
      + + + +
        +
      • +

        getSeed

        +
        public long getSeed()
        +
        Returns the seed
        +
        +
        Returns:
        +
        the seed
        +
        +
      • +
      + + + +
        +
      • +

        setP

        +
        public SetOperationBuilder setP​(float p)
        +
        Sets the upfront uniform sampling probability, p. Although this functionality is + implemented for Unions only, it rarely makes sense to use it. The proper use of upfront + sampling is when building the sketches.
        +
        +
        Parameters:
        +
        p - See Sampling Probability, p
        +
        Returns:
        +
        this SetOperationBuilder
        +
        +
      • +
      + + + +
        +
      • +

        getP

        +
        public float getP()
        +
        Returns the pre-sampling probability p
        +
        +
        Returns:
        +
        the pre-sampling probability p
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getResizeFactor

        +
        public ResizeFactor getResizeFactor()
        +
        Returns the Resize Factor
        +
        +
        Returns:
        +
        the Resize Factor
        +
        +
      • +
      + + + +
        +
      • +

        setMemoryRequestServer

        +
        public SetOperationBuilder setMemoryRequestServer​(org.apache.datasketches.memory.MemoryRequestServer memReqSvr)
        +
        Set the MemoryRequestServer
        +
        +
        Parameters:
        +
        memReqSvr - the given MemoryRequestServer
        +
        Returns:
        +
        this SetOperationBuilder
        +
        +
      • +
      + + + +
        +
      • +

        getMemoryRequestServer

        +
        public org.apache.datasketches.memory.MemoryRequestServer getMemoryRequestServer()
        +
        Returns the MemoryRequestServer
        +
        +
        Returns:
        +
        the MemoryRequestServer
        +
        +
      • +
      + + + +
        +
      • +

        build

        +
        public SetOperation build​(Family family)
        +
        Returns a SetOperation with the current configuration of this Builder and the given Family.
        +
        +
        Parameters:
        +
        family - the chosen SetOperation family
        +
        Returns:
        +
        a SetOperation
        +
        +
      • +
      + + + +
        +
      • +

        build

        +
        public SetOperation build​(Family family,
        +                          org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Returns a SetOperation with the current configuration of this Builder, the given Family + and the given destination memory. Note that the destination memory cannot be used with AnotB.
        +
        +
        Parameters:
        +
        family - the chosen SetOperation family
        +
        dstMem - The destination Memory.
        +
        Returns:
        +
        a SetOperation
        +
        +
      • +
      + + + +
        +
      • +

        buildUnion

        +
        public Union buildUnion()
        +
        Convenience method, returns a configured SetOperation Union with + Default Nominal Entries
        +
        +
        Returns:
        +
        a Union object
        +
        +
      • +
      + + + +
        +
      • +

        buildUnion

        +
        public Union buildUnion​(org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Convenience method, returns a configured SetOperation Union with + Default Nominal Entries + and the given destination memory.
        +
        +
        Parameters:
        +
        dstMem - The destination Memory.
        +
        Returns:
        +
        a Union object
        +
        +
      • +
      + + + +
        +
      • +

        buildIntersection

        +
        public Intersection buildIntersection()
        +
        Convenience method, returns a configured SetOperation Intersection with + Default Nominal Entries
        +
        +
        Returns:
        +
        an Intersection object
        +
        +
      • +
      + + + +
        +
      • +

        buildIntersection

        +
        public Intersection buildIntersection​(org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Convenience method, returns a configured SetOperation Intersection with + Default Nominal Entries + and the given destination memory.
        +
        +
        Parameters:
        +
        dstMem - The destination Memory.
        +
        Returns:
        +
        an Intersection object
        +
        +
      • +
      + + + +
        +
      • +

        buildANotB

        +
        public AnotB buildANotB()
        +
        Convenience method, returns a configured SetOperation ANotB with + Default Update Seed
        +
        +
        Returns:
        +
        an ANotB object
        +
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/Sketch.html b/docs/5.0.2/org/apache/datasketches/theta/Sketch.html new file mode 100644 index 000000000..4df6f2859 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/Sketch.html @@ -0,0 +1,1121 @@ + + + + + +Sketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Sketch

+
+
+ +
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    CompactSketch, UpdateSketch
    +
    +
    +
    public abstract class Sketch
    +extends Object
    +
    The top-level class for all theta sketches. This class is never constructed directly. + Use the UpdateSketch.builder() methods to create UpdateSketches.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and TypeMethodDescription
      CompactSketchcompact() +
      Converts this sketch to a ordered CompactSketch.
      +
      abstract CompactSketchcompact​(boolean dstOrdered, + org.apache.datasketches.memory.WritableMemory dstMem) +
      Convert this sketch to a CompactSketch.
      +
      abstract intgetCompactBytes() +
      Returns the number of storage bytes required for this Sketch if its current state were + compacted.
      +
      intgetCountLessThanThetaLong​(long thetaLong) +
      Gets the number of hash values less than the given theta expressed as a long.
      +
      abstract intgetCurrentBytes() +
      Returns the number of storage bytes required for this sketch in its current state.
      +
      abstract doublegetEstimate() +
      Gets the unique count estimate.
      +
      abstract FamilygetFamily() +
      Returns the Family that this sketch belongs to
      +
      doublegetLowerBound​(int numStdDev) +
      Gets the approximate lower error bound given the specified number of Standard Deviations.
      +
      static intgetMaxCompactSketchBytes​(int numberOfEntries) +
      Returns the maximum number of storage bytes required for a CompactSketch with the given + number of actual entries.
      +
      static intgetMaxUpdateSketchBytes​(int nomEntries) +
      Returns the maximum number of storage bytes required for an UpdateSketch with the given + number of nominal entries (power of 2).
      +
      intgetRetainedEntries() +
      Returns the number of valid entries that have been retained by the sketch.
      +
      abstract intgetRetainedEntries​(boolean valid) +
      Returns the number of entries that have been retained by the sketch.
      +
      static intgetSerializationVersion​(org.apache.datasketches.memory.Memory mem) +
      Returns the serialization version from the given Memory
      +
      doublegetTheta() +
      Gets the value of theta as a double with a value between zero and one
      +
      abstract longgetThetaLong() +
      Gets the value of theta as a long
      +
      doublegetUpperBound​(int numStdDev) +
      Gets the approximate upper error bound given the specified number of Standard Deviations.
      +
      abstract booleanhasMemory() +
      Returns true if this sketch's data structure is backed by Memory or WritableMemory.
      +
      static Sketchheapify​(org.apache.datasketches.memory.Memory srcMem) +
      Heapify takes the sketch image in Memory and instantiates an on-heap Sketch.
      +
      static Sketchheapify​(org.apache.datasketches.memory.Memory srcMem, + long expectedSeed) +
      Heapify takes the sketch image in Memory and instantiates an on-heap Sketch.
      +
      abstract booleanisCompact() +
      Returns true if this sketch is in compact form.
      +
      abstract booleanisDirect() +
      Returns true if the this sketch's internal data structure is backed by direct (off-heap) + Memory.
      +
      abstract booleanisEmpty() + +
      booleanisEstimationMode() +
      Returns true if the sketch is Estimation Mode (as opposed to Exact Mode).
      +
      abstract booleanisOrdered() +
      Returns true if internal cache is ordered
      +
      booleanisSameResource​(org.apache.datasketches.memory.Memory that) +
      Returns true if the backing resource of this is identical with the backing resource + of that.
      +
      abstract HashIteratoriterator() +
      Returns a HashIterator that can be used to iterate over the retained hash values of the + Theta sketch.
      +
      abstract byte[]toByteArray() +
      Serialize this sketch to a byte array form.
      +
      StringtoString() +
      Returns a human readable summary of the sketch.
      +
      StringtoString​(boolean sketchSummary, + boolean dataDetail, + int width, + boolean hexMode) +
      Gets a human readable listing of contents and summary of the given sketch.
      +
      static StringtoString​(byte[] byteArr) +
      Returns a human readable string of the preamble of a byte array image of a Theta Sketch.
      +
      static StringtoString​(org.apache.datasketches.memory.Memory mem) +
      Returns a human readable string of the preamble of a Memory image of a Theta Sketch.
      +
      static Sketchwrap​(org.apache.datasketches.memory.Memory srcMem) +
      Wrap takes the sketch image in the given Memory and refers to it directly.
      +
      static Sketchwrap​(org.apache.datasketches.memory.Memory srcMem, + long expectedSeed) +
      Wrap takes the sketch image in the given Memory and refers to it directly.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        heapify

        +
        public static Sketch heapify​(org.apache.datasketches.memory.Memory srcMem)
        +
        Heapify takes the sketch image in Memory and instantiates an on-heap Sketch. + +

        The resulting sketch will not retain any link to the source Memory.

        + +

        For Update Sketches this method checks if the + Default Update Seed

        + was used to create the source Memory image. + +

        For Compact Sketches this method assumes that the sketch image was created with the + correct hash seed, so it is not checked.

        +
        +
        Parameters:
        +
        srcMem - an image of a Sketch. + See Memory.
        +
        Returns:
        +
        a Sketch on the heap.
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static Sketch heapify​(org.apache.datasketches.memory.Memory srcMem,
        +                             long expectedSeed)
        +
        Heapify takes the sketch image in Memory and instantiates an on-heap Sketch. + +

        The resulting sketch will not retain any link to the source Memory.

        + +

        For Update and Compact Sketches this method checks if the given expectedSeed was used to + create the source Memory image. However, SerialVersion 1 sketches cannot be checked.

        +
        +
        Parameters:
        +
        srcMem - an image of a Sketch that was created using the given expectedSeed. + See Memory.
        +
        expectedSeed - the seed used to validate the given Memory image. + See Update Hash Seed. + Compact sketches store a 16-bit hash of the seed, but not the seed itself.
        +
        Returns:
        +
        a Sketch on the heap.
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static Sketch wrap​(org.apache.datasketches.memory.Memory srcMem)
        +
        Wrap takes the sketch image in the given Memory and refers to it directly. + There is no data copying onto the java heap. + The wrap operation enables fast read-only merging and access to all the public read-only API. + +

        Only "Direct" Serialization Version 3 (i.e, OpenSource) sketches that have + been explicitly stored as direct sketches can be wrapped. + Wrapping earlier serial version sketches will result in a on-heap CompactSketch + where all data will be copied to the heap. These early versions were never designed to + "wrap".

        + +

        Wrapping any subclass of this class that is empty or contains only a single item will + result in on-heap equivalent forms of empty and single item sketch respectively. + This is actually faster and consumes less overall memory.

        + +

        For Update Sketches this method checks if the + Default Update Seed

        + was used to create the source Memory image. + +

        For Compact Sketches this method assumes that the sketch image was created with the + correct hash seed, so it is not checked.

        +
        +
        Parameters:
        +
        srcMem - an image of a Sketch. + See Memory.
        +
        Returns:
        +
        a Sketch backed by the given Memory
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static Sketch wrap​(org.apache.datasketches.memory.Memory srcMem,
        +                          long expectedSeed)
        +
        Wrap takes the sketch image in the given Memory and refers to it directly. + There is no data copying onto the java heap. + The wrap operation enables fast read-only merging and access to all the public read-only API. + +

        Only "Direct" Serialization Version 3 (i.e, OpenSource) sketches that have + been explicitly stored as direct sketches can be wrapped. + Wrapping earlier serial version sketches will result in a on-heap CompactSketch + where all data will be copied to the heap. These early versions were never designed to + "wrap".

        + +

        Wrapping any subclass of this class that is empty or contains only a single item will + result in on-heap equivalent forms of empty and single item sketch respectively. + This is actually faster and consumes less overall memory.

        + +

        For Update and Compact Sketches this method checks if the given expectedSeed was used to + create the source Memory image. However, SerialVersion 1 sketches cannot be checked.

        +
        +
        Parameters:
        +
        srcMem - an image of a Sketch. + See Memory
        +
        expectedSeed - the seed used to validate the given Memory image. + See Update Hash Seed.
        +
        Returns:
        +
        a UpdateSketch backed by the given Memory except as above.
        +
        +
      • +
      + + + +
        +
      • +

        compact

        +
        public CompactSketch compact()
        +
        Converts this sketch to a ordered CompactSketch. + +

        If this.isCompact() == true this method returns this, + otherwise, this method is equivalent to + compact(true, null). + +

        A CompactSketch is always immutable.

        +
        +
        Returns:
        +
        this sketch as an ordered CompactSketch.
        +
        +
      • +
      + + + +
        +
      • +

        compact

        +
        public abstract CompactSketch compact​(boolean dstOrdered,
        +                                      org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Convert this sketch to a CompactSketch. + +

        If this sketch is a type of UpdateSketch, the compacting process converts the hash table + of the UpdateSketch to a simple list of the valid hash values. + Any hash values of zero or equal-to or greater than theta will be discarded. + The number of valid values remaining in the CompactSketch depends on a number of factors, + but may be larger or smaller than Nominal Entries (or k). + It will never exceed 2k. + If it is critical to always limit the size to no more than k, + then rebuild() should be called on the UpdateSketch prior to calling this method.

        + +

        A CompactSketch is always immutable.

        + +

        A new CompactSketch object is created:

        +
        • if dstMem != null
        • +
        • if dstMem == null and this.hasMemory() == true
        • +
        • if dstMem == null and this has more than 1 item and this.isOrdered() == false + and dstOrdered == true.
        • +
        + +

        Otherwise, this operation returns this.

        +
        +
        Parameters:
        +
        dstOrdered - assumed true if this sketch is empty or has only one value + See Destination Ordered
        +
        dstMem - See Destination Memory.
        +
        Returns:
        +
        this sketch as a CompactSketch.
        +
        +
      • +
      + + + +
        +
      • +

        getCompactBytes

        +
        public abstract int getCompactBytes()
        +
        Returns the number of storage bytes required for this Sketch if its current state were + compacted. It this sketch is already in the compact form this is equivalent to + calling getCurrentBytes().
        +
        +
        Returns:
        +
        number of compact bytes
        +
        +
      • +
      + + + +
        +
      • +

        getCountLessThanThetaLong

        +
        public int getCountLessThanThetaLong​(long thetaLong)
        +
        Gets the number of hash values less than the given theta expressed as a long.
        +
        +
        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.
        +
        +
      • +
      + + + +
        +
      • +

        getCurrentBytes

        +
        public abstract int getCurrentBytes()
        +
        Returns the number of storage bytes required for this sketch in its current state.
        +
        +
        Returns:
        +
        the number of storage bytes required for this sketch
        +
        +
      • +
      + + + +
        +
      • +

        getEstimate

        +
        public abstract double getEstimate()
        +
        Gets the unique count estimate.
        +
        +
        Returns:
        +
        the sketch's best estimate of the cardinality of the input stream.
        +
        +
      • +
      + + + +
        +
      • +

        getFamily

        +
        public abstract Family getFamily()
        +
        Returns the Family that this sketch belongs to
        +
        +
        Returns:
        +
        the Family that this sketch belongs to
        +
        +
      • +
      + + + +
        +
      • +

        getLowerBound

        +
        public double getLowerBound​(int numStdDev)
        +
        Gets the approximate lower error bound given the specified number of Standard Deviations. + This will return getEstimate() if isEmpty() is true.
        +
        +
        Parameters:
        +
        numStdDev - See Number of Standard Deviations
        +
        Returns:
        +
        the lower bound.
        +
        +
      • +
      + + + +
        +
      • +

        getMaxCompactSketchBytes

        +
        public static int getMaxCompactSketchBytes​(int numberOfEntries)
        +
        Returns the maximum number of storage bytes required for a CompactSketch with the given + number of actual entries. Note that this assumes the worse case of the sketch in + estimation mode, which requires storing theta and count.
        +
        +
        Parameters:
        +
        numberOfEntries - the actual number of entries stored with the CompactSketch.
        +
        Returns:
        +
        the maximum number of storage bytes required for a CompactSketch with the given number + of entries.
        +
        +
      • +
      + + + +
        +
      • +

        getMaxUpdateSketchBytes

        +
        public static int getMaxUpdateSketchBytes​(int nomEntries)
        +
        Returns the maximum number of storage bytes required for an UpdateSketch with the given + number of nominal entries (power of 2).
        +
        +
        Parameters:
        +
        nomEntries - Nominal Entries + This will become the ceiling power of 2 if it is not.
        +
        Returns:
        +
        the maximum number of storage bytes required for a UpdateSketch with the given + nomEntries
        +
        +
      • +
      + + + +
        +
      • +

        getRetainedEntries

        +
        public int getRetainedEntries()
        +
        Returns the number of valid entries that have been retained by the sketch.
        +
        +
        Returns:
        +
        the number of valid retained entries
        +
        +
      • +
      + + + +
        +
      • +

        getRetainedEntries

        +
        public abstract int getRetainedEntries​(boolean valid)
        +
        Returns the number of entries that have been retained by the sketch.
        +
        +
        Parameters:
        +
        valid - if true, returns the number of valid entries, which are less than theta and used + for estimation. + Otherwise, return the number of all entries, valid or not, that are currently in the internal + sketch cache.
        +
        Returns:
        +
        the number of retained entries
        +
        +
      • +
      + + + +
        +
      • +

        getSerializationVersion

        +
        public static int getSerializationVersion​(org.apache.datasketches.memory.Memory mem)
        +
        Returns the serialization version from the given Memory
        +
        +
        Parameters:
        +
        mem - the sketch Memory
        +
        Returns:
        +
        the serialization version from the Memory
        +
        +
      • +
      + + + +
        +
      • +

        getTheta

        +
        public double getTheta()
        +
        Gets the value of theta as a double with a value between zero and one
        +
        +
        Returns:
        +
        the value of theta as a double
        +
        +
      • +
      + + + +
        +
      • +

        getThetaLong

        +
        public abstract long getThetaLong()
        +
        Gets the value of theta as a long
        +
        +
        Returns:
        +
        the value of theta as a long
        +
        +
      • +
      + + + +
        +
      • +

        getUpperBound

        +
        public double getUpperBound​(int numStdDev)
        +
        Gets the approximate upper error bound given the specified number of Standard Deviations. + This will return getEstimate() if isEmpty() is true.
        +
        +
        Parameters:
        +
        numStdDev - See Number of Standard Deviations
        +
        Returns:
        +
        the upper bound.
        +
        +
      • +
      + + + +
        +
      • +

        hasMemory

        +
        public abstract boolean hasMemory()
        +
        Returns true if this sketch's data structure is backed by Memory or WritableMemory.
        +
        +
        Returns:
        +
        true if this sketch's data structure is backed by Memory or WritableMemory.
        +
        +
      • +
      + + + +
        +
      • +

        isCompact

        +
        public abstract boolean isCompact()
        +
        Returns true if this sketch is in compact form.
        +
        +
        Returns:
        +
        true if this sketch is in compact form.
        +
        +
      • +
      + + + +
        +
      • +

        isDirect

        +
        public abstract boolean isDirect()
        +
        Returns true if the this sketch's internal data structure is backed by direct (off-heap) + Memory.
        +
        +
        Returns:
        +
        true if the this sketch's internal data structure is backed by direct (off-heap) + Memory.
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public abstract boolean isEmpty()
        + +
        +
        Returns:
        +
        true if empty.
        +
        +
      • +
      + + + +
        +
      • +

        isEstimationMode

        +
        public boolean isEstimationMode()
        +
        Returns true if the sketch is Estimation Mode (as opposed to Exact Mode). + This is true if theta < 1.0 AND isEmpty() is false.
        +
        +
        Returns:
        +
        true if the sketch is in estimation mode.
        +
        +
      • +
      + + + +
        +
      • +

        isOrdered

        +
        public abstract boolean isOrdered()
        +
        Returns true if internal cache is ordered
        +
        +
        Returns:
        +
        true if internal cache is ordered
        +
        +
      • +
      + + + +
        +
      • +

        isSameResource

        +
        public boolean isSameResource​(org.apache.datasketches.memory.Memory that)
        +
        Returns true if the backing resource of this is identical with the backing resource + of that. The capacities must be the same. If this is a region, + the region offset must also be the same.
        +
        +
        Parameters:
        +
        that - A different non-null object
        +
        Returns:
        +
        true if the backing resource of this is the same as the backing resource + of that.
        +
        +
      • +
      + + + +
        +
      • +

        iterator

        +
        public abstract HashIterator iterator()
        +
        Returns a HashIterator that can be used to iterate over the retained hash values of the + Theta sketch.
        +
        +
        Returns:
        +
        a HashIterator that can be used to iterate over the retained hash values of the + Theta sketch.
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public abstract byte[] toByteArray()
        +
        Serialize this sketch to a byte array form.
        +
        +
        Returns:
        +
        byte array of this sketch
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Returns a human readable summary of the sketch. This method is equivalent to the parameterized + call:
        + Sketch.toString(sketch, true, false, 8, true);
        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        summary
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString​(boolean sketchSummary,
        +                       boolean dataDetail,
        +                       int width,
        +                       boolean hexMode)
        +
        Gets a human readable listing of contents and summary of the given sketch. + This can be a very long string. If this sketch is in a "dirty" state there + may be values in the dataDetail view that are ≥ theta.
        +
        +
        Parameters:
        +
        sketchSummary - If true the sketch summary will be output at the end.
        +
        dataDetail - If true, includes all valid hash values in the sketch.
        +
        width - The number of columns of hash values. Default is 8.
        +
        hexMode - If true, hashes will be output in hex.
        +
        Returns:
        +
        The result string, which can be very long.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString​(byte[] byteArr)
        +
        Returns a human readable string of the preamble of a byte array image of a Theta Sketch.
        +
        +
        Parameters:
        +
        byteArr - the given byte array
        +
        Returns:
        +
        a human readable string of the preamble of a byte array image of a Theta Sketch.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString​(org.apache.datasketches.memory.Memory mem)
        +
        Returns a human readable string of the preamble of a Memory image of a Theta Sketch.
        +
        +
        Parameters:
        +
        mem - the given Memory object
        +
        Returns:
        +
        a human readable string of the preamble of a Memory image of a Theta Sketch.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/Sketches.html b/docs/5.0.2/org/apache/datasketches/theta/Sketches.html new file mode 100644 index 000000000..971c708f2 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/Sketches.html @@ -0,0 +1,1073 @@ + + + + + +Sketches (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Sketches

+
+
+ +
+
    +
  • +
    +
    public final class Sketches
    +extends Object
    +
    This class brings together the common sketch and set operation creation methods and + the public static methods into one place.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+ +
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/Union.html b/docs/5.0.2/org/apache/datasketches/theta/Union.html new file mode 100644 index 000000000..0a452a5fa --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/Union.html @@ -0,0 +1,762 @@ + + + + + +Union (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Union

+
+
+ +
+
    +
  • +
    +
    public abstract class Union
    +extends SetOperation
    +
    Compute the union of two or more theta sketches. + A new instance represents an empty set.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Union() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and TypeMethodDescription
      abstract intgetCurrentBytes() +
      Returns the number of storage bytes required for this union in its current state.
      +
      FamilygetFamily() +
      Gets the Family of this SetOperation
      +
      abstract intgetMaxUnionBytes() +
      Returns the maximum required storage bytes for this union.
      +
      abstract CompactSketchgetResult() +
      Gets the result of this operation as an ordered CompactSketch on the Java heap.
      +
      abstract CompactSketchgetResult​(boolean dstOrdered, + org.apache.datasketches.memory.WritableMemory dstMem) +
      Gets the result of this operation as a CompactSketch of the chosen form.
      +
      abstract voidreset() +
      Resets this Union.
      +
      abstract byte[]toByteArray() +
      Returns a byte array image of this Union object
      +
      abstract voidunion​(org.apache.datasketches.memory.Memory mem) +
      Perform a Union operation with this union and the given Memory image of any sketch of the + Theta Family.
      +
      abstract voidunion​(Sketch sketchIn) +
      Perform a Union operation with this union and the given on-heap sketch of the Theta Family.
      +
      CompactSketchunion​(Sketch sketchA, + Sketch sketchB) +
      This implements a stateless, pair-wise union operation.
      +
      abstract CompactSketchunion​(Sketch sketchA, + Sketch sketchB, + boolean dstOrdered, + org.apache.datasketches.memory.WritableMemory dstMem) +
      This implements a stateless, pair-wise union operation.
      +
      abstract voidupdate​(byte[] data) +
      Update this union with the given byte array item.
      +
      abstract voidupdate​(char[] data) +
      Update this union with the given char array item.
      +
      abstract voidupdate​(double datum) +
      Update this union with the given double (or float) data item.
      +
      abstract voidupdate​(int[] data) +
      Update this union with the given integer array item.
      +
      abstract voidupdate​(long datum) +
      Update this union with the given long data item.
      +
      abstract voidupdate​(long[] data) +
      Update this union with the given long array item.
      +
      abstract voidupdate​(String datum) +
      Update this union with the with the given String data item.
      +
      + + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Union

        +
        public Union()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getCurrentBytes

        +
        public abstract int getCurrentBytes()
        +
        Returns the number of storage bytes required for this union in its current state.
        +
        +
        Returns:
        +
        the number of storage bytes required for this union in its current state.
        +
        +
      • +
      + + + +
        +
      • +

        getFamily

        +
        public Family getFamily()
        +
        Description copied from class: SetOperation
        +
        Gets the Family of this SetOperation
        +
        +
        Specified by:
        +
        getFamily in class SetOperation
        +
        Returns:
        +
        the Family of this SetOperation
        +
        +
      • +
      + + + +
        +
      • +

        getMaxUnionBytes

        +
        public abstract int getMaxUnionBytes()
        +
        Returns the maximum required storage bytes for this union.
        +
        +
        Returns:
        +
        the maximum required storage bytes for this union.
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public abstract CompactSketch getResult()
        +
        Gets the result of this operation as an ordered CompactSketch on the Java heap. + This does not disturb the underlying data structure of the union. + Therefore, it is OK to continue updating the union after this operation.
        +
        +
        Returns:
        +
        the result of this operation as an ordered CompactSketch on the Java heap
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public abstract CompactSketch getResult​(boolean dstOrdered,
        +                                        org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Gets the result of this operation as a CompactSketch of the chosen form. + This does not disturb the underlying data structure of the union. + Therefore, it is OK to continue updating the union after this operation.
        +
        +
        Parameters:
        +
        dstOrdered - See Destination Ordered
        +
        dstMem - See Destination Memory.
        +
        Returns:
        +
        the result of this operation as a CompactSketch of the chosen form
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public abstract void reset()
        +
        Resets this Union. The seed remains intact, everything else reverts back to its virgin state.
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public abstract byte[] toByteArray()
        +
        Returns a byte array image of this Union object
        +
        +
        Returns:
        +
        a byte array image of this Union object
        +
        +
      • +
      + + + +
        +
      • +

        union

        +
        public CompactSketch union​(Sketch sketchA,
        +                           Sketch sketchB)
        +
        This implements a stateless, pair-wise union operation. The returned sketch will be cut back to + the smaller of the two k values if required. + +

        Nulls and empty sketches are ignored.

        +
        +
        Parameters:
        +
        sketchA - The first argument
        +
        sketchB - The second argument
        +
        Returns:
        +
        the result ordered CompactSketch on the heap.
        +
        +
      • +
      + + + +
        +
      • +

        union

        +
        public abstract CompactSketch union​(Sketch sketchA,
        +                                    Sketch sketchB,
        +                                    boolean dstOrdered,
        +                                    org.apache.datasketches.memory.WritableMemory dstMem)
        +
        This implements a stateless, pair-wise union operation. The returned sketch will be cut back to + k if required, similar to the regular Union operation. + +

        Nulls and empty sketches are ignored.

        +
        +
        Parameters:
        +
        sketchA - The first argument
        +
        sketchB - The second argument
        +
        dstOrdered - If true, the returned CompactSketch will be ordered.
        +
        dstMem - If not null, the returned CompactSketch will be placed in this WritableMemory.
        +
        Returns:
        +
        the result CompactSketch.
        +
        +
      • +
      + + + +
        +
      • +

        union

        +
        public abstract void union​(Sketch sketchIn)
        +
        Perform a Union operation with this union and the given on-heap sketch of the Theta Family. + This method is not valid for the older SetSketch, which was prior to Open Source (August, 2015). + +

        This method can be repeatedly called. + +

        Nulls and empty sketches are ignored.

        +
        +
        Parameters:
        +
        sketchIn - The incoming sketch.
        +
        +
      • +
      + + + +
        +
      • +

        union

        +
        public abstract void union​(org.apache.datasketches.memory.Memory mem)
        +
        Perform a Union operation with this union and the given Memory image of any sketch of the + Theta Family. The input image may be from earlier versions of the Theta Compact Sketch, + called the SetSketch (circa 2014), which was prior to Open Source and are compact and ordered. + +

        This method can be repeatedly called. + +

        Nulls and empty sketches are ignored.

        +
        +
        Parameters:
        +
        mem - Memory image of sketch to be merged
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public abstract void update​(long datum)
        +
        Update this union with the given long data item.
        +
        +
        Parameters:
        +
        datum - The given long datum.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public abstract void update​(double datum)
        +
        Update this union with the given double (or float) data item. + The double will be converted to a long using Double.doubleToLongBits(datum), + which normalizes all NaN values to a single NaN representation. + Plus and minus zero will be normalized to plus zero. + Each of the special floating-point values NaN and +/- Infinity are treated as distinct.
        +
        +
        Parameters:
        +
        datum - The given double datum.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public abstract void update​(String datum)
        +
        Update this union with the with the given String data item. + The string is converted to a byte array using UTF8 encoding. + If the string is null or empty no update attempt is made and the method returns. + +

        Note: this will not produce the same output hash values as the update(char[]) + method and will generally be a little slower depending on the complexity of the UTF8 encoding. +

        + +

        Note: this is not a Sketch Union operation. This treats the given string as a data item.

        +
        +
        Parameters:
        +
        datum - The given String.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public abstract void update​(byte[] data)
        +
        Update this union with the given byte array item. + If the byte array is null or empty no update attempt is made and the method returns. + +

        Note: this is not a Sketch Union operation. This treats the given byte array as a data + item.

        +
        +
        Parameters:
        +
        data - The given byte array.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public abstract void update​(int[] data)
        +
        Update this union with the given integer array item. + If the integer array is null or empty no update attempt is made and the method returns. + +

        Note: this is not a Sketch Union operation. This treats the given integer array as a data + item.

        +
        +
        Parameters:
        +
        data - The given int array.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public abstract void update​(char[] data)
        +
        Update this union with the given char array item. + If the char array is null or empty no update attempt is made and the method returns. + +

        Note: this will not produce the same output hash values as the update(String) + method but will be a little faster as it avoids the complexity of the UTF8 encoding.

        + +

        Note: this is not a Sketch Union operation. This treats the given char array as a data + item.

        +
        +
        Parameters:
        +
        data - The given char array.
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public abstract void update​(long[] data)
        +
        Update this union with the given long array item. + If the long array is null or empty no update attempt is made and the method returns. + +

        Note: this is not a Sketch Union operation. This treats the given char array as a data + item.

        +
        +
        Parameters:
        +
        data - The given long array.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/UpdateReturnState.html b/docs/5.0.2/org/apache/datasketches/theta/UpdateReturnState.html new file mode 100644 index 000000000..a81655fcf --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/UpdateReturnState.html @@ -0,0 +1,509 @@ + + + + + +UpdateReturnState (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum UpdateReturnState

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        InsertedCountIncremented

        +
        public static final UpdateReturnState InsertedCountIncremented
        +
        The hash was accepted into the sketch and the retained count was incremented.
        +
      • +
      + + + +
        +
      • +

        InsertedCountIncrementedResized

        +
        public static final UpdateReturnState InsertedCountIncrementedResized
        +
        The hash was accepted into the sketch, the retained count was incremented. + The current cache was out of room and resized larger based on the Resize Factor.
        +
      • +
      + + + +
        +
      • +

        InsertedCountIncrementedRebuilt

        +
        public static final UpdateReturnState InsertedCountIncrementedRebuilt
        +
        The hash was accepted into the sketch, the retained count was incremented. + The current cache was out of room and at maximum size, so the cache was rebuilt.
        +
      • +
      + + + +
        +
      • +

        InsertedCountNotIncremented

        +
        public static final UpdateReturnState InsertedCountNotIncremented
        +
        The hash was accepted into the sketch and the retained count was not incremented.
        +
      • +
      + + + +
        +
      • +

        ConcurrentBufferInserted

        +
        public static final UpdateReturnState ConcurrentBufferInserted
        +
        The hash was inserted into the local concurrent buffer, + but has not yet been propagated to the concurrent shared sketch.
        +
      • +
      + + + +
        +
      • +

        ConcurrentPropagated

        +
        public static final UpdateReturnState ConcurrentPropagated
        +
        The hash has been propagated to the concurrent shared sketch. + This does not reflect the action taken by the shared sketch.
        +
      • +
      + + + +
        +
      • +

        RejectedDuplicate

        +
        public static final UpdateReturnState RejectedDuplicate
        +
        The hash was rejected as a duplicate.
        +
      • +
      + + + +
        +
      • +

        RejectedNullOrEmpty

        +
        public static final UpdateReturnState RejectedNullOrEmpty
        +
        The hash was rejected because it was null or empty.
        +
      • +
      + + + +
        +
      • +

        RejectedOverTheta

        +
        public static final UpdateReturnState RejectedOverTheta
        +
        The hash was rejected because the value was negative, zero or + greater than theta.
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static UpdateReturnState[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (UpdateReturnState c : UpdateReturnState.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static UpdateReturnState valueOf​(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/UpdateSketch.html b/docs/5.0.2/org/apache/datasketches/theta/UpdateSketch.html new file mode 100644 index 000000000..11acce0ec --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/UpdateSketch.html @@ -0,0 +1,794 @@ + + + + + +UpdateSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class UpdateSketch

+
+
+ +
+
    +
  • +
    +
    public abstract class UpdateSketch
    +extends Sketch
    +
    The parent class for the Update Sketch families, such as QuickSelect and Alpha. + The primary task of an Update Sketch is to consider datums presented via the update() methods + for inclusion in its internal cache. This is the sketch building process.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        wrap

        +
        public static UpdateSketch wrap​(org.apache.datasketches.memory.WritableMemory srcMem)
        +
        Wrap takes the sketch image in Memory and refers to it directly. There is no data copying onto + the java heap. Only "Direct" Serialization Version 3 (i.e, OpenSource) sketches that have + been explicitly stored as direct objects can be wrapped. This method assumes the + ThetaUtil.DEFAULT_UPDATE_SEED. + Default Update Seed.
        +
        +
        Parameters:
        +
        srcMem - an image of a Sketch where the image seed hash matches the default seed hash. + It must have a size of at least 24 bytes. + See Memory
        +
        Returns:
        +
        a Sketch backed by the given Memory
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static UpdateSketch wrap​(org.apache.datasketches.memory.WritableMemory srcMem,
        +                                long expectedSeed)
        +
        Wrap takes the sketch image in Memory and refers to it directly. There is no data copying onto + the java heap. Only "Direct" Serialization Version 3 (i.e, OpenSource) sketches that have + been explicitly stored as direct objects can be wrapped. + An attempt to "wrap" earlier version sketches will result in a "heapified", normal + Java Heap version of the sketch where all data will be copied to the heap.
        +
        +
        Parameters:
        +
        srcMem - an image of a Sketch where the image seed hash matches the given seed hash. + It must have a size of at least 24 bytes. + See Memory
        +
        expectedSeed - the seed used to validate the given Memory image. + See Update Hash Seed. + Compact sketches store a 16-bit hash of the seed, but not the seed itself.
        +
        Returns:
        +
        a UpdateSketch backed by the given Memory
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static UpdateSketch heapify​(org.apache.datasketches.memory.Memory srcMem)
        +
        Instantiates an on-heap UpdateSketch from Memory. This method assumes the + ThetaUtil.DEFAULT_UPDATE_SEED.
        +
        +
        Parameters:
        +
        srcMem - See Memory + It must have a size of at least 24 bytes.
        +
        Returns:
        +
        an UpdateSketch
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static UpdateSketch heapify​(org.apache.datasketches.memory.Memory srcMem,
        +                                   long expectedSeed)
        +
        Instantiates an on-heap UpdateSketch from Memory.
        +
        +
        Parameters:
        +
        srcMem - See Memory + It must have a size of at least 24 bytes.
        +
        expectedSeed - the seed used to validate the given Memory image. + See Update Hash Seed.
        +
        Returns:
        +
        an UpdateSketch
        +
        +
      • +
      + + + +
        +
      • +

        compact

        +
        public CompactSketch compact​(boolean dstOrdered,
        +                             org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Description copied from class: Sketch
        +
        Convert this sketch to a CompactSketch. + +

        If this sketch is a type of UpdateSketch, the compacting process converts the hash table + of the UpdateSketch to a simple list of the valid hash values. + Any hash values of zero or equal-to or greater than theta will be discarded. + The number of valid values remaining in the CompactSketch depends on a number of factors, + but may be larger or smaller than Nominal Entries (or k). + It will never exceed 2k. + If it is critical to always limit the size to no more than k, + then rebuild() should be called on the UpdateSketch prior to calling this method.

        + +

        A CompactSketch is always immutable.

        + +

        A new CompactSketch object is created:

        +
        • if dstMem != null
        • +
        • if dstMem == null and this.hasMemory() == true
        • +
        • if dstMem == null and this has more than 1 item and this.isOrdered() == false + and dstOrdered == true.
        • +
        + +

        Otherwise, this operation returns this.

        +
        +
        Specified by:
        +
        compact in class Sketch
        +
        Parameters:
        +
        dstOrdered - assumed true if this sketch is empty or has only one value + See Destination Ordered
        +
        dstMem - See Destination Memory.
        +
        Returns:
        +
        this sketch as a CompactSketch.
        +
        +
      • +
      + + + +
        +
      • +

        getCompactBytes

        +
        public int getCompactBytes()
        +
        Description copied from class: Sketch
        +
        Returns the number of storage bytes required for this Sketch if its current state were + compacted. It this sketch is already in the compact form this is equivalent to + calling Sketch.getCurrentBytes().
        +
        +
        Specified by:
        +
        getCompactBytes in class Sketch
        +
        Returns:
        +
        number of compact bytes
        +
        +
      • +
      + + + +
        +
      • +

        isCompact

        +
        public boolean isCompact()
        +
        Description copied from class: Sketch
        +
        Returns true if this sketch is in compact form.
        +
        +
        Specified by:
        +
        isCompact in class Sketch
        +
        Returns:
        +
        true if this sketch is in compact form.
        +
        +
      • +
      + + + +
        +
      • +

        isOrdered

        +
        public boolean isOrdered()
        +
        Description copied from class: Sketch
        +
        Returns true if internal cache is ordered
        +
        +
        Specified by:
        +
        isOrdered in class Sketch
        +
        Returns:
        +
        true if internal cache is ordered
        +
        +
      • +
      + + + +
        +
      • +

        builder

        +
        public static final UpdateSketchBuilder builder()
        +
        Returns a new builder
        +
        +
        Returns:
        +
        a new builder
        +
        +
      • +
      + + + +
        +
      • +

        getResizeFactor

        +
        public abstract ResizeFactor getResizeFactor()
        +
        Returns the configured ResizeFactor
        +
        +
        Returns:
        +
        the configured ResizeFactor
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public abstract void reset()
        +
        Resets this sketch back to a virgin empty state.
        +
      • +
      + + + +
        +
      • +

        rebuild

        +
        public abstract UpdateSketch rebuild()
        +
        Rebuilds the hash table to remove dirty values or to reduce the size + to nominal entries.
        +
        +
        Returns:
        +
        this sketch
        +
        +
      • +
      + + + + + + + +
        +
      • +

        update

        +
        public UpdateReturnState update​(double datum)
        +
        Present this sketch with the given double (or float) datum. + The double will be converted to a long using Double.doubleToLongBits(datum), + which normalizes all NaN values to a single NaN representation. + Plus and minus zero will be normalized to plus zero. + The special floating-point values NaN and +/- Infinity are treated as distinct.
        +
        +
        Parameters:
        +
        datum - The given double datum.
        +
        Returns:
        +
        See Update Return State
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public UpdateReturnState update​(String datum)
        +
        Present this sketch with the given String. + The string is converted to a byte array using UTF8 encoding. + If the string is null or empty no update attempt is made and the method returns. + +

        Note: this will not produce the same output hash values as the update(char[]) + method and will generally be a little slower depending on the complexity of the UTF8 encoding. +

        +
        +
        Parameters:
        +
        datum - The given String.
        +
        Returns:
        +
        See Update Return State
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public UpdateReturnState update​(byte[] data)
        +
        Present this sketch with the given byte array. + If the byte array is null or empty no update attempt is made and the method returns.
        +
        +
        Parameters:
        +
        data - The given byte array.
        +
        Returns:
        +
        See Update Return State
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public UpdateReturnState update​(char[] data)
        +
        Present this sketch with the given char array. + If the char array is null or empty no update attempt is made and the method returns. + +

        Note: this will not produce the same output hash values as the update(String) + method but will be a little faster as it avoids the complexity of the UTF8 encoding.

        +
        +
        Parameters:
        +
        data - The given char array.
        +
        Returns:
        +
        See Update Return State
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public UpdateReturnState update​(int[] data)
        +
        Present this sketch with the given integer array. + If the integer array is null or empty no update attempt is made and the method returns.
        +
        +
        Parameters:
        +
        data - The given int array.
        +
        Returns:
        +
        See Update Return State
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public UpdateReturnState update​(long[] data)
        +
        Present this sketch with the given long array. + If the long array is null or empty no update attempt is made and the method returns.
        +
        +
        Parameters:
        +
        data - The given long array.
        +
        Returns:
        +
        See Update Return State
        +
        +
      • +
      + + + +
        +
      • +

        getLgNomLongs

        +
        public abstract int getLgNomLongs()
        +
        Gets the Log base 2 of the configured nominal entries
        +
        +
        Returns:
        +
        the Log base 2 of the configured nominal entries
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/UpdateSketchBuilder.html b/docs/5.0.2/org/apache/datasketches/theta/UpdateSketchBuilder.html new file mode 100644 index 000000000..61e66a0ce --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/UpdateSketchBuilder.html @@ -0,0 +1,1078 @@ + + + + + +UpdateSketchBuilder (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class UpdateSketchBuilder

+
+
+ +
+
    +
  • +
    +
    public class UpdateSketchBuilder
    +extends Object
    +
    For building a new UpdateSketch.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        UpdateSketchBuilder

        +
        public UpdateSketchBuilder()
        +
        Constructor for building a new UpdateSketch. The default configuration is +
          +
        • Nominal Entries: 4096
        • +
        • Seed: 9001L
        • +
        • Input Sampling Probability: 1.0
        • +
        • Family: Family.QUICKSELECT
        • +
        • Resize Factor: The default for sketches on the Java heap is ResizeFactor.X8. + For direct sketches, which are targeted for native memory off the Java heap, this value will + be fixed at either ResizeFactor.X1 or ResizeFactor.X2.
        • +
        • MemoryRequestServer (Direct only): + DefaultMemoryRequestServer.
        • +
        + Parameters unique to the concurrent sketches only: +
          +
        • Number of local Nominal Entries: 4
        • +
        • Concurrent NumPoolThreads: 3
        • +
        • Concurrent PropagateOrderedCompact: true
        • +
        • Concurrent MaxConcurrencyError: 0
        • +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setNominalEntries

        +
        public UpdateSketchBuilder setNominalEntries​(int nomEntries)
        +
        Sets the Nominal Entries for this sketch. + This value is also used for building a shared concurrent sketch. + The minimum value is 16 (2^4) and the maximum value is 67,108,864 (2^26). + Be aware that sketches as large as this maximum value may not have been + thoroughly tested or characterized for performance.
        +
        +
        Parameters:
        +
        nomEntries - Nominal Entries + This will become the ceiling power of 2 if the given value is not.
        +
        Returns:
        +
        this UpdateSketchBuilder
        +
        +
      • +
      + + + +
        +
      • +

        setLogNominalEntries

        +
        public UpdateSketchBuilder setLogNominalEntries​(int lgNomEntries)
        +
        Alternative method of setting the Nominal Entries for this sketch from the log_base2 value. + This value is also used for building a shared concurrent sketch. + The minimum value is 4 and the maximum value is 26. + Be aware that sketches as large as this maximum value may not have been + thoroughly characterized for performance.
        +
        +
        Parameters:
        +
        lgNomEntries - the Log Nominal Entries. Also for the concurrent shared sketch
        +
        Returns:
        +
        this UpdateSketchBuilder
        +
        +
      • +
      + + + +
        +
      • +

        getLgNominalEntries

        +
        public int getLgNominalEntries()
        +
        Returns Log-base 2 Nominal Entries
        +
        +
        Returns:
        +
        Log-base 2 Nominal Entries
        +
        +
      • +
      + + + +
        +
      • +

        setLocalNominalEntries

        +
        public UpdateSketchBuilder setLocalNominalEntries​(int nomEntries)
        +
        Sets the Nominal Entries for the concurrent local sketch. The minimum value is 16 and the + maximum value is 67,108,864, which is 2^26. + Be aware that sketches as large as this maximum + value have not been thoroughly tested or characterized for performance.
        +
        +
        Parameters:
        +
        nomEntries - Nominal Entries + This will become the ceiling power of 2 if it is not.
        +
        Returns:
        +
        this UpdateSketchBuilder
        +
        +
      • +
      + + + +
        +
      • +

        setLocalLogNominalEntries

        +
        public UpdateSketchBuilder setLocalLogNominalEntries​(int lgNomEntries)
        +
        Alternative method of setting the Nominal Entries for a local concurrent sketch from the + log_base2 value. + The minimum value is 4 and the maximum value is 26. + Be aware that sketches as large as this maximum + value have not been thoroughly tested or characterized for performance.
        +
        +
        Parameters:
        +
        lgNomEntries - the Log Nominal Entries for a concurrent local sketch
        +
        Returns:
        +
        this UpdateSketchBuilder
        +
        +
      • +
      + + + +
        +
      • +

        getLocalLgNominalEntries

        +
        public int getLocalLgNominalEntries()
        +
        Returns Log-base 2 Nominal Entries for the concurrent local sketch
        +
        +
        Returns:
        +
        Log-base 2 Nominal Entries for the concurrent local sketch
        +
        +
      • +
      + + + +
        +
      • +

        setSeed

        +
        public UpdateSketchBuilder setSeed​(long seed)
        +
        Sets the long seed value that is required by the hashing function.
        +
        +
        Parameters:
        +
        seed - See seed
        +
        Returns:
        +
        this UpdateSketchBuilder
        +
        +
      • +
      + + + +
        +
      • +

        getSeed

        +
        public long getSeed()
        +
        Returns the seed
        +
        +
        Returns:
        +
        the seed
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getP

        +
        public float getP()
        +
        Returns the pre-sampling probability p
        +
        +
        Returns:
        +
        the pre-sampling probability p
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getResizeFactor

        +
        public ResizeFactor getResizeFactor()
        +
        Returns the Resize Factor
        +
        +
        Returns:
        +
        the Resize Factor
        +
        +
      • +
      + + + +
        +
      • +

        setFamily

        +
        public UpdateSketchBuilder setFamily​(Family family)
        +
        Set the Family.
        +
        +
        Parameters:
        +
        family - the family for this builder
        +
        Returns:
        +
        this UpdateSketchBuilder
        +
        +
      • +
      + + + +
        +
      • +

        getFamily

        +
        public Family getFamily()
        +
        Returns the Family
        +
        +
        Returns:
        +
        the Family
        +
        +
      • +
      + + + +
        +
      • +

        setMemoryRequestServer

        +
        public UpdateSketchBuilder setMemoryRequestServer​(org.apache.datasketches.memory.MemoryRequestServer memReqSvr)
        +
        Set the MemoryRequestServer
        +
        +
        Parameters:
        +
        memReqSvr - the given MemoryRequestServer
        +
        Returns:
        +
        this UpdateSketchBuilder
        +
        +
      • +
      + + + +
        +
      • +

        getMemoryRequestServer

        +
        public org.apache.datasketches.memory.MemoryRequestServer getMemoryRequestServer()
        +
        Returns the MemoryRequestServer
        +
        +
        Returns:
        +
        the MemoryRequestServer
        +
        +
      • +
      + + + +
        +
      • +

        setNumPoolThreads

        +
        public void setNumPoolThreads​(int numPoolThreads)
        +
        Sets the number of pool threads used for background propagation in the concurrent sketches.
        +
        +
        Parameters:
        +
        numPoolThreads - the given number of pool threads
        +
        +
      • +
      + + + +
        +
      • +

        getNumPoolThreads

        +
        public int getNumPoolThreads()
        +
        Gets the number of background pool threads used for propagation in the concurrent sketches.
        +
        +
        Returns:
        +
        the number of background pool threads
        +
        +
      • +
      + + + +
        +
      • +

        setPropagateOrderedCompact

        +
        public UpdateSketchBuilder setPropagateOrderedCompact​(boolean prop)
        +
        Sets the Propagate Ordered Compact flag to the given value. Used with concurrent sketches.
        +
        +
        Parameters:
        +
        prop - the given value
        +
        Returns:
        +
        this UpdateSketchBuilder
        +
        +
      • +
      + + + +
        +
      • +

        getPropagateOrderedCompact

        +
        public boolean getPropagateOrderedCompact()
        +
        Gets the Propagate Ordered Compact flag used with concurrent sketches.
        +
        +
        Returns:
        +
        the Propagate Ordered Compact flag
        +
        +
      • +
      + + + +
        +
      • +

        setMaxConcurrencyError

        +
        public void setMaxConcurrencyError​(double maxConcurrencyError)
        +
        Sets the Maximum Concurrency Error.
        +
        +
        Parameters:
        +
        maxConcurrencyError - the given Maximum Concurrency Error.
        +
        +
      • +
      + + + +
        +
      • +

        getMaxConcurrencyError

        +
        public double getMaxConcurrencyError()
        +
        Gets the Maximum Concurrency Error
        +
        +
        Returns:
        +
        the Maximum Concurrency Error
        +
        +
      • +
      + + + +
        +
      • +

        setMaxNumLocalThreads

        +
        public void setMaxNumLocalThreads​(int maxNumLocalThreads)
        +
        Sets the Maximum Number of Local Threads. + This is used to set the size of the local concurrent buffers.
        +
        +
        Parameters:
        +
        maxNumLocalThreads - the given Maximum Number of Local Threads
        +
        +
      • +
      + + + +
        +
      • +

        getMaxNumLocalThreads

        +
        public int getMaxNumLocalThreads()
        +
        Gets the Maximum Number of Local Threads.
        +
        +
        Returns:
        +
        the Maximum Number of Local Threads.
        +
        +
      • +
      + + + +
        +
      • +

        build

        +
        public UpdateSketch build()
        +
        Returns an UpdateSketch with the current configuration of this Builder.
        +
        +
        Returns:
        +
        an UpdateSketch
        +
        +
      • +
      + + + +
        +
      • +

        build

        +
        public UpdateSketch build​(org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Returns an UpdateSketch with the current configuration of this Builder + with the specified backing destination Memory store. + Note: this cannot be used with the Alpha Family of sketches.
        +
        +
        Parameters:
        +
        dstMem - The destination Memory.
        +
        Returns:
        +
        an UpdateSketch
        +
        +
      • +
      + + + +
        +
      • +

        buildShared

        +
        public UpdateSketch buildShared()
        +
        Returns an on-heap concurrent shared UpdateSketch with the current configuration of the + Builder. + +

        The parameters unique to the shared concurrent sketch are: +

          +
        • Number of Pool Threads (default is 3)
        • +
        • Maximum Concurrency Error
        • +
        + +

        Key parameters that are in common with other Theta sketches: +

          +
        • Nominal Entries or Log Nominal Entries (for the shared concurrent sketch)
        • +
        +
        +
        Returns:
        +
        an on-heap concurrent UpdateSketch with the current configuration of the Builder.
        +
        +
      • +
      + + + +
        +
      • +

        buildShared

        +
        public UpdateSketch buildShared​(org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Returns a direct (potentially off-heap) concurrent shared UpdateSketch with the current + configuration of the Builder and the given destination WritableMemory. If the destination + WritableMemory is null, this defaults to an on-heap concurrent shared UpdateSketch. + +

        The parameters unique to the shared concurrent sketch are: +

          +
        • Number of Pool Threads (default is 3)
        • +
        • Maximum Concurrency Error
        • +
        + +

        Key parameters that are in common with other Theta sketches: +

          +
        • Nominal Entries or Log Nominal Entries (for the shared concurrent sketch)
        • +
        • Destination Writable Memory (if not null, returned sketch is Direct. Default is null.)
        • +
        +
        +
        Parameters:
        +
        dstMem - the given WritableMemory for Direct, otherwise null.
        +
        Returns:
        +
        a concurrent UpdateSketch with the current configuration of the Builder + and the given destination WritableMemory.
        +
        +
      • +
      + + + +
        +
      • +

        buildSharedFromSketch

        +
        public UpdateSketch buildSharedFromSketch​(UpdateSketch sketch,
        +                                          org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Returns a direct (potentially off-heap) concurrent shared UpdateSketch with the current + configuration of the Builder, the data from the given sketch, and the given destination + WritableMemory. If the destination WritableMemory is null, this defaults to an on-heap + concurrent shared UpdateSketch. + +

        The parameters unique to the shared concurrent sketch are: +

          +
        • Number of Pool Threads (default is 3)
        • +
        • Maximum Concurrency Error
        • +
        + +

        Key parameters that are in common with other Theta sketches: +

          +
        • Nominal Entries or Log Nominal Entries (for the shared concurrent sketch)
        • +
        • Destination Writable Memory (if not null, returned sketch is Direct. Default is null.)
        • +
        +
        +
        Parameters:
        +
        sketch - a given UpdateSketch from which the data is used to initialize the returned + shared sketch.
        +
        dstMem - the given WritableMemory for Direct, otherwise null.
        +
        Returns:
        +
        a concurrent UpdateSketch with the current configuration of the Builder + and the given destination WritableMemory.
        +
        +
      • +
      + + + +
        +
      • +

        buildLocal

        +
        public UpdateSketch buildLocal​(UpdateSketch shared)
        +
        Returns a local, on-heap, concurrent UpdateSketch to be used as a per-thread local buffer + along with the given concurrent shared UpdateSketch and the current configuration of this + Builder. + +

        The parameters unique to the local concurrent sketch are: +

          +
        • Local Nominal Entries or Local Log Nominal Entries
        • +
        • Propagate Ordered Compact flag
        • +
        +
        +
        Parameters:
        +
        shared - the concurrent shared sketch to be accessed via the concurrent local sketch.
        +
        Returns:
        +
        an UpdateSketch to be used as a per-thread local buffer.
        +
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/class-use/AnotB.html b/docs/5.0.2/org/apache/datasketches/theta/class-use/AnotB.html new file mode 100644 index 000000000..c132eeda3 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/class-use/AnotB.html @@ -0,0 +1,199 @@ + + + + + +Uses of Class org.apache.datasketches.theta.AnotB (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.theta.AnotB

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/class-use/BitPacking.html b/docs/5.0.2/org/apache/datasketches/theta/class-use/BitPacking.html new file mode 100644 index 000000000..7b04e3761 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/class-use/BitPacking.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.theta.BitPacking (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.theta.BitPacking

+
+
No usage of org.apache.datasketches.theta.BitPacking
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/class-use/CompactSketch.html b/docs/5.0.2/org/apache/datasketches/theta/class-use/CompactSketch.html new file mode 100644 index 000000000..f91178624 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/class-use/CompactSketch.html @@ -0,0 +1,386 @@ + + + + + +Uses of Class org.apache.datasketches.theta.CompactSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.theta.CompactSketch

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/class-use/HashIterator.html b/docs/5.0.2/org/apache/datasketches/theta/class-use/HashIterator.html new file mode 100644 index 000000000..2e6a7c7e1 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/class-use/HashIterator.html @@ -0,0 +1,199 @@ + + + + + +Uses of Interface org.apache.datasketches.theta.HashIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.theta.HashIterator

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/class-use/Intersection.html b/docs/5.0.2/org/apache/datasketches/theta/class-use/Intersection.html new file mode 100644 index 000000000..16f6b9ffa --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/class-use/Intersection.html @@ -0,0 +1,222 @@ + + + + + +Uses of Class org.apache.datasketches.theta.Intersection (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.theta.Intersection

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/class-use/JaccardSimilarity.html b/docs/5.0.2/org/apache/datasketches/theta/class-use/JaccardSimilarity.html new file mode 100644 index 000000000..6459627ad --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/class-use/JaccardSimilarity.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.theta.JaccardSimilarity (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.theta.JaccardSimilarity

+
+
No usage of org.apache.datasketches.theta.JaccardSimilarity
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/class-use/SetOperation.html b/docs/5.0.2/org/apache/datasketches/theta/class-use/SetOperation.html new file mode 100644 index 000000000..941642a09 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/class-use/SetOperation.html @@ -0,0 +1,331 @@ + + + + + +Uses of Class org.apache.datasketches.theta.SetOperation (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.theta.SetOperation

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/class-use/SetOperationBuilder.html b/docs/5.0.2/org/apache/datasketches/theta/class-use/SetOperationBuilder.html new file mode 100644 index 000000000..bf957f501 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/class-use/SetOperationBuilder.html @@ -0,0 +1,247 @@ + + + + + +Uses of Class org.apache.datasketches.theta.SetOperationBuilder (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.theta.SetOperationBuilder

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/class-use/Sketch.html b/docs/5.0.2/org/apache/datasketches/theta/class-use/Sketch.html new file mode 100644 index 000000000..4ddb54b0a --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/class-use/Sketch.html @@ -0,0 +1,602 @@ + + + + + +Uses of Class org.apache.datasketches.theta.Sketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.theta.Sketch

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + +
    Packages that use Sketch 
    PackageDescription
    org.apache.datasketches.theta +
    The theta package contains the basic sketch classes that are members of the + Theta Sketch Framework.
    +
    org.apache.datasketches.thetacommon +
    This package contains common tools and methods for the theta, + tuple, tuple/* and fdt packages.
    +
    org.apache.datasketches.tuple +
    The tuple package contains a number of sketches based on the same + fundamental algorithms of the Theta Sketch Framework and extend these + concepts for whole new families of sketches.
    +
    +
  • +
  • +
      +
    • +
      + + +

      Uses of Sketch in org.apache.datasketches.theta

      + + + + + + + + + + + + + + + + + + + +
      Subclasses of Sketch in org.apache.datasketches.theta 
      Modifier and TypeClassDescription
      class CompactSketch +
      The parent class of all the CompactSketches.
      +
      class UpdateSketch +
      The parent class for the Update Sketch families, such as QuickSelect and Alpha.
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.theta that return Sketch 
      Modifier and TypeMethodDescription
      static SketchSketch.heapify​(org.apache.datasketches.memory.Memory srcMem) +
      Heapify takes the sketch image in Memory and instantiates an on-heap Sketch.
      +
      static SketchSketch.heapify​(org.apache.datasketches.memory.Memory srcMem, + long expectedSeed) +
      Heapify takes the sketch image in Memory and instantiates an on-heap Sketch.
      +
      static SketchSketches.heapifySketch​(org.apache.datasketches.memory.Memory srcMem) + +
      static SketchSketches.heapifySketch​(org.apache.datasketches.memory.Memory srcMem, + long expectedSeed) + +
      static SketchSketch.wrap​(org.apache.datasketches.memory.Memory srcMem) +
      Wrap takes the sketch image in the given Memory and refers to it directly.
      +
      static SketchSketch.wrap​(org.apache.datasketches.memory.Memory srcMem, + long expectedSeed) +
      Wrap takes the sketch image in the given Memory and refers to it directly.
      +
      static SketchSketches.wrapSketch​(org.apache.datasketches.memory.Memory srcMem) + +
      static SketchSketches.wrapSketch​(org.apache.datasketches.memory.Memory srcMem, + long expectedSeed) + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.theta with parameters of type Sketch 
      Modifier and TypeMethodDescription
      CompactSketchAnotB.aNotB​(Sketch skA, + Sketch skB) +
      Perform A-and-not-B set operation on the two given sketches and return the result as an + ordered CompactSketch on the heap.
      +
      abstract CompactSketchAnotB.aNotB​(Sketch skA, + Sketch skB, + boolean dstOrdered, + org.apache.datasketches.memory.WritableMemory dstMem) +
      Perform A-and-not-B set operation on the two given sketches and return the result as a + CompactSketch.
      +
      static booleanJaccardSimilarity.dissimilarityTest​(Sketch measured, + Sketch expected, + double threshold) +
      Tests dissimilarity of a measured Sketch against an expected Sketch.
      +
      static booleanJaccardSimilarity.exactlyEqual​(Sketch sketchA, + Sketch sketchB) +
      Returns true if the two given sketches have exactly the same hash values and the same + theta values.
      +
      abstract voidIntersection.intersect​(Sketch sketchIn) +
      Intersect the given sketch with the internal state.
      +
      CompactSketchIntersection.intersect​(Sketch a, + Sketch b) +
      Perform intersect set operation on the two given sketch arguments and return the result as an + ordered CompactSketch on the heap.
      +
      abstract CompactSketchIntersection.intersect​(Sketch a, + Sketch b, + boolean dstOrdered, + org.apache.datasketches.memory.WritableMemory dstMem) +
      Perform intersect set operation on the two given sketches and return the result as a + CompactSketch.
      +
      static double[]JaccardSimilarity.jaccard​(Sketch sketchA, + Sketch sketchB) +
      Computes the Jaccard similarity index with upper and lower bounds.
      +
      abstract voidAnotB.notB​(Sketch skB) +
      This is part of a multistep, stateful AnotB operation and sets the given Theta sketch as the + second (or n+1th) argument B of A-AND-NOT-B.
      +
      abstract voidAnotB.setA​(Sketch skA) +
      This is part of a multistep, stateful AnotB operation and sets the given Theta sketch as the + first argument A of A-AND-NOT-B.
      +
      static booleanJaccardSimilarity.similarityTest​(Sketch measured, + Sketch expected, + double threshold) +
      Tests similarity of a measured Sketch against an expected Sketch.
      +
      abstract voidUnion.union​(Sketch sketchIn) +
      Perform a Union operation with this union and the given on-heap sketch of the Theta Family.
      +
      CompactSketchUnion.union​(Sketch sketchA, + Sketch sketchB) +
      This implements a stateless, pair-wise union operation.
      +
      abstract CompactSketchUnion.union​(Sketch sketchA, + Sketch sketchB, + boolean dstOrdered, + org.apache.datasketches.memory.WritableMemory dstMem) +
      This implements a stateless, pair-wise union operation.
      +
      +
      +
    • +
    • +
      + + +

      Uses of Sketch in org.apache.datasketches.thetacommon

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.thetacommon with parameters of type Sketch 
      Modifier and TypeMethodDescription
      static doubleBoundsOnRatiosInThetaSketchedSets.getEstimateOfBoverA​(Sketch sketchA, + Sketch sketchB) +
      Gets the estimate for B over A
      +
      static <S extends Summary>
      double
      BoundsOnRatiosInTupleSketchedSets.getEstimateOfBoverA​(Sketch<S> sketchA, + Sketch sketchB) +
      Gets the estimate for B over A
      +
      static doubleBoundsOnRatiosInThetaSketchedSets.getLowerBoundForBoverA​(Sketch sketchA, + Sketch sketchB) +
      Gets the approximate lower bound for B over A based on a 95% confidence interval
      +
      static <S extends Summary>
      double
      BoundsOnRatiosInTupleSketchedSets.getLowerBoundForBoverA​(Sketch<S> sketchA, + Sketch sketchB) +
      Gets the approximate lower bound for B over A based on a 95% confidence interval
      +
      static doubleBoundsOnRatiosInThetaSketchedSets.getUpperBoundForBoverA​(Sketch sketchA, + Sketch sketchB) +
      Gets the approximate upper bound for B over A based on a 95% confidence interval
      +
      static <S extends Summary>
      double
      BoundsOnRatiosInTupleSketchedSets.getUpperBoundForBoverA​(Sketch<S> sketchA, + Sketch sketchB) +
      Gets the approximate upper bound for B over A based on a 95% confidence interval
      +
      +
      +
    • +
    • +
      + + +

      Uses of Sketch in org.apache.datasketches.tuple

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.tuple with parameters of type Sketch 
      Modifier and TypeMethodDescription
      static <S extends Summary>
      CompactSketch<S>
      AnotB.aNotB​(Sketch<S> skA, + Sketch skB) +
      Returns the A-and-not-B set operation on a Tuple sketch and a Theta sketch.
      +
      static <S extends Summary>
      boolean
      JaccardSimilarity.dissimilarityTest​(Sketch<S> measured, + Sketch expected, + S summary, + SummarySetOperations<S> summarySetOps, + double threshold) +
      Tests dissimilarity of a measured Sketch against an expected Sketch.
      +
      static <S extends Summary>
      boolean
      JaccardSimilarity.exactlyEqual​(Sketch<S> sketchA, + Sketch sketchB, + S summary, + SummarySetOperations<S> summarySetOps) +
      Returns true if the two given sketches have exactly the same hash values and the same + theta values.
      +
      voidIntersection.intersect​(Sketch thetaSketch, + S summary) +
      Performs a stateful intersection of the internal set with the given thetaSketch by combining entries + using the hashes from the theta sketch and summary values from the given summary and rules + from the summarySetOps defined by the Intersection constructor.
      +
      CompactSketch<S>Intersection.intersect​(Sketch<S> tupleSketch, + Sketch thetaSketch, + S summary) +
      Perform a stateless intersect set operation on a tuple sketch and a theta sketch and returns the + result as an unordered CompactSketch on the heap.
      +
      static <S extends Summary>
      double[]
      JaccardSimilarity.jaccard​(Sketch<S> sketchA, + Sketch sketchB, + S summary, + SummarySetOperations<S> summarySetOps) +
      Computes the Jaccard similarity index with upper and lower bounds.
      +
      voidAnotB.notB​(Sketch skB) +
      This is part of a multistep, stateful AnotB operation and sets the given Theta sketch as the + second (or n+1th) argument B of A-AND-NOT-B.
      +
      static <S extends Summary>
      boolean
      JaccardSimilarity.similarityTest​(Sketch<S> measured, + Sketch expected, + S summary, + SummarySetOperations<S> summarySetOps, + double threshold) +
      Tests similarity of a measured Sketch against an expected Sketch.
      +
      voidUnion.union​(Sketch thetaSketch, + S summary) +
      Performs a stateful union of the internal set with the given thetaSketch by combining entries + using the hashes from the theta sketch and summary values from the given summary.
      +
      CompactSketch<S>Union.union​(Sketch<S> tupleSketch, + Sketch thetaSketch, + S summary) +
      Perform a stateless, pair-wise union operation between a tupleSketch and a thetaSketch.
      +
      +
      +
    • +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/class-use/Sketches.html b/docs/5.0.2/org/apache/datasketches/theta/class-use/Sketches.html new file mode 100644 index 000000000..788b8489f --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/class-use/Sketches.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.theta.Sketches (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.theta.Sketches

+
+
No usage of org.apache.datasketches.theta.Sketches
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/class-use/Union.html b/docs/5.0.2/org/apache/datasketches/theta/class-use/Union.html new file mode 100644 index 000000000..d915e962a --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/class-use/Union.html @@ -0,0 +1,222 @@ + + + + + +Uses of Class org.apache.datasketches.theta.Union (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.theta.Union

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/class-use/UpdateReturnState.html b/docs/5.0.2/org/apache/datasketches/theta/class-use/UpdateReturnState.html new file mode 100644 index 000000000..c30963b96 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/class-use/UpdateReturnState.html @@ -0,0 +1,255 @@ + + + + + +Uses of Class org.apache.datasketches.theta.UpdateReturnState (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.theta.UpdateReturnState

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/class-use/UpdateSketch.html b/docs/5.0.2/org/apache/datasketches/theta/class-use/UpdateSketch.html new file mode 100644 index 000000000..82799e39f --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/class-use/UpdateSketch.html @@ -0,0 +1,338 @@ + + + + + +Uses of Class org.apache.datasketches.theta.UpdateSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.theta.UpdateSketch

+
+
+
    +
  • + + + + + + + + + + + + +
    Packages that use UpdateSketch 
    PackageDescription
    org.apache.datasketches.theta +
    The theta package contains the basic sketch classes that are members of the + Theta Sketch Framework.
    +
    +
  • +
  • +
      +
    • +
      + + +

      Uses of UpdateSketch in org.apache.datasketches.theta

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.theta that return UpdateSketch 
      Modifier and TypeMethodDescription
      UpdateSketchUpdateSketchBuilder.build() +
      Returns an UpdateSketch with the current configuration of this Builder.
      +
      UpdateSketchUpdateSketchBuilder.build​(org.apache.datasketches.memory.WritableMemory dstMem) +
      Returns an UpdateSketch with the current configuration of this Builder + with the specified backing destination Memory store.
      +
      UpdateSketchUpdateSketchBuilder.buildLocal​(UpdateSketch shared) +
      Returns a local, on-heap, concurrent UpdateSketch to be used as a per-thread local buffer + along with the given concurrent shared UpdateSketch and the current configuration of this + Builder.
      +
      UpdateSketchUpdateSketchBuilder.buildShared() +
      Returns an on-heap concurrent shared UpdateSketch with the current configuration of the + Builder.
      +
      UpdateSketchUpdateSketchBuilder.buildShared​(org.apache.datasketches.memory.WritableMemory dstMem) +
      Returns a direct (potentially off-heap) concurrent shared UpdateSketch with the current + configuration of the Builder and the given destination WritableMemory.
      +
      UpdateSketchUpdateSketchBuilder.buildSharedFromSketch​(UpdateSketch sketch, + org.apache.datasketches.memory.WritableMemory dstMem) +
      Returns a direct (potentially off-heap) concurrent shared UpdateSketch with the current + configuration of the Builder, the data from the given sketch, and the given destination + WritableMemory.
      +
      static UpdateSketchUpdateSketch.heapify​(org.apache.datasketches.memory.Memory srcMem) +
      Instantiates an on-heap UpdateSketch from Memory.
      +
      static UpdateSketchUpdateSketch.heapify​(org.apache.datasketches.memory.Memory srcMem, + long expectedSeed) +
      Instantiates an on-heap UpdateSketch from Memory.
      +
      static UpdateSketchSketches.heapifyUpdateSketch​(org.apache.datasketches.memory.Memory srcMem) + +
      static UpdateSketchSketches.heapifyUpdateSketch​(org.apache.datasketches.memory.Memory srcMem, + long expectedSeed) + +
      abstract UpdateSketchUpdateSketch.rebuild() +
      Rebuilds the hash table to remove dirty values or to reduce the size + to nominal entries.
      +
      static UpdateSketchUpdateSketch.wrap​(org.apache.datasketches.memory.WritableMemory srcMem) +
      Wrap takes the sketch image in Memory and refers to it directly.
      +
      static UpdateSketchUpdateSketch.wrap​(org.apache.datasketches.memory.WritableMemory srcMem, + long expectedSeed) +
      Wrap takes the sketch image in Memory and refers to it directly.
      +
      static UpdateSketchSketches.wrapUpdateSketch​(org.apache.datasketches.memory.WritableMemory srcMem) + +
      static UpdateSketchSketches.wrapUpdateSketch​(org.apache.datasketches.memory.WritableMemory srcMem, + long expectedSeed) + +
      + + + + + + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.theta with parameters of type UpdateSketch 
      Modifier and TypeMethodDescription
      UpdateSketchUpdateSketchBuilder.buildLocal​(UpdateSketch shared) +
      Returns a local, on-heap, concurrent UpdateSketch to be used as a per-thread local buffer + along with the given concurrent shared UpdateSketch and the current configuration of this + Builder.
      +
      UpdateSketchUpdateSketchBuilder.buildSharedFromSketch​(UpdateSketch sketch, + org.apache.datasketches.memory.WritableMemory dstMem) +
      Returns a direct (potentially off-heap) concurrent shared UpdateSketch with the current + configuration of the Builder, the data from the given sketch, and the given destination + WritableMemory.
      +
      +
      +
    • +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/class-use/UpdateSketchBuilder.html b/docs/5.0.2/org/apache/datasketches/theta/class-use/UpdateSketchBuilder.html new file mode 100644 index 000000000..70e6bf301 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/class-use/UpdateSketchBuilder.html @@ -0,0 +1,276 @@ + + + + + +Uses of Class org.apache.datasketches.theta.UpdateSketchBuilder (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.theta.UpdateSketchBuilder

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/package-summary.html b/docs/5.0.2/org/apache/datasketches/theta/package-summary.html new file mode 100644 index 000000000..e48cd8507 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/package-summary.html @@ -0,0 +1,277 @@ + + + + + +org.apache.datasketches.theta (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches.theta

+
+
+
+ + +
The theta package contains the basic sketch classes that are members of the + Theta Sketch Framework. + +

There is a separate Tuple package for many of the sketches that are derived from the + same algorithms defined in the Theta Sketch Framework paper.

+
+
    +
  • + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    HashIterator +
    This is used to iterate over the retained hash values of the Theta sketch.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    AnotB +
    Computes a set difference, A-AND-NOT-B, of two theta sketches.
    +
    BitPacking 
    CompactSketch +
    The parent class of all the CompactSketches.
    +
    Intersection +
    The API for intersection operations
    +
    JaccardSimilarity +
    Jaccard similarity of two Theta Sketches.
    +
    SetOperation +
    The parent API for all Set Operations
    +
    SetOperationBuilder +
    For building a new SetOperation.
    +
    Sketch +
    The top-level class for all theta sketches.
    +
    Sketches +
    This class brings together the common sketch and set operation creation methods and + the public static methods into one place.
    +
    Union +
    Compute the union of two or more theta sketches.
    +
    UpdateSketch +
    The parent class for the Update Sketch families, such as QuickSelect and Alpha.
    +
    UpdateSketchBuilder +
    For building a new UpdateSketch.
    +
    +
  • +
  • + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    UpdateReturnState + +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/package-tree.html b/docs/5.0.2/org/apache/datasketches/theta/package-tree.html new file mode 100644 index 000000000..4ffb66f6b --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/package-tree.html @@ -0,0 +1,201 @@ + + + + + +org.apache.datasketches.theta Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches.theta

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+

Interface Hierarchy

+ +
+
+

Enum Hierarchy

+ +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/theta/package-use.html b/docs/5.0.2/org/apache/datasketches/theta/package-use.html new file mode 100644 index 000000000..5db472830 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/theta/package-use.html @@ -0,0 +1,302 @@ + + + + + +Uses of Package org.apache.datasketches.theta (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches.theta

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/BinomialBoundsN.html b/docs/5.0.2/org/apache/datasketches/thetacommon/BinomialBoundsN.html new file mode 100644 index 000000000..cf63433db --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/BinomialBoundsN.html @@ -0,0 +1,333 @@ + + + + + +BinomialBoundsN (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class BinomialBoundsN

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.thetacommon.BinomialBoundsN
    • +
    +
  • +
+
+
    +
  • +
    +
    public final class BinomialBoundsN
    +extends Object
    +
    This class enables the estimation of error bounds given a sample set size, the sampling + probability theta, the number of standard deviations and a simple noDataSeen flag. This can + be used to estimate error bounds for fixed threshold sampling as well as the error bounds + calculations for sketches.
    +
    +
    Author:
    +
    Kevin Lang
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getLowerBound

        +
        public static double getLowerBound​(long numSamples,
        +                                   double theta,
        +                                   int numSDev,
        +                                   boolean noDataSeen)
        +
        Returns the approximate lower bound value
        +
        +
        Parameters:
        +
        numSamples - the number of samples in the sample set
        +
        theta - the sampling probability
        +
        numSDev - the number of "standard deviations" from the mean for the tail bounds. + This must be an integer value of 1, 2 or 3.
        +
        noDataSeen - this is normally false. However, in the case where you have zero samples + and a theta < 1.0, this flag enables the distinction between a virgin case when no actual + data has been seen and the case where the estimate may be zero but an upper error bound may + still exist.
        +
        Returns:
        +
        the approximate lower bound value
        +
        +
      • +
      + + + +
        +
      • +

        getUpperBound

        +
        public static double getUpperBound​(long numSamples,
        +                                   double theta,
        +                                   int numSDev,
        +                                   boolean noDataSeen)
        +
        Returns the approximate upper bound value
        +
        +
        Parameters:
        +
        numSamples - the number of samples in the sample set
        +
        theta - the sampling probability
        +
        numSDev - the number of "standard deviations" from the mean for the tail bounds. + This must be an integer value of 1, 2 or 3.
        +
        noDataSeen - this is normally false. However, in the case where you have zero samples + and a theta < 1.0, this flag enables the distinction between a virgin case when no actual + data has been seen and the case where the estimate may be zero but an upper error bound may + still exist.
        +
        Returns:
        +
        the approximate upper bound value
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/BoundsOnRatiosInThetaSketchedSets.html b/docs/5.0.2/org/apache/datasketches/thetacommon/BoundsOnRatiosInThetaSketchedSets.html new file mode 100644 index 000000000..3e89c63d9 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/BoundsOnRatiosInThetaSketchedSets.html @@ -0,0 +1,351 @@ + + + + + +BoundsOnRatiosInThetaSketchedSets (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class BoundsOnRatiosInThetaSketchedSets

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.thetacommon.BoundsOnRatiosInThetaSketchedSets
    • +
    +
  • +
+
+
    +
  • +
    +
    public final class BoundsOnRatiosInThetaSketchedSets
    +extends Object
    +
    This class is used to compute the bounds on the estimate of the ratio B / A, where: +
      +
    • A is a Theta Sketch of population PopA.
    • +
    • B is a Theta Sketch of population PopB that is a subset of A, + obtained by an intersection of A with some other Theta Sketch C, + which acts like a predicate or selection clause.
    • +
    • The estimate of the ratio PopB/PopA is + BoundsOnRatiosInThetaSketchedSets.getEstimateOfBoverA(A, B).
    • +
    • The Upper Bound estimate on the ratio PopB/PopA is + BoundsOnRatiosInThetaSketchedSets.getUpperBoundForBoverA(A, B).
    • +
    • The Lower Bound estimate on the ratio PopB/PopA is + BoundsOnRatiosInThetaSketchedSets.getLowerBoundForBoverA(A, B).
    • +
    + Note: The theta of A cannot be greater than the theta of B. + If B is formed as an intersection of A and some other set C, + then the theta of B is guaranteed to be less than or equal to the theta of B.
    +
    +
    Author:
    +
    Kevin Lang, Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getLowerBoundForBoverA

        +
        public static double getLowerBoundForBoverA​(Sketch sketchA,
        +                                            Sketch sketchB)
        +
        Gets the approximate lower bound for B over A based on a 95% confidence interval
        +
        +
        Parameters:
        +
        sketchA - the sketch A
        +
        sketchB - the sketch B
        +
        Returns:
        +
        the approximate lower bound for B over A
        +
        +
      • +
      + + + +
        +
      • +

        getUpperBoundForBoverA

        +
        public static double getUpperBoundForBoverA​(Sketch sketchA,
        +                                            Sketch sketchB)
        +
        Gets the approximate upper bound for B over A based on a 95% confidence interval
        +
        +
        Parameters:
        +
        sketchA - the sketch A
        +
        sketchB - the sketch B
        +
        Returns:
        +
        the approximate upper bound for B over A
        +
        +
      • +
      + + + +
        +
      • +

        getEstimateOfBoverA

        +
        public static double getEstimateOfBoverA​(Sketch sketchA,
        +                                         Sketch sketchB)
        +
        Gets the estimate for B over A
        +
        +
        Parameters:
        +
        sketchA - the sketch A
        +
        sketchB - the sketch B
        +
        Returns:
        +
        the estimate for B over A
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/BoundsOnRatiosInTupleSketchedSets.html b/docs/5.0.2/org/apache/datasketches/thetacommon/BoundsOnRatiosInTupleSketchedSets.html new file mode 100644 index 000000000..3670f2e25 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/BoundsOnRatiosInTupleSketchedSets.html @@ -0,0 +1,441 @@ + + + + + +BoundsOnRatiosInTupleSketchedSets (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class BoundsOnRatiosInTupleSketchedSets

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.thetacommon.BoundsOnRatiosInTupleSketchedSets
    • +
    +
  • +
+
+
    +
  • +
    +
    public final class BoundsOnRatiosInTupleSketchedSets
    +extends Object
    +
    This class is used to compute the bounds on the estimate of the ratio B / A, where: +
      +
    • A is a Tuple Sketch of population PopA.
    • +
    • B is a Tuple or Theta Sketch of population PopB that is a subset of A, + obtained by an intersection of A with some other Tuple or Theta Sketch C, + which acts like a predicate or selection clause.
    • +
    • The estimate of the ratio PopB/PopA is + BoundsOnRatiosInThetaSketchedSets.getEstimateOfBoverA(A, B).
    • +
    • The Upper Bound estimate on the ratio PopB/PopA is + BoundsOnRatiosInThetaSketchedSets.getUpperBoundForBoverA(A, B).
    • +
    • The Lower Bound estimate on the ratio PopB/PopA is + BoundsOnRatiosInThetaSketchedSets.getLowerBoundForBoverA(A, B).
    • +
    + Note: The theta of A cannot be greater than the theta of B. + If B is formed as an intersection of A and some other set C, + then the theta of B is guaranteed to be less than or equal to the theta of B.
    +
    +
    Author:
    +
    Kevin Lang, Lee Rhodes, David Cromberge
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getLowerBoundForBoverA

        +
        public static <S extends Summary> double getLowerBoundForBoverA​(Sketch<S> sketchA,
        +                                                                Sketch<S> sketchB)
        +
        Gets the approximate lower bound for B over A based on a 95% confidence interval
        +
        +
        Type Parameters:
        +
        S - Summary
        +
        Parameters:
        +
        sketchA - the Tuple sketch A with summary type S
        +
        sketchB - the Tuple sketch B with summary type S
        +
        Returns:
        +
        the approximate lower bound for B over A
        +
        +
      • +
      + + + +
        +
      • +

        getLowerBoundForBoverA

        +
        public static <S extends Summary> double getLowerBoundForBoverA​(Sketch<S> sketchA,
        +                                                                Sketch sketchB)
        +
        Gets the approximate lower bound for B over A based on a 95% confidence interval
        +
        +
        Type Parameters:
        +
        S - Summary
        +
        Parameters:
        +
        sketchA - the Tuple sketch A with summary type S
        +
        sketchB - the Theta sketch B
        +
        Returns:
        +
        the approximate lower bound for B over A
        +
        +
      • +
      + + + +
        +
      • +

        getUpperBoundForBoverA

        +
        public static <S extends Summary> double getUpperBoundForBoverA​(Sketch<S> sketchA,
        +                                                                Sketch<S> sketchB)
        +
        Gets the approximate upper bound for B over A based on a 95% confidence interval
        +
        +
        Type Parameters:
        +
        S - Summary
        +
        Parameters:
        +
        sketchA - the Tuple sketch A with summary type S
        +
        sketchB - the Tuple sketch B with summary type S
        +
        Returns:
        +
        the approximate upper bound for B over A
        +
        +
      • +
      + + + +
        +
      • +

        getUpperBoundForBoverA

        +
        public static <S extends Summary> double getUpperBoundForBoverA​(Sketch<S> sketchA,
        +                                                                Sketch sketchB)
        +
        Gets the approximate upper bound for B over A based on a 95% confidence interval
        +
        +
        Type Parameters:
        +
        S - Summary
        +
        Parameters:
        +
        sketchA - the Tuple sketch A with summary type S
        +
        sketchB - the Theta sketch B
        +
        Returns:
        +
        the approximate upper bound for B over A
        +
        +
      • +
      + + + +
        +
      • +

        getEstimateOfBoverA

        +
        public static <S extends Summary> double getEstimateOfBoverA​(Sketch<S> sketchA,
        +                                                             Sketch<S> sketchB)
        +
        Gets the estimate for B over A
        +
        +
        Type Parameters:
        +
        S - Summary
        +
        Parameters:
        +
        sketchA - the Tuple sketch A with summary type S
        +
        sketchB - the Tuple sketch B with summary type S
        +
        Returns:
        +
        the estimate for B over A
        +
        +
      • +
      + + + +
        +
      • +

        getEstimateOfBoverA

        +
        public static <S extends Summary> double getEstimateOfBoverA​(Sketch<S> sketchA,
        +                                                             Sketch sketchB)
        +
        Gets the estimate for B over A
        +
        +
        Type Parameters:
        +
        S - Summary
        +
        Parameters:
        +
        sketchA - the Tuple sketch A with summary type S
        +
        sketchB - the Theta sketch B
        +
        Returns:
        +
        the estimate for B over A
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/HashOperations.html b/docs/5.0.2/org/apache/datasketches/thetacommon/HashOperations.html new file mode 100644 index 000000000..08896ee7e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/HashOperations.html @@ -0,0 +1,739 @@ + + + + + +HashOperations (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class HashOperations

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.thetacommon.HashOperations
    • +
    +
  • +
+
+
    +
  • +
    +
    public final class HashOperations
    +extends Object
    +
    Helper class for the common hash table methods.
    +
    +
    Author:
    +
    Lee Rhodes, Kevin Lang
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      static intSTRIDE_MASK +
      The stride mask for the Open Address, Double Hashing (OADH) hash table algorithm.
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static voidcheckHashCorruption​(long hash) 
      static voidcheckThetaCorruption​(long thetaLong) 
      static booleancontinueCondition​(long thetaLong, + long hash) +
      Return true (continue) if hash is greater than or equal to thetaLong, or if hash == 0, + or if hash == Long.MAX_VALUE.
      +
      static long[]convertToHashTable​(long[] hashArr, + int count, + long thetaLong, + double rebuildThreshold) +
      Converts the given array to a hash table.
      +
      static intcount​(long[] srcArr, + long thetaLong) +
      Counts the cardinality of the given source array.
      +
      static intcountPart​(long[] srcArr, + int lgArrLongs, + long thetaLong) +
      Counts the cardinality of the first Log2 values of the given source array.
      +
      static inthashArrayInsert​(long[] srcArr, + long[] hashTable, + int lgArrLongs, + long thetaLong) +
      Inserts the given long array into the given OADH hashTable of the target size, + ignores duplicates and counts the values inserted.
      +
      static inthashInsertOnly​(long[] hashTable, + int lgArrLongs, + long hash) +
      This is a classical Knuth-style Open Addressing, Double Hash (OADH) insert scheme for on-heap.
      +
      static inthashInsertOnlyMemory​(org.apache.datasketches.memory.WritableMemory wmem, + int lgArrLongs, + long hash, + int memOffsetBytes) +
      This is a classical Knuth-style Open Addressing, Double Hash (OADH) insert scheme for Memory.
      +
      static inthashSearch​(long[] hashTable, + int lgArrLongs, + long hash) +
      This is a classical Knuth-style Open Addressing, Double Hash (OADH) search scheme for on-heap.
      +
      static inthashSearchMemory​(org.apache.datasketches.memory.Memory mem, + int lgArrLongs, + long hash, + int memOffsetBytes) +
      This is a classical Knuth-style Open Addressing, Double Hash (OADH) search scheme for Memory.
      +
      static inthashSearchOrInsert​(long[] hashTable, + int lgArrLongs, + long hash) +
      This is a classical Knuth-style Open Addressing, Double Hash (OADH) insert scheme for on-heap.
      +
      static inthashSearchOrInsertMemory​(org.apache.datasketches.memory.WritableMemory wmem, + int lgArrLongs, + long hash, + int memOffsetBytes) +
      This is a classical Knuth-style Open Addressing, Double Hash insert scheme, but inserts + values directly into a Memory.
      +
      static intminLgHashTableSize​(int count, + double rebuild_threshold) +
      Returns the smallest log hash table size given the count of items and the rebuild threshold.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        STRIDE_MASK

        +
        public static final int STRIDE_MASK
        +
        The stride mask for the Open Address, Double Hashing (OADH) hash table algorithm.
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        hashSearch

        +
        public static int hashSearch​(long[] hashTable,
        +                             int lgArrLongs,
        +                             long hash)
        +
        This is a classical Knuth-style Open Addressing, Double Hash (OADH) search scheme for on-heap. + Returns the index if found, -1 if not found.
        +
        +
        Parameters:
        +
        hashTable - The hash table to search. Its size must be a power of 2.
        +
        lgArrLongs - The log_base2(hashTable.length). + See lgArrLongs.
        +
        hash - The hash value to search for. It must not be zero.
        +
        Returns:
        +
        Current probe index if found, -1 if not found.
        +
        +
      • +
      + + + +
        +
      • +

        hashInsertOnly

        +
        public static int hashInsertOnly​(long[] hashTable,
        +                                 int lgArrLongs,
        +                                 long hash)
        +
        This is a classical Knuth-style Open Addressing, Double Hash (OADH) insert scheme for on-heap. + This method assumes that the input hash is not a duplicate. + Useful for rebuilding tables to avoid unnecessary comparisons. + Returns the index of insertion, which is always positive or zero. + Throws an exception if the table has no empty slot.
        +
        +
        Parameters:
        +
        hashTable - the hash table to insert into. Its size must be a power of 2.
        +
        lgArrLongs - The log_base2(hashTable.length). + See lgArrLongs.
        +
        hash - The hash value to be potentially inserted into an empty slot. It must not be zero.
        +
        Returns:
        +
        index of insertion. Always positive or zero.
        +
        +
      • +
      + + + +
        +
      • +

        hashSearchOrInsert

        +
        public static int hashSearchOrInsert​(long[] hashTable,
        +                                     int lgArrLongs,
        +                                     long hash)
        +
        This is a classical Knuth-style Open Addressing, Double Hash (OADH) insert scheme for on-heap. + Returns index ≥ 0 if found (duplicate); < 0 if inserted, inserted at -(index + 1). + Throws an exception if the value is not found and table has no empty slot.
        +
        +
        Parameters:
        +
        hashTable - The hash table to insert into. Its size must be a power of 2.
        +
        lgArrLongs - The log_base2(hashTable.length). + See lgArrLongs.
        +
        hash - The hash value to be potentially inserted into an empty slot only if it is not + a duplicate of any other hash value in the table. It must not be zero.
        +
        Returns:
        +
        index ≥ 0 if found (duplicate); < 0 if inserted, inserted at -(index + 1).
        +
        +
      • +
      + + + +
        +
      • +

        hashArrayInsert

        +
        public static int hashArrayInsert​(long[] srcArr,
        +                                  long[] hashTable,
        +                                  int lgArrLongs,
        +                                  long thetaLong)
        +
        Inserts the given long array into the given OADH hashTable of the target size, + ignores duplicates and counts the values inserted. + The hash values must not be negative, zero values and values ≥ thetaLong are ignored. + The given hash table may have values, but they must have been inserted by this method or one + of the other OADH insert methods in this class. + This method performs additional checks against potentially invalid hash values or theta values. + Returns the count of values actually inserted.
        +
        +
        Parameters:
        +
        srcArr - the source hash array to be potentially inserted
        +
        hashTable - The hash table to insert into. Its size must be a power of 2.
        +
        lgArrLongs - The log_base2(hashTable.length). + See lgArrLongs.
        +
        thetaLong - The theta value that all input hash values are compared against. + It must greater than zero. + See Theta Long
        +
        Returns:
        +
        the count of values actually inserted
        +
        +
      • +
      + + + +
        +
      • +

        hashSearchMemory

        +
        public static int hashSearchMemory​(org.apache.datasketches.memory.Memory mem,
        +                                   int lgArrLongs,
        +                                   long hash,
        +                                   int memOffsetBytes)
        +
        This is a classical Knuth-style Open Addressing, Double Hash (OADH) search scheme for Memory. + Returns the index if found, -1 if not found.
        +
        +
        Parameters:
        +
        mem - The Memory containing the hash table to search. + The hash table portion must be a power of 2 in size.
        +
        lgArrLongs - The log_base2(hashTable.length). + See lgArrLongs.
        +
        hash - The hash value to search for. Must not be zero.
        +
        memOffsetBytes - offset in the memory where the hashTable starts
        +
        Returns:
        +
        Current probe index if found, -1 if not found.
        +
        +
      • +
      + + + +
        +
      • +

        hashInsertOnlyMemory

        +
        public static int hashInsertOnlyMemory​(org.apache.datasketches.memory.WritableMemory wmem,
        +                                       int lgArrLongs,
        +                                       long hash,
        +                                       int memOffsetBytes)
        +
        This is a classical Knuth-style Open Addressing, Double Hash (OADH) insert scheme for Memory. + This method assumes that the input hash is not a duplicate. + Useful for rebuilding tables to avoid unnecessary comparisons. + Returns the index of insertion, which is always positive or zero. + Throws an exception if table has no empty slot.
        +
        +
        Parameters:
        +
        wmem - The WritableMemory that contains the hashTable to insert into. + The size of the hashTable portion must be a power of 2.
        +
        lgArrLongs - The log_base2(hashTable.length. + See lgArrLongs.
        +
        hash - value that must not be zero and will be inserted into the array into an empty slot.
        +
        memOffsetBytes - offset in the WritableMemory where the hashTable starts
        +
        Returns:
        +
        index of insertion. Always positive or zero.
        +
        +
      • +
      + + + +
        +
      • +

        hashSearchOrInsertMemory

        +
        public static int hashSearchOrInsertMemory​(org.apache.datasketches.memory.WritableMemory wmem,
        +                                           int lgArrLongs,
        +                                           long hash,
        +                                           int memOffsetBytes)
        +
        This is a classical Knuth-style Open Addressing, Double Hash insert scheme, but inserts + values directly into a Memory. + Returns index ≥ 0 if found (duplicate); < 0 if inserted, inserted at -(index + 1). + Throws an exception if the value is not found and table has no empty slot.
        +
        +
        Parameters:
        +
        wmem - The WritableMemory that contains the hashTable to insert into.
        +
        lgArrLongs - The log_base2(hashTable.length). + See lgArrLongs.
        +
        hash - The hash value to be potentially inserted into an empty slot only if it is not + a duplicate of any other hash value in the table. It must not be zero.
        +
        memOffsetBytes - offset in the WritableMemory where the hash array starts
        +
        Returns:
        +
        index ≥ 0 if found (duplicate); < 0 if inserted, inserted at -(index + 1).
        +
        +
      • +
      + + + +
        +
      • +

        checkThetaCorruption

        +
        public static void checkThetaCorruption​(long thetaLong)
        +
        +
        Parameters:
        +
        thetaLong - must be greater than zero otherwise throws an exception. + See Theta Long
        +
        +
      • +
      + + + +
        +
      • +

        checkHashCorruption

        +
        public static void checkHashCorruption​(long hash)
        +
        +
        Parameters:
        +
        hash - must be greater than -1 otherwise throws an exception. + Note a hash of zero is normally ignored, but a negative hash is never allowed.
        +
        +
      • +
      + + + +
        +
      • +

        continueCondition

        +
        public static boolean continueCondition​(long thetaLong,
        +                                        long hash)
        +
        Return true (continue) if hash is greater than or equal to thetaLong, or if hash == 0, + or if hash == Long.MAX_VALUE.
        +
        +
        Parameters:
        +
        thetaLong - must be greater than the hash value + See Theta Long
        +
        hash - must be less than thetaLong and not less than or equal to zero.
        +
        Returns:
        +
        true (continue) if hash is greater than or equal to thetaLong, or if hash == 0, + or if hash == Long.MAX_VALUE.
        +
        +
      • +
      + + + +
        +
      • +

        convertToHashTable

        +
        public static long[] convertToHashTable​(long[] hashArr,
        +                                        int count,
        +                                        long thetaLong,
        +                                        double rebuildThreshold)
        +
        Converts the given array to a hash table.
        +
        +
        Parameters:
        +
        hashArr - The given array of hashes. Gaps are OK.
        +
        count - The number of valid hashes in the array
        +
        thetaLong - Any hashes equal to or greater than thetaLong will be ignored
        +
        rebuildThreshold - The fill fraction for the hash table forcing a rebuild or resize.
        +
        Returns:
        +
        a HashTable
        +
        +
      • +
      + + + +
        +
      • +

        minLgHashTableSize

        +
        public static int minLgHashTableSize​(int count,
        +                                     double rebuild_threshold)
        +
        Returns the smallest log hash table size given the count of items and the rebuild threshold.
        +
        +
        Parameters:
        +
        count - the given count of items
        +
        rebuild_threshold - the rebuild threshold as a fraction between zero and one.
        +
        Returns:
        +
        the smallest log hash table size
        +
        +
      • +
      + + + +
        +
      • +

        countPart

        +
        public static int countPart​(long[] srcArr,
        +                            int lgArrLongs,
        +                            long thetaLong)
        +
        Counts the cardinality of the first Log2 values of the given source array.
        +
        +
        Parameters:
        +
        srcArr - the given source array
        +
        lgArrLongs - See lgArrLongs
        +
        thetaLong - See Theta Long
        +
        Returns:
        +
        the cardinality
        +
        +
      • +
      + + + +
        +
      • +

        count

        +
        public static int count​(long[] srcArr,
        +                        long thetaLong)
        +
        Counts the cardinality of the given source array.
        +
        +
        Parameters:
        +
        srcArr - the given source array
        +
        thetaLong - See Theta Long
        +
        Returns:
        +
        the cardinality
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/QuickSelect.html b/docs/5.0.2/org/apache/datasketches/thetacommon/QuickSelect.html new file mode 100644 index 000000000..d820866e2 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/QuickSelect.html @@ -0,0 +1,459 @@ + + + + + +QuickSelect (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class QuickSelect

+
+
+ +
+
    +
  • +
    +
    public final class QuickSelect
    +extends Object
    +
    QuickSelect algorithm improved from Sedgewick. Gets the kth order value + (1-based or 0-based) from the array. + Warning! This changes the ordering of elements in the given array!
    + Also see:
    + blog.teamleadnet.com/2012/07/quick-select-algorithm-find-kth-element.html
    + See QuickSelectTest for examples and testNG tests.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static doubleselect​(double[] arr, + int lo, + int hi, + int pivot) +
      Gets the 0-based kth order statistic from the array.
      +
      static longselect​(long[] arr, + int lo, + int hi, + int pivot) +
      Gets the 0-based kth order statistic from the array.
      +
      static doubleselectExcludingZeros​(double[] arr, + int nonZeros, + int pivot) +
      Gets the 1-based kth order statistic from the array excluding any zero values in the + array.
      +
      static longselectExcludingZeros​(long[] arr, + int nonZeros, + int pivot) +
      Gets the 1-based kth order statistic from the array excluding any zero values in the + array.
      +
      static doubleselectIncludingZeros​(double[] arr, + int pivot) +
      Gets the 1-based kth order statistic from the array including any zero values in the + array.
      +
      static longselectIncludingZeros​(long[] arr, + int pivot) +
      Gets the 1-based kth order statistic from the array including any zero values in the + array.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        select

        +
        public static long select​(long[] arr,
        +                          int lo,
        +                          int hi,
        +                          int pivot)
        +
        Gets the 0-based kth order statistic from the array. Warning! This changes the ordering + of elements in the given array!
        +
        +
        Parameters:
        +
        arr - The array to be re-arranged.
        +
        lo - The lowest 0-based index to be considered.
        +
        hi - The highest 0-based index to be considered.
        +
        pivot - The 0-based index of the value to pivot on.
        +
        Returns:
        +
        The value of the smallest (n)th element where n is 0-based.
        +
        +
      • +
      + + + +
        +
      • +

        selectIncludingZeros

        +
        public static long selectIncludingZeros​(long[] arr,
        +                                        int pivot)
        +
        Gets the 1-based kth order statistic from the array including any zero values in the + array. Warning! This changes the ordering of elements in the given array!
        +
        +
        Parameters:
        +
        arr - The hash array.
        +
        pivot - The 1-based index of the value that is chosen as the pivot for the array. + After the operation all values below this 1-based index will be less than this value + and all values above this index will be greater. The 0-based index of the pivot will be + pivot-1.
        +
        Returns:
        +
        The value of the smallest (N)th element including zeros, where N is 1-based.
        +
        +
      • +
      + + + +
        +
      • +

        selectExcludingZeros

        +
        public static long selectExcludingZeros​(long[] arr,
        +                                        int nonZeros,
        +                                        int pivot)
        +
        Gets the 1-based kth order statistic from the array excluding any zero values in the + array. Warning! This changes the ordering of elements in the given array!
        +
        +
        Parameters:
        +
        arr - The hash array.
        +
        nonZeros - The number of non-zero values in the array.
        +
        pivot - The 1-based index of the value that is chosen as the pivot for the array. + After the operation all values below this 1-based index will be less than this value + and all values above this index will be greater. The 0-based index of the pivot will be + pivot+arr.length-nonZeros-1.
        +
        Returns:
        +
        The value of the smallest (N)th element excluding zeros, where N is 1-based.
        +
        +
      • +
      + + + +
        +
      • +

        select

        +
        public static double select​(double[] arr,
        +                            int lo,
        +                            int hi,
        +                            int pivot)
        +
        Gets the 0-based kth order statistic from the array. Warning! This changes the ordering + of elements in the given array!
        +
        +
        Parameters:
        +
        arr - The array to be re-arranged.
        +
        lo - The lowest 0-based index to be considered.
        +
        hi - The highest 0-based index to be considered.
        +
        pivot - The 0-based smallest value to pivot on.
        +
        Returns:
        +
        The value of the smallest (n)th element where n is 0-based.
        +
        +
      • +
      + + + +
        +
      • +

        selectIncludingZeros

        +
        public static double selectIncludingZeros​(double[] arr,
        +                                          int pivot)
        +
        Gets the 1-based kth order statistic from the array including any zero values in the + array. Warning! This changes the ordering of elements in the given array!
        +
        +
        Parameters:
        +
        arr - The hash array.
        +
        pivot - The 1-based index of the value that is chosen as the pivot for the array. + After the operation all values below this 1-based index will be less than this value + and all values above this index will be greater. The 0-based index of the pivot will be + pivot-1.
        +
        Returns:
        +
        The value of the smallest (N)th element including zeros, where N is 1-based.
        +
        +
      • +
      + + + +
        +
      • +

        selectExcludingZeros

        +
        public static double selectExcludingZeros​(double[] arr,
        +                                          int nonZeros,
        +                                          int pivot)
        +
        Gets the 1-based kth order statistic from the array excluding any zero values in the + array. Warning! This changes the ordering of elements in the given array!
        +
        +
        Parameters:
        +
        arr - The hash array.
        +
        nonZeros - The number of non-zero values in the array.
        +
        pivot - The 1-based index of the value that is chosen as the pivot for the array. + After the operation all values below this 1-based index will be less than this value + and all values above this index will be greater. The 0-based index of the pivot will be + pivot+arr.length-nonZeros-1.
        +
        Returns:
        +
        The value of the smallest (N)th element excluding zeros, where N is 1-based.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/SetOperationCornerCases.AnotbAction.html b/docs/5.0.2/org/apache/datasketches/thetacommon/SetOperationCornerCases.AnotbAction.html new file mode 100644 index 000000000..faaee16ff --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/SetOperationCornerCases.AnotbAction.html @@ -0,0 +1,463 @@ + + + + + +SetOperationCornerCases.AnotbAction (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum SetOperationCornerCases.AnotbAction

+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/SetOperationCornerCases.CornerCase.html b/docs/5.0.2/org/apache/datasketches/thetacommon/SetOperationCornerCases.CornerCase.html new file mode 100644 index 000000000..b063f53d9 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/SetOperationCornerCases.CornerCase.html @@ -0,0 +1,649 @@ + + + + + +SetOperationCornerCases.CornerCase (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum SetOperationCornerCases.CornerCase

+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/SetOperationCornerCases.IntersectAction.html b/docs/5.0.2/org/apache/datasketches/thetacommon/SetOperationCornerCases.IntersectAction.html new file mode 100644 index 000000000..15571a099 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/SetOperationCornerCases.IntersectAction.html @@ -0,0 +1,424 @@ + + + + + +SetOperationCornerCases.IntersectAction (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum SetOperationCornerCases.IntersectAction

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static SetOperationCornerCases.IntersectAction[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (SetOperationCornerCases.IntersectAction c : SetOperationCornerCases.IntersectAction.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static SetOperationCornerCases.IntersectAction valueOf​(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        getActionId

        +
        public String getActionId()
        +
      • +
      + + + +
        +
      • +

        getActionDescription

        +
        public String getActionDescription()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/SetOperationCornerCases.UnionAction.html b/docs/5.0.2/org/apache/datasketches/thetacommon/SetOperationCornerCases.UnionAction.html new file mode 100644 index 000000000..7f84acf38 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/SetOperationCornerCases.UnionAction.html @@ -0,0 +1,502 @@ + + + + + +SetOperationCornerCases.UnionAction (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum SetOperationCornerCases.UnionAction

+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/SetOperationCornerCases.html b/docs/5.0.2/org/apache/datasketches/thetacommon/SetOperationCornerCases.html new file mode 100644 index 000000000..fcc822809 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/SetOperationCornerCases.html @@ -0,0 +1,378 @@ + + + + + +SetOperationCornerCases (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SetOperationCornerCases

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.thetacommon.SetOperationCornerCases
    • +
    +
  • +
+
+
    +
  • +
    +
    public class SetOperationCornerCases
    +extends Object
    +
    Simplifies and speeds up set operations by resolving specific corner cases.
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SetOperationCornerCases

        +
        public SetOperationCornerCases()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        createCornerCaseId

        +
        public static int createCornerCaseId​(long thetaLongA,
        +                                     int countA,
        +                                     boolean emptyA,
        +                                     long thetaLongB,
        +                                     int countB,
        +                                     boolean emptyB)
        +
      • +
      + + + +
        +
      • +

        sketchStateId

        +
        public static int sketchStateId​(boolean isEmpty,
        +                                int numRetained,
        +                                long thetaLong)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/ThetaUtil.html b/docs/5.0.2/org/apache/datasketches/thetacommon/ThetaUtil.html new file mode 100644 index 000000000..85f526a98 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/ThetaUtil.html @@ -0,0 +1,565 @@ + + + + + +ThetaUtil (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ThetaUtil

+
+
+ +
+
    +
  • +
    +
    public final class ThetaUtil
    +extends Object
    +
    Utility methods for the Theta Family of sketches
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      static intDEFAULT_NOMINAL_ENTRIES +
      The default nominal entries is provided as a convenience for those cases where the + nominal sketch size in number of entries is not provided.
      +
      static longDEFAULT_UPDATE_SEED +
      The seed 9001 used in the sketch update methods is a prime number that + was chosen very early on in experimental testing.
      +
      static intMAX_LG_NOM_LONGS +
      The largest Log2 nom entries allowed: 26.
      +
      static intMIN_LG_ARR_LONGS +
      The smallest Log2 cache size allowed: 5.
      +
      static intMIN_LG_NOM_LONGS +
      The smallest Log2 nom entries allowed: 4.
      +
      static doubleREBUILD_THRESHOLD +
      The hash table rebuild threshold = 15.0/16.0.
      +
      static doubleRESIZE_THRESHOLD +
      The resize threshold = 0.5; tuned for speed.
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static intcheckNomLongs​(int nomLongs) +
      Checks that the given nomLongs is within bounds and returns the Log2 of the ceiling power of 2 + of the given nomLongs.
      +
      static shortcheckSeedHashes​(short seedHashA, + short seedHashB) +
      Check if the two seed hashes are equal.
      +
      static shortcomputeSeedHash​(long seed) +
      Computes and checks the 16-bit seed hash from the given long seed.
      +
      static intstartingSubMultiple​(int lgTarget, + int lgRF, + int lgMin) +
      Gets the smallest allowed exponent of 2 that it is a sub-multiple of the target by zero, + one or more resize factors.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        MIN_LG_NOM_LONGS

        +
        public static final int MIN_LG_NOM_LONGS
        +
        The smallest Log2 nom entries allowed: 4.
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        MAX_LG_NOM_LONGS

        +
        public static final int MAX_LG_NOM_LONGS
        +
        The largest Log2 nom entries allowed: 26.
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        REBUILD_THRESHOLD

        +
        public static final double REBUILD_THRESHOLD
        +
        The hash table rebuild threshold = 15.0/16.0.
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        RESIZE_THRESHOLD

        +
        public static final double RESIZE_THRESHOLD
        +
        The resize threshold = 0.5; tuned for speed.
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        DEFAULT_NOMINAL_ENTRIES

        +
        public static final int DEFAULT_NOMINAL_ENTRIES
        +
        The default nominal entries is provided as a convenience for those cases where the + nominal sketch size in number of entries is not provided. + A sketch of 4096 entries has a Relative Standard Error (RSE) of +/- 1.56% at a confidence of + 68%; or equivalently, a Relative Error of +/- 3.1% at a confidence of 95.4%. + See Default Nominal Entries
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        DEFAULT_UPDATE_SEED

        +
        public static final long DEFAULT_UPDATE_SEED
        +
        The seed 9001 used in the sketch update methods is a prime number that + was chosen very early on in experimental testing. Choosing a seed is somewhat arbitrary, and + the author cannot prove that this particular seed is somehow superior to other seeds. There + was some early Internet discussion that a seed of 0 did not produce as clean avalanche diagrams + as non-zero seeds, but this may have been more related to the MurmurHash2 release, which did + have some issues. As far as the author can determine, MurmurHash3 does not have these problems. + +

        In order to perform set operations on two sketches it is critical that the same hash + function and seed are identical for both sketches, otherwise the assumed 1:1 relationship + between the original source key value and the hashed bit string would be violated. Once + you have developed a history of stored sketches you are stuck with it. + +

        WARNING: This seed is used internally by library sketches in different + packages and thus must be declared public. However, this seed value must not be used by library + users with the MurmurHash3 function. It should be viewed as existing for exclusive, private + use by the library. + +

        See Default Update Seed

        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        MIN_LG_ARR_LONGS

        +
        public static final int MIN_LG_ARR_LONGS
        +
        The smallest Log2 cache size allowed: 5.
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        checkSeedHashes

        +
        public static short checkSeedHashes​(short seedHashA,
        +                                    short seedHashB)
        +
        Check if the two seed hashes are equal. If not, throw an SketchesArgumentException.
        +
        +
        Parameters:
        +
        seedHashA - the seedHash A
        +
        seedHashB - the seedHash B
        +
        Returns:
        +
        seedHashA if they are equal
        +
        +
      • +
      + + + +
        +
      • +

        computeSeedHash

        +
        public static short computeSeedHash​(long seed)
        +
        Computes and checks the 16-bit seed hash from the given long seed. + The seed hash may not be zero in order to maintain compatibility with older serialized + versions that did not have this concept.
        +
        +
        Parameters:
        +
        seed - See Update Hash Seed
        +
        Returns:
        +
        the seed hash.
        +
        +
      • +
      + + + +
        +
      • +

        startingSubMultiple

        +
        public static int startingSubMultiple​(int lgTarget,
        +                                      int lgRF,
        +                                      int lgMin)
        +
        Gets the smallest allowed exponent of 2 that it is a sub-multiple of the target by zero, + one or more resize factors.
        +
        +
        Parameters:
        +
        lgTarget - Log2 of the target size
        +
        lgRF - Log_base2 of Resize Factor. + See Resize Factor
        +
        lgMin - Log2 of the minimum allowed starting size
        +
        Returns:
        +
        The Log2 of the starting size
        +
        +
      • +
      + + + +
        +
      • +

        checkNomLongs

        +
        public static int checkNomLongs​(int nomLongs)
        +
        Checks that the given nomLongs is within bounds and returns the Log2 of the ceiling power of 2 + of the given nomLongs.
        +
        +
        Parameters:
        +
        nomLongs - the given number of nominal longs. This can be any value from 16 to + 67108864, inclusive.
        +
        Returns:
        +
        The Log2 of the ceiling power of 2 of the given nomLongs.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/BinomialBoundsN.html b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/BinomialBoundsN.html new file mode 100644 index 000000000..47faf099c --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/BinomialBoundsN.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.thetacommon.BinomialBoundsN (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.thetacommon.BinomialBoundsN

+
+
No usage of org.apache.datasketches.thetacommon.BinomialBoundsN
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/BoundsOnRatiosInThetaSketchedSets.html b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/BoundsOnRatiosInThetaSketchedSets.html new file mode 100644 index 000000000..e31d52213 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/BoundsOnRatiosInThetaSketchedSets.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.thetacommon.BoundsOnRatiosInThetaSketchedSets (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.thetacommon.BoundsOnRatiosInThetaSketchedSets

+
+
No usage of org.apache.datasketches.thetacommon.BoundsOnRatiosInThetaSketchedSets
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/BoundsOnRatiosInTupleSketchedSets.html b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/BoundsOnRatiosInTupleSketchedSets.html new file mode 100644 index 000000000..0453a0af0 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/BoundsOnRatiosInTupleSketchedSets.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.thetacommon.BoundsOnRatiosInTupleSketchedSets (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.thetacommon.BoundsOnRatiosInTupleSketchedSets

+
+
No usage of org.apache.datasketches.thetacommon.BoundsOnRatiosInTupleSketchedSets
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/HashOperations.html b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/HashOperations.html new file mode 100644 index 000000000..a9510bb90 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/HashOperations.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.thetacommon.HashOperations (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.thetacommon.HashOperations

+
+
No usage of org.apache.datasketches.thetacommon.HashOperations
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/QuickSelect.html b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/QuickSelect.html new file mode 100644 index 000000000..0384686a6 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/QuickSelect.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.thetacommon.QuickSelect (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.thetacommon.QuickSelect

+
+
No usage of org.apache.datasketches.thetacommon.QuickSelect
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/SetOperationCornerCases.AnotbAction.html b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/SetOperationCornerCases.AnotbAction.html new file mode 100644 index 000000000..5a88154d1 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/SetOperationCornerCases.AnotbAction.html @@ -0,0 +1,211 @@ + + + + + +Uses of Class org.apache.datasketches.thetacommon.SetOperationCornerCases.AnotbAction (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.thetacommon.SetOperationCornerCases.AnotbAction

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/SetOperationCornerCases.CornerCase.html b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/SetOperationCornerCases.CornerCase.html new file mode 100644 index 000000000..2fcd7408b --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/SetOperationCornerCases.CornerCase.html @@ -0,0 +1,211 @@ + + + + + +Uses of Class org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.thetacommon.SetOperationCornerCases.CornerCase

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/SetOperationCornerCases.IntersectAction.html b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/SetOperationCornerCases.IntersectAction.html new file mode 100644 index 000000000..5505c97bb --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/SetOperationCornerCases.IntersectAction.html @@ -0,0 +1,211 @@ + + + + + +Uses of Class org.apache.datasketches.thetacommon.SetOperationCornerCases.IntersectAction (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.thetacommon.SetOperationCornerCases.IntersectAction

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/SetOperationCornerCases.UnionAction.html b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/SetOperationCornerCases.UnionAction.html new file mode 100644 index 000000000..ad180b4a2 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/SetOperationCornerCases.UnionAction.html @@ -0,0 +1,211 @@ + + + + + +Uses of Class org.apache.datasketches.thetacommon.SetOperationCornerCases.UnionAction (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.thetacommon.SetOperationCornerCases.UnionAction

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/SetOperationCornerCases.html b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/SetOperationCornerCases.html new file mode 100644 index 000000000..e7feb71e7 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/SetOperationCornerCases.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.thetacommon.SetOperationCornerCases (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.thetacommon.SetOperationCornerCases

+
+
No usage of org.apache.datasketches.thetacommon.SetOperationCornerCases
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/ThetaUtil.html b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/ThetaUtil.html new file mode 100644 index 000000000..55fd6e5fe --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/class-use/ThetaUtil.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.thetacommon.ThetaUtil (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.thetacommon.ThetaUtil

+
+
No usage of org.apache.datasketches.thetacommon.ThetaUtil
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/package-summary.html b/docs/5.0.2/org/apache/datasketches/thetacommon/package-summary.html new file mode 100644 index 000000000..977ba2e67 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/package-summary.html @@ -0,0 +1,265 @@ + + + + + +org.apache.datasketches.thetacommon (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches.thetacommon

+
+
+
+ + +
This package contains common tools and methods for the theta, + tuple, tuple/* and fdt packages.
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    BinomialBoundsN +
    This class enables the estimation of error bounds given a sample set size, the sampling + probability theta, the number of standard deviations and a simple noDataSeen flag.
    +
    BoundsOnRatiosInThetaSketchedSets +
    This class is used to compute the bounds on the estimate of the ratio B / A, where: + + A is a Theta Sketch of population PopA. + B is a Theta Sketch of population PopB that is a subset of A, + obtained by an intersection of A with some other Theta Sketch C, + which acts like a predicate or selection clause. + The estimate of the ratio PopB/PopA is + BoundsOnRatiosInThetaSketchedSets.getEstimateOfBoverA(A, B). + The Upper Bound estimate on the ratio PopB/PopA is + BoundsOnRatiosInThetaSketchedSets.getUpperBoundForBoverA(A, B). + The Lower Bound estimate on the ratio PopB/PopA is + BoundsOnRatiosInThetaSketchedSets.getLowerBoundForBoverA(A, B). + + Note: The theta of A cannot be greater than the theta of B.
    +
    BoundsOnRatiosInTupleSketchedSets +
    This class is used to compute the bounds on the estimate of the ratio B / A, where: + + A is a Tuple Sketch of population PopA. + B is a Tuple or Theta Sketch of population PopB that is a subset of A, + obtained by an intersection of A with some other Tuple or Theta Sketch C, + which acts like a predicate or selection clause. + The estimate of the ratio PopB/PopA is + BoundsOnRatiosInThetaSketchedSets.getEstimateOfBoverA(A, B). + The Upper Bound estimate on the ratio PopB/PopA is + BoundsOnRatiosInThetaSketchedSets.getUpperBoundForBoverA(A, B). + The Lower Bound estimate on the ratio PopB/PopA is + BoundsOnRatiosInThetaSketchedSets.getLowerBoundForBoverA(A, B). + + Note: The theta of A cannot be greater than the theta of B.
    +
    HashOperations +
    Helper class for the common hash table methods.
    +
    QuickSelect +
    QuickSelect algorithm improved from Sedgewick.
    +
    SetOperationCornerCases +
    Simplifies and speeds up set operations by resolving specific corner cases.
    +
    ThetaUtil +
    Utility methods for the Theta Family of sketches
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    SetOperationCornerCases.AnotbAction 
    SetOperationCornerCases.CornerCase 
    SetOperationCornerCases.IntersectAction 
    SetOperationCornerCases.UnionAction 
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/package-tree.html b/docs/5.0.2/org/apache/datasketches/thetacommon/package-tree.html new file mode 100644 index 000000000..a9d615480 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/package-tree.html @@ -0,0 +1,187 @@ + + + + + +org.apache.datasketches.thetacommon Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches.thetacommon

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+

Enum Hierarchy

+ +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/thetacommon/package-use.html b/docs/5.0.2/org/apache/datasketches/thetacommon/package-use.html new file mode 100644 index 000000000..c0dbff5dc --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/thetacommon/package-use.html @@ -0,0 +1,199 @@ + + + + + +Uses of Package org.apache.datasketches.thetacommon (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches.thetacommon

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/AnotB.html b/docs/5.0.2/org/apache/datasketches/tuple/AnotB.html new file mode 100644 index 000000000..2ee616e4d --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/AnotB.html @@ -0,0 +1,571 @@ + + + + + +AnotB (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class AnotB<S extends Summary>

+
+
+ +
+
    +
  • +
    +
    Type Parameters:
    +
    S - Type of Summary
    +
    +
    +
    public final class AnotB<S extends Summary>
    +extends Object
    +
    Computes a set difference, A-AND-NOT-B, of two generic tuple sketches. + This class includes both stateful and stateless operations. + +

    The stateful operation is as follows:

    +
    
    + AnotB anotb = new AnotB();
    +
    + anotb.setA(Sketch skA); //The first argument.
    + anotb.notB(Sketch skB); //The second (subtraction) argument.
    + anotb.notB(Sketch skC); // ...any number of additional subtractions...
    + anotb.getResult(false); //Get an interim result.
    + anotb.notB(Sketch skD); //Additional subtractions.
    + anotb.getResult(true);  //Final result and resets the AnotB operator.
    + 
    + +

    The stateless operation is as follows:

    +
    
    + AnotB anotb = new AnotB();
    +
    + CompactSketch csk = anotb.aNotB(Sketch skA, Sketch skB);
    + 
    + +

    Calling the setA operation a second time essentially clears the internal state and loads + the new sketch.

    + +

    The stateless and stateful operations are independent of each other.

    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        AnotB

        +
        public AnotB()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setA

        +
        public void setA​(Sketch<S> skA)
        +
        This is part of a multistep, stateful AnotB operation and sets the given Tuple sketch as the + first argument A of A-AND-NOT-B. This overwrites the internal state of this + AnotB operator with the contents of the given sketch. + This sets the stage for multiple following notB steps. + +

        An input argument of null will throw an exception.

        + +

        Rationale: In mathematics a "null set" is a set with no members, which we call an empty set. + That is distinctly different from the java null, which represents a nonexistent object. + In most cases it is a programming error due to some object that was not properly initialized. + With a null as the first argument, we cannot know what the user's intent is. + Since it is very likely that a null is a programming error, we throw a an exception.

        + +

        An empty input argument will set the internal state to empty.

        + +

        Rationale: An empty set is a mathematically legal concept. Although it makes any subsequent, + valid argument for B irrelevant, we must allow this and assume the user knows what they are + doing.

        + +

        Performing getResult(boolean) just after this step will return a compact form of + the given argument.

        +
        +
        Parameters:
        +
        skA - The incoming sketch for the first argument, A.
        +
        +
      • +
      + + + +
        +
      • +

        notB

        +
        public void notB​(Sketch<S> skB)
        +
        This is part of a multistep, stateful AnotB operation and sets the given Tuple sketch as the + second (or n+1th) argument B of A-AND-NOT-B. + Performs an AND NOT operation with the existing internal state of this AnotB operator. + +

        An input argument of null or empty is ignored.

        + +

        Rationale: A null for the second or following arguments is more tolerable because + A NOT null is still A even if we don't know exactly what the null represents. It + clearly does not have any content that overlaps with A. Also, because this can be part of + a multistep operation with multiple notB steps. Other following steps can still produce + a valid result.

        + +

        Use getResult(boolean) to obtain the result.

        +
        +
        Parameters:
        +
        skB - The incoming Tuple sketch for the second (or following) argument B.
        +
        +
      • +
      + + + +
        +
      • +

        notB

        +
        public void notB​(Sketch skB)
        +
        This is part of a multistep, stateful AnotB operation and sets the given Theta sketch as the + second (or n+1th) argument B of A-AND-NOT-B. + Performs an AND NOT operation with the existing internal state of this AnotB operator. + Calls to this method can be intermingled with calls to + notB(org.apache.datasketches.theta.Sketch). + +

        An input argument of null or empty is ignored.

        + +

        Rationale: A null for the second or following arguments is more tolerable because + A NOT null is still A even if we don't know exactly what the null represents. It + clearly does not have any content that overlaps with A. Also, because this can be part of + a multistep operation with multiple notB steps. Other following steps can still produce + a valid result.

        + +

        Use getResult(boolean) to obtain the result.

        +
        +
        Parameters:
        +
        skB - The incoming Theta sketch for the second (or following) argument B.
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public CompactSketch<S> getResult​(boolean reset)
        +
        Gets the result of the multistep, stateful operation AnotB that have been executed with calls + to setA(Sketch) and (notB(Sketch) or + notB(org.apache.datasketches.theta.Sketch)).
        +
        +
        Parameters:
        +
        reset - If true, clears this operator to the empty state after this result is + returned. Set this to false if you wish to obtain an intermediate result.
        +
        Returns:
        +
        the result of this operation as an unordered CompactSketch.
        +
        +
      • +
      + + + +
        +
      • +

        aNotB

        +
        public static <S extends SummaryCompactSketch<S> aNotB​(Sketch<S> skA,
        +                                                         Sketch<S> skB)
        +
        Returns the A-and-not-B set operation on the two given Tuple sketches. + +

        This a stateless operation and has no impact on the internal state of this operator. + Thus, this is not an accumulating update and is independent of the setA(Sketch), + notB(Sketch), notB(org.apache.datasketches.theta.Sketch), and + getResult(boolean) methods.

        + +

        If either argument is null an exception is thrown.

        + +

        Rationale: In mathematics a "null set" is a set with no members, which we call an empty set. + That is distinctly different from the java null, which represents a nonexistent object. + In most cases it is a programming error due to some object that was not properly initialized. + With a null as the first argument, we cannot know what the user's intent is. + With a null as the second argument, we can't ignore it as we must return a result and there is + no following possible viable arguments for the second argument. + Since it is very likely that a null is a programming error, we throw an exception.

        +
        +
        Type Parameters:
        +
        S - Type of Summary
        +
        Parameters:
        +
        skA - The incoming Tuple sketch for the first argument
        +
        skB - The incoming Tuple sketch for the second argument
        +
        Returns:
        +
        the result as an unordered CompactSketch
        +
        +
      • +
      + + + +
        +
      • +

        aNotB

        +
        public static <S extends SummaryCompactSketch<S> aNotB​(Sketch<S> skA,
        +                                                         Sketch skB)
        +
        Returns the A-and-not-B set operation on a Tuple sketch and a Theta sketch. + +

        This a stateless operation and has no impact on the internal state of this operator. + Thus, this is not an accumulating update and is independent of the setA(Sketch), + notB(Sketch), notB(org.apache.datasketches.theta.Sketch), and + getResult(boolean) methods.

        + +

        If either argument is null an exception is thrown.

        + +

        Rationale: In mathematics a "null set" is a set with no members, which we call an empty set. + That is distinctly different from the java null, which represents a nonexistent object. + In most cases it is a programming error due to some object that was not properly initialized. + With a null as the first argument, we cannot know what the user's intent is. + With a null as the second argument, we can't ignore it as we must return a result and there is + no following possible viable arguments for the second argument. + Since it is very likely that a null is a programming error for either argument + we throw a an exception.

        +
        +
        Type Parameters:
        +
        S - Type of Summary
        +
        Parameters:
        +
        skA - The incoming Tuple sketch for the first argument
        +
        skB - The incoming Theta sketch for the second argument
        +
        Returns:
        +
        the result as an unordered CompactSketch
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Resets this operation back to the empty state.
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/CompactSketch.html b/docs/5.0.2/org/apache/datasketches/tuple/CompactSketch.html new file mode 100644 index 000000000..fd818598d --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/CompactSketch.html @@ -0,0 +1,416 @@ + + + + + +CompactSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class CompactSketch<S extends Summary>

+
+
+ +
+
    +
  • +
    +
    Type Parameters:
    +
    S - type of Summary
    +
    +
    +
    public final class CompactSketch<S extends Summary>
    +extends Sketch<S>
    +
    CompactSketches are never created directly. They are created as a result of + the compact() method of an UpdatableSketch or as a result of the getResult() + method of a set operation like Union, Intersection or AnotB. CompactSketch + 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. CompactSketch is read-only.
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        compact

        +
        public CompactSketch<S> compact()
        +
        Description copied from class: Sketch
        +
        Converts this sketch to a CompactSketch on the Java heap. + +

        If this sketch is already in compact form this operation returns this.

        +
        +
        Specified by:
        +
        compact in class Sketch<S extends Summary>
        +
        Returns:
        +
        this sketch as a CompactSketch on the Java heap.
        +
        +
      • +
      + + + +
        +
      • +

        getRetainedEntries

        +
        public int getRetainedEntries()
        +
        +
        Specified by:
        +
        getRetainedEntries in class Sketch<S extends Summary>
        +
        Returns:
        +
        number of retained entries
        +
        +
      • +
      + + + +
        +
      • +

        getCountLessThanThetaLong

        +
        public int getCountLessThanThetaLong​(long thetaLong)
        +
        Description copied from class: Sketch
        +
        Gets the number of hash values less than the given theta expressed as a long.
        +
        +
        Specified by:
        +
        getCountLessThanThetaLong in class Sketch<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.
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray()
        +
        Description copied from class: Sketch
        +
        This is to serialize a sketch instance to a byte array. + +

        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.

        +
        +
        Specified by:
        +
        toByteArray in class Sketch<S extends Summary>
        +
        Returns:
        +
        serialized representation of the sketch
        +
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/DeserializeResult.html b/docs/5.0.2/org/apache/datasketches/tuple/DeserializeResult.html new file mode 100644 index 000000000..fd1109411 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/DeserializeResult.html @@ -0,0 +1,346 @@ + + + + + +DeserializeResult (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class DeserializeResult<T>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.DeserializeResult<T>
    • +
    +
  • +
+
+
    +
  • +
    +
    Type Parameters:
    +
    T - Type of object
    +
    +
    +
    public class DeserializeResult<T>
    +extends Object
    +
    Returns an object and its size in bytes as a result of a deserialize operation
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + + + +
        +
      • +

        DeserializeResult

        +
        public DeserializeResult​(T object,
        +                         int size)
        +
        Creates an instance.
        +
        +
        Parameters:
        +
        object - Deserialized object.
        +
        size - Deserialized size in bytes.
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getObject

        +
        public T getObject()
        +
        +
        Returns:
        +
        Deserialized object
        +
        +
      • +
      + + + +
        +
      • +

        getSize

        +
        public int getSize()
        +
        +
        Returns:
        +
        Size in bytes occupied by the object in the serialized form
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/Filter.html b/docs/5.0.2/org/apache/datasketches/tuple/Filter.html new file mode 100644 index 000000000..af9ab4e8b --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/Filter.html @@ -0,0 +1,330 @@ + + + + + +Filter (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Filter<T extends Summary>

+
+
+ +
+
    +
  • +
    +
    Type Parameters:
    +
    T - Summary type against which apply the Predicate
    +
    +
    +
    public class Filter<T extends Summary>
    +extends Object
    +
    Class for filtering entries from a Sketch given a Summary
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Filter

        +
        public Filter​(Predicate<T> predicate)
        +
        Filter constructor with a Predicate
        +
        +
        Parameters:
        +
        predicate - Predicate to use in this filter. If the Predicate returns False, the + element is discarded. If the Predicate returns True, then the element is kept in the + Sketch
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        filter

        +
        public CompactSketch<T> filter​(Sketch<T> sketchIn)
        +
        Filters elements on the provided Sketch
        +
        +
        Parameters:
        +
        sketchIn - The sketch against which apply the Predicate
        +
        Returns:
        +
        A new Sketch with some of the entries filtered out based on the Predicate
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/Intersection.html b/docs/5.0.2/org/apache/datasketches/tuple/Intersection.html new file mode 100644 index 000000000..c4fcd4d02 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/Intersection.html @@ -0,0 +1,485 @@ + + + + + +Intersection (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Intersection<S extends Summary>

+
+
+ +
+
    +
  • +
    +
    Type Parameters:
    +
    S - Type of Summary
    +
    +
    +
    public class Intersection<S extends Summary>
    +extends Object
    +
    Computes an intersection of two or more generic tuple sketches or generic tuple sketches + combined with theta sketches. + A new instance represents the Universal Set. Because the Universal Set + cannot be realized a getResult() on a new instance will produce an error. + Every update() computes an intersection with the internal state, which will never + grow larger and may be reduced to zero.
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Intersection​(SummarySetOperations<S> summarySetOps) +
      Creates new Intersection instance with instructions on how to process two summaries that + intersect.
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      CompactSketch<S>getResult() +
      Gets the internal set as an unordered CompactSketch
      +
      booleanhasResult() +
      Returns true if there is a valid intersection result available
      +
      voidintersect​(Sketch thetaSketch, + S summary) +
      Performs a stateful intersection of the internal set with the given thetaSketch by combining entries + using the hashes from the theta sketch and summary values from the given summary and rules + from the summarySetOps defined by the Intersection constructor.
      +
      voidintersect​(Sketch<S> tupleSketch) +
      Performs a stateful intersection of the internal set with the given tupleSketch.
      +
      CompactSketch<S>intersect​(Sketch<S> tupleSketch, + Sketch thetaSketch, + S summary) +
      Perform a stateless intersect set operation on a tuple sketch and a theta sketch and returns the + result as an unordered CompactSketch on the heap.
      +
      CompactSketch<S>intersect​(Sketch<S> tupleSketchA, + Sketch<S> tupleSketchB) +
      Perform a stateless intersect set operation on the two given tuple sketches and returns the + result as an unordered CompactSketch on the heap.
      +
      voidreset() +
      Resets the internal set to the initial state, which represents the Universal Set
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Intersection

        +
        public Intersection​(SummarySetOperations<S> summarySetOps)
        +
        Creates new Intersection instance with instructions on how to process two summaries that + intersect.
        +
        +
        Parameters:
        +
        summarySetOps - instance of SummarySetOperations
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        intersect

        +
        public CompactSketch<S> intersect​(Sketch<S> tupleSketchA,
        +                                  Sketch<S> tupleSketchB)
        +
        Perform a stateless intersect set operation on the two given tuple sketches and returns the + result as an unordered CompactSketch on the heap.
        +
        +
        Parameters:
        +
        tupleSketchA - The first sketch argument. It must not be null.
        +
        tupleSketchB - The second sketch argument. It must not be null.
        +
        Returns:
        +
        an unordered CompactSketch on the heap
        +
        +
      • +
      + + + + + +
        +
      • +

        intersect

        +
        public CompactSketch<S> intersect​(Sketch<S> tupleSketch,
        +                                  Sketch thetaSketch,
        +                                  S summary)
        +
        Perform a stateless intersect set operation on a tuple sketch and a theta sketch and returns the + result as an unordered CompactSketch on the heap.
        +
        +
        Parameters:
        +
        tupleSketch - The first sketch argument. It must not be null.
        +
        thetaSketch - The second sketch argument. It must not be null.
        +
        summary - the given proxy summary for the theta sketch, which doesn't have one. + This must not be null.
        +
        Returns:
        +
        an unordered CompactSketch on the heap
        +
        +
      • +
      + + + +
        +
      • +

        intersect

        +
        public void intersect​(Sketch<S> tupleSketch)
        +
        Performs a stateful intersection of the internal set with the given tupleSketch.
        +
        +
        Parameters:
        +
        tupleSketch - input sketch to intersect with the internal state. It must not be null.
        +
        +
      • +
      + + + + + +
        +
      • +

        intersect

        +
        public void intersect​(Sketch thetaSketch,
        +                      S summary)
        +
        Performs a stateful intersection of the internal set with the given thetaSketch by combining entries + using the hashes from the theta sketch and summary values from the given summary and rules + from the summarySetOps defined by the Intersection constructor.
        +
        +
        Parameters:
        +
        thetaSketch - input theta sketch to intersect with the internal state. It must not be null.
        +
        summary - the given proxy summary for the theta sketch, which doesn't have one. + It will be copied for each matching index. It must not be null.
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public CompactSketch<S> getResult()
        +
        Gets the internal set as an unordered CompactSketch
        +
        +
        Returns:
        +
        result of the intersections so far
        +
        +
      • +
      + + + +
        +
      • +

        hasResult

        +
        public boolean hasResult()
        +
        Returns true if there is a valid intersection result available
        +
        +
        Returns:
        +
        true if there is a valid intersection result available
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Resets the internal set to the initial state, which represents the Universal Set
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/JaccardSimilarity.html b/docs/5.0.2/org/apache/datasketches/tuple/JaccardSimilarity.html new file mode 100644 index 000000000..033ed55ad --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/JaccardSimilarity.html @@ -0,0 +1,627 @@ + + + + + +JaccardSimilarity (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class JaccardSimilarity

+
+
+ +
+
    +
  • +
    +
    public final class JaccardSimilarity
    +extends Object
    +
    Jaccard similarity of two Tuple Sketches, or alternatively, of a Tuple and Theta Sketch. + +

    Note: only retained hash values are compared, and the Tuple summary values are not accounted for in the + similarity measure.

    +
    +
    Author:
    +
    Lee Rhodes, David Cromberge
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JaccardSimilarity

        +
        public JaccardSimilarity()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        jaccard

        +
        public static <S extends Summary> double[] jaccard​(Sketch<S> sketchA,
        +                                                   Sketch<S> sketchB,
        +                                                   SummarySetOperations<S> summarySetOps)
        +
        Computes the Jaccard similarity index with upper and lower bounds. The Jaccard similarity index + J(A,B) = (A ^ B)/(A U B) is used to measure how similar the two sketches are to each + other. If J = 1.0, the sketches are considered equal. If J = 0, the two sketches are + distinct from each other. A Jaccard of .95 means the overlap between the two + populations is 95% of the union of the two populations. + +

        Note: For very large pairs of sketches, where the configured nominal entries of the sketches + are 2^25 or 2^26, this method may produce unpredictable results.

        +
        +
        Type Parameters:
        +
        S - Summary
        +
        Parameters:
        +
        sketchA - The first argument, a Tuple sketch with summary type S
        +
        sketchB - The second argument, a Tuple sketch with summary type S
        +
        summarySetOps - instance of SummarySetOperations used to unify or intersect summaries.
        +
        Returns:
        +
        a double array {LowerBound, Estimate, UpperBound} of the Jaccard index. + The Upper and Lower bounds are for a confidence interval of 95.4% or +/- 2 standard deviations.
        +
        +
      • +
      + + + + + +
        +
      • +

        jaccard

        +
        public static <S extends Summary> double[] jaccard​(Sketch<S> sketchA,
        +                                                   Sketch sketchB,
        +                                                   S summary,
        +                                                   SummarySetOperations<S> summarySetOps)
        +
        Computes the Jaccard similarity index with upper and lower bounds. The Jaccard similarity index + J(A,B) = (A ^ B)/(A U B) is used to measure how similar the two sketches are to each + other. If J = 1.0, the sketches are considered equal. If J = 0, the two sketches are + distinct from each other. A Jaccard of .95 means the overlap between the two + populations is 95% of the union of the two populations. + +

        Note: For very large pairs of sketches, where the configured nominal entries of the sketches + are 2^25 or 2^26, this method may produce unpredictable results.

        +
        +
        Type Parameters:
        +
        S - Summary
        +
        Parameters:
        +
        sketchA - The first argument, a Tuple sketch with summary type S
        +
        sketchB - The second argument, a Theta sketch
        +
        summary - the given proxy summary for the theta sketch, which doesn't have one. + This may not be null.
        +
        summarySetOps - instance of SummarySetOperations used to unify or intersect summaries.
        +
        Returns:
        +
        a double array {LowerBound, Estimate, UpperBound} of the Jaccard index. + The Upper and Lower bounds are for a confidence interval of 95.4% or +/- 2 standard deviations.
        +
        +
      • +
      + + + +
        +
      • +

        exactlyEqual

        +
        public static <S extends Summary> boolean exactlyEqual​(Sketch<S> sketchA,
        +                                                       Sketch<S> sketchB,
        +                                                       SummarySetOperations<S> summarySetOps)
        +
        Returns true if the two given sketches have exactly the same hash values and the same + theta values. Thus, they are equivalent.
        +
        +
        Type Parameters:
        +
        S - Summary
        +
        Parameters:
        +
        sketchA - The first argument, a Tuple sketch with summary type S
        +
        sketchB - The second argument, a Tuple sketch with summary type S
        +
        summarySetOps - instance of SummarySetOperations used to unify or intersect summaries.
        +
        Returns:
        +
        true if the two given sketches have exactly the same hash values and the same + theta values.
        +
        +
      • +
      + + + + + +
        +
      • +

        exactlyEqual

        +
        public static <S extends Summary> boolean exactlyEqual​(Sketch<S> sketchA,
        +                                                       Sketch sketchB,
        +                                                       S summary,
        +                                                       SummarySetOperations<S> summarySetOps)
        +
        Returns true if the two given sketches have exactly the same hash values and the same + theta values. Thus, they are equivalent.
        +
        +
        Type Parameters:
        +
        S - Summary
        +
        Parameters:
        +
        sketchA - The first argument, a Tuple sketch with summary type S
        +
        sketchB - The second argument, a Theta sketch
        +
        summary - the given proxy summary for the theta sketch, which doesn't have one. + This may not be null.
        +
        summarySetOps - instance of SummarySetOperations used to unify or intersect summaries.
        +
        Returns:
        +
        true if the two given sketches have exactly the same hash values and the same + theta values.
        +
        +
      • +
      + + + +
        +
      • +

        similarityTest

        +
        public static <S extends Summary> boolean similarityTest​(Sketch<S> measured,
        +                                                         Sketch<S> expected,
        +                                                         SummarySetOperations<S> summarySetOps,
        +                                                         double threshold)
        +
        Tests similarity of a measured Sketch against an expected Sketch. + Computes the lower bound of the Jaccard index JLB of the measured and + expected sketches. + if JLB ≥ threshold, then the sketches are considered to be + similar with a confidence of 97.7%.
        +
        +
        Type Parameters:
        +
        S - Summary
        +
        Parameters:
        +
        measured - a Tuple sketch with summary type S to be tested
        +
        expected - the reference Tuple sketch with summary type S that is considered to be correct.
        +
        summarySetOps - instance of SummarySetOperations used to unify or intersect summaries.
        +
        threshold - a real value between zero and one.
        +
        Returns:
        +
        if true, the similarity of the two sketches is greater than the given threshold + with at least 97.7% confidence.
        +
        +
      • +
      + + + + + +
        +
      • +

        similarityTest

        +
        public static <S extends Summary> boolean similarityTest​(Sketch<S> measured,
        +                                                         Sketch expected,
        +                                                         S summary,
        +                                                         SummarySetOperations<S> summarySetOps,
        +                                                         double threshold)
        +
        Tests similarity of a measured Sketch against an expected Sketch. + Computes the lower bound of the Jaccard index JLB of the measured and + expected sketches. + if JLB ≥ threshold, then the sketches are considered to be + similar with a confidence of 97.7%.
        +
        +
        Type Parameters:
        +
        S - Summary
        +
        Parameters:
        +
        measured - a Tuple sketch with summary type S to be tested
        +
        expected - the reference Theta sketch that is considered to be correct.
        +
        summary - the given proxy summary for the theta sketch, which doesn't have one. + This may not be null.
        +
        summarySetOps - instance of SummarySetOperations used to unify or intersect summaries.
        +
        threshold - a real value between zero and one.
        +
        Returns:
        +
        if true, the similarity of the two sketches is greater than the given threshold + with at least 97.7% confidence.
        +
        +
      • +
      + + + +
        +
      • +

        dissimilarityTest

        +
        public static <S extends Summary> boolean dissimilarityTest​(Sketch<S> measured,
        +                                                            Sketch<S> expected,
        +                                                            SummarySetOperations<S> summarySetOps,
        +                                                            double threshold)
        +
        Tests dissimilarity of a measured Sketch against an expected Sketch. + Computes the upper bound of the Jaccard index JUB of the measured and + expected sketches. + if JUB ≤ threshold, then the sketches are considered to be + dissimilar with a confidence of 97.7%.
        +
        +
        Type Parameters:
        +
        S - Summary
        +
        Parameters:
        +
        measured - a Tuple sketch with summary type S to be tested
        +
        expected - the reference Theta sketch that is considered to be correct.
        +
        summarySetOps - instance of SummarySetOperations used to unify or intersect summaries.
        +
        threshold - a real value between zero and one.
        +
        Returns:
        +
        if true, the dissimilarity of the two sketches is greater than the given threshold + with at least 97.7% confidence.
        +
        +
      • +
      + + + + + +
        +
      • +

        dissimilarityTest

        +
        public static <S extends Summary> boolean dissimilarityTest​(Sketch<S> measured,
        +                                                            Sketch expected,
        +                                                            S summary,
        +                                                            SummarySetOperations<S> summarySetOps,
        +                                                            double threshold)
        +
        Tests dissimilarity of a measured Sketch against an expected Sketch. + Computes the upper bound of the Jaccard index JUB of the measured and + expected sketches. + if JUB ≤ threshold, then the sketches are considered to be + dissimilar with a confidence of 97.7%.
        +
        +
        Type Parameters:
        +
        S - Summary
        +
        Parameters:
        +
        measured - a Tuple sketch with summary type S to be tested
        +
        expected - the reference Theta sketch that is considered to be correct.
        +
        summary - the given proxy summary for the theta sketch, which doesn't have one. + This may not be null.
        +
        summarySetOps - instance of SummarySetOperations used to unify or intersect summaries.
        +
        threshold - a real value between zero and one.
        +
        Returns:
        +
        if true, the dissimilarity of the two sketches is greater than the given threshold + with at least 97.7% confidence.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/SerializerDeserializer.SketchType.html b/docs/5.0.2/org/apache/datasketches/tuple/SerializerDeserializer.SketchType.html new file mode 100644 index 000000000..3f9a21bf2 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/SerializerDeserializer.SketchType.html @@ -0,0 +1,423 @@ + + + + + +SerializerDeserializer.SketchType (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum SerializerDeserializer.SketchType

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static SerializerDeserializer.SketchType[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (SerializerDeserializer.SketchType c : SerializerDeserializer.SketchType.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static SerializerDeserializer.SketchType valueOf​(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/SerializerDeserializer.html b/docs/5.0.2/org/apache/datasketches/tuple/SerializerDeserializer.html new file mode 100644 index 000000000..2c3e97bbb --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/SerializerDeserializer.html @@ -0,0 +1,390 @@ + + + + + +SerializerDeserializer (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SerializerDeserializer

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.SerializerDeserializer
    • +
    +
  • +
+
+
    +
  • +
    +
    public final class SerializerDeserializer
    +extends Object
    +
    Multipurpose serializer-deserializer for a collection of sketches defined by the enum.
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SerializerDeserializer

        +
        public SerializerDeserializer()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        validateFamily

        +
        public static void validateFamily​(byte familyId,
        +                                  byte preambleLongs)
        +
        Validates the preamble-Longs value given the family ID
        +
        +
        Parameters:
        +
        familyId - the given family ID
        +
        preambleLongs - the given preambleLongs value
        +
        +
      • +
      + + + +
        +
      • +

        validateType

        +
        public static void validateType​(byte sketchTypeByte,
        +                                SerializerDeserializer.SketchType expectedType)
        +
        Validates the sketch type byte versus the expected value
        +
        +
        Parameters:
        +
        sketchTypeByte - the given sketch type byte
        +
        expectedType - the expected value
        +
        +
      • +
      + + + +
        +
      • +

        getSketchType

        +
        public static SerializerDeserializer.SketchType getSketchType​(org.apache.datasketches.memory.Memory mem)
        +
        Gets the sketch type byte from the given Memory image
        +
        +
        Parameters:
        +
        mem - the given Memory image
        +
        Returns:
        +
        the SketchType
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/Sketch.html b/docs/5.0.2/org/apache/datasketches/tuple/Sketch.html new file mode 100644 index 000000000..933f7fe5d --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/Sketch.html @@ -0,0 +1,711 @@ + + + + + +Sketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Sketch<S extends Summary>

+
+
+ +
+
    +
  • +
    +
    Type Parameters:
    +
    S - Type of Summary
    +
    +
    +
    Direct Known Subclasses:
    +
    CompactSketch, UpdatableSketch
    +
    +
    +
    public abstract class Sketch<S extends Summary>
    +extends Object
    +
    This is an equivalent to org.apache.datasketches.theta.Sketch with + addition of a user-defined Summary object associated with every unique entry + in the sketch.
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and TypeMethodDescription
      abstract CompactSketch<S>compact() +
      Converts this sketch to a CompactSketch on the Java heap.
      +
      abstract intgetCountLessThanThetaLong​(long thetaLong) +
      Gets the number of hash values less than the given theta expressed as a long.
      +
      doublegetEstimate() +
      Estimates the cardinality of the set (number of unique values presented to the sketch)
      +
      doublegetEstimate​(int numSubsetEntries) +
      Gets the estimate of the true distinct population of subset tuples represented by the count + of entries in a subset of the total retained entries of the sketch.
      +
      doublegetLowerBound​(int numStdDev) +
      Gets the approximate lower error bound given the specified number of Standard Deviations.
      +
      doublegetLowerBound​(int numStdDev, + int numSubsetEntries) +
      Gets the estimate of the lower bound of the true distinct population represented by the count + of entries in a subset of the total retained entries of the sketch.
      +
      abstract intgetRetainedEntries() 
      SummaryFactory<S>getSummaryFactory() +
      Gets the Summary Factory class of type S
      +
      doublegetTheta() +
      Gets the value of theta as a double between zero and one
      +
      longgetThetaLong() +
      Returns Theta as a long
      +
      doublegetUpperBound​(int numStdDev) +
      Gets the approximate upper error bound given the specified number of Standard Deviations.
      +
      doublegetUpperBound​(int numStdDev, + int numSubsetEntries) +
      Gets the estimate of the upper bound of the true distinct population represented by the count + of entries in a subset of the total retained entries of the sketch.
      +
      booleanisEmpty() + +
      booleanisEstimationMode() +
      Returns true if the sketch is Estimation Mode (as opposed to Exact Mode).
      +
      abstract TupleSketchIterator<S>iterator() +
      Returns a SketchIterator
      +
      abstract byte[]toByteArray() +
      This is to serialize a sketch instance to a byte array.
      +
      StringtoString() 
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        compact

        +
        public abstract CompactSketch<S> compact()
        +
        Converts this sketch to a CompactSketch on the Java heap. + +

        If this sketch is already in compact form this operation returns this.

        +
        +
        Returns:
        +
        this sketch as a CompactSketch on the Java heap.
        +
        +
      • +
      + + + +
        +
      • +

        getEstimate

        +
        public double getEstimate()
        +
        Estimates the cardinality of the set (number of unique values presented to the sketch)
        +
        +
        Returns:
        +
        best estimate of the number of unique values
        +
        +
      • +
      + + + +
        +
      • +

        getUpperBound

        +
        public double getUpperBound​(int numStdDev)
        +
        Gets the approximate upper error bound given the specified number of Standard Deviations. + This will return getEstimate() if isEmpty() is true.
        +
        +
        Parameters:
        +
        numStdDev - See Number of Standard Deviations
        +
        Returns:
        +
        the upper bound.
        +
        +
      • +
      + + + +
        +
      • +

        getLowerBound

        +
        public double getLowerBound​(int numStdDev)
        +
        Gets the approximate lower error bound given the specified number of Standard Deviations. + This will return getEstimate() if isEmpty() is true.
        +
        +
        Parameters:
        +
        numStdDev - See Number of Standard Deviations
        +
        Returns:
        +
        the lower bound.
        +
        +
      • +
      + + + +
        +
      • +

        getEstimate

        +
        public double getEstimate​(int numSubsetEntries)
        +
        Gets the estimate of the true distinct population of subset tuples represented by the count + of entries in a subset of the total retained entries of the sketch.
        +
        +
        Parameters:
        +
        numSubsetEntries - number of entries for a chosen subset of the sketch.
        +
        Returns:
        +
        the estimate of the true distinct population of subset tuples represented by the count + of entries in a subset of the total retained entries of the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getLowerBound

        +
        public double getLowerBound​(int numStdDev,
        +                            int numSubsetEntries)
        +
        Gets the estimate of the lower bound of the true distinct population represented by the count + of entries in a subset of the total retained entries of the sketch.
        +
        +
        Parameters:
        +
        numStdDev - See Number of Standard Deviations
        +
        numSubsetEntries - number of entries for a chosen subset of the sketch.
        +
        Returns:
        +
        the estimate of the lower bound of the true distinct population represented by the count + of entries in a subset of the total retained entries of the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getUpperBound

        +
        public double getUpperBound​(int numStdDev,
        +                            int numSubsetEntries)
        +
        Gets the estimate of the upper bound of the true distinct population represented by the count + of entries in a subset of the total retained entries of the sketch.
        +
        +
        Parameters:
        +
        numStdDev - See Number of Standard Deviations
        +
        numSubsetEntries - number of entries for a chosen subset of the sketch.
        +
        Returns:
        +
        the estimate of the upper bound of the true distinct population represented by the count + of entries in a subset of the total retained entries of the sketch.
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        + +
        +
        Returns:
        +
        true if empty.
        +
        +
      • +
      + + + +
        +
      • +

        isEstimationMode

        +
        public boolean isEstimationMode()
        +
        Returns true if the sketch is Estimation Mode (as opposed to Exact Mode). + This is true if theta < 1.0 AND isEmpty() is false.
        +
        +
        Returns:
        +
        true if the sketch is in estimation mode.
        +
        +
      • +
      + + + +
        +
      • +

        getRetainedEntries

        +
        public abstract int getRetainedEntries()
        +
        +
        Returns:
        +
        number of retained entries
        +
        +
      • +
      + + + +
        +
      • +

        getCountLessThanThetaLong

        +
        public abstract int getCountLessThanThetaLong​(long thetaLong)
        +
        Gets the number of hash values less than the given theta expressed as a long.
        +
        +
        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.
        +
        +
      • +
      + + + +
        +
      • +

        getSummaryFactory

        +
        public SummaryFactory<S> getSummaryFactory()
        +
        Gets the Summary Factory class of type S
        +
        +
        Returns:
        +
        the Summary Factory class of type S
        +
        +
      • +
      + + + +
        +
      • +

        getTheta

        +
        public double getTheta()
        +
        Gets the value of theta as a double between zero and one
        +
        +
        Returns:
        +
        the value of theta as a double
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public abstract byte[] toByteArray()
        +
        This is to serialize a sketch instance to a byte array. + +

        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.

        +
        +
        Returns:
        +
        serialized representation of the sketch
        +
        +
      • +
      + + + +
        +
      • +

        iterator

        +
        public abstract TupleSketchIterator<S> iterator()
        +
        Returns a SketchIterator
        +
        +
        Returns:
        +
        a SketchIterator
        +
        +
      • +
      + + + +
        +
      • +

        getThetaLong

        +
        public long getThetaLong()
        +
        Returns Theta as a long
        +
        +
        Returns:
        +
        Theta as a long
        +
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/Sketches.html b/docs/5.0.2/org/apache/datasketches/tuple/Sketches.html new file mode 100644 index 000000000..0fc82f286 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/Sketches.html @@ -0,0 +1,374 @@ + + + + + +Sketches (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Sketches

+
+
+ +
+
    +
  • +
    +
    public final class Sketches
    +extends Object
    +
    Convenient static methods to instantiate generic tuple sketches.
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Sketches

        +
        public Sketches()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        createEmptySketch

        +
        public static <S extends SummarySketch<S> createEmptySketch()
        +
        +
        Type Parameters:
        +
        S - Type of Summary
        +
        Returns:
        +
        an empty instance of Sketch
        +
        +
      • +
      + + + +
        +
      • +

        heapifySketch

        +
        public static <S extends SummarySketch<S> heapifySketch​(org.apache.datasketches.memory.Memory mem,
        +                                                          SummaryDeserializer<S> deserializer)
        +
        Instantiate a Sketch from a given Memory.
        +
        +
        Type Parameters:
        +
        S - Type of Summary
        +
        Parameters:
        +
        mem - Memory object representing a Sketch
        +
        deserializer - instance of SummaryDeserializer
        +
        Returns:
        +
        Sketch created from its Memory representation
        +
        +
      • +
      + + + +
        +
      • +

        heapifyUpdatableSketch

        +
        public static <U,​S extends UpdatableSummary<U>> UpdatableSketch<U,​S> heapifyUpdatableSketch​(org.apache.datasketches.memory.Memory mem,
        +                                                                                                        SummaryDeserializer<S> deserializer,
        +                                                                                                        SummaryFactory<S> summaryFactory)
        +
        Instantiate UpdatableSketch from a given Memory
        +
        +
        Type Parameters:
        +
        U - Type of update value
        +
        S - Type of Summary
        +
        Parameters:
        +
        mem - Memory object representing a Sketch
        +
        deserializer - instance of SummaryDeserializer
        +
        summaryFactory - instance of SummaryFactory
        +
        Returns:
        +
        Sketch created from its Memory representation
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/Summary.html b/docs/5.0.2/org/apache/datasketches/tuple/Summary.html new file mode 100644 index 000000000..fd23fed46 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/Summary.html @@ -0,0 +1,293 @@ + + + + + +Summary (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface Summary

+
+
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        copy

        +
        Summary copy()
        +
        Deep copy. + +

        Caution: This must implement a deep copy.

        +
        +
        Returns:
        +
        deep copy of the Summary
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        byte[] toByteArray()
        +
        This is to serialize a Summary instance to a byte array. + +

        The user should encode in the byte array its total size, which is used during + deserialization, especially if the Summary has variable sized elements.

        +
        +
        Returns:
        +
        serialized representation of the Summary
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/SummaryDeserializer.html b/docs/5.0.2/org/apache/datasketches/tuple/SummaryDeserializer.html new file mode 100644 index 000000000..b9424158c --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/SummaryDeserializer.html @@ -0,0 +1,274 @@ + + + + + +SummaryDeserializer (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface SummaryDeserializer<S extends Summary>

+
+
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        heapifySummary

        +
        DeserializeResult<S> heapifySummary​(org.apache.datasketches.memory.Memory mem)
        +
        This is to create an instance of a Summary given a serialized representation. + The user may assume that the start of the given Memory is the correct place to start + deserializing. However, the user must be able to determine the number of bytes required to + deserialize the summary as the capacity of the given Memory may + include multiple such summaries and may be much larger than required for a single summary.
        +
        +
        Parameters:
        +
        mem - Memory object with serialized representation of a Summary
        +
        Returns:
        +
        DeserializedResult object, which contains a Summary object and number of bytes read + from the Memory
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/SummaryFactory.html b/docs/5.0.2/org/apache/datasketches/tuple/SummaryFactory.html new file mode 100644 index 000000000..d21114564 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/SummaryFactory.html @@ -0,0 +1,264 @@ + + + + + +SummaryFactory (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface SummaryFactory<S extends Summary>

+
+
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        newSummary

        +
        S newSummary()
        +
        +
        Returns:
        +
        new instance of Summary
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/SummarySetOperations.html b/docs/5.0.2/org/apache/datasketches/tuple/SummarySetOperations.html new file mode 100644 index 000000000..032dc31c0 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/SummarySetOperations.html @@ -0,0 +1,312 @@ + + + + + +SummarySetOperations (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface SummarySetOperations<S extends Summary>

+
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethodDescription
      Sintersection​(S a, + S b) +
      This is called by the intersection operator when both sketches have the same hash value.
      +
      Sunion​(S a, + S b) +
      This is called by the union operator when both sketches have the same hash value.
      +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        union

        +
        S union​(S a,
        +        S b)
        +
        This is called by the union operator when both sketches have the same hash value. + +

        Caution: Do not modify the input Summary objects. Also do not return them directly, + unless they are immutable (most Summary objects are not). For mutable Summary objects, it is + important to create a new Summary object with the correct contents to be returned. Do not + return null summaries.

        +
        +
        Parameters:
        +
        a - Summary from sketch A
        +
        b - Summary from sketch B
        +
        Returns:
        +
        union of Summary A and Summary B
        +
        +
      • +
      + + + + + +
        +
      • +

        intersection

        +
        S intersection​(S a,
        +               S b)
        +
        This is called by the intersection operator when both sketches have the same hash value. + +

        Caution: Do not modify the input Summary objects. Also do not return them directly, + unless they are immutable (most Summary objects are not). For mutable Summary objects, it is + important to create a new Summary object with the correct contents to be returned. Do not + return null summaries.

        +
        +
        Parameters:
        +
        a - Summary from sketch A
        +
        b - Summary from sketch B
        +
        Returns:
        +
        intersection of Summary A and Summary B
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/TupleSketchIterator.html b/docs/5.0.2/org/apache/datasketches/tuple/TupleSketchIterator.html new file mode 100644 index 000000000..7462af431 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/TupleSketchIterator.html @@ -0,0 +1,330 @@ + + + + + +TupleSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class TupleSketchIterator<S extends Summary>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.TupleSketchIterator<S>
    • +
    +
  • +
+
+
    +
  • +
    +
    Type Parameters:
    +
    S - Type of Summary
    +
    +
    +
    public class TupleSketchIterator<S extends Summary>
    +extends Object
    +
    Iterator over a generic tuple sketch
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        next

        +
        public boolean next()
        +
        Advancing the iterator and checking existence of the next entry + is combined here for efficiency. This results in an undefined + state of the iterator before the first call of this method.
        +
        +
        Returns:
        +
        true if the next element exists
        +
        +
      • +
      + + + +
        +
      • +

        getHash

        +
        public long getHash()
        +
        Gets the hash from the current entry in the sketch, which is a hash + of the original key passed to update(). The original keys are not + retained. Don't call this before calling next() for the first time + or after getting false from next().
        +
        +
        Returns:
        +
        hash from the current entry
        +
        +
      • +
      + + + +
        +
      • +

        getSummary

        +
        public S getSummary()
        +
        Gets a Summary object from the current entry in the sketch. + Don't call this before calling next() for the first time + or after getting false from next().
        +
        +
        Returns:
        +
        Summary object for the current entry (this is not a copy!)
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/Union.html b/docs/5.0.2/org/apache/datasketches/tuple/Union.html new file mode 100644 index 000000000..5494c57c9 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/Union.html @@ -0,0 +1,512 @@ + + + + + +Union (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Union<S extends Summary>

+
+
+ +
+
    +
  • +
    +
    Type Parameters:
    +
    S - Type of Summary
    +
    +
    +
    public class Union<S extends Summary>
    +extends Object
    +
    Compute the union of two or more generic tuple sketches or generic tuple sketches combined with + theta sketches. A new instance represents an empty set.
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Union​(int nomEntries, + SummarySetOperations<S> summarySetOps) +
      Creates new Union instance.
      +
      Union​(SummarySetOperations<S> summarySetOps) +
      Creates new Union instance with instructions on how to process two summaries that + overlap.
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      CompactSketch<S>getResult() +
      Gets the result of a sequence of stateful union operations as an unordered CompactSketch
      +
      CompactSketch<S>getResult​(boolean reset) +
      Gets the result of a sequence of stateful union operations as an unordered CompactSketch.
      +
      voidreset() +
      Resets the internal set to the initial state, which represents an empty set.
      +
      voidunion​(Sketch thetaSketch, + S summary) +
      Performs a stateful union of the internal set with the given thetaSketch by combining entries + using the hashes from the theta sketch and summary values from the given summary.
      +
      voidunion​(Sketch<S> tupleSketch) +
      Performs a stateful union of the internal set with the given tupleSketch.
      +
      CompactSketch<S>union​(Sketch<S> tupleSketch, + Sketch thetaSketch, + S summary) +
      Perform a stateless, pair-wise union operation between a tupleSketch and a thetaSketch.
      +
      CompactSketch<S>union​(Sketch<S> tupleSketchA, + Sketch<S> tupleSketchB) +
      Perform a stateless, pair-wise union operation between two tuple sketches.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Union

        +
        public Union​(SummarySetOperations<S> summarySetOps)
        +
        Creates new Union instance with instructions on how to process two summaries that + overlap. This will have the default nominal entries (K).
        +
        +
        Parameters:
        +
        summarySetOps - instance of SummarySetOperations
        +
        +
      • +
      + + + +
        +
      • +

        Union

        +
        public Union​(int nomEntries,
        +             SummarySetOperations<S> summarySetOps)
        +
        Creates new Union instance.
        +
        +
        Parameters:
        +
        nomEntries - nominal entries (K). Forced to the nearest power of 2 greater than + given value.
        +
        summarySetOps - instance of SummarySetOperations
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        union

        +
        public CompactSketch<S> union​(Sketch<S> tupleSketchA,
        +                              Sketch<S> tupleSketchB)
        +
        Perform a stateless, pair-wise union operation between two tuple sketches. + The returned sketch will be cut back to the smaller of the two k values if required. + +

        Nulls and empty sketches are ignored.

        +
        +
        Parameters:
        +
        tupleSketchA - The first argument
        +
        tupleSketchB - The second argument
        +
        Returns:
        +
        the result ordered CompactSketch on the heap.
        +
        +
      • +
      + + + + + +
        +
      • +

        union

        +
        public CompactSketch<S> union​(Sketch<S> tupleSketch,
        +                              Sketch thetaSketch,
        +                              S summary)
        +
        Perform a stateless, pair-wise union operation between a tupleSketch and a thetaSketch. + The returned sketch will be cut back to the smaller of the two k values if required. + +

        Nulls and empty sketches are ignored.

        +
        +
        Parameters:
        +
        tupleSketch - The first argument
        +
        thetaSketch - The second argument
        +
        summary - the given proxy summary for the theta sketch, which doesn't have one. + This may not be null.
        +
        Returns:
        +
        the result ordered CompactSketch on the heap.
        +
        +
      • +
      + + + +
        +
      • +

        union

        +
        public void union​(Sketch<S> tupleSketch)
        +
        Performs a stateful union of the internal set with the given tupleSketch.
        +
        +
        Parameters:
        +
        tupleSketch - input tuple sketch to merge with the internal set. + +

        Nulls and empty sketches are ignored.

        +
        +
      • +
      + + + + + +
        +
      • +

        union

        +
        public void union​(Sketch thetaSketch,
        +                  S summary)
        +
        Performs a stateful union of the internal set with the given thetaSketch by combining entries + using the hashes from the theta sketch and summary values from the given summary.
        +
        +
        Parameters:
        +
        thetaSketch - the given theta sketch input. If null or empty, it is ignored.
        +
        summary - the given proxy summary for the theta sketch, which doesn't have one. This may + not be null.
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public CompactSketch<S> getResult()
        +
        Gets the result of a sequence of stateful union operations as an unordered CompactSketch
        +
        +
        Returns:
        +
        result of the stateful unions so far. The state of this operation is not reset after the + result is returned.
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public CompactSketch<S> getResult​(boolean reset)
        +
        Gets the result of a sequence of stateful union operations as an unordered CompactSketch.
        +
        +
        Parameters:
        +
        reset - If true, clears this operator to the empty state after this result is + returned. Set this to false if you wish to obtain an intermediate result.
        +
        Returns:
        +
        result of the stateful union
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Resets the internal set to the initial state, which represents an empty set. This is only useful + after sequences of stateful union operations.
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/UpdatableSketch.html b/docs/5.0.2/org/apache/datasketches/tuple/UpdatableSketch.html new file mode 100644 index 000000000..28e81c689 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/UpdatableSketch.html @@ -0,0 +1,879 @@ + + + + + +UpdatableSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class UpdatableSketch<U,​S extends UpdatableSummary<U>>

+
+
+ +
+
    +
  • +
    +
    Type Parameters:
    +
    U - Type of the value, which is passed to update method of a Summary
    +
    S - Type of the UpdatableSummary<U>
    +
    +
    +
    Direct Known Subclasses:
    +
    ArrayOfStringsSketch, DoubleSketch, IntegerSketch
    +
    +
    +
    public class UpdatableSketch<U,​S extends UpdatableSummary<U>>
    +extends Sketch<S>
    +
    An extension of QuickSelectSketch<S>, which can be updated with many types of keys. + Summary objects are created using a user-defined SummaryFactory class, + which should allow very flexible parameterization if needed. + Keys are presented to a sketch along with values of a user-defined + update type U. When an entry is inserted into a sketch or a duplicate key is + presented to a sketch then summary.update(U value) method will be called. So + any kind of user-defined accumulation is possible. Summaries also must know + how to copy themselves. Also union and intersection of summaries can be + implemented in a sub-class of SummarySetOperations, which will be used in + case Union or Intersection of two instances of Tuple Sketch is needed
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        UpdatableSketch

        +
        public UpdatableSketch​(int nomEntries,
        +                       int lgResizeFactor,
        +                       float samplingProbability,
        +                       SummaryFactory<S> summaryFactory)
        +
        This is to create a new instance of an UpdatableQuickSelectSketch.
        +
        +
        Parameters:
        +
        nomEntries - Nominal number of entries. Forced to the nearest power of 2 greater than + or equal to the given value.
        +
        lgResizeFactor - log2(resizeFactor) - value from 0 to 3: +
        + 0 - no resizing (max size allocated),
        + 1 - double internal hash table each time it reaches a threshold
        + 2 - grow four times
        + 3 - grow eight times (default)
        + 
        +
        samplingProbability - See Sampling Probability
        +
        summaryFactory - An instance of a SummaryFactory.
        +
        +
      • +
      + + + +
        +
      • +

        UpdatableSketch

        +
        @Deprecated
        +public UpdatableSketch​(org.apache.datasketches.memory.Memory srcMem,
        +                       SummaryDeserializer<S> deserializer,
        +                       SummaryFactory<S> summaryFactory)
        +
        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.
        +
        +
        This is to create an instance of a sketch given a serialized form
        +
        +
        Parameters:
        +
        srcMem - Memory object with data of a serialized UpdatableSketch
        +
        deserializer - instance of SummaryDeserializer
        +
        summaryFactory - instance of SummaryFactory
        +
        +
      • +
      + + + +
        +
      • +

        UpdatableSketch

        +
        public UpdatableSketch​(UpdatableSketch<U,​S> sketch)
        +
        Copy Constructor
        +
        +
        Parameters:
        +
        sketch - the sketch to copy
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        copy

        +
        public UpdatableSketch<U,​S> copy()
        +
        +
        Returns:
        +
        a deep copy of this sketch
        +
        +
      • +
      + + + + + +
        +
      • +

        update

        +
        public void update​(long key,
        +                   U value)
        +
        Updates this sketch with a long key and U value. + The value is passed to update() method of the Summary object associated with the key
        +
        +
        Parameters:
        +
        key - The given long key
        +
        value - The given U value
        +
        +
      • +
      + + + + + +
        +
      • +

        update

        +
        public void update​(double key,
        +                   U value)
        +
        Updates this sketch with a double key and U value. + The value is passed to update() method of the Summary object associated with the key
        +
        +
        Parameters:
        +
        key - The given double key
        +
        value - The given U value
        +
        +
      • +
      + + + + + +
        +
      • +

        update

        +
        public void update​(String key,
        +                   U value)
        +
        Updates this sketch with a String key and U value. + The value is passed to update() method of the Summary object associated with the key
        +
        +
        Parameters:
        +
        key - The given String key
        +
        value - The given U value
        +
        +
      • +
      + + + + + +
        +
      • +

        update

        +
        public void update​(byte[] key,
        +                   U value)
        +
        Updates this sketch with a byte[] key and U value. + The value is passed to update() method of the Summary object associated with the key
        +
        +
        Parameters:
        +
        key - The given byte[] key
        +
        value - The given U value
        +
        +
      • +
      + + + + + +
        +
      • +

        update

        +
        public void update​(int[] key,
        +                   U value)
        +
        Updates this sketch with a int[] key and U value. + The value is passed to update() method of the Summary object associated with the key
        +
        +
        Parameters:
        +
        key - The given int[] key
        +
        value - The given U value
        +
        +
      • +
      + + + + + +
        +
      • +

        update

        +
        public void update​(long[] key,
        +                   U value)
        +
        Updates this sketch with a long[] key and U value. + The value is passed to update() method of the Summary object associated with the key
        +
        +
        Parameters:
        +
        key - The given long[] key
        +
        value - The given U value
        +
        +
      • +
      + + + +
        +
      • +

        getRetainedEntries

        +
        public int getRetainedEntries()
        +
        +
        Specified by:
        +
        getRetainedEntries in class Sketch<S extends Summary>
        +
        Returns:
        +
        number of retained entries
        +
        +
      • +
      + + + +
        +
      • +

        getCountLessThanThetaLong

        +
        public int getCountLessThanThetaLong​(long thetaLong)
        +
        Description copied from class: Sketch
        +
        Gets the number of hash values less than the given theta expressed as a long.
        +
        +
        Specified by:
        +
        getCountLessThanThetaLong in class Sketch<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

        +
        public ResizeFactor 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

        +
        public CompactSketch<S> compact()
        +
        Converts the current state of the sketch into a compact sketch
        +
        +
        Specified by:
        +
        compact in class Sketch<S extends Summary>
        +
        Returns:
        +
        compact sketch
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        @Deprecated
        +public 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.
        +
        +
        This serializes an UpdatableSketch (QuickSelectSketch).
        +
        +
        Specified by:
        +
        toByteArray in class Sketch<S extends Summary>
        +
        Returns:
        +
        serialized representation of an UpdatableSketch (QuickSelectSketch).
        +
        +
      • +
      + + + + + +
        +
      • +

        insertSummary

        +
        protected void insertSummary​(int index,
        +                             S summary)
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/UpdatableSketchBuilder.html b/docs/5.0.2/org/apache/datasketches/tuple/UpdatableSketchBuilder.html new file mode 100644 index 000000000..c8fe864e6 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/UpdatableSketchBuilder.html @@ -0,0 +1,418 @@ + + + + + +UpdatableSketchBuilder (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class UpdatableSketchBuilder<U,​S extends UpdatableSummary<U>>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.UpdatableSketchBuilder<U,​S>
    • +
    +
  • +
+
+
    +
  • +
    +
    Type Parameters:
    +
    U - Type of update value
    +
    S - Type of Summary
    +
    +
    +
    public class UpdatableSketchBuilder<U,​S extends UpdatableSummary<U>>
    +extends Object
    +
    For building a new generic tuple UpdatableSketch
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        UpdatableSketchBuilder

        +
        public UpdatableSketchBuilder​(SummaryFactory<S> summaryFactory)
        +
        Creates an instance of UpdatableSketchBuilder with default parameters
        +
        +
        Parameters:
        +
        summaryFactory - An instance of SummaryFactory.
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setNominalEntries

        +
        public UpdatableSketchBuilder<U,​S> setNominalEntries​(int nomEntries)
        +
        This is to set the nominal number of entries.
        +
        +
        Parameters:
        +
        nomEntries - Nominal number of entries. Forced to the nearest power of 2 greater than + or equal to the given value.
        +
        Returns:
        +
        this UpdatableSketchBuilder
        +
        +
      • +
      + + + +
        +
      • +

        setResizeFactor

        +
        public UpdatableSketchBuilder<U,​S> setResizeFactor​(ResizeFactor resizeFactor)
        +
        This is to set the resize factor. + Value of X1 means that the maximum capacity is allocated from the start. + Default resize factor is X8.
        +
        +
        Parameters:
        +
        resizeFactor - value of X1, X2, X4 or X8
        +
        Returns:
        +
        this UpdatableSketchBuilder
        +
        +
      • +
      + + + +
        +
      • +

        setSamplingProbability

        +
        public UpdatableSketchBuilder<U,​S> setSamplingProbability​(float samplingProbability)
        +
        This is to set sampling probability. + Default probability is 1.
        +
        +
        Parameters:
        +
        samplingProbability - sampling probability from 0 to 1
        +
        Returns:
        +
        this UpdatableSketchBuilder
        +
        +
      • +
      + + + +
        +
      • +

        build

        +
        public UpdatableSketch<U,​S> build()
        +
        Returns an UpdatableSketch with the current configuration of this Builder.
        +
        +
        Returns:
        +
        an UpdatableSketch
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Resets the Nominal Entries, Resize Factor and Sampling Probability to their default values. + The assignment of U and S remain the same.
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/UpdatableSummary.html b/docs/5.0.2/org/apache/datasketches/tuple/UpdatableSummary.html new file mode 100644 index 000000000..59e369d2d --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/UpdatableSummary.html @@ -0,0 +1,284 @@ + + + + + +UpdatableSummary (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface UpdatableSummary<U>

+
+
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        update

        +
        UpdatableSummary<U> update​(U value)
        +
        This is to provide a method of updating summaries. + This is primarily used internally.
        +
        +
        Parameters:
        +
        value - update value
        +
        Returns:
        +
        this
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/Util.html b/docs/5.0.2/org/apache/datasketches/tuple/Util.html new file mode 100644 index 000000000..28b056b29 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/Util.html @@ -0,0 +1,524 @@ + + + + + +Util (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Util

+
+
+ +
+
    +
  • +
    +
    public final class Util
    +extends Object
    +
    Common utility functions for Tuples
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Util

        +
        public Util()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        doubleToLongArray

        +
        public static final long[] doubleToLongArray​(double value)
        +
        Converts a double to a long[].
        +
        +
        Parameters:
        +
        value - the given double value
        +
        Returns:
        +
        the long array
        +
        +
      • +
      + + + +
        +
      • +

        stringToByteArray

        +
        public static final byte[] stringToByteArray​(String value)
        +
        Converts a String to a UTF_8 byte array. If the given value is either null or empty this + method returns null.
        +
        +
        Parameters:
        +
        value - the given String value
        +
        Returns:
        +
        the UTF_8 byte array
        +
        +
      • +
      + + + +
        +
      • +

        computeSeedHash

        +
        public static short computeSeedHash​(long seed)
        +
        Computes and checks the 16-bit seed hash from the given long seed. + The seed hash may not be zero in order to maintain compatibility with older serialized + versions that did not have this concept.
        +
        +
        Parameters:
        +
        seed - See Update Hash Seed
        +
        Returns:
        +
        the seed hash.
        +
        +
      • +
      + + + +
        +
      • +

        checkSeedHashes

        +
        public static final void checkSeedHashes​(short seedHashA,
        +                                         short seedHashB)
        +
        Checks the two given seed hashes. If they are not equal, this method throws an Exception.
        +
        +
        Parameters:
        +
        seedHashA - given seed hash A
        +
        seedHashB - given seed hash B
        +
        +
      • +
      + + + +
        +
      • +

        getStartingCapacity

        +
        public static int getStartingCapacity​(int nomEntries,
        +                                      int lgResizeFactor)
        +
        Gets the starting capacity of a new sketch given the Nominal Entries and the log Resize Factor.
        +
        +
        Parameters:
        +
        nomEntries - the given Nominal Entries
        +
        lgResizeFactor - the given log Resize Factor
        +
        Returns:
        +
        the starting capacity
        +
        +
      • +
      + + + +
        +
      • +

        stringConcat

        +
        public static String stringConcat​(String[] strArr)
        +
        Concatenate array of Strings to a single String.
        +
        +
        Parameters:
        +
        strArr - the given String array
        +
        Returns:
        +
        the concatenated String
        +
        +
      • +
      + + + +
        +
      • +

        stringHash

        +
        public static long stringHash​(String s)
        +
        +
        Parameters:
        +
        s - the string to hash
        +
        Returns:
        +
        the hash of the string
        +
        +
      • +
      + + + +
        +
      • +

        stringArrHash

        +
        public static long stringArrHash​(String[] strArray)
        +
        +
        Parameters:
        +
        strArray - array of Strings
        +
        Returns:
        +
        long hash of concatenated strings.
        +
        +
      • +
      + + + + + +
        +
      • +

        copySummaryArray

        +
        public static <S extends Summary> S[] copySummaryArray​(S[] summaryArr)
        +
        Will copy compact summary arrays as well as hashed summary tables (with nulls).
        +
        +
        Type Parameters:
        +
        S - type of summary
        +
        Parameters:
        +
        summaryArr - the given summary array or table
        +
        Returns:
        +
        the copy
        +
        +
      • +
      + + + + + +
        +
      • +

        newSummaryArray

        +
        public static <S extends Summary> S[] newSummaryArray​(S[] summaryArr,
        +                                                      int length)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/adouble/DoubleSketch.html b/docs/5.0.2/org/apache/datasketches/tuple/adouble/DoubleSketch.html new file mode 100644 index 000000000..89fa01e3a --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/adouble/DoubleSketch.html @@ -0,0 +1,753 @@ + + + + + +DoubleSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class DoubleSketch

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DoubleSketch

        +
        public DoubleSketch​(int lgK,
        +                    DoubleSummary.Mode mode)
        +
        Constructs this sketch with given lgK.
        +
        +
        Parameters:
        +
        lgK - Log_base2 of Nominal Entries. + See Nominal Entries
        +
        mode - The DoubleSummary mode to be used
        +
        +
      • +
      + + + +
        +
      • +

        DoubleSketch

        +
        public DoubleSketch​(int lgK,
        +                    int lgResizeFactor,
        +                    float samplingProbability,
        +                    DoubleSummary.Mode mode)
        +
        Creates this sketch with the following parameters:
        +
        +
        Parameters:
        +
        lgK - Log_base2 of Nominal Entries.
        +
        lgResizeFactor - log2(resizeFactor) - value from 0 to 3: +
        + 0 - no resizing (max size allocated),
        + 1 - double internal hash table each time it reaches a threshold
        + 2 - grow four times
        + 3 - grow eight times (default)
        + 
        +
        samplingProbability - See Sampling Probability
        +
        mode - The DoubleSummary mode to be used
        +
        +
      • +
      + + + +
        +
      • +

        DoubleSketch

        +
        @Deprecated
        +public DoubleSketch​(org.apache.datasketches.memory.Memory mem,
        +                    DoubleSummary.Mode mode)
        +
        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 DoubleSketch, and + usually with data.
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        mode - The DoubleSummary mode to be used
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        update

        +
        public void update​(String key,
        +                   Double value)
        +
        Description copied from class: UpdatableSketch
        +
        Updates this sketch with a String key and U value. + The value is passed to update() method of the Summary object associated with the key
        +
        +
        Overrides:
        +
        update in class UpdatableSketch<Double,​DoubleSummary>
        +
        Parameters:
        +
        key - The given String key
        +
        value - The given U value
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(long key,
        +                   Double value)
        +
        Description copied from class: UpdatableSketch
        +
        Updates this sketch with a long key and U value. + The value is passed to update() method of the Summary object associated with the key
        +
        +
        Overrides:
        +
        update in class UpdatableSketch<Double,​DoubleSummary>
        +
        Parameters:
        +
        key - The given long key
        +
        value - The given U value
        +
        +
      • +
      + + + +
        +
      • +

        getRetainedEntries

        +
        public int getRetainedEntries()
        +
        +
        Specified by:
        +
        getRetainedEntries in class Sketch<S extends Summary>
        +
        Returns:
        +
        number of retained entries
        +
        +
      • +
      + + + +
        +
      • +

        getCountLessThanThetaLong

        +
        public int getCountLessThanThetaLong​(long thetaLong)
        +
        Description copied from class: Sketch
        +
        Gets the number of hash values less than the given theta expressed as a long.
        +
        +
        Specified by:
        +
        getCountLessThanThetaLong in class Sketch<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

        +
        public ResizeFactor 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

        +
        public CompactSketch<S> compact()
        +
        Converts the current state of the sketch into a compact sketch
        +
        +
        Specified by:
        +
        compact in class Sketch<S extends Summary>
        +
        Returns:
        +
        compact sketch
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        @Deprecated
        +public 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.
        +
        +
        This serializes an UpdatableSketch (QuickSelectSketch).
        +
        +
        Specified by:
        +
        toByteArray in class Sketch<S extends Summary>
        +
        Returns:
        +
        serialized representation of an UpdatableSketch (QuickSelectSketch).
        +
        +
      • +
      + + + + + +
        +
      • +

        insertSummary

        +
        protected void insertSummary​(int index,
        +                             S summary)
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/adouble/DoubleSummary.Mode.html b/docs/5.0.2/org/apache/datasketches/tuple/adouble/DoubleSummary.Mode.html new file mode 100644 index 000000000..c473e1c3a --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/adouble/DoubleSummary.Mode.html @@ -0,0 +1,426 @@ + + + + + +DoubleSummary.Mode (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum DoubleSummary.Mode

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        Sum

        +
        public static final DoubleSummary.Mode Sum
        +
        The aggregation mode is the summation function. +

        New retained value = previous retained value + incoming value

        +
      • +
      + + + +
        +
      • +

        Min

        +
        public static final DoubleSummary.Mode Min
        +
        The aggregation mode is the minimum function. +

        New retained value = min(previous retained value, incoming value)

        +
      • +
      + + + +
        +
      • +

        Max

        +
        public static final DoubleSummary.Mode Max
        +
        The aggregation mode is the maximum function. +

        New retained value = max(previous retained value, incoming value)

        +
      • +
      + + + +
        +
      • +

        AlwaysOne

        +
        public static final DoubleSummary.Mode AlwaysOne
        +
        The aggregation mode is always one. +

        New retained value = 1.0

        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static DoubleSummary.Mode[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (DoubleSummary.Mode c : DoubleSummary.Mode.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static DoubleSummary.Mode valueOf​(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/adouble/DoubleSummary.html b/docs/5.0.2/org/apache/datasketches/tuple/adouble/DoubleSummary.html new file mode 100644 index 000000000..b11e0f9fb --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/adouble/DoubleSummary.html @@ -0,0 +1,456 @@ + + + + + +DoubleSummary (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class DoubleSummary

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.adouble.DoubleSummary
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Summary, UpdatableSummary<Double>
    +
    +
    +
    public final class DoubleSummary
    +extends Object
    +implements UpdatableSummary<Double>
    +
    Summary for generic tuple sketches of type Double. + This summary keeps a double value. On update a predefined operation is performed depending on + the mode. + Supported modes: Sum, Min, Max, AlwaysOne, Increment. The default mode is Sum.
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DoubleSummary

        +
        public DoubleSummary​(DoubleSummary.Mode mode)
        +
        Creates an instance of DoubleSummary with a given mode.
        +
        +
        Parameters:
        +
        mode - update mode
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        update

        +
        public DoubleSummary update​(Double value)
        +
        Description copied from interface: UpdatableSummary
        +
        This is to provide a method of updating summaries. + This is primarily used internally.
        +
        +
        Specified by:
        +
        update in interface UpdatableSummary<Double>
        +
        Parameters:
        +
        value - update value
        +
        Returns:
        +
        this
        +
        +
      • +
      + + + +
        +
      • +

        copy

        +
        public DoubleSummary copy()
        +
        Description copied from interface: Summary
        +
        Deep copy. + +

        Caution: This must implement a deep copy.

        +
        +
        Specified by:
        +
        copy in interface Summary
        +
        Returns:
        +
        deep copy of the Summary
        +
        +
      • +
      + + + +
        +
      • +

        getValue

        +
        public double getValue()
        +
        +
        Returns:
        +
        current value of the DoubleSummary
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray()
        +
        Description copied from interface: Summary
        +
        This is to serialize a Summary instance to a byte array. + +

        The user should encode in the byte array its total size, which is used during + deserialization, especially if the Summary has variable sized elements.

        +
        +
        Specified by:
        +
        toByteArray in interface Summary
        +
        Returns:
        +
        serialized representation of the Summary
        +
        +
      • +
      + + + +
        +
      • +

        fromMemory

        +
        public static DeserializeResult<DoubleSummary> fromMemory​(org.apache.datasketches.memory.Memory mem)
        +
        Creates an instance of the DoubleSummary given a serialized representation
        +
        +
        Parameters:
        +
        mem - Memory object with serialized DoubleSummary
        +
        Returns:
        +
        DeserializedResult object, which contains a DoubleSummary object and number of bytes + read from the Memory
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/adouble/DoubleSummaryDeserializer.html b/docs/5.0.2/org/apache/datasketches/tuple/adouble/DoubleSummaryDeserializer.html new file mode 100644 index 000000000..d0c1e9b5e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/adouble/DoubleSummaryDeserializer.html @@ -0,0 +1,333 @@ + + + + + +DoubleSummaryDeserializer (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class DoubleSummaryDeserializer

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.adouble.DoubleSummaryDeserializer
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DoubleSummaryDeserializer

        +
        public DoubleSummaryDeserializer()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        heapifySummary

        +
        public DeserializeResult<DoubleSummary> heapifySummary​(org.apache.datasketches.memory.Memory mem)
        +
        Description copied from interface: SummaryDeserializer
        +
        This is to create an instance of a Summary given a serialized representation. + The user may assume that the start of the given Memory is the correct place to start + deserializing. However, the user must be able to determine the number of bytes required to + deserialize the summary as the capacity of the given Memory may + include multiple such summaries and may be much larger than required for a single summary.
        +
        +
        Specified by:
        +
        heapifySummary in interface SummaryDeserializer<DoubleSummary>
        +
        Parameters:
        +
        mem - Memory object with serialized representation of a Summary
        +
        Returns:
        +
        DeserializedResult object, which contains a Summary object and number of bytes read + from the Memory
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/adouble/DoubleSummaryFactory.html b/docs/5.0.2/org/apache/datasketches/tuple/adouble/DoubleSummaryFactory.html new file mode 100644 index 000000000..1634930e2 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/adouble/DoubleSummaryFactory.html @@ -0,0 +1,330 @@ + + + + + +DoubleSummaryFactory (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class DoubleSummaryFactory

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.adouble.DoubleSummaryFactory
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DoubleSummaryFactory

        +
        public DoubleSummaryFactory​(DoubleSummary.Mode summaryMode)
        +
        Creates an instance of DoubleSummaryFactory with a given mode
        +
        +
        Parameters:
        +
        summaryMode - summary mode
        +
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/adouble/DoubleSummarySetOperations.html b/docs/5.0.2/org/apache/datasketches/tuple/adouble/DoubleSummarySetOperations.html new file mode 100644 index 000000000..8cf411732 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/adouble/DoubleSummarySetOperations.html @@ -0,0 +1,417 @@ + + + + + +DoubleSummarySetOperations (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class DoubleSummarySetOperations

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.adouble.DoubleSummarySetOperations
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DoubleSummarySetOperations

        +
        public DoubleSummarySetOperations()
        +
        Creates an instance with default mode of sum for both union and intersection. + This exists for backward compatibility.
        +
      • +
      + + + +
        +
      • +

        DoubleSummarySetOperations

        +
        public DoubleSummarySetOperations​(DoubleSummary.Mode summaryMode)
        +
        Creates an instance given a DoubleSummary update mode where the mode is the same for both + union and intersection. This exists for backward compatibility.
        +
        +
        Parameters:
        +
        summaryMode - DoubleSummary update mode.
        +
        +
      • +
      + + + +
        +
      • +

        DoubleSummarySetOperations

        +
        public DoubleSummarySetOperations​(DoubleSummary.Mode unionSummaryMode,
        +                                  DoubleSummary.Mode intersectionSummaryMode)
        +
        Creates an instance with two modes.
        +
        +
        Parameters:
        +
        unionSummaryMode - for unions
        +
        intersectionSummaryMode - for intersections
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        union

        +
        public DoubleSummary union​(DoubleSummary a,
        +                           DoubleSummary b)
        +
        Description copied from interface: SummarySetOperations
        +
        This is called by the union operator when both sketches have the same hash value. + +

        Caution: Do not modify the input Summary objects. Also do not return them directly, + unless they are immutable (most Summary objects are not). For mutable Summary objects, it is + important to create a new Summary object with the correct contents to be returned. Do not + return null summaries.

        +
        +
        Specified by:
        +
        union in interface SummarySetOperations<DoubleSummary>
        +
        Parameters:
        +
        a - Summary from sketch A
        +
        b - Summary from sketch B
        +
        Returns:
        +
        union of Summary A and Summary B
        +
        +
      • +
      + + + +
        +
      • +

        intersection

        +
        public DoubleSummary intersection​(DoubleSummary a,
        +                                  DoubleSummary b)
        +
        Description copied from interface: SummarySetOperations
        +
        This is called by the intersection operator when both sketches have the same hash value. + +

        Caution: Do not modify the input Summary objects. Also do not return them directly, + unless they are immutable (most Summary objects are not). For mutable Summary objects, it is + important to create a new Summary object with the correct contents to be returned. Do not + return null summaries.

        +
        +
        Specified by:
        +
        intersection in interface SummarySetOperations<DoubleSummary>
        +
        Parameters:
        +
        a - Summary from sketch A
        +
        b - Summary from sketch B
        +
        Returns:
        +
        intersection of Summary A and Summary B
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/adouble/class-use/DoubleSketch.html b/docs/5.0.2/org/apache/datasketches/tuple/adouble/class-use/DoubleSketch.html new file mode 100644 index 000000000..0aea3e109 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/adouble/class-use/DoubleSketch.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.adouble.DoubleSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.adouble.DoubleSketch

+
+
No usage of org.apache.datasketches.tuple.adouble.DoubleSketch
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/adouble/class-use/DoubleSummary.Mode.html b/docs/5.0.2/org/apache/datasketches/tuple/adouble/class-use/DoubleSummary.Mode.html new file mode 100644 index 000000000..e7f6b2a8f --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/adouble/class-use/DoubleSummary.Mode.html @@ -0,0 +1,265 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.adouble.DoubleSummary.Mode (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.adouble.DoubleSummary.Mode

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/adouble/class-use/DoubleSummary.html b/docs/5.0.2/org/apache/datasketches/tuple/adouble/class-use/DoubleSummary.html new file mode 100644 index 000000000..bc14cc3cf --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/adouble/class-use/DoubleSummary.html @@ -0,0 +1,261 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.adouble.DoubleSummary (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.adouble.DoubleSummary

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/adouble/class-use/DoubleSummaryDeserializer.html b/docs/5.0.2/org/apache/datasketches/tuple/adouble/class-use/DoubleSummaryDeserializer.html new file mode 100644 index 000000000..9551c203d --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/adouble/class-use/DoubleSummaryDeserializer.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.adouble.DoubleSummaryDeserializer (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.adouble.DoubleSummaryDeserializer

+
+
No usage of org.apache.datasketches.tuple.adouble.DoubleSummaryDeserializer
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/adouble/class-use/DoubleSummaryFactory.html b/docs/5.0.2/org/apache/datasketches/tuple/adouble/class-use/DoubleSummaryFactory.html new file mode 100644 index 000000000..68866c4b0 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/adouble/class-use/DoubleSummaryFactory.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.adouble.DoubleSummaryFactory (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.adouble.DoubleSummaryFactory

+
+
No usage of org.apache.datasketches.tuple.adouble.DoubleSummaryFactory
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/adouble/class-use/DoubleSummarySetOperations.html b/docs/5.0.2/org/apache/datasketches/tuple/adouble/class-use/DoubleSummarySetOperations.html new file mode 100644 index 000000000..a23994945 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/adouble/class-use/DoubleSummarySetOperations.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.adouble.DoubleSummarySetOperations (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.adouble.DoubleSummarySetOperations

+
+
No usage of org.apache.datasketches.tuple.adouble.DoubleSummarySetOperations
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/adouble/package-summary.html b/docs/5.0.2/org/apache/datasketches/tuple/adouble/package-summary.html new file mode 100644 index 000000000..bd60cd48b --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/adouble/package-summary.html @@ -0,0 +1,212 @@ + + + + + +org.apache.datasketches.tuple.adouble (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches.tuple.adouble

+
+
+
+ + +
This package is for a generic implementation of the Tuple sketch for single Double value.
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/adouble/package-tree.html b/docs/5.0.2/org/apache/datasketches/tuple/adouble/package-tree.html new file mode 100644 index 000000000..872bf999b --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/adouble/package-tree.html @@ -0,0 +1,190 @@ + + + + + +org.apache.datasketches.tuple.adouble Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches.tuple.adouble

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+

Enum Hierarchy

+ +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/adouble/package-use.html b/docs/5.0.2/org/apache/datasketches/tuple/adouble/package-use.html new file mode 100644 index 000000000..3cd6ef4c0 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/adouble/package-use.html @@ -0,0 +1,194 @@ + + + + + +Uses of Package org.apache.datasketches.tuple.adouble (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches.tuple.adouble

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/aninteger/IntegerSketch.html b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/IntegerSketch.html new file mode 100644 index 000000000..e98c74163 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/IntegerSketch.html @@ -0,0 +1,753 @@ + + + + + +IntegerSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class IntegerSketch

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        IntegerSketch

        +
        public IntegerSketch​(int lgK,
        +                     IntegerSummary.Mode mode)
        +
        Constructs this sketch with given lgK.
        +
        +
        Parameters:
        +
        lgK - Log_base2 of Nominal Entries. + See Nominal Entries
        +
        mode - The IntegerSummary mode to be used
        +
        +
      • +
      + + + +
        +
      • +

        IntegerSketch

        +
        public IntegerSketch​(int lgK,
        +                     int lgResizeFactor,
        +                     float samplingProbability,
        +                     IntegerSummary.Mode mode)
        +
        Creates this sketch with the following parameters:
        +
        +
        Parameters:
        +
        lgK - Log_base2 of Nominal Entries.
        +
        lgResizeFactor - log2(resizeFactor) - value from 0 to 3: +
        + 0 - no resizing (max size allocated),
        + 1 - double internal hash table each time it reaches a threshold
        + 2 - grow four times
        + 3 - grow eight times (default)
        + 
        +
        samplingProbability - See Sampling Probability
        +
        mode - The IntegerSummary mode to be used
        +
        +
      • +
      + + + +
        +
      • +

        IntegerSketch

        +
        @Deprecated
        +public IntegerSketch​(org.apache.datasketches.memory.Memory mem,
        +                     IntegerSummary.Mode mode)
        +
        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 IntegerSketch, and + usually with data.
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        mode - The IntegerSummary mode to be used
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        update

        +
        public void update​(String key,
        +                   Integer value)
        +
        Description copied from class: UpdatableSketch
        +
        Updates this sketch with a String key and U value. + The value is passed to update() method of the Summary object associated with the key
        +
        +
        Overrides:
        +
        update in class UpdatableSketch<Integer,​IntegerSummary>
        +
        Parameters:
        +
        key - The given String key
        +
        value - The given U value
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(long key,
        +                   Integer value)
        +
        Description copied from class: UpdatableSketch
        +
        Updates this sketch with a long key and U value. + The value is passed to update() method of the Summary object associated with the key
        +
        +
        Overrides:
        +
        update in class UpdatableSketch<Integer,​IntegerSummary>
        +
        Parameters:
        +
        key - The given long key
        +
        value - The given U value
        +
        +
      • +
      + + + +
        +
      • +

        getRetainedEntries

        +
        public int getRetainedEntries()
        +
        +
        Specified by:
        +
        getRetainedEntries in class Sketch<S extends Summary>
        +
        Returns:
        +
        number of retained entries
        +
        +
      • +
      + + + +
        +
      • +

        getCountLessThanThetaLong

        +
        public int getCountLessThanThetaLong​(long thetaLong)
        +
        Description copied from class: Sketch
        +
        Gets the number of hash values less than the given theta expressed as a long.
        +
        +
        Specified by:
        +
        getCountLessThanThetaLong in class Sketch<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

        +
        public ResizeFactor 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

        +
        public CompactSketch<S> compact()
        +
        Converts the current state of the sketch into a compact sketch
        +
        +
        Specified by:
        +
        compact in class Sketch<S extends Summary>
        +
        Returns:
        +
        compact sketch
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        @Deprecated
        +public 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.
        +
        +
        This serializes an UpdatableSketch (QuickSelectSketch).
        +
        +
        Specified by:
        +
        toByteArray in class Sketch<S extends Summary>
        +
        Returns:
        +
        serialized representation of an UpdatableSketch (QuickSelectSketch).
        +
        +
      • +
      + + + + + +
        +
      • +

        insertSummary

        +
        protected void insertSummary​(int index,
        +                             S summary)
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/aninteger/IntegerSummary.Mode.html b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/IntegerSummary.Mode.html new file mode 100644 index 000000000..e9e69a76b --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/IntegerSummary.Mode.html @@ -0,0 +1,426 @@ + + + + + +IntegerSummary.Mode (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum IntegerSummary.Mode

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        Sum

        +
        public static final IntegerSummary.Mode Sum
        +
        The aggregation mode is the summation function. +

        New retained value = previous retained value + incoming value

        +
      • +
      + + + +
        +
      • +

        Min

        +
        public static final IntegerSummary.Mode Min
        +
        The aggregation mode is the minimum function. +

        New retained value = min(previous retained value, incoming value)

        +
      • +
      + + + +
        +
      • +

        Max

        +
        public static final IntegerSummary.Mode Max
        +
        The aggregation mode is the maximum function. +

        New retained value = max(previous retained value, incoming value)

        +
      • +
      + + + +
        +
      • +

        AlwaysOne

        +
        public static final IntegerSummary.Mode AlwaysOne
        +
        The aggregation mode is always one. +

        New retained value = 1

        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static IntegerSummary.Mode[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (IntegerSummary.Mode c : IntegerSummary.Mode.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static IntegerSummary.Mode valueOf​(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/aninteger/IntegerSummary.html b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/IntegerSummary.html new file mode 100644 index 000000000..77d22e4fb --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/IntegerSummary.html @@ -0,0 +1,456 @@ + + + + + +IntegerSummary (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class IntegerSummary

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.aninteger.IntegerSummary
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Summary, UpdatableSummary<Integer>
    +
    +
    +
    public class IntegerSummary
    +extends Object
    +implements UpdatableSummary<Integer>
    +
    Summary for generic tuple sketches of type Integer. + This summary keeps an Integer value. On update a predefined operation is performed depending on + the mode. + Supported modes: Sum, Min, Max, AlwaysOne, Increment. The default mode is Sum.
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        IntegerSummary

        +
        public IntegerSummary​(IntegerSummary.Mode mode)
        +
        Creates an instance of IntegerSummary with a given mode.
        +
        +
        Parameters:
        +
        mode - update mode. This should not be called by a user.
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        copy

        +
        public IntegerSummary copy()
        +
        Description copied from interface: Summary
        +
        Deep copy. + +

        Caution: This must implement a deep copy.

        +
        +
        Specified by:
        +
        copy in interface Summary
        +
        Returns:
        +
        deep copy of the Summary
        +
        +
      • +
      + + + +
        +
      • +

        getValue

        +
        public int getValue()
        +
        +
        Returns:
        +
        current value of the IntegerSummary
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray()
        +
        Description copied from interface: Summary
        +
        This is to serialize a Summary instance to a byte array. + +

        The user should encode in the byte array its total size, which is used during + deserialization, especially if the Summary has variable sized elements.

        +
        +
        Specified by:
        +
        toByteArray in interface Summary
        +
        Returns:
        +
        serialized representation of the Summary
        +
        +
      • +
      + + + +
        +
      • +

        fromMemory

        +
        public static DeserializeResult<IntegerSummary> fromMemory​(org.apache.datasketches.memory.Memory mem)
        +
        Creates an instance of the IntegerSummary given a serialized representation
        +
        +
        Parameters:
        +
        mem - Memory object with serialized IntegerSummary
        +
        Returns:
        +
        DeserializedResult object, which contains a IntegerSummary object and number of bytes + read from the Memory
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/aninteger/IntegerSummaryDeserializer.html b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/IntegerSummaryDeserializer.html new file mode 100644 index 000000000..95245d254 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/IntegerSummaryDeserializer.html @@ -0,0 +1,333 @@ + + + + + +IntegerSummaryDeserializer (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class IntegerSummaryDeserializer

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.aninteger.IntegerSummaryDeserializer
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        IntegerSummaryDeserializer

        +
        public IntegerSummaryDeserializer()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        heapifySummary

        +
        public DeserializeResult<IntegerSummary> heapifySummary​(org.apache.datasketches.memory.Memory mem)
        +
        Description copied from interface: SummaryDeserializer
        +
        This is to create an instance of a Summary given a serialized representation. + The user may assume that the start of the given Memory is the correct place to start + deserializing. However, the user must be able to determine the number of bytes required to + deserialize the summary as the capacity of the given Memory may + include multiple such summaries and may be much larger than required for a single summary.
        +
        +
        Specified by:
        +
        heapifySummary in interface SummaryDeserializer<IntegerSummary>
        +
        Parameters:
        +
        mem - Memory object with serialized representation of a Summary
        +
        Returns:
        +
        DeserializedResult object, which contains a Summary object and number of bytes read + from the Memory
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/aninteger/IntegerSummaryFactory.html b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/IntegerSummaryFactory.html new file mode 100644 index 000000000..dede362f6 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/IntegerSummaryFactory.html @@ -0,0 +1,330 @@ + + + + + +IntegerSummaryFactory (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class IntegerSummaryFactory

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.aninteger.IntegerSummaryFactory
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        IntegerSummaryFactory

        +
        public IntegerSummaryFactory​(IntegerSummary.Mode summaryMode)
        +
        Creates an instance of IntegerSummaryFactory with a given mode
        +
        +
        Parameters:
        +
        summaryMode - summary mode
        +
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/aninteger/IntegerSummarySetOperations.html b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/IntegerSummarySetOperations.html new file mode 100644 index 000000000..7284b7fe4 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/IntegerSummarySetOperations.html @@ -0,0 +1,382 @@ + + + + + +IntegerSummarySetOperations (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class IntegerSummarySetOperations

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.aninteger.IntegerSummarySetOperations
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        IntegerSummarySetOperations

        +
        public IntegerSummarySetOperations​(IntegerSummary.Mode unionSummaryMode,
        +                                   IntegerSummary.Mode intersectionSummaryMode)
        +
        Creates a new instance with two modes
        +
        +
        Parameters:
        +
        unionSummaryMode - for unions
        +
        intersectionSummaryMode - for intersections
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        union

        +
        public IntegerSummary union​(IntegerSummary a,
        +                            IntegerSummary b)
        +
        Description copied from interface: SummarySetOperations
        +
        This is called by the union operator when both sketches have the same hash value. + +

        Caution: Do not modify the input Summary objects. Also do not return them directly, + unless they are immutable (most Summary objects are not). For mutable Summary objects, it is + important to create a new Summary object with the correct contents to be returned. Do not + return null summaries.

        +
        +
        Specified by:
        +
        union in interface SummarySetOperations<IntegerSummary>
        +
        Parameters:
        +
        a - Summary from sketch A
        +
        b - Summary from sketch B
        +
        Returns:
        +
        union of Summary A and Summary B
        +
        +
      • +
      + + + +
        +
      • +

        intersection

        +
        public IntegerSummary intersection​(IntegerSummary a,
        +                                   IntegerSummary b)
        +
        Description copied from interface: SummarySetOperations
        +
        This is called by the intersection operator when both sketches have the same hash value. + +

        Caution: Do not modify the input Summary objects. Also do not return them directly, + unless they are immutable (most Summary objects are not). For mutable Summary objects, it is + important to create a new Summary object with the correct contents to be returned. Do not + return null summaries.

        +
        +
        Specified by:
        +
        intersection in interface SummarySetOperations<IntegerSummary>
        +
        Parameters:
        +
        a - Summary from sketch A
        +
        b - Summary from sketch B
        +
        Returns:
        +
        intersection of Summary A and Summary B
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/aninteger/class-use/IntegerSketch.html b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/class-use/IntegerSketch.html new file mode 100644 index 000000000..f87f39761 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/class-use/IntegerSketch.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.aninteger.IntegerSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.aninteger.IntegerSketch

+
+
No usage of org.apache.datasketches.tuple.aninteger.IntegerSketch
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/aninteger/class-use/IntegerSummary.Mode.html b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/class-use/IntegerSummary.Mode.html new file mode 100644 index 000000000..d9708a8e3 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/class-use/IntegerSummary.Mode.html @@ -0,0 +1,258 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.aninteger.IntegerSummary.Mode (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.aninteger.IntegerSummary.Mode

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/aninteger/class-use/IntegerSummary.html b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/class-use/IntegerSummary.html new file mode 100644 index 000000000..0d3524609 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/class-use/IntegerSummary.html @@ -0,0 +1,261 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.aninteger.IntegerSummary (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.aninteger.IntegerSummary

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/aninteger/class-use/IntegerSummaryDeserializer.html b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/class-use/IntegerSummaryDeserializer.html new file mode 100644 index 000000000..fcc6e08eb --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/class-use/IntegerSummaryDeserializer.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.aninteger.IntegerSummaryDeserializer (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.aninteger.IntegerSummaryDeserializer

+
+
No usage of org.apache.datasketches.tuple.aninteger.IntegerSummaryDeserializer
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/aninteger/class-use/IntegerSummaryFactory.html b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/class-use/IntegerSummaryFactory.html new file mode 100644 index 000000000..9a4d53c9d --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/class-use/IntegerSummaryFactory.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.aninteger.IntegerSummaryFactory (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.aninteger.IntegerSummaryFactory

+
+
No usage of org.apache.datasketches.tuple.aninteger.IntegerSummaryFactory
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/aninteger/class-use/IntegerSummarySetOperations.html b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/class-use/IntegerSummarySetOperations.html new file mode 100644 index 000000000..be1ed55b4 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/class-use/IntegerSummarySetOperations.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.aninteger.IntegerSummarySetOperations (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.aninteger.IntegerSummarySetOperations

+
+
No usage of org.apache.datasketches.tuple.aninteger.IntegerSummarySetOperations
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/aninteger/package-summary.html b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/package-summary.html new file mode 100644 index 000000000..f96bdd180 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/package-summary.html @@ -0,0 +1,212 @@ + + + + + +org.apache.datasketches.tuple.aninteger (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches.tuple.aninteger

+
+
+
+ + +
This package is for a generic implementation of the Tuple sketch for single Integer value.
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/aninteger/package-tree.html b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/package-tree.html new file mode 100644 index 000000000..1f4514dd5 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/package-tree.html @@ -0,0 +1,190 @@ + + + + + +org.apache.datasketches.tuple.aninteger Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches.tuple.aninteger

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+

Enum Hierarchy

+ +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/aninteger/package-use.html b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/package-use.html new file mode 100644 index 000000000..76662f1e3 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/aninteger/package-use.html @@ -0,0 +1,194 @@ + + + + + +Uses of Package org.apache.datasketches.tuple.aninteger (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches.tuple.aninteger

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesAnotB.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesAnotB.html new file mode 100644 index 000000000..c608fefaa --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesAnotB.html @@ -0,0 +1,331 @@ + + + + + +ArrayOfDoublesAnotB (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfDoublesAnotB

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesAnotB
    • +
    +
  • +
+
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    ArrayOfDoublesAnotBImpl
    +
    +
    +
    public abstract class ArrayOfDoublesAnotB
    +extends Object
    +
    Computes a set difference of two tuple sketches of type ArrayOfDoubles
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        update

        +
        public abstract void update​(ArrayOfDoublesSketch a,
        +                            ArrayOfDoublesSketch b)
        +
        Perform A-and-not-B set operation on the two given sketches. + A null sketch is interpreted as an empty sketch. + This is not an accumulating update. Calling update() more than once + without calling getResult() will discard the result of previous update(). + Both input sketches must have the same numValues.
        +
        +
        Parameters:
        +
        a - The incoming sketch for the first argument
        +
        b - The incoming sketch for the second argument
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public abstract ArrayOfDoublesCompactSketch getResult()
        +
        Gets the result of this operation in the form of a ArrayOfDoublesCompactSketch
        +
        +
        Returns:
        +
        compact sketch representing the result of the operation
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public abstract ArrayOfDoublesCompactSketch getResult​(org.apache.datasketches.memory.WritableMemory mem)
        +
        Gets the result of this operation in the form of a ArrayOfDoublesCompactSketch
        +
        +
        Parameters:
        +
        mem - memory for the result (can be null)
        +
        Returns:
        +
        compact sketch representing the result of the operation (off-heap if memory is + provided)
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesAnotBImpl.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesAnotBImpl.html new file mode 100644 index 000000000..372a8d33e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesAnotBImpl.html @@ -0,0 +1,351 @@ + + + + + +ArrayOfDoublesAnotBImpl (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfDoublesAnotBImpl

+
+
+ +
+
    +
  • +
    +
    public class ArrayOfDoublesAnotBImpl
    +extends ArrayOfDoublesAnotB
    +
    Computes a set difference, A-AND-NOT-B, of two ArrayOfDoublesSketches. + +

    This class includes a stateless operation as follows:

    + +
    
    + CompactSketch csk = anotb.aNotB(ArrayOfDoublesSketch skA, ArrayOfDoublesSketch skB);
    + 
    +
    +
    Author:
    +
    Lee Rhodes
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        update

        +
        public void update​(ArrayOfDoublesSketch skA,
        +                   ArrayOfDoublesSketch skB)
        +
        Description copied from class: ArrayOfDoublesAnotB
        +
        Perform A-and-not-B set operation on the two given sketches. + A null sketch is interpreted as an empty sketch. + This is not an accumulating update. Calling update() more than once + without calling getResult() will discard the result of previous update(). + Both input sketches must have the same numValues.
        +
        +
        Specified by:
        +
        update in class ArrayOfDoublesAnotB
        +
        Parameters:
        +
        skA - The incoming sketch for the first argument
        +
        skB - The incoming sketch for the second argument
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getResult

        +
        public ArrayOfDoublesCompactSketch getResult​(org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Description copied from class: ArrayOfDoublesAnotB
        +
        Gets the result of this operation in the form of a ArrayOfDoublesCompactSketch
        +
        +
        Specified by:
        +
        getResult in class ArrayOfDoublesAnotB
        +
        Parameters:
        +
        dstMem - memory for the result (can be null)
        +
        Returns:
        +
        compact sketch representing the result of the operation (off-heap if memory is + provided)
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesCombiner.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesCombiner.html new file mode 100644 index 000000000..7e959e704 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesCombiner.html @@ -0,0 +1,264 @@ + + + + + +ArrayOfDoublesCombiner (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface ArrayOfDoublesCombiner

+
+
+
+
    +
  • +
    +
    public interface ArrayOfDoublesCombiner
    +
    Combines two arrays of double values for use with ArrayOfDoubles tuple sketches
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethodDescription
      double[]combine​(double[] a, + double[] b) +
      Method of combining two arrays of double values
      +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        combine

        +
        double[] combine​(double[] a,
        +                 double[] b)
        +
        Method of combining two arrays of double values
        +
        +
        Parameters:
        +
        a - Array A.
        +
        b - Array B.
        +
        Returns:
        +
        Result of combining A and B
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesCompactSketch.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesCompactSketch.html new file mode 100644 index 000000000..dfc99ddc3 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesCompactSketch.html @@ -0,0 +1,315 @@ + + + + + +ArrayOfDoublesCompactSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfDoublesCompactSketch

+
+
+ +
+
    +
  • +
    +
    public abstract class ArrayOfDoublesCompactSketch
    +extends ArrayOfDoublesSketch
    +
    Top level compact tuple sketch of type ArrayOfDoubles. Compact sketches are never created + directly. They are created as a result of the compact() method on a QuickSelectSketch + or the getResult() method of a set operation like Union, Intersection or AnotB. + Compact sketch consists of a compact list (i.e. no intervening spaces) of hash values, + corresponding list of double values, and a value for theta. The lists may or may + not be ordered. A compact sketch is read-only.
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getCurrentBytes

        +
        public int getCurrentBytes()
        +
        Description copied from class: ArrayOfDoublesSketch
        +
        For compact sketches this is the same as getMaxBytes().
        +
        +
        Specified by:
        +
        getCurrentBytes in class ArrayOfDoublesSketch
        +
        Returns:
        +
        the current number of bytes for this sketch when serialized.
        +
        +
      • +
      + + + +
        +
      • +

        getMaxBytes

        +
        public int getMaxBytes()
        +
        +
        Specified by:
        +
        getMaxBytes in class ArrayOfDoublesSketch
        +
        Returns:
        +
        the maximum number of bytes for this sketch when serialized.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesIntersection.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesIntersection.html new file mode 100644 index 000000000..9ee4762cf --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesIntersection.html @@ -0,0 +1,361 @@ + + + + + +ArrayOfDoublesIntersection (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfDoublesIntersection

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesIntersection
    • +
    +
  • +
+
+
    +
  • +
    +
    public abstract class ArrayOfDoublesIntersection
    +extends Object
    +
    Computes the intersection of two or more tuple sketches of type ArrayOfDoubles. + A new instance represents the Universal Set. + Every update() computes an intersection with the internal set + and can only reduce the internal set.
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        intersect

        +
        public void intersect​(ArrayOfDoublesSketch tupleSketch,
        +                      ArrayOfDoublesCombiner combiner)
        +
        Performs a stateful intersection of the internal set with the given tupleSketch. + The given tupleSketch and the internal state must have the same numValues.
        +
        +
        Parameters:
        +
        tupleSketch - Input sketch to intersect with the internal set.
        +
        combiner - Method of combining two arrays of double values
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public ArrayOfDoublesCompactSketch getResult()
        +
        Gets the internal set as an on-heap compact sketch.
        +
        +
        Returns:
        +
        Result of the intersections so far as a compact sketch.
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public ArrayOfDoublesCompactSketch getResult​(org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Gets the result of stateful intersections so far.
        +
        +
        Parameters:
        +
        dstMem - Memory for the compact sketch (can be null).
        +
        Returns:
        +
        Result of the intersections so far as a compact sketch.
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Resets the internal set to the initial state, which represents the Universal Set
        +
      • +
      + + + +
        +
      • +

        createSketch

        +
        protected abstract org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesQuickSelectSketch createSketch​(int nomEntries,
        +                                                                                                             int numValues,
        +                                                                                                             long seed)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesSetOperationBuilder.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesSetOperationBuilder.html new file mode 100644 index 000000000..589986460 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesSetOperationBuilder.html @@ -0,0 +1,559 @@ + + + + + +ArrayOfDoublesSetOperationBuilder (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfDoublesSetOperationBuilder

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSetOperationBuilder
    • +
    +
  • +
+
+
    +
  • +
    +
    public class ArrayOfDoublesSetOperationBuilder
    +extends Object
    +
    Builds set operations object for tuple sketches of type ArrayOfDoubles.
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        DEFAULT_NOMINAL_ENTRIES

        +
        public static final int DEFAULT_NOMINAL_ENTRIES
        +
        Default Nominal Entries (a.k.a. K)
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        DEFAULT_NUMBER_OF_VALUES

        +
        public static final int DEFAULT_NUMBER_OF_VALUES
        +
        Default number of values
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ArrayOfDoublesSetOperationBuilder

        +
        public ArrayOfDoublesSetOperationBuilder()
        +
        Creates an instance of the builder with default parameters
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setNominalEntries

        +
        public ArrayOfDoublesSetOperationBuilder setNominalEntries​(int nomEntries)
        +
        This is to set the nominal number of entries.
        +
        +
        Parameters:
        +
        nomEntries - Nominal number of entries. Forced to the nearest power of 2 greater than + given value.
        +
        Returns:
        +
        this builder
        +
        +
      • +
      + + + +
        +
      • +

        setNumberOfValues

        +
        public ArrayOfDoublesSetOperationBuilder setNumberOfValues​(int numValues)
        +
        This is to set the number of double values associated with each key
        +
        +
        Parameters:
        +
        numValues - number of double values
        +
        Returns:
        +
        this builder
        +
        +
      • +
      + + + +
        +
      • +

        setSeed

        +
        public ArrayOfDoublesSetOperationBuilder setSeed​(long seed)
        +
        Sets the long seed value that is required by the hashing function.
        +
        +
        Parameters:
        +
        seed - See seed
        +
        Returns:
        +
        this builder
        +
        +
      • +
      + + + +
        +
      • +

        buildUnion

        +
        public ArrayOfDoublesUnion buildUnion()
        +
        Creates an instance of ArrayOfDoublesUnion based on the current configuration of the builder. + The new instance is allocated on the heap if the memory is not provided.
        +
        +
        Returns:
        +
        an instance of ArrayOfDoublesUnion
        +
        +
      • +
      + + + +
        +
      • +

        buildUnion

        +
        public ArrayOfDoublesUnion buildUnion​(org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Creates an instance of ArrayOfDoublesUnion based on the current configuration of the builder + and the given destination memory.
        +
        +
        Parameters:
        +
        dstMem - destination memory to be used by the sketch
        +
        Returns:
        +
        an instance of ArrayOfDoublesUnion
        +
        +
      • +
      + + + +
        +
      • +

        buildIntersection

        +
        public ArrayOfDoublesIntersection buildIntersection()
        +
        Creates an instance of ArrayOfDoublesIntersection based on the current configuration of the + builder. + The new instance is allocated on the heap if the memory is not provided. + The number of nominal entries is not relevant to this, so it is ignored.
        +
        +
        Returns:
        +
        an instance of ArrayOfDoublesIntersection
        +
        +
      • +
      + + + +
        +
      • +

        buildIntersection

        +
        public ArrayOfDoublesIntersection buildIntersection​(org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Creates an instance of ArrayOfDoublesIntersection based on the current configuration of the + builder. + The new instance is allocated on the heap if the memory is not provided. + The number of nominal entries is not relevant to this, so it is ignored.
        +
        +
        Parameters:
        +
        dstMem - destination memory to be used by the sketch
        +
        Returns:
        +
        an instance of ArrayOfDoublesIntersection
        +
        +
      • +
      + + + +
        +
      • +

        buildAnotB

        +
        public ArrayOfDoublesAnotB buildAnotB()
        +
        Creates an instance of ArrayOfDoublesAnotB based on the current configuration of the builder. + The memory is not relevant to this, so it is ignored if set. + The number of nominal entries is not relevant to this, so it is ignored.
        +
        +
        Returns:
        +
        an instance of ArrayOfDoublesAnotB
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesSketch.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesSketch.html new file mode 100644 index 000000000..8c7bc025d --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesSketch.html @@ -0,0 +1,698 @@ + + + + + +ArrayOfDoublesSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfDoublesSketch

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch
    • +
    +
  • +
+
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    ArrayOfDoublesCompactSketch, ArrayOfDoublesUpdatableSketch
    +
    +
    +
    public abstract class ArrayOfDoublesSketch
    +extends Object
    +
    The base class for the tuple sketch of type ArrayOfDoubles, where an array of double values + is associated with each key. + A primitive array of doubles is used here, as opposed to a generic Summary object, + for improved performance.
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        heapify

        +
        public static ArrayOfDoublesSketch heapify​(org.apache.datasketches.memory.Memory mem)
        +
        Heapify the given Memory as an ArrayOfDoublesSketch
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        Returns:
        +
        an ArrayOfDoublesSketch
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static ArrayOfDoublesSketch heapify​(org.apache.datasketches.memory.Memory mem,
        +                                           long seed)
        +
        Heapify the given Memory and seed as a ArrayOfDoublesSketch
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        seed - the given seed
        +
        Returns:
        +
        an ArrayOfDoublesSketch
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static ArrayOfDoublesSketch wrap​(org.apache.datasketches.memory.Memory mem)
        +
        Wrap the given Memory as an ArrayOfDoublesSketch
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        Returns:
        +
        an ArrayOfDoublesSketch
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static ArrayOfDoublesSketch wrap​(org.apache.datasketches.memory.Memory mem,
        +                                        long seed)
        +
        Wrap the given Memory and seed as a ArrayOfDoublesSketch
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        seed - the given seed
        +
        Returns:
        +
        an ArrayOfDoublesSketch
        +
        +
      • +
      + + + +
        +
      • +

        getEstimate

        +
        public double getEstimate()
        +
        Estimates the cardinality of the set (number of unique values presented to the sketch)
        +
        +
        Returns:
        +
        best estimate of the number of unique values
        +
        +
      • +
      + + + +
        +
      • +

        getUpperBound

        +
        public double getUpperBound​(int numStdDev)
        +
        Gets the approximate upper error bound given the specified number of Standard Deviations. + This will return getEstimate() if isEmpty() is true.
        +
        +
        Parameters:
        +
        numStdDev - See Number of Standard Deviations
        +
        Returns:
        +
        the upper bound.
        +
        +
      • +
      + + + +
        +
      • +

        getLowerBound

        +
        public double getLowerBound​(int numStdDev)
        +
        Gets the approximate lower error bound given the specified number of Standard Deviations. + This will return getEstimate() if isEmpty() is true.
        +
        +
        Parameters:
        +
        numStdDev - See Number of Standard Deviations
        +
        Returns:
        +
        the lower bound.
        +
        +
      • +
      + + + +
        +
      • +

        hasMemory

        +
        public abstract boolean hasMemory()
        +
        Returns true if this sketch's data structure is backed by Memory or WritableMemory.
        +
        +
        Returns:
        +
        true if this sketch's data structure is backed by Memory or WritableMemory.
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        + +
        +
        Returns:
        +
        true if empty.
        +
        +
      • +
      + + + +
        +
      • +

        getNumValues

        +
        public int getNumValues()
        +
        +
        Returns:
        +
        number of double values associated with each key
        +
        +
      • +
      + + + +
        +
      • +

        isEstimationMode

        +
        public boolean isEstimationMode()
        +
        Returns true if the sketch is Estimation Mode (as opposed to Exact Mode). + This is true if theta < 1.0 AND isEmpty() is false.
        +
        +
        Returns:
        +
        true if the sketch is in estimation mode.
        +
        +
      • +
      + + + +
        +
      • +

        getTheta

        +
        public double getTheta()
        +
        Gets the value of theta as a double between zero and one
        +
        +
        Returns:
        +
        the value of theta as a double
        +
        +
      • +
      + + + +
        +
      • +

        getRetainedEntries

        +
        public abstract int getRetainedEntries()
        +
        +
        Returns:
        +
        number of retained entries
        +
        +
      • +
      + + + +
        +
      • +

        getMaxBytes

        +
        public abstract int getMaxBytes()
        +
        +
        Returns:
        +
        the maximum number of bytes for this sketch when serialized.
        +
        +
      • +
      + + + +
        +
      • +

        getCurrentBytes

        +
        public abstract int getCurrentBytes()
        +
        For compact sketches this is the same as getMaxBytes().
        +
        +
        Returns:
        +
        the current number of bytes for this sketch when serialized.
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public abstract byte[] toByteArray()
        +
        +
        Returns:
        +
        serialized representation of the sketch
        +
        +
      • +
      + + + +
        +
      • +

        getValues

        +
        public abstract double[][] getValues()
        +
        +
        Returns:
        +
        array of arrays of double values in the sketch
        +
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        compact

        +
        public abstract ArrayOfDoublesCompactSketch compact​(org.apache.datasketches.memory.WritableMemory dstMem)
        +
        +
        Parameters:
        +
        dstMem - the destination WritableMemory
        +
        Returns:
        +
        this sketch in compact form, which is immutable.
        +
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesSketchIterator.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesSketchIterator.html new file mode 100644 index 000000000..390febc3e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesSketchIterator.html @@ -0,0 +1,310 @@ + + + + + +ArrayOfDoublesSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface ArrayOfDoublesSketchIterator

+
+
+
+
    +
  • +
    +
    public interface ArrayOfDoublesSketchIterator
    +
    Interface for iterating over tuple sketches of type ArrayOfDoubles
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethodDescription
      longgetKey() +
      Gets a key from the current entry in the sketch, which is a hash + of the original key passed to update().
      +
      double[]getValues() +
      Gets an array of values from the current entry in the sketch.
      +
      booleannext() +
      Advancing the iterator and checking existence of the next entry + is combined here for efficiency.
      +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        next

        +
        boolean next()
        +
        Advancing the iterator and checking existence of the next entry + is combined here for efficiency. This results in an undefined + state of the iterator before the first call of this method.
        +
        +
        Returns:
        +
        true if the next element exists
        +
        +
      • +
      + + + +
        +
      • +

        getKey

        +
        long getKey()
        +
        Gets a key from the current entry in the sketch, which is a hash + of the original key passed to update(). The original keys are not + retained. Don't call this before calling next() for the first time + or after getting false from next().
        +
        +
        Returns:
        +
        hash key from the current entry
        +
        +
      • +
      + + + +
        +
      • +

        getValues

        +
        double[] getValues()
        +
        Gets an array of values from the current entry in the sketch. + Don't call this before calling next() for the first time + or after getting false from next().
        +
        +
        Returns:
        +
        array of double values for the current entry (may or may not be a copy)
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesSketches.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesSketches.html new file mode 100644 index 000000000..a27c2d3f4 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesSketches.html @@ -0,0 +1,637 @@ + + + + + +ArrayOfDoublesSketches (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfDoublesSketches

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches
    • +
    +
  • +
+
+
    +
  • +
    +
    public final class ArrayOfDoublesSketches
    +extends Object
    +
    Convenient static methods to instantiate tuple sketches of type ArrayOfDoubles.
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ArrayOfDoublesSketches

        +
        public ArrayOfDoublesSketches()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        heapifySketch

        +
        public static ArrayOfDoublesSketch heapifySketch​(org.apache.datasketches.memory.Memory srcMem)
        +
        Heapify the given Memory as an ArrayOfDoublesSketch
        +
        +
        Parameters:
        +
        srcMem - the given source Memory
        +
        Returns:
        +
        an ArrayOfDoublesSketch
        +
        +
      • +
      + + + +
        +
      • +

        heapifySketch

        +
        public static ArrayOfDoublesSketch heapifySketch​(org.apache.datasketches.memory.Memory srcMem,
        +                                                 long seed)
        +
        Heapify the given Memory and seed as a ArrayOfDoublesSketch
        +
        +
        Parameters:
        +
        srcMem - the given source Memory
        +
        seed - the given seed
        +
        Returns:
        +
        an ArrayOfDoublesSketch
        +
        +
      • +
      + + + +
        +
      • +

        heapifyUpdatableSketch

        +
        public static ArrayOfDoublesUpdatableSketch heapifyUpdatableSketch​(org.apache.datasketches.memory.Memory srcMem)
        +
        Heapify the given Memory as an ArrayOfDoublesUpdatableSketch
        +
        +
        Parameters:
        +
        srcMem - the given source Memory
        +
        Returns:
        +
        an ArrayOfDoublesUpdatableSketch
        +
        +
      • +
      + + + +
        +
      • +

        heapifyUpdatableSketch

        +
        public static ArrayOfDoublesUpdatableSketch heapifyUpdatableSketch​(org.apache.datasketches.memory.Memory srcMem,
        +                                                                   long seed)
        +
        Heapify the given Memory and seed as a ArrayOfDoublesUpdatableSketch
        +
        +
        Parameters:
        +
        srcMem - the given source Memory
        +
        seed - the given seed
        +
        Returns:
        +
        an ArrayOfDoublesUpdatableSketch
        +
        +
      • +
      + + + +
        +
      • +

        wrapSketch

        +
        public static ArrayOfDoublesSketch wrapSketch​(org.apache.datasketches.memory.Memory srcMem)
        +
        Wrap the given Memory as an ArrayOfDoublesSketch
        +
        +
        Parameters:
        +
        srcMem - the given source Memory
        +
        Returns:
        +
        an ArrayOfDoublesSketch
        +
        +
      • +
      + + + +
        +
      • +

        wrapSketch

        +
        public static ArrayOfDoublesSketch wrapSketch​(org.apache.datasketches.memory.Memory srcMem,
        +                                              long seed)
        +
        Wrap the given Memory and seed as a ArrayOfDoublesSketch
        +
        +
        Parameters:
        +
        srcMem - the given source Memory
        +
        seed - the given seed
        +
        Returns:
        +
        an ArrayOfDoublesSketch
        +
        +
      • +
      + + + +
        +
      • +

        wrapUpdatableSketch

        +
        public static ArrayOfDoublesUpdatableSketch wrapUpdatableSketch​(org.apache.datasketches.memory.WritableMemory srcMem)
        +
        Wrap the given WritableMemory as an ArrayOfDoublesUpdatableSketch
        +
        +
        Parameters:
        +
        srcMem - the given source Memory
        +
        Returns:
        +
        an ArrayOfDoublesUpdatableSketch
        +
        +
      • +
      + + + +
        +
      • +

        wrapUpdatableSketch

        +
        public static ArrayOfDoublesUpdatableSketch wrapUpdatableSketch​(org.apache.datasketches.memory.WritableMemory srcMem,
        +                                                                long seed)
        +
        Wrap the given WritableMemory and seed as a ArrayOfDoublesUpdatableSketch
        +
        +
        Parameters:
        +
        srcMem - the given source Memory
        +
        seed - the given seed
        +
        Returns:
        +
        an ArrayOfDoublesUpdatableSketch
        +
        +
      • +
      + + + +
        +
      • +

        heapifyUnion

        +
        public static ArrayOfDoublesUnion heapifyUnion​(org.apache.datasketches.memory.Memory srcMem)
        +
        Heapify the given Memory as an ArrayOfDoublesUnion
        +
        +
        Parameters:
        +
        srcMem - the given source Memory
        +
        Returns:
        +
        an ArrayOfDoublesUnion
        +
        +
      • +
      + + + +
        +
      • +

        heapifyUnion

        +
        public static ArrayOfDoublesUnion heapifyUnion​(org.apache.datasketches.memory.Memory srcMem,
        +                                               long seed)
        +
        Heapify the given Memory and seed as an ArrayOfDoublesUnion
        +
        +
        Parameters:
        +
        srcMem - the given source Memory
        +
        seed - the given seed
        +
        Returns:
        +
        an ArrayOfDoublesUnion
        +
        +
      • +
      + + + +
        +
      • +

        wrapUnion

        +
        public static ArrayOfDoublesUnion wrapUnion​(org.apache.datasketches.memory.Memory srcMem)
        +
        Wrap the given Memory as an ArrayOfDoublesUnion
        +
        +
        Parameters:
        +
        srcMem - the given source Memory
        +
        Returns:
        +
        an ArrayOfDoublesUnion
        +
        +
      • +
      + + + +
        +
      • +

        wrapUnion

        +
        public static ArrayOfDoublesUnion wrapUnion​(org.apache.datasketches.memory.Memory srcMem,
        +                                            long seed)
        +
        Wrap the given Memory and seed as an ArrayOfDoublesUnion
        +
        +
        Parameters:
        +
        srcMem - the given source Memory
        +
        seed - the given seed
        +
        Returns:
        +
        an ArrayOfDoublesUnion
        +
        +
      • +
      + + + +
        +
      • +

        wrapUnion

        +
        public static ArrayOfDoublesUnion wrapUnion​(org.apache.datasketches.memory.WritableMemory srcMem)
        +
        Wrap the given Memory as an ArrayOfDoublesUnion
        +
        +
        Parameters:
        +
        srcMem - the given source Memory
        +
        Returns:
        +
        an ArrayOfDoublesUnion
        +
        +
      • +
      + + + +
        +
      • +

        wrapUnion

        +
        public static ArrayOfDoublesUnion wrapUnion​(org.apache.datasketches.memory.WritableMemory srcMem,
        +                                            long seed)
        +
        Wrap the given Memory and seed as an ArrayOfDoublesUnion
        +
        +
        Parameters:
        +
        srcMem - the given source Memory
        +
        seed - the given seed
        +
        Returns:
        +
        an ArrayOfDoublesUnion
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesUnion.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesUnion.html new file mode 100644 index 000000000..ce646cbfa --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesUnion.html @@ -0,0 +1,528 @@ + + + + + +ArrayOfDoublesUnion (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfDoublesUnion

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUnion
    • +
    +
  • +
+
+
    +
  • +
    +
    public abstract class ArrayOfDoublesUnion
    +extends Object
    +
    The base class for unions of tuple sketches of type ArrayOfDoubles.
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        heapify

        +
        public static ArrayOfDoublesUnion heapify​(org.apache.datasketches.memory.Memory srcMem)
        +
        Heapify the given Memory as an ArrayOfDoublesUnion
        +
        +
        Parameters:
        +
        srcMem - the given source Memory
        +
        Returns:
        +
        an ArrayOfDoublesUnion
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static ArrayOfDoublesUnion heapify​(org.apache.datasketches.memory.Memory srcMem,
        +                                          long seed)
        +
        Heapify the given Memory and seed as an ArrayOfDoublesUnion
        +
        +
        Parameters:
        +
        srcMem - the given source Memory
        +
        seed - the given seed
        +
        Returns:
        +
        an ArrayOfDoublesUnion
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static ArrayOfDoublesUnion wrap​(org.apache.datasketches.memory.Memory srcMem)
        +
        Wrap the given Memory as an ArrayOfDoublesUnion
        +
        +
        Parameters:
        +
        srcMem - the given source Memory
        +
        Returns:
        +
        an ArrayOfDoublesUnion
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static ArrayOfDoublesUnion wrap​(org.apache.datasketches.memory.Memory srcMem,
        +                                       long seed)
        +
        Wrap the given Memory and seed as an ArrayOfDoublesUnion
        +
        +
        Parameters:
        +
        srcMem - the given source Memory
        +
        seed - the given seed
        +
        Returns:
        +
        an ArrayOfDoublesUnion
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static ArrayOfDoublesUnion wrap​(org.apache.datasketches.memory.WritableMemory srcMem)
        +
        Wrap the given WritableMemory as an ArrayOfDoublesUnion
        +
        +
        Parameters:
        +
        srcMem - the given source Memory
        +
        Returns:
        +
        an ArrayOfDoublesUnion
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static ArrayOfDoublesUnion wrap​(org.apache.datasketches.memory.WritableMemory srcMem,
        +                                       long seed)
        +
        Wrap the given WritableMemory and seed as an ArrayOfDoublesUnion
        +
        +
        Parameters:
        +
        srcMem - the given source Memory
        +
        seed - the given seed
        +
        Returns:
        +
        an ArrayOfDoublesUnion
        +
        +
      • +
      + + + +
        +
      • +

        union

        +
        public void union​(ArrayOfDoublesSketch tupleSketch)
        +
        Updates the union by adding a set of entries from a given sketch, which can be on-heap or off-heap. + Both the given tupleSketch and the internal state of the Union must have the same numValues. + +

        Nulls and empty sketches are ignored.

        +
        +
        Parameters:
        +
        tupleSketch - sketch to add to the union
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public ArrayOfDoublesCompactSketch getResult​(org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Returns the resulting union in the form of a compact sketch
        +
        +
        Parameters:
        +
        dstMem - memory for the result (can be null)
        +
        Returns:
        +
        compact sketch representing the union (off-heap if memory is provided)
        +
        +
      • +
      + + + +
        +
      • +

        getResult

        +
        public ArrayOfDoublesCompactSketch getResult()
        +
        Returns the resulting union in the form of a compact sketch
        +
        +
        Returns:
        +
        on-heap compact sketch representing the union
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Resets the union to an empty state
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray()
        +
        +
        Returns:
        +
        a byte array representation of this object
        +
        +
      • +
      + + + +
        +
      • +

        getMaxBytes

        +
        public static int getMaxBytes​(int nomEntries,
        +                              int numValues)
        +
        +
        Parameters:
        +
        nomEntries - Nominal number of entries. Forced to the nearest power of 2 greater than or equal to + given value.
        +
        numValues - Number of double values to keep for each key
        +
        Returns:
        +
        maximum required storage bytes given nomEntries and numValues
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesUpdatableSketch.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesUpdatableSketch.html new file mode 100644 index 000000000..97df3eaa8 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesUpdatableSketch.html @@ -0,0 +1,659 @@ + + + + + +ArrayOfDoublesUpdatableSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfDoublesUpdatableSketch

+
+
+ +
+
    +
  • +
    +
    public abstract class ArrayOfDoublesUpdatableSketch
    +extends ArrayOfDoublesSketch
    +
    The top level for updatable tuple sketches of type ArrayOfDoubles.
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        heapify

        +
        public static ArrayOfDoublesUpdatableSketch heapify​(org.apache.datasketches.memory.Memory mem)
        +
        Heapify the given Memory as an ArrayOfDoublesUpdatableSketch
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        Returns:
        +
        an ArrayOfDoublesUpdatableSketch
        +
        +
      • +
      + + + +
        +
      • +

        heapify

        +
        public static ArrayOfDoublesUpdatableSketch heapify​(org.apache.datasketches.memory.Memory mem,
        +                                                    long seed)
        +
        Heapify the given Memory and seed as a ArrayOfDoublesUpdatableSketch
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        seed - the given seed
        +
        Returns:
        +
        an ArrayOfDoublesUpdatableSketch
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static ArrayOfDoublesUpdatableSketch wrap​(org.apache.datasketches.memory.WritableMemory mem)
        +
        Wrap the given WritableMemory as an ArrayOfDoublesUpdatableSketch
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        Returns:
        +
        an ArrayOfDoublesUpdatableSketch
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static ArrayOfDoublesUpdatableSketch wrap​(org.apache.datasketches.memory.WritableMemory mem,
        +                                                 long seed)
        +
        Wrap the given WritableMemory and seed as a ArrayOfDoublesUpdatableSketch
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        seed - the given seed
        +
        Returns:
        +
        an ArrayOfDoublesUpdatableSketch
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(long key,
        +                   double[] values)
        +
        Updates this sketch with a long key and double values. + The values will be stored or added to the ones associated with the key
        +
        +
        Parameters:
        +
        key - The given long key
        +
        values - The given values
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(double key,
        +                   double[] values)
        +
        Updates this sketch with a double key and double values. + The values will be stored or added to the ones associated with the key
        +
        +
        Parameters:
        +
        key - The given double key
        +
        values - The given values
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(String key,
        +                   double[] values)
        +
        Updates this sketch with a String key and double values. + The values will be stored or added to the ones associated with the key
        +
        +
        Parameters:
        +
        key - The given String key
        +
        values - The given values
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(byte[] key,
        +                   double[] values)
        +
        Updates this sketch with a byte[] key and double values. + The values will be stored or added to the ones associated with the key
        +
        +
        Parameters:
        +
        key - The given byte[] key
        +
        values - The given values
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(int[] key,
        +                   double[] values)
        +
        Updates this sketch with a int[] key and double values. + The values will be stored or added to the ones associated with the key
        +
        +
        Parameters:
        +
        key - The given int[] key
        +
        values - The given values
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update​(long[] key,
        +                   double[] values)
        +
        Updates this sketch with a long[] key and double values. + The values will be stored or added to the ones associated with the key
        +
        +
        Parameters:
        +
        key - The given long[] key
        +
        values - The given values
        +
        +
      • +
      + + + +
        +
      • +

        getNominalEntries

        +
        public abstract int getNominalEntries()
        +
        Gets the configured nominal number of entries
        +
        +
        Returns:
        +
        nominal number of entries
        +
        +
      • +
      + + + +
        +
      • +

        getResizeFactor

        +
        public abstract ResizeFactor getResizeFactor()
        +
        Gets the configured resize factor
        +
        +
        Returns:
        +
        resize factor
        +
        +
      • +
      + + + +
        +
      • +

        getSamplingProbability

        +
        public abstract float getSamplingProbability()
        +
        Gets the configured sampling probability
        +
        +
        Returns:
        +
        sampling probability
        +
        +
      • +
      + + + +
        +
      • +

        trim

        +
        public abstract void trim()
        +
        Rebuilds reducing the actual number of entries to the nominal number of entries if needed
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public abstract void reset()
        +
        Resets this sketch an empty state.
        +
      • +
      + + + + + + + +
        +
      • +

        compact

        +
        public ArrayOfDoublesCompactSketch compact​(org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Gets an off-heap compact representation of the sketch using the given memory
        +
        +
        Specified by:
        +
        compact in class ArrayOfDoublesSketch
        +
        Parameters:
        +
        dstMem - memory for the compact sketch (can be null)
        +
        Returns:
        +
        compact sketch (off-heap if memory is provided)
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesUpdatableSketchBuilder.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesUpdatableSketchBuilder.html new file mode 100644 index 000000000..bd25136ee --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesUpdatableSketchBuilder.html @@ -0,0 +1,460 @@ + + + + + +ArrayOfDoublesUpdatableSketchBuilder (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfDoublesUpdatableSketchBuilder

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder
    • +
    +
  • +
+
+
    +
  • +
    +
    public class ArrayOfDoublesUpdatableSketchBuilder
    +extends Object
    +
    For building a new ArrayOfDoublesUpdatableSketch
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ArrayOfDoublesUpdatableSketchBuilder

        +
        public ArrayOfDoublesUpdatableSketchBuilder()
        +
        Creates an instance of builder with default parameters
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setNominalEntries

        +
        public ArrayOfDoublesUpdatableSketchBuilder setNominalEntries​(int nomEntries)
        +
        This is to set the nominal number of entries.
        +
        +
        Parameters:
        +
        nomEntries - Nominal number of entries. Forced to the nearest power of 2 greater than + or equal to given value.
        +
        Returns:
        +
        this builder
        +
        +
      • +
      + + + +
        +
      • +

        setResizeFactor

        +
        public ArrayOfDoublesUpdatableSketchBuilder setResizeFactor​(ResizeFactor resizeFactor)
        +
        This is to set the resize factor. + Value of X1 means that the maximum capacity is allocated from the start. + Default resize factor is X8.
        +
        +
        Parameters:
        +
        resizeFactor - value of X1, X2, X4 or X8
        +
        Returns:
        +
        this UpdatableSketchBuilder
        +
        +
      • +
      + + + +
        +
      • +

        setSamplingProbability

        +
        public ArrayOfDoublesUpdatableSketchBuilder setSamplingProbability​(float samplingProbability)
        +
        This is to set sampling probability. + Default probability is 1.
        +
        +
        Parameters:
        +
        samplingProbability - sampling probability from 0 to 1
        +
        Returns:
        +
        this builder
        +
        +
      • +
      + + + +
        +
      • +

        setNumberOfValues

        +
        public ArrayOfDoublesUpdatableSketchBuilder setNumberOfValues​(int numValues)
        +
        This is to set the number of double values associated with each key
        +
        +
        Parameters:
        +
        numValues - number of double values
        +
        Returns:
        +
        this builder
        +
        +
      • +
      + + + + + + + +
        +
      • +

        build

        +
        public ArrayOfDoublesUpdatableSketch build()
        +
        Returns an ArrayOfDoublesUpdatableSketch with the current configuration of this Builder.
        +
        +
        Returns:
        +
        an ArrayOfDoublesUpdatableSketch
        +
        +
      • +
      + + + +
        +
      • +

        build

        +
        public ArrayOfDoublesUpdatableSketch build​(org.apache.datasketches.memory.WritableMemory dstMem)
        +
        Returns an ArrayOfDoublesUpdatableSketch with the current configuration of this Builder.
        +
        +
        Parameters:
        +
        dstMem - instance of Memory to be used by the sketch
        +
        Returns:
        +
        an ArrayOfDoublesUpdatableSketch
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesAnotB.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesAnotB.html new file mode 100644 index 000000000..5cdb0f409 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesAnotB.html @@ -0,0 +1,214 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesAnotB (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesAnotB

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesAnotBImpl.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesAnotBImpl.html new file mode 100644 index 000000000..ef15e28b3 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesAnotBImpl.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesAnotBImpl (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesAnotBImpl

+
+
No usage of org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesAnotBImpl
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesCombiner.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesCombiner.html new file mode 100644 index 000000000..39c17e85b --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesCombiner.html @@ -0,0 +1,198 @@ + + + + + +Uses of Interface org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesCombiner (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesCombiner

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesCompactSketch.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesCompactSketch.html new file mode 100644 index 000000000..4cf1af0b9 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesCompactSketch.html @@ -0,0 +1,266 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesCompactSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesCompactSketch

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesIntersection.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesIntersection.html new file mode 100644 index 000000000..c84a1f643 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesIntersection.html @@ -0,0 +1,206 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesIntersection (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesIntersection

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesSetOperationBuilder.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesSetOperationBuilder.html new file mode 100644 index 000000000..cecc7da86 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesSetOperationBuilder.html @@ -0,0 +1,211 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSetOperationBuilder (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSetOperationBuilder

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesSketch.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesSketch.html new file mode 100644 index 000000000..fa1ab21dc --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesSketch.html @@ -0,0 +1,313 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketch

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesSketchIterator.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesSketchIterator.html new file mode 100644 index 000000000..e87a7a5f2 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesSketchIterator.html @@ -0,0 +1,195 @@ + + + + + +Uses of Interface org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketchIterator

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesSketches.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesSketches.html new file mode 100644 index 000000000..0922f5a70 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesSketches.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches

+
+
No usage of org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesSketches
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesUnion.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesUnion.html new file mode 100644 index 000000000..7068432af --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesUnion.html @@ -0,0 +1,295 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUnion (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUnion

+
+
+
    +
  • + + + + + + + + + + + + +
    Packages that use ArrayOfDoublesUnion 
    PackageDescription
    org.apache.datasketches.tuple.arrayofdoubles +
    This package is for a concrete implementation of the Tuple sketch for an array of double values.
    +
    +
  • +
  • +
      +
    • +
      + + +

      Uses of ArrayOfDoublesUnion in org.apache.datasketches.tuple.arrayofdoubles

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in org.apache.datasketches.tuple.arrayofdoubles that return ArrayOfDoublesUnion 
      Modifier and TypeMethodDescription
      ArrayOfDoublesUnionArrayOfDoublesSetOperationBuilder.buildUnion() +
      Creates an instance of ArrayOfDoublesUnion based on the current configuration of the builder.
      +
      ArrayOfDoublesUnionArrayOfDoublesSetOperationBuilder.buildUnion​(org.apache.datasketches.memory.WritableMemory dstMem) +
      Creates an instance of ArrayOfDoublesUnion based on the current configuration of the builder + and the given destination memory.
      +
      static ArrayOfDoublesUnionArrayOfDoublesUnion.heapify​(org.apache.datasketches.memory.Memory srcMem) +
      Heapify the given Memory as an ArrayOfDoublesUnion
      +
      static ArrayOfDoublesUnionArrayOfDoublesUnion.heapify​(org.apache.datasketches.memory.Memory srcMem, + long seed) +
      Heapify the given Memory and seed as an ArrayOfDoublesUnion
      +
      static ArrayOfDoublesUnionArrayOfDoublesSketches.heapifyUnion​(org.apache.datasketches.memory.Memory srcMem) +
      Heapify the given Memory as an ArrayOfDoublesUnion
      +
      static ArrayOfDoublesUnionArrayOfDoublesSketches.heapifyUnion​(org.apache.datasketches.memory.Memory srcMem, + long seed) +
      Heapify the given Memory and seed as an ArrayOfDoublesUnion
      +
      static ArrayOfDoublesUnionArrayOfDoublesUnion.wrap​(org.apache.datasketches.memory.Memory srcMem) +
      Wrap the given Memory as an ArrayOfDoublesUnion
      +
      static ArrayOfDoublesUnionArrayOfDoublesUnion.wrap​(org.apache.datasketches.memory.Memory srcMem, + long seed) +
      Wrap the given Memory and seed as an ArrayOfDoublesUnion
      +
      static ArrayOfDoublesUnionArrayOfDoublesUnion.wrap​(org.apache.datasketches.memory.WritableMemory srcMem) +
      Wrap the given WritableMemory as an ArrayOfDoublesUnion
      +
      static ArrayOfDoublesUnionArrayOfDoublesUnion.wrap​(org.apache.datasketches.memory.WritableMemory srcMem, + long seed) +
      Wrap the given WritableMemory and seed as an ArrayOfDoublesUnion
      +
      static ArrayOfDoublesUnionArrayOfDoublesSketches.wrapUnion​(org.apache.datasketches.memory.Memory srcMem) +
      Wrap the given Memory as an ArrayOfDoublesUnion
      +
      static ArrayOfDoublesUnionArrayOfDoublesSketches.wrapUnion​(org.apache.datasketches.memory.Memory srcMem, + long seed) +
      Wrap the given Memory and seed as an ArrayOfDoublesUnion
      +
      static ArrayOfDoublesUnionArrayOfDoublesSketches.wrapUnion​(org.apache.datasketches.memory.WritableMemory srcMem) +
      Wrap the given Memory as an ArrayOfDoublesUnion
      +
      static ArrayOfDoublesUnionArrayOfDoublesSketches.wrapUnion​(org.apache.datasketches.memory.WritableMemory srcMem, + long seed) +
      Wrap the given Memory and seed as an ArrayOfDoublesUnion
      +
      +
      +
    • +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesUpdatableSketch.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesUpdatableSketch.html new file mode 100644 index 000000000..af6410df0 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesUpdatableSketch.html @@ -0,0 +1,264 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketch

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesUpdatableSketchBuilder.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesUpdatableSketchBuilder.html new file mode 100644 index 000000000..5e957f36f --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/class-use/ArrayOfDoublesUpdatableSketchBuilder.html @@ -0,0 +1,225 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesUpdatableSketchBuilder

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/package-summary.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/package-summary.html new file mode 100644 index 000000000..7b9c8b661 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/package-summary.html @@ -0,0 +1,252 @@ + + + + + +org.apache.datasketches.tuple.arrayofdoubles (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches.tuple.arrayofdoubles

+
+
+
+ + +
This package is for a concrete implementation of the Tuple sketch for an array of double values.
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/package-tree.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/package-tree.html new file mode 100644 index 000000000..86a03e9a7 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/package-tree.html @@ -0,0 +1,186 @@ + + + + + +org.apache.datasketches.tuple.arrayofdoubles Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches.tuple.arrayofdoubles

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+

Interface Hierarchy

+ +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/package-use.html b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/package-use.html new file mode 100644 index 000000000..a344b9179 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/arrayofdoubles/package-use.html @@ -0,0 +1,243 @@ + + + + + +Uses of Package org.apache.datasketches.tuple.arrayofdoubles (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches.tuple.arrayofdoubles

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/class-use/AnotB.html b/docs/5.0.2/org/apache/datasketches/tuple/class-use/AnotB.html new file mode 100644 index 000000000..507963360 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/class-use/AnotB.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.AnotB (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.AnotB

+
+
No usage of org.apache.datasketches.tuple.AnotB
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/class-use/CompactSketch.html b/docs/5.0.2/org/apache/datasketches/tuple/class-use/CompactSketch.html new file mode 100644 index 000000000..01ca1ef17 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/class-use/CompactSketch.html @@ -0,0 +1,293 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.CompactSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.CompactSketch

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/class-use/DeserializeResult.html b/docs/5.0.2/org/apache/datasketches/tuple/class-use/DeserializeResult.html new file mode 100644 index 000000000..653628e18 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/class-use/DeserializeResult.html @@ -0,0 +1,297 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.DeserializeResult (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.DeserializeResult

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/class-use/Filter.html b/docs/5.0.2/org/apache/datasketches/tuple/class-use/Filter.html new file mode 100644 index 000000000..d4edf4b18 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/class-use/Filter.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.Filter (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.Filter

+
+
No usage of org.apache.datasketches.tuple.Filter
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/class-use/Intersection.html b/docs/5.0.2/org/apache/datasketches/tuple/class-use/Intersection.html new file mode 100644 index 000000000..4aa3ab65a --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/class-use/Intersection.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.Intersection (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.Intersection

+
+
No usage of org.apache.datasketches.tuple.Intersection
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/class-use/JaccardSimilarity.html b/docs/5.0.2/org/apache/datasketches/tuple/class-use/JaccardSimilarity.html new file mode 100644 index 000000000..df9cdff8a --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/class-use/JaccardSimilarity.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.JaccardSimilarity (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.JaccardSimilarity

+
+
No usage of org.apache.datasketches.tuple.JaccardSimilarity
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/class-use/SerializerDeserializer.SketchType.html b/docs/5.0.2/org/apache/datasketches/tuple/class-use/SerializerDeserializer.SketchType.html new file mode 100644 index 000000000..c9a15b7fa --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/class-use/SerializerDeserializer.SketchType.html @@ -0,0 +1,232 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.SerializerDeserializer.SketchType (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.SerializerDeserializer.SketchType

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/class-use/SerializerDeserializer.html b/docs/5.0.2/org/apache/datasketches/tuple/class-use/SerializerDeserializer.html new file mode 100644 index 000000000..1ec43b16f --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/class-use/SerializerDeserializer.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.SerializerDeserializer (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.SerializerDeserializer

+
+
No usage of org.apache.datasketches.tuple.SerializerDeserializer
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/class-use/Sketch.html b/docs/5.0.2/org/apache/datasketches/tuple/class-use/Sketch.html new file mode 100644 index 000000000..6e33d15ad --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/class-use/Sketch.html @@ -0,0 +1,596 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.Sketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.Sketch

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/class-use/Sketches.html b/docs/5.0.2/org/apache/datasketches/tuple/class-use/Sketches.html new file mode 100644 index 000000000..9b2606163 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/class-use/Sketches.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.Sketches (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.Sketches

+
+
No usage of org.apache.datasketches.tuple.Sketches
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/class-use/Summary.html b/docs/5.0.2/org/apache/datasketches/tuple/class-use/Summary.html new file mode 100644 index 000000000..753fb9d98 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/class-use/Summary.html @@ -0,0 +1,630 @@ + + + + + +Uses of Interface org.apache.datasketches.tuple.Summary (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.tuple.Summary

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/class-use/SummaryDeserializer.html b/docs/5.0.2/org/apache/datasketches/tuple/class-use/SummaryDeserializer.html new file mode 100644 index 000000000..356fda637 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/class-use/SummaryDeserializer.html @@ -0,0 +1,312 @@ + + + + + +Uses of Interface org.apache.datasketches.tuple.SummaryDeserializer (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.tuple.SummaryDeserializer

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/class-use/SummaryFactory.html b/docs/5.0.2/org/apache/datasketches/tuple/class-use/SummaryFactory.html new file mode 100644 index 000000000..e15f61dfa --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/class-use/SummaryFactory.html @@ -0,0 +1,355 @@ + + + + + +Uses of Interface org.apache.datasketches.tuple.SummaryFactory (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.tuple.SummaryFactory

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/class-use/SummarySetOperations.html b/docs/5.0.2/org/apache/datasketches/tuple/class-use/SummarySetOperations.html new file mode 100644 index 000000000..0ea5b51f9 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/class-use/SummarySetOperations.html @@ -0,0 +1,394 @@ + + + + + +Uses of Interface org.apache.datasketches.tuple.SummarySetOperations (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.tuple.SummarySetOperations

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/class-use/TupleSketchIterator.html b/docs/5.0.2/org/apache/datasketches/tuple/class-use/TupleSketchIterator.html new file mode 100644 index 000000000..3d5a3d0ee --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/class-use/TupleSketchIterator.html @@ -0,0 +1,204 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.TupleSketchIterator (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.TupleSketchIterator

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/class-use/Union.html b/docs/5.0.2/org/apache/datasketches/tuple/class-use/Union.html new file mode 100644 index 000000000..8510e441e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/class-use/Union.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.Union (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.Union

+
+
No usage of org.apache.datasketches.tuple.Union
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/class-use/UpdatableSketch.html b/docs/5.0.2/org/apache/datasketches/tuple/class-use/UpdatableSketch.html new file mode 100644 index 000000000..a18dc283e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/class-use/UpdatableSketch.html @@ -0,0 +1,342 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.UpdatableSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.UpdatableSketch

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/class-use/UpdatableSketchBuilder.html b/docs/5.0.2/org/apache/datasketches/tuple/class-use/UpdatableSketchBuilder.html new file mode 100644 index 000000000..4e7a11e37 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/class-use/UpdatableSketchBuilder.html @@ -0,0 +1,213 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.UpdatableSketchBuilder (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.UpdatableSketchBuilder

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/class-use/UpdatableSummary.html b/docs/5.0.2/org/apache/datasketches/tuple/class-use/UpdatableSummary.html new file mode 100644 index 000000000..25da7c6e4 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/class-use/UpdatableSummary.html @@ -0,0 +1,330 @@ + + + + + +Uses of Interface org.apache.datasketches.tuple.UpdatableSummary (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
org.apache.datasketches.tuple.UpdatableSummary

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/class-use/Util.html b/docs/5.0.2/org/apache/datasketches/tuple/class-use/Util.html new file mode 100644 index 000000000..23abeec88 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/class-use/Util.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.Util (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.Util

+
+
No usage of org.apache.datasketches.tuple.Util
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/package-summary.html b/docs/5.0.2/org/apache/datasketches/tuple/package-summary.html new file mode 100644 index 000000000..da27e4212 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/package-summary.html @@ -0,0 +1,316 @@ + + + + + +org.apache.datasketches.tuple (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches.tuple

+
+
+
+ + +
The tuple package contains a number of sketches based on the same + fundamental algorithms of the Theta Sketch Framework and extend these + concepts for whole new families of sketches.
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    Summary +
    Interface for user-defined Summary, which is associated with every hash in a tuple sketch
    +
    SummaryDeserializer<S extends Summary> +
    Interface for deserializing user-defined Summary
    +
    SummaryFactory<S extends Summary> +
    Interface for user-defined SummaryFactory
    +
    SummarySetOperations<S extends Summary> +
    This is to provide methods of producing unions and intersections of two Summary objects.
    +
    UpdatableSummary<U> +
    Interface for updating user-defined Summary
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    AnotB<S extends Summary> +
    Computes a set difference, A-AND-NOT-B, of two generic tuple sketches.
    +
    CompactSketch<S extends Summary> +
    CompactSketches are never created directly.
    +
    DeserializeResult<T> +
    Returns an object and its size in bytes as a result of a deserialize operation
    +
    Filter<T extends Summary> +
    Class for filtering entries from a Sketch given a Summary
    +
    Intersection<S extends Summary> +
    Computes an intersection of two or more generic tuple sketches or generic tuple sketches + combined with theta sketches.
    +
    JaccardSimilarity +
    Jaccard similarity of two Tuple Sketches, or alternatively, of a Tuple and Theta Sketch.
    +
    SerializerDeserializer +
    Multipurpose serializer-deserializer for a collection of sketches defined by the enum.
    +
    Sketch<S extends Summary> +
    This is an equivalent to org.apache.datasketches.theta.Sketch with + addition of a user-defined Summary object associated with every unique entry + in the sketch.
    +
    Sketches +
    Convenient static methods to instantiate generic tuple sketches.
    +
    TupleSketchIterator<S extends Summary> +
    Iterator over a generic tuple sketch
    +
    Union<S extends Summary> +
    Compute the union of two or more generic tuple sketches or generic tuple sketches combined with + theta sketches.
    +
    UpdatableSketch<U,​S extends UpdatableSummary<U>> +
    An extension of QuickSelectSketch<S>, which can be updated with many types of keys.
    +
    UpdatableSketchBuilder<U,​S extends UpdatableSummary<U>> +
    For building a new generic tuple UpdatableSketch
    +
    Util +
    Common utility functions for Tuples
    +
    +
  • +
  • + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    SerializerDeserializer.SketchType +
    Defines the sketch classes that this SerializerDeserializer can handle.
    +
    +
  • +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/package-tree.html b/docs/5.0.2/org/apache/datasketches/tuple/package-tree.html new file mode 100644 index 000000000..0eea2131d --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/package-tree.html @@ -0,0 +1,207 @@ + + + + + +org.apache.datasketches.tuple Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches.tuple

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+

Interface Hierarchy

+ +
+
+

Enum Hierarchy

+ +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/package-use.html b/docs/5.0.2/org/apache/datasketches/tuple/package-use.html new file mode 100644 index 000000000..dcd39cecc --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/package-use.html @@ -0,0 +1,532 @@ + + + + + +Uses of Package org.apache.datasketches.tuple (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches.tuple

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/strings/ArrayOfStringsSketch.html b/docs/5.0.2/org/apache/datasketches/tuple/strings/ArrayOfStringsSketch.html new file mode 100644 index 000000000..6cad12af5 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/strings/ArrayOfStringsSketch.html @@ -0,0 +1,771 @@ + + + + + +ArrayOfStringsSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfStringsSketch

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        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

        +
        @Deprecated
        +public 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.
        +
        +
        Constructs this sketch from a Memory image, which must be from an ArrayOfStringsSketch, and + usually with data.
        +
        +
        Parameters:
        +
        mem - the given Memory
        +
        +
      • +
      + + + +
        +
      • +

        ArrayOfStringsSketch

        +
        public ArrayOfStringsSketch​(ArrayOfStringsSketch sketch)
        +
        Copy Constructor
        +
        +
        Parameters:
        +
        sketch - the sketch to copy
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        update

        +
        public void update​(String[] strArrKey,
        +                   String[] strArr)
        +
        Updates the sketch with String arrays for both key and value.
        +
        +
        Parameters:
        +
        strArrKey - the given String array key
        +
        strArr - the given String array value
        +
        +
      • +
      + + + +
        +
      • +

        getRetainedEntries

        +
        public int getRetainedEntries()
        +
        +
        Specified by:
        +
        getRetainedEntries in class Sketch<S extends Summary>
        +
        Returns:
        +
        number of retained entries
        +
        +
      • +
      + + + +
        +
      • +

        getCountLessThanThetaLong

        +
        public int getCountLessThanThetaLong​(long thetaLong)
        +
        Description copied from class: Sketch
        +
        Gets the number of hash values less than the given theta expressed as a long.
        +
        +
        Specified by:
        +
        getCountLessThanThetaLong in class Sketch<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

        +
        public ResizeFactor 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

        +
        public CompactSketch<S> compact()
        +
        Converts the current state of the sketch into a compact sketch
        +
        +
        Specified by:
        +
        compact in class Sketch<S extends Summary>
        +
        Returns:
        +
        compact sketch
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        @Deprecated
        +public 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.
        +
        +
        This serializes an UpdatableSketch (QuickSelectSketch).
        +
        +
        Specified by:
        +
        toByteArray in class Sketch<S extends Summary>
        +
        Returns:
        +
        serialized representation of an UpdatableSketch (QuickSelectSketch).
        +
        +
      • +
      + + + + + +
        +
      • +

        insertSummary

        +
        protected void insertSummary​(int index,
        +                             S summary)
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/strings/ArrayOfStringsSummary.html b/docs/5.0.2/org/apache/datasketches/tuple/strings/ArrayOfStringsSummary.html new file mode 100644 index 000000000..59d90eb10 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/strings/ArrayOfStringsSummary.html @@ -0,0 +1,396 @@ + + + + + +ArrayOfStringsSummary (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfStringsSummary

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.strings.ArrayOfStringsSummary
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        copy

        +
        public ArrayOfStringsSummary copy()
        +
        Description copied from interface: Summary
        +
        Deep copy. + +

        Caution: This must implement a deep copy.

        +
        +
        Specified by:
        +
        copy in interface Summary
        +
        Returns:
        +
        deep copy of the Summary
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray()
        +
        Description copied from interface: Summary
        +
        This is to serialize a Summary instance to a byte array. + +

        The user should encode in the byte array its total size, which is used during + deserialization, especially if the Summary has variable sized elements.

        +
        +
        Specified by:
        +
        toByteArray in interface Summary
        +
        Returns:
        +
        serialized representation of the Summary
        +
        +
      • +
      + + + + + + + +
        +
      • +

        hashCode

        +
        public int hashCode()
        +
        +
        Overrides:
        +
        hashCode in class Object
        +
        +
      • +
      + + + +
        +
      • +

        equals

        +
        public boolean equals​(Object summary)
        +
        +
        Overrides:
        +
        equals in class Object
        +
        +
      • +
      + + + +
        +
      • +

        getValue

        +
        public String[] getValue()
        +
        +
        Returns:
        +
        the nodes array for this summary.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/strings/ArrayOfStringsSummaryDeserializer.html b/docs/5.0.2/org/apache/datasketches/tuple/strings/ArrayOfStringsSummaryDeserializer.html new file mode 100644 index 000000000..48f41325e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/strings/ArrayOfStringsSummaryDeserializer.html @@ -0,0 +1,333 @@ + + + + + +ArrayOfStringsSummaryDeserializer (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfStringsSummaryDeserializer

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.strings.ArrayOfStringsSummaryDeserializer
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ArrayOfStringsSummaryDeserializer

        +
        public ArrayOfStringsSummaryDeserializer()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        heapifySummary

        +
        public DeserializeResult<ArrayOfStringsSummary> heapifySummary​(org.apache.datasketches.memory.Memory mem)
        +
        Description copied from interface: SummaryDeserializer
        +
        This is to create an instance of a Summary given a serialized representation. + The user may assume that the start of the given Memory is the correct place to start + deserializing. However, the user must be able to determine the number of bytes required to + deserialize the summary as the capacity of the given Memory may + include multiple such summaries and may be much larger than required for a single summary.
        +
        +
        Specified by:
        +
        heapifySummary in interface SummaryDeserializer<ArrayOfStringsSummary>
        +
        Parameters:
        +
        mem - Memory object with serialized representation of a Summary
        +
        Returns:
        +
        DeserializedResult object, which contains a Summary object and number of bytes read + from the Memory
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/strings/ArrayOfStringsSummaryFactory.html b/docs/5.0.2/org/apache/datasketches/tuple/strings/ArrayOfStringsSummaryFactory.html new file mode 100644 index 000000000..d010b2d31 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/strings/ArrayOfStringsSummaryFactory.html @@ -0,0 +1,322 @@ + + + + + +ArrayOfStringsSummaryFactory (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfStringsSummaryFactory

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.strings.ArrayOfStringsSummaryFactory
    • +
    +
  • +
+
+ +
+
+ +
+
+ +
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/strings/ArrayOfStringsSummarySetOperations.html b/docs/5.0.2/org/apache/datasketches/tuple/strings/ArrayOfStringsSummarySetOperations.html new file mode 100644 index 000000000..718315564 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/strings/ArrayOfStringsSummarySetOperations.html @@ -0,0 +1,370 @@ + + + + + +ArrayOfStringsSummarySetOperations (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ArrayOfStringsSummarySetOperations

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.apache.datasketches.tuple.strings.ArrayOfStringsSummarySetOperations
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ArrayOfStringsSummarySetOperations

        +
        public ArrayOfStringsSummarySetOperations()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        union

        +
        public ArrayOfStringsSummary union​(ArrayOfStringsSummary a,
        +                                   ArrayOfStringsSummary b)
        +
        Description copied from interface: SummarySetOperations
        +
        This is called by the union operator when both sketches have the same hash value. + +

        Caution: Do not modify the input Summary objects. Also do not return them directly, + unless they are immutable (most Summary objects are not). For mutable Summary objects, it is + important to create a new Summary object with the correct contents to be returned. Do not + return null summaries.

        +
        +
        Specified by:
        +
        union in interface SummarySetOperations<ArrayOfStringsSummary>
        +
        Parameters:
        +
        a - Summary from sketch A
        +
        b - Summary from sketch B
        +
        Returns:
        +
        union of Summary A and Summary B
        +
        +
      • +
      + + + +
        +
      • +

        intersection

        +
        public ArrayOfStringsSummary intersection​(ArrayOfStringsSummary a,
        +                                          ArrayOfStringsSummary b)
        +
        Description copied from interface: SummarySetOperations
        +
        This is called by the intersection operator when both sketches have the same hash value. + +

        Caution: Do not modify the input Summary objects. Also do not return them directly, + unless they are immutable (most Summary objects are not). For mutable Summary objects, it is + important to create a new Summary object with the correct contents to be returned. Do not + return null summaries.

        +
        +
        Specified by:
        +
        intersection in interface SummarySetOperations<ArrayOfStringsSummary>
        +
        Parameters:
        +
        a - Summary from sketch A
        +
        b - Summary from sketch B
        +
        Returns:
        +
        intersection of Summary A and Summary B
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/strings/class-use/ArrayOfStringsSketch.html b/docs/5.0.2/org/apache/datasketches/tuple/strings/class-use/ArrayOfStringsSketch.html new file mode 100644 index 000000000..72796953d --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/strings/class-use/ArrayOfStringsSketch.html @@ -0,0 +1,240 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.strings.ArrayOfStringsSketch (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.strings.ArrayOfStringsSketch

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/strings/class-use/ArrayOfStringsSummary.html b/docs/5.0.2/org/apache/datasketches/tuple/strings/class-use/ArrayOfStringsSummary.html new file mode 100644 index 000000000..f4bc55caa --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/strings/class-use/ArrayOfStringsSummary.html @@ -0,0 +1,254 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.strings.ArrayOfStringsSummary (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.strings.ArrayOfStringsSummary

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/strings/class-use/ArrayOfStringsSummaryDeserializer.html b/docs/5.0.2/org/apache/datasketches/tuple/strings/class-use/ArrayOfStringsSummaryDeserializer.html new file mode 100644 index 000000000..fc971dd9e --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/strings/class-use/ArrayOfStringsSummaryDeserializer.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.strings.ArrayOfStringsSummaryDeserializer (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.strings.ArrayOfStringsSummaryDeserializer

+
+
No usage of org.apache.datasketches.tuple.strings.ArrayOfStringsSummaryDeserializer
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/strings/class-use/ArrayOfStringsSummaryFactory.html b/docs/5.0.2/org/apache/datasketches/tuple/strings/class-use/ArrayOfStringsSummaryFactory.html new file mode 100644 index 000000000..443ff697a --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/strings/class-use/ArrayOfStringsSummaryFactory.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.strings.ArrayOfStringsSummaryFactory (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.strings.ArrayOfStringsSummaryFactory

+
+
No usage of org.apache.datasketches.tuple.strings.ArrayOfStringsSummaryFactory
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/strings/class-use/ArrayOfStringsSummarySetOperations.html b/docs/5.0.2/org/apache/datasketches/tuple/strings/class-use/ArrayOfStringsSummarySetOperations.html new file mode 100644 index 000000000..2d85d60a6 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/strings/class-use/ArrayOfStringsSummarySetOperations.html @@ -0,0 +1,149 @@ + + + + + +Uses of Class org.apache.datasketches.tuple.strings.ArrayOfStringsSummarySetOperations (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
org.apache.datasketches.tuple.strings.ArrayOfStringsSummarySetOperations

+
+
No usage of org.apache.datasketches.tuple.strings.ArrayOfStringsSummarySetOperations
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/strings/package-summary.html b/docs/5.0.2/org/apache/datasketches/tuple/strings/package-summary.html new file mode 100644 index 000000000..5f890e264 --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/strings/package-summary.html @@ -0,0 +1,188 @@ + + + + + +org.apache.datasketches.tuple.strings (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Package org.apache.datasketches.tuple.strings

+
+
+
+ + +
This package is for a generic implementation of the Tuple sketch for single String value.
+
+ +
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/strings/package-tree.html b/docs/5.0.2/org/apache/datasketches/tuple/strings/package-tree.html new file mode 100644 index 000000000..3bd5d332d --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/strings/package-tree.html @@ -0,0 +1,176 @@ + + + + + +org.apache.datasketches.tuple.strings Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package org.apache.datasketches.tuple.strings

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+
+ + + diff --git a/docs/5.0.2/org/apache/datasketches/tuple/strings/package-use.html b/docs/5.0.2/org/apache/datasketches/tuple/strings/package-use.html new file mode 100644 index 000000000..d4371635f --- /dev/null +++ b/docs/5.0.2/org/apache/datasketches/tuple/strings/package-use.html @@ -0,0 +1,213 @@ + + + + + +Uses of Package org.apache.datasketches.tuple.strings (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
org.apache.datasketches.tuple.strings

+
+
+ +
+
+ + + diff --git a/docs/5.0.2/overview-summary.html b/docs/5.0.2/overview-summary.html new file mode 100644 index 000000000..eaf65146d --- /dev/null +++ b/docs/5.0.2/overview-summary.html @@ -0,0 +1,23 @@ + + + + + +datasketches-java 5.0.2 API + + + + + + + +
+ +

index.html

+
+ + diff --git a/docs/5.0.2/overview-tree.html b/docs/5.0.2/overview-tree.html new file mode 100644 index 000000000..411a8f59b --- /dev/null +++ b/docs/5.0.2/overview-tree.html @@ -0,0 +1,455 @@ + + + + + +Class Hierarchy (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
+ +
+
+ +
+
+

Class Hierarchy

+ +
+
+

Interface Hierarchy

+ +
+
+

Annotation Type Hierarchy

+ +
+
+

Enum Hierarchy

+ +
+
+
+ + + diff --git a/docs/5.0.2/package-search-index.js b/docs/5.0.2/package-search-index.js new file mode 100644 index 000000000..5f351290a --- /dev/null +++ b/docs/5.0.2/package-search-index.js @@ -0,0 +1 @@ +packageSearchIndex = [{"l":"All Packages","url":"allpackages-index.html"},{"l":"org.apache.datasketches"},{"l":"org.apache.datasketches.common"},{"l":"org.apache.datasketches.cpc"},{"l":"org.apache.datasketches.fdt"},{"l":"org.apache.datasketches.frequencies"},{"l":"org.apache.datasketches.hash"},{"l":"org.apache.datasketches.hll"},{"l":"org.apache.datasketches.hllmap"},{"l":"org.apache.datasketches.kll"},{"l":"org.apache.datasketches.partitions"},{"l":"org.apache.datasketches.quantiles"},{"l":"org.apache.datasketches.quantilescommon"},{"l":"org.apache.datasketches.req"},{"l":"org.apache.datasketches.sampling"},{"l":"org.apache.datasketches.theta"},{"l":"org.apache.datasketches.thetacommon"},{"l":"org.apache.datasketches.tuple"},{"l":"org.apache.datasketches.tuple.adouble"},{"l":"org.apache.datasketches.tuple.aninteger"},{"l":"org.apache.datasketches.tuple.arrayofdoubles"},{"l":"org.apache.datasketches.tuple.strings"}] \ No newline at end of file diff --git a/docs/5.0.2/package-search-index.zip b/docs/5.0.2/package-search-index.zip new file mode 100644 index 000000000..fc86852cf Binary files /dev/null and b/docs/5.0.2/package-search-index.zip differ diff --git a/docs/5.0.2/resources/dictionary.html b/docs/5.0.2/resources/dictionary.html new file mode 100644 index 000000000..55bafe089 --- /dev/null +++ b/docs/5.0.2/resources/dictionary.html @@ -0,0 +1,282 @@ + + + + + + +Sketch Library Dictionary + + +

Sketch Library Dictionary

+ +

Sketch Accuracy

+Refers to sketch accuracy... + +

Alpha TCF

+The Alpha Theta Choosing Function (TCF) and the theory behind it is fully described in the +Theta Sketch Framework paper. +The alpha algorithm is optimized for speed and accuracy in a real-time sketch +building / estimating environment. +

One of the properties of the Alpha Algorithm used for cache management within a sketch is that +the value of Theta Long is always up-to-date. There may be +dirty hash +values in the cache, but the Alpha Algorithm estimation function ignores them.

+ +

Default Nominal Entries

+In Theta Sketches, the default nominal entries of 4096 is provided as a convenience for those cases where the +number of entries is not provided. +A sketch of 4096 entries has a Relative Standard Error (RSE) of +/- 1.56% at a confidence of 68%; +or equivalently, a Relative Error of +/- 3.1% at a confidence of 95.4%. + +

Default Update Seed

+

In Theta Sketches, the default Update Hash Seed 9001 is a prime number that was chosen +very early on in experimental testing. +Choosing a seed is somewhat arbitrary, and this particular seed is not superior to other seeds. +

In performing set operations on two sketches it is critical that the same hash +function and seed was used for both sketches, otherwise the assumed 1:1 relationship +between the original source key value and the hashed bit string would be violated. +Once you have developed a history of stored sketches you are stuck with your chosen seed. +So don't change it! +Update Hash Seed + +

Degenerate Sketch

+A sketch is considered degenerate if it has never reached reached +Estimation Mode where the count of its retained hash values is +exact and less than Nominal Entries (or k entries) +and no estimation is needed. This is also referred to as Exact Mode. + +

Destination Memory

+The destination Memory for this object. If not required it may be null. If not null and large +enough the returned object will be backed by this Memory. +If null, the returned object will be on the Java heap. + +

Destination Ordered

+In Theta Sketches, this refers to the ordering of hash values in a returned CompactSketch. +If true, the internal hash values will be ordered. This will enable much higher +performance during union (merge) operations but at the cost of a sort, which may not be +desirable in some applications, especially real-time. + +

Dirty Hash

+For the Theta Alpha Sketch, a retained hash value is considered dirty if it is ≥ Theta Long or < 0. +See Valid Hash. + +

isEmpty()

+In Theta Sketches, the state isEmpty() for a sketch means that the sketch cache has zero hash values and that none of the +update methods have been called with valid data. In other words, the sketch has never seen any data. +This state is equivalent to "null" in the sense that it is safe to exclude empty sketches from union operations. However, an empty sketch +will impact intersections and difference set operations. + +

Note that isEmpty() does not always mean that theta is 1.0 because if p < 1.0, theta will be set +equal to p during construction. +Also, a cache of zero values (getRetainedEntries(true) = 0) does not mean that the sketch is Empty since +set intersection or difference operations can result in a sketch with zero values. +If the sourcing sketches had seen data then a resulting intersection or difference sketch will be not Empty +and have valid upper and lower bounds even if the cache has zero values. In other words, the resulting sketch represents +a valid distribution of data that just happens to have zero samples collected from it. + +

Note also that a virgin Intersection object will return isEmpty() == false. This is because a virgin Intersection object represents +the Universe Set, which is clearly not empty.

+ +

These are subtle distinctions and exist for mathematical correctness. Excluding sketches that just have getRetainedEntries(true) = 0 +from set operations them could result in impacting the accuracy of results. + +

Estimation Mode

+Once a Theta Sketch exceeds the configured Nominal Entries, or k, number of retained hash values, +the sketch transitions into estimation mode where it must now estimate the population of uniques that +the retained entries represent. A sketch can also be in estimation mode if the sketch was configured with a +Sampling Probability < 1.0. +Estimation Mode = (θ < 1.0) & NOT empty. + +

lgNomLongs

+For Theta Sketches, the Log base 2 of the number of Nominal Entries. + +

lgArrLongs

+For Theta Sketches, the Log base 2 of the size of the internal hash table in 64-bit longs. + +

Memory

+The backing Memory object which may be a source or destination. + +

Nominal Entries

+For Theta Sketches and depending on the specific sketch, the constructor data type is int or String. +Acceptable values for constructing new sketches are positive integers that are powers of two. +This parameter specifies the target nominal number of entries (a.k.a. k) that will be retained in the internal cache +and ultimately determines the accuracy of the sketch (see Sketch Accuracy). +Internally each entry is retained as a long of 8 bytes. + +

The reason it is called "nominal" is that depending on the specific algorithm of the sketch, the actual +number of entries retained by the sketch after the sketch goes into estimation mode +may differ from the configured value. For the AlphaSketch the number of retained entries statistically varies +but has a mean of k. For the QuickSelect sketches, the number of retained entries will statistically +vary from k to almost 2*k. + +

Each sketch type also has a minimum acceptable value for this value. For QuickSelect Sketches this value is 16 and for +Alpha Sketches this value is 512. Specifying a value less than this minimum value just results in the minimum value being used. + +

Number of Standard Deviations

+This is a positive number, which may be either an integer (1, 2, or 3) or a double ≤ 3.0. +This value is used in the getUpperBounds(int numStdDev) and +getLowerBounds(int numStdDev) methods and represents (theoretically) the +/- standard deviation from the center of the +Standard Normal Gaussian Distribution. For example: + +

getUpperBound(1) returns the estimated quantile(0.841) of the distribution.
+getLowerBound(1) returns the estimated quantile(0.158) of the distribution.
+getUpperBound(2) returns the estimated quantile(0.977) of the distribution.
+getLowerBound(2) returns the estimated quantile(0.023) of the distribution.
+getUpperBound(3) returns the estimated quantile(0.9986) of the distribution.
+getLowerBound(3) returns the estimated quantile(0.0013) of the distribution.
+

+ +

However, for sketches with small configured values of Nominal Entries < 4096 for Theta or lgConfigK < 12 for HLL, +the error distribution of the sketch becomes quite asymmetric and cannot be approximated with a Gaussian. In these cases the interpretation of +numStdDev is that of an index that returns the quantile of the sketch error distribution that corresponds to fractional normalized rank +of the standard normal distribution at the specified numStdDev. + +

Thus, getUpperBound(1) and getLowerBound(2) represent the 68.3% confidence bounds, +getUpperBound(2) and getLowerBound(2) represent the 95.4% confidence bounds, and +getUpperBound(3) and getLowerBound(3) represent the 99.7% confidence bounds. +
+ +

For some sketches where the error distribution is not Gaussian, special mathematical approximation methods are used. +See Sketch Accuracy.

+ + + +

Quick Select TCF

+The fundamental Theta Sketch QuickSelect algorithm is described in classic algorithm texts by Sedgewick and +is the Theta Choosing Function (TCF) for the QuickSelect Sketches. +When the internal hash table of the sketch reaches its internal +refresh threshold, +the quick select algorithm is used to select the (k+1)th order statistic +from the hash table with a complexity of O(n). +The value of the selected hash becomes the new +Theta Long +and immediately makes some number of entries in the table +dirty. +The rebuild() method is called that rebuilds the hash table removing the +dirty values. +Since the value of Theta Long +is only changed when the hash table needs to be rebuilt, +the values in the hash table are only ever dirty +briefly during the rebuild process. +Thus, all the values in the hash table are always +valid during normal updating of the sketch. +

One of the benefits of using the QuickSelect algorithm for the cache management of the sketch is +that the number of valid hashes ranges from +nominal entries +to the current REBUILD_THRESHOLD, which is nominally 15/16 * cacheSize. +This means that without the user forcing +a rebuild(), the sketch, on average, may be about 50% larger than +nominal entries, about 19% more accurate, and faster.

+ +

Resize Factor

+For Theta Sketches, the Resize Factor is a dynamic, speed performance vs. memory size tradeoff. +The sketches created on-heap and configured with a Resize Factor of > X1 start out with +an internal hash table size that is the smallest submultiple of the the target +Nominal Entries +and larger than the minimum required hash table size for that sketch. +When the sketch needs to be resized larger, then the Resize Factor is used as a multiplier of +the current sketch cache array size.
+"X1" means no resizing is allowed and the sketch will be intialized at full size.
+"X2" means the internal cache will start very small and double in size until the target size is reached.
+Similarly, "X4" is a factor of 4 and "X8 is a factor of 8. + +

Sampling Probability p

+For Theta Sketches, the uniform random pre-sketching sampling probability. +Depending on the specific sketch, the constructor data type is float or String. +Incoming hashed data values are sampled by this probability factor before being submitted to +the sketching algorithm. For example, if p were set to 0.25, then on average, only one +forth of the incoming values, selected uniformly and at random, would be evaluated by the +sketching algorithm to be retained by the sketch. +Its default value is 1.0 (no sampling). +Its value must be in the range: 0 < p ≤ 1.0. +

This mode is particularly useful when merging large numbers of +degenerate sketches. + +

Seed

+For Theta Sketches, the long (64-bit) seed is required by the Update Hash Function. +This seed value is intentionally not serialized along with this sketch in order to provide +some security and protection against "dictionary attacks". +

In order to provide some protection against accidental mixing +of sketches that were generated with different seeds a short, 16-bit, +Seed Hash is stored with the sketch image. +When heapifying or wrapping an UpdateSketch image, which can be either a byte array or a Memory object, +the user must provide the original seed either directly or indirectly by assuming the DEFAULT_UPDATE_SEED. +The provided seed will be hashed and validated against the internal short Seed Hash and an error will be thrown if the seed hashes do not match. +The Set Operations classes, Union, Intersection and AnotB also require the user to provide the seed either directly or indirectly. +

An internal check will be made to make sure that the provided seed does not hash to a 16-bit value of zero. +If it does produce zero, an error will be thrown and the user must provide a different seed value. +
+See also Default Update Seed. + +

Seed Hash

+For Theta and Tuple Sketches, a 16-bit hash of the Update Hash Seed used internally to validate +(1) that two sketches undergoing set operations were, in fact, created using matching Update Hash Seeds; +or (2) that when deserializing or wrapping a sketch image that the caller has the correct seed. + +

Snow Plow Effect

+When coordinated hash tables are merged and if the merging process does not update the target sketch with sufficient randomness, clustering +in the target hash table can be greatly exaggerated causing poor speed performance for both updates and searches. This is called the +"snowplow" effect because of the analogy of visualizing the clusters in a hash table as piles of snow that grow larger and larger. Since the +size of the clusters are only represented by their width (not height like piles of snow), the clusters push themselves out horizontally and +merge together as if they were pushed together with a snowplow. + +

Theta Choosing Function (TCF)

+For Theta Sketches, the Theta Choosing Function (TCF) and the theory behind it is fully described in the +Theta Sketch Framework paper. + +

Theta, θ

+For Theta Sketches, refers to the mathematical random variable θ that represents the current probability +that the next, non-duplicate unique input value presented to the sketch will change the state of the sketch. +Given N uniquified inputs to a sketch configured to retain at most k hashes of the inputs, +θ ≈ k/N, 0 < θ ≤ 1.0, and θ = (double) thetaLong / Long.MAX_VALUE;. +See thetaLong. + +

thetaLong

+For Theta Sketches, the 64-bit, positive long equivalent of theta where
+0 < thetaLongLong.MAX_VALUE, and thetaLong = θ * Long.MAX_VALUE. + +

Theta Sketch Framework

+This framework enables sketches with different algorithms and Theta Choosing Functions +to be arguments to the Union, Intersection and AnotB Set Operations. +This framework also enables the sketches to share estimation, upper and lower bounds algorithms and +a common serialization data structure. +The Theta Sketch Framework, Theta Choosing Functions and the theory behind them is fully described +in the Theta Sketch Framework paper. + +

Update Return State

+For Theta Sketches, this provides useful detail for sketch characterization and debugging. It is not required that any of +these values be monitored during normal operation. +The UpdateReturnState is defined as follows: +
    +
  • InsertedCountIncremented: Inserted, not full, retained_entries_count incremented.
  • +
  • InsertedCountNotIncremented: Inserted, not full, retained-entries-count not incremented +because a dirty value was overridden.
  • +
  • RejectedDuplicate: Rejected as duplicate.
  • +
  • RejectedNullOrEmpty: Rejected because input was null or empty. Only for update objects.
  • +
  • RejectedOverTheta: Rejected because the computed hash was over the current value of thetaLong.
  • +
+ + +

Valid Hash

+For Theta Sketches, a retained hash value is considered valid if it is greater than zero and less than +thetaLong. See Dirty Hash. + + + \ No newline at end of file diff --git a/docs/5.0.2/resources/glass.png b/docs/5.0.2/resources/glass.png new file mode 100644 index 000000000..a7f591f46 Binary files /dev/null and b/docs/5.0.2/resources/glass.png differ diff --git a/docs/5.0.2/resources/x.png b/docs/5.0.2/resources/x.png new file mode 100644 index 000000000..30548a756 Binary files /dev/null and b/docs/5.0.2/resources/x.png differ diff --git a/docs/5.0.2/script.js b/docs/5.0.2/script.js new file mode 100644 index 000000000..7dc93c48e --- /dev/null +++ b/docs/5.0.2/script.js @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +var moduleSearchIndex; +var packageSearchIndex; +var typeSearchIndex; +var memberSearchIndex; +var tagSearchIndex; +function loadScripts(doc, tag) { + createElem(doc, tag, 'jquery/jszip/dist/jszip.js'); + createElem(doc, tag, 'jquery/jszip-utils/dist/jszip-utils.js'); + if (window.navigator.userAgent.indexOf('MSIE ') > 0 || window.navigator.userAgent.indexOf('Trident/') > 0 || + window.navigator.userAgent.indexOf('Edge/') > 0) { + createElem(doc, tag, 'jquery/jszip-utils/dist/jszip-utils-ie.js'); + } + createElem(doc, tag, 'search.js'); + + $.get(pathtoroot + "module-search-index.zip") + .done(function() { + JSZipUtils.getBinaryContent(pathtoroot + "module-search-index.zip", function(e, data) { + JSZip.loadAsync(data).then(function(zip){ + zip.file("module-search-index.json").async("text").then(function(content){ + moduleSearchIndex = JSON.parse(content); + }); + }); + }); + }); + $.get(pathtoroot + "package-search-index.zip") + .done(function() { + JSZipUtils.getBinaryContent(pathtoroot + "package-search-index.zip", function(e, data) { + JSZip.loadAsync(data).then(function(zip){ + zip.file("package-search-index.json").async("text").then(function(content){ + packageSearchIndex = JSON.parse(content); + }); + }); + }); + }); + $.get(pathtoroot + "type-search-index.zip") + .done(function() { + JSZipUtils.getBinaryContent(pathtoroot + "type-search-index.zip", function(e, data) { + JSZip.loadAsync(data).then(function(zip){ + zip.file("type-search-index.json").async("text").then(function(content){ + typeSearchIndex = JSON.parse(content); + }); + }); + }); + }); + $.get(pathtoroot + "member-search-index.zip") + .done(function() { + JSZipUtils.getBinaryContent(pathtoroot + "member-search-index.zip", function(e, data) { + JSZip.loadAsync(data).then(function(zip){ + zip.file("member-search-index.json").async("text").then(function(content){ + memberSearchIndex = JSON.parse(content); + }); + }); + }); + }); + $.get(pathtoroot + "tag-search-index.zip") + .done(function() { + JSZipUtils.getBinaryContent(pathtoroot + "tag-search-index.zip", function(e, data) { + JSZip.loadAsync(data).then(function(zip){ + zip.file("tag-search-index.json").async("text").then(function(content){ + tagSearchIndex = JSON.parse(content); + }); + }); + }); + }); + if (!moduleSearchIndex) { + createElem(doc, tag, 'module-search-index.js'); + } + if (!packageSearchIndex) { + createElem(doc, tag, 'package-search-index.js'); + } + if (!typeSearchIndex) { + createElem(doc, tag, 'type-search-index.js'); + } + if (!memberSearchIndex) { + createElem(doc, tag, 'member-search-index.js'); + } + if (!tagSearchIndex) { + createElem(doc, tag, 'tag-search-index.js'); + } + $(window).resize(function() { + $('.navPadding').css('padding-top', $('.fixedNav').css("height")); + }); +} + +function createElem(doc, tag, path) { + var script = doc.createElement(tag); + var scriptElement = doc.getElementsByTagName(tag)[0]; + script.src = pathtoroot + path; + scriptElement.parentNode.insertBefore(script, scriptElement); +} + +function show(type) { + count = 0; + for (var key in data) { + var row = document.getElementById(key); + if ((data[key] & type) !== 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) { + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} + +function updateModuleFrame(pFrame, cFrame) { + top.packageFrame.location = pFrame; + top.classFrame.location = cFrame; +} diff --git a/docs/5.0.2/search.js b/docs/5.0.2/search.js new file mode 100644 index 000000000..8492271e7 --- /dev/null +++ b/docs/5.0.2/search.js @@ -0,0 +1,326 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +var noResult = {l: "No results found"}; +var catModules = "Modules"; +var catPackages = "Packages"; +var catTypes = "Types"; +var catMembers = "Members"; +var catSearchTags = "SearchTags"; +var highlight = "$&"; +var camelCaseRegexp = ""; +var secondaryMatcher = ""; +function getHighlightedText(item) { + var ccMatcher = new RegExp(camelCaseRegexp); + var label = item.replace(ccMatcher, highlight); + if (label === item) { + label = item.replace(secondaryMatcher, highlight); + } + return label; +} +function getURLPrefix(ui) { + var urlPrefix=""; + if (useModuleDirectories) { + var slash = "/"; + if (ui.item.category === catModules) { + return ui.item.l + slash; + } else if (ui.item.category === catPackages && ui.item.m) { + return ui.item.m + slash; + } else if ((ui.item.category === catTypes && ui.item.p) || ui.item.category === catMembers) { + $.each(packageSearchIndex, function(index, item) { + if (item.m && ui.item.p == item.l) { + urlPrefix = item.m + slash; + } + }); + return urlPrefix; + } else { + return urlPrefix; + } + } + return urlPrefix; +} +var watermark = 'Search'; +$(function() { + $("#search").val(''); + $("#search").prop("disabled", false); + $("#reset").prop("disabled", false); + $("#search").val(watermark).addClass('watermark'); + $("#search").blur(function() { + if ($(this).val().length == 0) { + $(this).val(watermark).addClass('watermark'); + } + }); + $("#search").on('click keydown', function() { + if ($(this).val() == watermark) { + $(this).val('').removeClass('watermark'); + } + }); + $("#reset").click(function() { + $("#search").val(''); + $("#search").focus(); + }); + $("#search").focus(); + $("#search")[0].setSelectionRange(0, 0); +}); +$.widget("custom.catcomplete", $.ui.autocomplete, { + _create: function() { + this._super(); + this.widget().menu("option", "items", "> :not(.ui-autocomplete-category)"); + }, + _renderMenu: function(ul, items) { + var rMenu = this, + currentCategory = ""; + rMenu.menu.bindings = $(); + $.each(items, function(index, item) { + var li; + if (item.l !== noResult.l && item.category !== currentCategory) { + ul.append("
  • " + item.category + "
  • "); + currentCategory = item.category; + } + li = rMenu._renderItemData(ul, item); + if (item.category) { + li.attr("aria-label", item.category + " : " + item.l); + li.attr("class", "resultItem"); + } else { + li.attr("aria-label", item.l); + li.attr("class", "resultItem"); + } + }); + }, + _renderItem: function(ul, item) { + var label = ""; + if (item.category === catModules) { + label = getHighlightedText(item.l); + } else if (item.category === catPackages) { + label = (item.m) + ? getHighlightedText(item.m + "/" + item.l) + : getHighlightedText(item.l); + } else if (item.category === catTypes) { + label = (item.p) + ? getHighlightedText(item.p + "." + item.l) + : getHighlightedText(item.l); + } else if (item.category === catMembers) { + label = getHighlightedText(item.p + "." + (item.c + "." + item.l)); + } else if (item.category === catSearchTags) { + label = getHighlightedText(item.l); + } else { + label = item.l; + } + var li = $("
  • ").appendTo(ul); + var div = $("
    ").appendTo(li); + if (item.category === catSearchTags) { + if (item.d) { + div.html(label + " (" + item.h + ")
    " + + item.d + "
    "); + } else { + div.html(label + " (" + item.h + ")"); + } + } else { + div.html(label); + } + return li; + } +}); +$(function() { + $("#search").catcomplete({ + minLength: 1, + delay: 100, + source: function(request, response) { + var result = new Array(); + var presult = new Array(); + var tresult = new Array(); + var mresult = new Array(); + var tgresult = new Array(); + var secondaryresult = new Array(); + var displayCount = 0; + var exactMatcher = new RegExp("^" + $.ui.autocomplete.escapeRegex(request.term) + "$", "i"); + camelCaseRegexp = ($.ui.autocomplete.escapeRegex(request.term)).split(/(?=[A-Z])/).join("([a-z0-9_$]*?)"); + var camelCaseMatcher = new RegExp("^" + camelCaseRegexp); + secondaryMatcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), "i"); + + // Return the nested innermost name from the specified object + function nestedName(e) { + return e.l.substring(e.l.lastIndexOf(".") + 1); + } + + function concatResults(a1, a2) { + a1 = a1.concat(a2); + a2.length = 0; + return a1; + } + + if (moduleSearchIndex) { + var mdleCount = 0; + $.each(moduleSearchIndex, function(index, item) { + item.category = catModules; + if (exactMatcher.test(item.l)) { + result.push(item); + mdleCount++; + } else if (camelCaseMatcher.test(item.l)) { + result.push(item); + } else if (secondaryMatcher.test(item.l)) { + secondaryresult.push(item); + } + }); + displayCount = mdleCount; + result = concatResults(result, secondaryresult); + } + if (packageSearchIndex) { + var pCount = 0; + var pkg = ""; + $.each(packageSearchIndex, function(index, item) { + item.category = catPackages; + pkg = (item.m) + ? (item.m + "/" + item.l) + : item.l; + if (exactMatcher.test(item.l)) { + presult.push(item); + pCount++; + } else if (camelCaseMatcher.test(pkg)) { + presult.push(item); + } else if (secondaryMatcher.test(pkg)) { + secondaryresult.push(item); + } + }); + result = result.concat(concatResults(presult, secondaryresult)); + displayCount = (pCount > displayCount) ? pCount : displayCount; + } + if (typeSearchIndex) { + var tCount = 0; + $.each(typeSearchIndex, function(index, item) { + item.category = catTypes; + var s = nestedName(item); + if (exactMatcher.test(s)) { + tresult.push(item); + tCount++; + } else if (camelCaseMatcher.test(s)) { + tresult.push(item); + } else if (secondaryMatcher.test(item.p + "." + item.l)) { + secondaryresult.push(item); + } + }); + result = result.concat(concatResults(tresult, secondaryresult)); + displayCount = (tCount > displayCount) ? tCount : displayCount; + } + if (memberSearchIndex) { + var mCount = 0; + $.each(memberSearchIndex, function(index, item) { + item.category = catMembers; + var s = nestedName(item); + if (exactMatcher.test(s)) { + mresult.push(item); + mCount++; + } else if (camelCaseMatcher.test(s)) { + mresult.push(item); + } else if (secondaryMatcher.test(item.c + "." + item.l)) { + secondaryresult.push(item); + } + }); + result = result.concat(concatResults(mresult, secondaryresult)); + displayCount = (mCount > displayCount) ? mCount : displayCount; + } + if (tagSearchIndex) { + var tgCount = 0; + $.each(tagSearchIndex, function(index, item) { + item.category = catSearchTags; + if (exactMatcher.test(item.l)) { + tgresult.push(item); + tgCount++; + } else if (secondaryMatcher.test(item.l)) { + secondaryresult.push(item); + } + }); + result = result.concat(concatResults(tgresult, secondaryresult)); + displayCount = (tgCount > displayCount) ? tgCount : displayCount; + } + displayCount = (displayCount > 500) ? displayCount : 500; + var counter = function() { + var count = {Modules: 0, Packages: 0, Types: 0, Members: 0, SearchTags: 0}; + var f = function(item) { + count[item.category] += 1; + return (count[item.category] <= displayCount); + }; + return f; + }(); + response(result.filter(counter)); + }, + response: function(event, ui) { + if (!ui.content.length) { + ui.content.push(noResult); + } else { + $("#search").empty(); + } + }, + autoFocus: true, + position: { + collision: "flip" + }, + select: function(event, ui) { + if (ui.item.l !== noResult.l) { + var url = getURLPrefix(ui); + if (ui.item.category === catModules) { + if (useModuleDirectories) { + url += "module-summary.html"; + } else { + url = ui.item.l + "-summary.html"; + } + } else if (ui.item.category === catPackages) { + if (ui.item.url) { + url = ui.item.url; + } else { + url += ui.item.l.replace(/\./g, '/') + "/package-summary.html"; + } + } else if (ui.item.category === catTypes) { + if (ui.item.url) { + url = ui.item.url; + } else if (ui.item.p === "") { + url += ui.item.l + ".html"; + } else { + url += ui.item.p.replace(/\./g, '/') + "/" + ui.item.l + ".html"; + } + } else if (ui.item.category === catMembers) { + if (ui.item.p === "") { + url += ui.item.c + ".html" + "#"; + } else { + url += ui.item.p.replace(/\./g, '/') + "/" + ui.item.c + ".html" + "#"; + } + if (ui.item.url) { + url += ui.item.url; + } else { + url += ui.item.l; + } + } else if (ui.item.category === catSearchTags) { + url += ui.item.u; + } + if (top !== window) { + parent.classFrame.location = pathtoroot + url; + } else { + window.location.href = pathtoroot + url; + } + $("#search").focus(); + } + } + }); +}); diff --git a/docs/5.0.2/serialized-form.html b/docs/5.0.2/serialized-form.html new file mode 100644 index 000000000..f51a7a0b1 --- /dev/null +++ b/docs/5.0.2/serialized-form.html @@ -0,0 +1,211 @@ + + + + + +Serialized Form (datasketches-java 5.0.2 API) + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Serialized Form

    +
    +
    + +
    +
    + + + diff --git a/docs/5.0.2/stylesheet.css b/docs/5.0.2/stylesheet.css new file mode 100644 index 000000000..de945eda2 --- /dev/null +++ b/docs/5.0.2/stylesheet.css @@ -0,0 +1,910 @@ +/* + * Javadoc style sheet + */ + +@import url('resources/fonts/dejavu.css'); + +/* + * Styles for individual HTML elements. + * + * These are styles that are specific to individual HTML elements. Changing them affects the style of a particular + * HTML element throughout the page. + */ + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; + padding:0; + height:100%; + width:100%; +} +iframe { + margin:0; + padding:0; + height:100%; + width:100%; + overflow-y:scroll; + border:none; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a[href]:hover, a[href]:focus { + text-decoration:none; + color:#bb7a2a; +} +a[name] { + color:#353833; +} +a[name]:before, a[name]:target, a[id]:before, a[id]:target { + content:""; + display:inline-block; + position:relative; + padding-top:129px; + margin-top:-129px; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} + +/* + * Styles for HTML generated by javadoc. + * + * These are style classes that are used by the standard doclet to generate HTML documentation. + */ + +/* + * Styles for document title and copyright. + */ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* + * Styles for navigation bar. + */ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.navPadding { + padding-top: 107px; +} +.fixedNav { + position:fixed; + width:100%; + z-index:999; + background-color:#ffffff; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.navListSearch { + float:right; + margin:0 0 0 0; + padding:0; +} +ul.navListSearch li { + list-style:none; + float:right; + padding: 5px 6px; + text-transform:uppercase; +} +ul.navListSearch li label { + position:relative; + right:-16px; +} +ul.subNavList li { + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* + * Styles for page header and footer. + */ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexNav { + position:relative; + font-size:12px; + background-color:#dee3e9; +} +.indexNav ul { + margin-top:0; + padding:5px; +} +.indexNav ul li { + display:inline; + list-style-type:none; + padding-right:10px; + text-transform:uppercase; +} +.indexNav h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* + * Styles for headings. + */ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* + * Styles for page layout containers. + */ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer, +.allClassesContainer, .allPackagesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* + * Styles for lists. + */ +li.circle { + list-style:circle; +} +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* + * Styles for tables. + */ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary, +.requiresSummary, .packagesSummary, .providesSummary, .usesSummary { + width:100%; + border-spacing:0; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary, .requiresSummary, .packagesSummary, .providesSummary, .usesSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption, +.requiresSummary caption, .packagesSummary caption, .providesSummary caption, .usesSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.constantsSummary caption a:link, .constantsSummary caption a:visited, +.useSummary caption a:link, .useSummary caption a:visited { + color:#1f389c; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.deprecatedSummary caption a:link, +.requiresSummary caption a:link, .packagesSummary caption a:link, .providesSummary caption a:link, +.usesSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.requiresSummary caption a:hover, .packagesSummary caption a:hover, .providesSummary caption a:hover, +.usesSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.requiresSummary caption a:active, .packagesSummary caption a:active, .providesSummary caption a:active, +.usesSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.deprecatedSummary caption a:visited, +.requiresSummary caption a:visited, .packagesSummary caption a:visited, .providesSummary caption a:visited, +.usesSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span, +.requiresSummary caption span, .packagesSummary caption span, .providesSummary caption span, +.usesSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span, .packagesSummary caption span.activeTableTab span, +.overviewSummary caption span.activeTableTab span, .typeSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span, .packagesSummary caption span.tableTab span, +.overviewSummary caption span.tableTab span, .typeSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab, +.packagesSummary caption span.tableTab, .packagesSummary caption span.activeTableTab, +.overviewSummary caption span.tableTab, .overviewSummary caption span.activeTableTab, +.typeSummary caption span.tableTab, .typeSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd, +.requiresSummary .tabEnd, .packagesSummary .tabEnd, .providesSummary .tabEnd, .usesSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd, .packagesSummary .activeTableTab .tabEnd, +.overviewSummary .activeTableTab .tabEnd, .typeSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd, .packagesSummary .tableTab .tabEnd, +.overviewSummary .tableTab .tabEnd, .typeSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; +} +.rowColor th, .altColor th { + font-weight:normal; +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td, +.requiresSummary td, .packagesSummary td, .providesSummary td, .usesSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colFirst, th.colSecond, th.colLast, th.colConstructorName, th.colDeprecatedItemName, .useSummary th, +.constantsSummary th, .packagesSummary th, td.colFirst, td.colSecond, td.colLast, .useSummary td, +.constantsSummary td { + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colSecond, th.colLast, th.colConstructorName, th.colDeprecatedItemName, .constantsSummary th, +.packagesSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + font-size:13px; +} +td.colSecond, th.colSecond, td.colLast, th.colConstructorName, th.colDeprecatedItemName, th.colLast { + font-size:13px; +} +.constantsSummary th, .packagesSummary th { + font-size:13px; +} +.providesSummary th.colFirst, .providesSummary th.colLast, .providesSummary td.colFirst, +.providesSummary td.colLast { + white-space:normal; + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.requiresSummary td.colFirst, .requiresSummary th.colFirst, +.packagesSummary td.colFirst, .packagesSummary td.colSecond, .packagesSummary th.colFirst, .packagesSummary th, +.usesSummary td.colFirst, .usesSummary th.colFirst, +.providesSummary td.colFirst, .providesSummary th.colFirst, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colSecond, .memberSummary th.colSecond, .memberSummary th.colConstructorName, +.typeSummary td.colFirst, .typeSummary th.colFirst { + vertical-align:top; +} +.packagesSummary th.colLast, .packagesSummary td.colLast { + white-space:normal; +} +td.colFirst a:link, td.colFirst a:visited, +td.colSecond a:link, td.colSecond a:visited, +th.colFirst a:link, th.colFirst a:visited, +th.colSecond a:link, th.colSecond a:visited, +th.colConstructorName a:link, th.colConstructorName a:visited, +th.colDeprecatedItemName a:link, th.colDeprecatedItemName a:visited, +.constantValuesContainer td a:link, .constantValuesContainer td a:visited, +.allClassesContainer td a:link, .allClassesContainer td a:visited, +.allPackagesContainer td a:link, .allPackagesContainer td a:visited { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor, .altColor th { + background-color:#FFFFFF; +} +.rowColor, .rowColor th { + background-color:#EEEEEF; +} +/* + * Styles for contents. + */ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} +td.colLast div { + padding-top:0px; +} +td.colLast a { + padding-bottom:3px; +} +/* + * Styles for formatting effect. + */ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .implementationLabel, .memberNameLabel, .memberNameLink, +.moduleLabelInPackage, .moduleLabelInType, .overrideSpecifyLabel, .packageLabelInType, +.packageHierarchyLabel, .paramLabel, .returnLabel, .seeLabel, .simpleTagLabel, +.throwsLabel, .typeNameLabel, .typeNameLink, .searchTagLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} +.deprecationBlock { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; + border-style:solid; + border-width:thin; + border-radius:10px; + padding:10px; + margin-bottom:10px; + margin-right:10px; + display:inline-block; +} +div.block div.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} +div.contentContainer ul.blockList li.blockList h2 { + padding-bottom:0px; +} +/* + * Styles for IFRAME. + */ +.mainContainer { + margin:0 auto; + padding:0; + height:100%; + width:100%; + position:fixed; + top:0; + left:0; +} +.leftContainer { + height:100%; + position:fixed; + width:320px; +} +.leftTop { + position:relative; + float:left; + width:315px; + top:0; + left:0; + height:30%; + border-right:6px solid #ccc; + border-bottom:6px solid #ccc; +} +.leftBottom { + position:relative; + float:left; + width:315px; + bottom:0; + left:0; + height:70%; + border-right:6px solid #ccc; + border-top:1px solid #000; +} +.rightContainer { + position:absolute; + left:320px; + top:0; + bottom:0; + height:100%; + right:0; + border-left:1px solid #000; +} +.rightIframe { + margin:0; + padding:0; + height:100%; + right:30px; + width:100%; + overflow:visible; + margin-bottom:30px; +} +/* + * Styles specific to HTML5 elements. + */ +main, nav, header, footer, section { + display:block; +} +/* + * Styles for javadoc search. + */ +.ui-autocomplete-category { + font-weight:bold; + font-size:15px; + padding:7px 0 7px 3px; + background-color:#4D7A97; + color:#FFFFFF; +} +.resultItem { + font-size:13px; +} +.ui-autocomplete { + max-height:85%; + max-width:65%; + overflow-y:scroll; + overflow-x:scroll; + white-space:nowrap; + box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23); +} +ul.ui-autocomplete { + position:fixed; + z-index:999999; + background-color: #FFFFFF; +} +ul.ui-autocomplete li { + float:left; + clear:both; + width:100%; +} +.resultHighlight { + font-weight:bold; +} +.ui-autocomplete .result-item { + font-size: inherit; +} +#search { + background-image:url('resources/glass.png'); + background-size:13px; + background-repeat:no-repeat; + background-position:2px 3px; + padding-left:20px; + position:relative; + right:-18px; +} +#reset { + background-color: rgb(255,255,255); + background-image:url('resources/x.png'); + background-position:center; + background-repeat:no-repeat; + background-size:12px; + border:0 none; + width:16px; + height:17px; + position:relative; + left:-4px; + top:-4px; + font-size:0px; +} +.watermark { + color:#545454; +} +.searchTagDescResult { + font-style:italic; + font-size:11px; +} +.searchTagHolderResult { + font-style:italic; + font-size:12px; +} +.searchTagResult:before, .searchTagResult:target { + color:red; +} +.moduleGraph span { + display:none; + position:absolute; +} +.moduleGraph:hover span { + display:block; + margin: -100px 0 0 100px; + z-index: 1; +} +.methodSignature { + white-space:normal; +} + +/* + * Styles for user-provided tables. + * + * borderless: + * No borders, vertical margins, styled caption. + * This style is provided for use with existing doc comments. + * In general, borderless tables should not be used for layout purposes. + * + * plain: + * Plain borders around table and cells, vertical margins, styled caption. + * Best for small tables or for complex tables for tables with cells that span + * rows and columns, when the "striped" style does not work well. + * + * striped: + * Borders around the table and vertical borders between cells, striped rows, + * vertical margins, styled caption. + * Best for tables that have a header row, and a body containing a series of simple rows. + */ + +table.borderless, +table.plain, +table.striped { + margin-top: 10px; + margin-bottom: 10px; +} +table.borderless > caption, +table.plain > caption, +table.striped > caption { + font-weight: bold; + font-size: smaller; +} +table.borderless th, table.borderless td, +table.plain th, table.plain td, +table.striped th, table.striped td { + padding: 2px 5px; +} +table.borderless, +table.borderless > thead > tr > th, table.borderless > tbody > tr > th, table.borderless > tr > th, +table.borderless > thead > tr > td, table.borderless > tbody > tr > td, table.borderless > tr > td { + border: none; +} +table.borderless > thead > tr, table.borderless > tbody > tr, table.borderless > tr { + background-color: transparent; +} +table.plain { + border-collapse: collapse; + border: 1px solid black; +} +table.plain > thead > tr, table.plain > tbody tr, table.plain > tr { + background-color: transparent; +} +table.plain > thead > tr > th, table.plain > tbody > tr > th, table.plain > tr > th, +table.plain > thead > tr > td, table.plain > tbody > tr > td, table.plain > tr > td { + border: 1px solid black; +} +table.striped { + border-collapse: collapse; + border: 1px solid black; +} +table.striped > thead { + background-color: #E3E3E3; +} +table.striped > thead > tr > th, table.striped > thead > tr > td { + border: 1px solid black; +} +table.striped > tbody > tr:nth-child(even) { + background-color: #EEE +} +table.striped > tbody > tr:nth-child(odd) { + background-color: #FFF +} +table.striped > tbody > tr > th, table.striped > tbody > tr > td { + border-left: 1px solid black; + border-right: 1px solid black; +} +table.striped > tbody > tr > th { + font-weight: normal; +} diff --git a/docs/5.0.2/type-search-index.js b/docs/5.0.2/type-search-index.js new file mode 100644 index 000000000..a1da34403 --- /dev/null +++ b/docs/5.0.2/type-search-index.js @@ -0,0 +1 @@ +typeSearchIndex = [{"l":"All Classes","url":"allclasses-index.html"},{"p":"org.apache.datasketches.theta","l":"AnotB"},{"p":"org.apache.datasketches.tuple","l":"AnotB"},{"p":"org.apache.datasketches.thetacommon","l":"SetOperationCornerCases.AnotbAction"},{"p":"org.apache.datasketches.common","l":"ArrayOfBooleansSerDe"},{"p":"org.apache.datasketches.tuple.arrayofdoubles","l":"ArrayOfDoublesAnotB"},{"p":"org.apache.datasketches.tuple.arrayofdoubles","l":"ArrayOfDoublesAnotBImpl"},{"p":"org.apache.datasketches.tuple.arrayofdoubles","l":"ArrayOfDoublesCombiner"},{"p":"org.apache.datasketches.tuple.arrayofdoubles","l":"ArrayOfDoublesCompactSketch"},{"p":"org.apache.datasketches.tuple.arrayofdoubles","l":"ArrayOfDoublesIntersection"},{"p":"org.apache.datasketches.common","l":"ArrayOfDoublesSerDe"},{"p":"org.apache.datasketches.tuple.arrayofdoubles","l":"ArrayOfDoublesSetOperationBuilder"},{"p":"org.apache.datasketches.tuple.arrayofdoubles","l":"ArrayOfDoublesSketch"},{"p":"org.apache.datasketches.tuple.arrayofdoubles","l":"ArrayOfDoublesSketches"},{"p":"org.apache.datasketches.tuple.arrayofdoubles","l":"ArrayOfDoublesSketchIterator"},{"p":"org.apache.datasketches.tuple.arrayofdoubles","l":"ArrayOfDoublesUnion"},{"p":"org.apache.datasketches.tuple.arrayofdoubles","l":"ArrayOfDoublesUpdatableSketch"},{"p":"org.apache.datasketches.tuple.arrayofdoubles","l":"ArrayOfDoublesUpdatableSketchBuilder"},{"p":"org.apache.datasketches.common","l":"ArrayOfItemsSerDe"},{"p":"org.apache.datasketches.common","l":"ArrayOfLongsSerDe"},{"p":"org.apache.datasketches.common","l":"ArrayOfNumbersSerDe"},{"p":"org.apache.datasketches.common","l":"ArrayOfStringsSerDe"},{"p":"org.apache.datasketches.tuple.strings","l":"ArrayOfStringsSketch"},{"p":"org.apache.datasketches.tuple.strings","l":"ArrayOfStringsSummary"},{"p":"org.apache.datasketches.tuple.strings","l":"ArrayOfStringsSummaryDeserializer"},{"p":"org.apache.datasketches.tuple.strings","l":"ArrayOfStringsSummaryFactory"},{"p":"org.apache.datasketches.tuple.strings","l":"ArrayOfStringsSummarySetOperations"},{"p":"org.apache.datasketches.common","l":"ArrayOfUtf16StringsSerDe"},{"p":"org.apache.datasketches.quantilescommon","l":"BinarySearch"},{"p":"org.apache.datasketches.thetacommon","l":"BinomialBoundsN"},{"p":"org.apache.datasketches.theta","l":"BitPacking"},{"p":"org.apache.datasketches.common","l":"BoundsOnBinomialProportions"},{"p":"org.apache.datasketches.common","l":"BoundsOnRatiosInSampledSets"},{"p":"org.apache.datasketches.thetacommon","l":"BoundsOnRatiosInThetaSketchedSets"},{"p":"org.apache.datasketches.thetacommon","l":"BoundsOnRatiosInTupleSketchedSets"},{"p":"org.apache.datasketches.partitions","l":"BoundsRule"},{"p":"org.apache.datasketches.common","l":"ByteArrayUtil"},{"p":"org.apache.datasketches.quantiles","l":"ClassicUtil"},{"p":"org.apache.datasketches.quantiles","l":"CompactDoublesSketch"},{"p":"org.apache.datasketches.theta","l":"CompactSketch"},{"p":"org.apache.datasketches.tuple","l":"CompactSketch"},{"p":"org.apache.datasketches.cpc","l":"CompressionCharacterization"},{"p":"org.apache.datasketches.thetacommon","l":"SetOperationCornerCases.CornerCase"},{"p":"org.apache.datasketches.cpc","l":"CpcSketch"},{"p":"org.apache.datasketches.cpc","l":"CpcUnion"},{"p":"org.apache.datasketches.cpc","l":"CpcWrapper"},{"p":"org.apache.datasketches.tuple","l":"DeserializeResult"},{"p":"org.apache.datasketches.tuple.adouble","l":"DoubleSketch"},{"p":"org.apache.datasketches.quantiles","l":"DoublesSketch"},{"p":"org.apache.datasketches.quantiles","l":"DoublesSketchBuilder"},{"p":"org.apache.datasketches.quantiles","l":"DoublesSketchIterator"},{"p":"org.apache.datasketches.quantiles","l":"DoublesSketchSortedView"},{"p":"org.apache.datasketches.quantilescommon","l":"DoublesSortedView"},{"p":"org.apache.datasketches.quantilescommon","l":"DoublesSortedViewIterator"},{"p":"org.apache.datasketches.tuple.adouble","l":"DoubleSummary"},{"p":"org.apache.datasketches.tuple.adouble","l":"DoubleSummaryDeserializer"},{"p":"org.apache.datasketches.tuple.adouble","l":"DoubleSummaryFactory"},{"p":"org.apache.datasketches.tuple.adouble","l":"DoubleSummarySetOperations"},{"p":"org.apache.datasketches.quantiles","l":"DoublesUnion"},{"p":"org.apache.datasketches.quantiles","l":"DoublesUnionBuilder"},{"p":"org.apache.datasketches.frequencies","l":"ErrorType"},{"p":"org.apache.datasketches.common","l":"Family"},{"p":"org.apache.datasketches.fdt","l":"FdtSketch"},{"p":"org.apache.datasketches.tuple","l":"Filter"},{"p":"org.apache.datasketches.quantilescommon","l":"FloatsSortedView"},{"p":"org.apache.datasketches.quantilescommon","l":"FloatsSortedViewIterator"},{"p":"org.apache.datasketches.quantilescommon","l":"GenericInequalitySearch"},{"p":"org.apache.datasketches.quantilescommon","l":"GenericPartitionBoundaries"},{"p":"org.apache.datasketches.quantilescommon","l":"GenericSortedView"},{"p":"org.apache.datasketches.quantilescommon","l":"GenericSortedViewIterator"},{"p":"org.apache.datasketches.fdt","l":"Group"},{"p":"org.apache.datasketches.theta","l":"HashIterator"},{"p":"org.apache.datasketches.thetacommon","l":"HashOperations"},{"p":"org.apache.datasketches.hll","l":"HllSketch"},{"p":"org.apache.datasketches.quantilescommon","l":"GenericInequalitySearch.Inequality"},{"p":"org.apache.datasketches.quantilescommon","l":"InequalitySearch"},{"p":"org.apache.datasketches.tuple.aninteger","l":"IntegerSketch"},{"p":"org.apache.datasketches.tuple.aninteger","l":"IntegerSummary"},{"p":"org.apache.datasketches.tuple.aninteger","l":"IntegerSummaryDeserializer"},{"p":"org.apache.datasketches.tuple.aninteger","l":"IntegerSummaryFactory"},{"p":"org.apache.datasketches.tuple.aninteger","l":"IntegerSummarySetOperations"},{"p":"org.apache.datasketches.thetacommon","l":"SetOperationCornerCases.IntersectAction"},{"p":"org.apache.datasketches.theta","l":"Intersection"},{"p":"org.apache.datasketches.tuple","l":"Intersection"},{"p":"org.apache.datasketches.frequencies","l":"ItemsSketch"},{"p":"org.apache.datasketches.quantiles","l":"ItemsSketch"},{"p":"org.apache.datasketches.quantiles","l":"ItemsSketchIterator"},{"p":"org.apache.datasketches.quantiles","l":"ItemsSketchSortedView"},{"p":"org.apache.datasketches.quantiles","l":"ItemsUnion"},{"p":"org.apache.datasketches.theta","l":"JaccardSimilarity"},{"p":"org.apache.datasketches.tuple","l":"JaccardSimilarity"},{"p":"org.apache.datasketches.kll","l":"KllDoublesSketch"},{"p":"org.apache.datasketches.kll","l":"KllDoublesSketchIterator"},{"p":"org.apache.datasketches.kll","l":"KllDoublesSketchSortedView"},{"p":"org.apache.datasketches.kll","l":"KllFloatsSketch"},{"p":"org.apache.datasketches.kll","l":"KllFloatsSketchIterator"},{"p":"org.apache.datasketches.kll","l":"KllFloatsSketchSortedView"},{"p":"org.apache.datasketches.kll","l":"KllItemsSketch"},{"p":"org.apache.datasketches.kll","l":"KllItemsSketchIterator"},{"p":"org.apache.datasketches.kll","l":"KllItemsSketchSortedView"},{"p":"org.apache.datasketches.kll","l":"KllSketch"},{"p":"org.apache.datasketches.kll","l":"KllSketchIterator"},{"p":"org.apache.datasketches.frequencies","l":"LongsSketch"},{"p":"org.apache.datasketches.cpc","l":"MergingValidation"},{"p":"org.apache.datasketches.tuple.adouble","l":"DoubleSummary.Mode"},{"p":"org.apache.datasketches.tuple.aninteger","l":"IntegerSummary.Mode"},{"p":"org.apache.datasketches.hash","l":"MurmurHash3"},{"p":"org.apache.datasketches.hash","l":"MurmurHash3Adaptor"},{"p":"org.apache.datasketches.quantilescommon","l":"PartitionBoundaries"},{"p":"org.apache.datasketches.partitions","l":"Partitioner.PartitionBoundsRow"},{"p":"org.apache.datasketches.partitions","l":"Partitioner"},{"p":"org.apache.datasketches.quantilescommon","l":"PartitioningFeature"},{"p":"org.apache.datasketches.fdt","l":"PostProcessor"},{"p":"org.apache.datasketches.quantilescommon","l":"QuantilesAPI"},{"p":"org.apache.datasketches.quantilescommon","l":"QuantilesDoublesAPI"},{"p":"org.apache.datasketches.quantilescommon","l":"QuantilesDoublesSketchIterator"},{"p":"org.apache.datasketches.quantilescommon","l":"QuantileSearchCriteria"},{"p":"org.apache.datasketches.quantilescommon","l":"QuantilesFloatsAPI"},{"p":"org.apache.datasketches.quantilescommon","l":"QuantilesFloatsSketchIterator"},{"p":"org.apache.datasketches.quantilescommon","l":"QuantilesGenericAPI"},{"p":"org.apache.datasketches.quantilescommon","l":"QuantilesGenericSketchIterator"},{"p":"org.apache.datasketches.quantilescommon","l":"QuantilesSketchIterator"},{"p":"org.apache.datasketches.quantilescommon","l":"QuantilesUtil"},{"p":"org.apache.datasketches.cpc","l":"QuickMergingValidation"},{"p":"org.apache.datasketches.thetacommon","l":"QuickSelect"},{"p":"org.apache.datasketches.req","l":"ReqDebug"},{"p":"org.apache.datasketches.req","l":"ReqSketch"},{"p":"org.apache.datasketches.req","l":"ReqSketchBuilder"},{"p":"org.apache.datasketches.req","l":"ReqSketchIterator"},{"p":"org.apache.datasketches.req","l":"ReqSketchSortedView"},{"p":"org.apache.datasketches.sampling","l":"ReservoirItemsSketch"},{"p":"org.apache.datasketches.sampling","l":"ReservoirItemsUnion"},{"p":"org.apache.datasketches.sampling","l":"ReservoirLongsSketch"},{"p":"org.apache.datasketches.sampling","l":"ReservoirLongsUnion"},{"p":"org.apache.datasketches.common","l":"ResizeFactor"},{"p":"org.apache.datasketches.frequencies","l":"ItemsSketch.Row"},{"p":"org.apache.datasketches.frequencies","l":"LongsSketch.Row"},{"p":"org.apache.datasketches.sampling","l":"SampleSubsetSummary"},{"p":"org.apache.datasketches.tuple","l":"SerializerDeserializer"},{"p":"org.apache.datasketches.theta","l":"SetOperation"},{"p":"org.apache.datasketches.theta","l":"SetOperationBuilder"},{"p":"org.apache.datasketches.thetacommon","l":"SetOperationCornerCases"},{"p":"org.apache.datasketches.theta","l":"Sketch"},{"p":"org.apache.datasketches.tuple","l":"Sketch"},{"p":"org.apache.datasketches.theta","l":"Sketches"},{"p":"org.apache.datasketches.tuple","l":"Sketches"},{"p":"org.apache.datasketches.common","l":"SketchesArgumentException"},{"p":"org.apache.datasketches.common","l":"SketchesException"},{"p":"org.apache.datasketches.common","l":"SketchesReadOnlyException"},{"p":"org.apache.datasketches.common","l":"SketchesStateException"},{"p":"org.apache.datasketches.partitions","l":"SketchFillRequest"},{"p":"org.apache.datasketches.kll","l":"KllSketch.SketchStructure"},{"p":"org.apache.datasketches.kll","l":"KllSketch.SketchType"},{"p":"org.apache.datasketches.tuple","l":"SerializerDeserializer.SketchType"},{"p":"org.apache.datasketches.quantilescommon","l":"SortedView"},{"p":"org.apache.datasketches.quantilescommon","l":"SortedViewIterator"},{"p":"org.apache.datasketches.partitions","l":"Partitioner.StackElement"},{"p":"org.apache.datasketches.cpc","l":"StreamingValidation"},{"p":"org.apache.datasketches.tuple","l":"Summary"},{"p":"org.apache.datasketches.tuple","l":"SummaryDeserializer"},{"p":"org.apache.datasketches.tuple","l":"SummaryFactory"},{"p":"org.apache.datasketches.tuple","l":"SummarySetOperations"},{"p":"org.apache.datasketches.common","l":"SuppressFBWarnings"},{"p":"org.apache.datasketches.cpc","l":"TestUtil"},{"p":"org.apache.datasketches.hll","l":"TgtHllType"},{"p":"org.apache.datasketches.thetacommon","l":"ThetaUtil"},{"p":"org.apache.datasketches.tuple","l":"TupleSketchIterator"},{"p":"org.apache.datasketches.hll","l":"Union"},{"p":"org.apache.datasketches.theta","l":"Union"},{"p":"org.apache.datasketches.tuple","l":"Union"},{"p":"org.apache.datasketches.thetacommon","l":"SetOperationCornerCases.UnionAction"},{"p":"org.apache.datasketches.hllmap","l":"UniqueCountMap"},{"p":"org.apache.datasketches.tuple","l":"UpdatableSketch"},{"p":"org.apache.datasketches.tuple","l":"UpdatableSketchBuilder"},{"p":"org.apache.datasketches.tuple","l":"UpdatableSummary"},{"p":"org.apache.datasketches.quantiles","l":"UpdateDoublesSketch"},{"p":"org.apache.datasketches.theta","l":"UpdateReturnState"},{"p":"org.apache.datasketches.theta","l":"UpdateSketch"},{"p":"org.apache.datasketches.theta","l":"UpdateSketchBuilder"},{"p":"org.apache.datasketches.common","l":"Util"},{"p":"org.apache.datasketches.tuple","l":"Util"},{"p":"org.apache.datasketches.sampling","l":"VarOptItemsSamples.VarOptItemsIterator"},{"p":"org.apache.datasketches.sampling","l":"VarOptItemsSamples"},{"p":"org.apache.datasketches.sampling","l":"VarOptItemsSketch"},{"p":"org.apache.datasketches.sampling","l":"VarOptItemsUnion"},{"p":"org.apache.datasketches.sampling","l":"VarOptItemsSamples.WeightedSample"},{"p":"org.apache.datasketches.hash","l":"XxHash"}] \ No newline at end of file diff --git a/docs/5.0.2/type-search-index.zip b/docs/5.0.2/type-search-index.zip new file mode 100644 index 000000000..fe40ad101 Binary files /dev/null and b/docs/5.0.2/type-search-index.zip differ