The serialization
- *
* @author Alexander Saydakov
*/
public class ArrayOfStringsSerDe extends ArrayOfItemsSerDe Note: This is an approximation to the true mapping from numCoupons to N,
* which has a range of validity roughly from 0 to 6 million coupons. The k of the implied coupon sketch, which must not be confused with the k of the HLL
- * sketch. In this application k is always 2^26, which is the number of address bits of the
+ * The k of the implied coupon sketch must not be confused with the k of the HLL
+ * sketch. In this context k is always 2^26, which is the number of address bits of the
* 32-bit coupon.{@code
* 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.
+ * double estUB = sketch.getUpperBound(1); //the upper bound at 1 standard deviation.
+ * double estLB = sketch.getLowerBound(1); //the lower bound at 1 standard deviation.
* //OR
* System.out.println(sketch.toString()); //will output a summary of the sketch.
* }
diff --git a/src/main/java/org/apache/datasketches/hll/PairIterator.java b/src/main/java/org/apache/datasketches/hll/PairIterator.java
index 0282152a3..1e56ec7f8 100644
--- a/src/main/java/org/apache/datasketches/hll/PairIterator.java
+++ b/src/main/java/org/apache/datasketches/hll/PairIterator.java
@@ -36,13 +36,14 @@ String getHeader() {
* In LIST and SET modes, this gets the iterating index into the integer array of HLL key/value
* pairs.
* In HLL mode, this is the iterating index into the hypothetical array of HLL values, which may
- * be physically contructed differently based on the compaction scheme (HLL_4, HLL_6, HLL_8).
+ * be physically constructed differently based on the compaction scheme (HLL_4, HLL_6, HLL_8).
* @return the index.
*/
abstract int getIndex();
/**
- * Gets the key, the low 26 bits of an pair, and can be up to 26 bits in length.
+ * Gets the key from the low 26 bits of a pair.
+ * The key corresponds to the address in the HLL array and can be up to 26 bits in length.
* @return the key
*/
abstract int getKey();
diff --git a/src/main/java/org/apache/datasketches/kll/KllDirectDoublesSketch.java b/src/main/java/org/apache/datasketches/kll/KllDirectDoublesSketch.java
index 0283c015b..6638007b6 100644
--- a/src/main/java/org/apache/datasketches/kll/KllDirectDoublesSketch.java
+++ b/src/main/java/org/apache/datasketches/kll/KllDirectDoublesSketch.java
@@ -86,7 +86,7 @@ class KllDirectDoublesSketch extends KllDoublesSketch {
* @param k parameter that controls size of the sketch and accuracy of estimates
* @param m parameter that controls the minimum level width in items.
* @param dstSeg the given destination MemorySegment object for use by the sketch
- * @param mSegReq the callback for the sketch to request a larger MemorySegment.
+ * @param mSegmentRequest the callback for the sketch to request a larger MemorySegment.
* @return a new instance of this sketch
*/
static KllDirectDoublesSketch newDirectUpdatableInstance(
diff --git a/src/main/java/org/apache/datasketches/kll/KllDirectLongsSketch.java b/src/main/java/org/apache/datasketches/kll/KllDirectLongsSketch.java
index 1de0b2ff1..d4c89322b 100644
--- a/src/main/java/org/apache/datasketches/kll/KllDirectLongsSketch.java
+++ b/src/main/java/org/apache/datasketches/kll/KllDirectLongsSketch.java
@@ -86,7 +86,7 @@ class KllDirectLongsSketch extends KllLongsSketch {
* @param k parameter that controls size of the sketch and accuracy of estimates
* @param m parameter that controls the minimum level width in items.
* @param dstSeg the given destination MemorySegment object for use by the sketch
- * @param mSegReq the callback for the sketch to request a larger MemorySegment.
+ * @param mSegmentRequest the callback for the sketch to request a larger MemorySegment.
* @return a new instance of this sketch
*/
static KllDirectLongsSketch newDirectUpdatableInstance(
diff --git a/src/main/java/org/apache/datasketches/kll/KllPreambleUtil.java b/src/main/java/org/apache/datasketches/kll/KllPreambleUtil.java
index e7df5cfd6..27a6372bb 100644
--- a/src/main/java/org/apache/datasketches/kll/KllPreambleUtil.java
+++ b/src/main/java/org/apache/datasketches/kll/KllPreambleUtil.java
@@ -52,7 +52,7 @@
* This allows the possibility of the introduction of different serialization
* schemes with minimal impact on the rest of the library.
This class contains a highly specialized sort called blockyTandemMergeSort(). - * It also contains methods that are used while building histograms and other common - * functions.
+ *This class contains methods that are used while building histograms and other common functions.
* * @author Lee Rhodes */ diff --git a/src/main/java/org/apache/datasketches/quantiles/ItemsMergeImpl.java b/src/main/java/org/apache/datasketches/quantiles/ItemsMergeImpl.java index 5105abe8a..84d62dee6 100644 --- a/src/main/java/org/apache/datasketches/quantiles/ItemsMergeImpl.java +++ b/src/main/java/org/apache/datasketches/quantiles/ItemsMergeImpl.java @@ -219,8 +219,7 @@ private staticbyte values are treated as unsigned.
*
- * Sketch: The count of items seen is limited to 48 bits (~256 trillion) even * though there are adjacent unused preamble bits. The acceptance probability for an item is a @@ -80,7 +80,7 @@ * * * - *
VarOpt: A VarOpt sketch has a more complex internal items structure and * requires a larger preamble. Values serving a similar purpose in both reservoir and varopt sampling @@ -129,7 +129,7 @@ * * * - *
An empty sketch requires 8 bytes. * diff --git a/src/main/java/org/apache/datasketches/sampling/VarOptItemsSamples.java b/src/main/java/org/apache/datasketches/sampling/VarOptItemsSamples.java index 00ad3fd6f..15d84512b 100644 --- a/src/main/java/org/apache/datasketches/sampling/VarOptItemsSamples.java +++ b/src/main/java/org/apache/datasketches/sampling/VarOptItemsSamples.java @@ -217,12 +217,9 @@ public void setClass(final Class> clazz) { } /** - * 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 samples from the sketch. The result will be 0 for an empty sketch. * - * @return The number of items and weights in the sketch + * @return The number of samples (items and weights) in the sketch */ public int getNumSamples() { loadArrays(); @@ -232,7 +229,7 @@ public int getNumSamples() { /** * 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. - * @return The number of samples contained in the sketch. + * @return The samples contained in the sketch. */ public T[] items() { loadArrays(); @@ -253,7 +250,7 @@ public T items(final int i) { /** * 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. - * @return The number of samples contained in the sketch. + * @return The array of weights contained in the sketch. */ public double[] weights() { loadArrays(); diff --git a/src/main/java/org/apache/datasketches/tdigest/BinarySearch.java b/src/main/java/org/apache/datasketches/tdigest/BinarySearch.java index cdd14b89b..209d1727e 100644 --- a/src/main/java/org/apache/datasketches/tdigest/BinarySearch.java +++ b/src/main/java/org/apache/datasketches/tdigest/BinarySearch.java @@ -31,9 +31,9 @@ public BinarySearch() { } /** * Returns an index to the first element in the range [first, last) such that - * element < value is false (i.e. that is greater than or equal to value), + * {@code element < value} is false (i.e. that is greater than or equal to value), * or last if no such element is found. - * The range [first, last) must be partitioned with respect to the expression element < value, + * The range [first, last) must be partitioned with respect to the expression {@code element < value}, * i.e., all elements for which the expression is true must precede all elements * for which the expression is false. * A fully-sorted range meets this criterion. @@ -64,9 +64,9 @@ static int lowerBound(final double[] values, int first, final int last, final do /** * Returns an index to the first element in the range [first, last) such that - * value < element is true (i.e. that is strictly greater than value), + * {@code value < element} is true (i.e. that is strictly greater than value), * or last if no such element is found. - * The range [first, last) must be partitioned with respect to the expression !(value < element), + * The range [first, last) must be partitioned with respect to the expression {@code !(value < element)}, * i.e., all elements for which the expression is true must precede all elements * for which the expression is false. * A fully-sorted range meets this criterion. diff --git a/src/main/java/org/apache/datasketches/theta/CompactOperations.java b/src/main/java/org/apache/datasketches/theta/CompactOperations.java index 46d2d7e7e..99d406600 100644 --- a/src/main/java/org/apache/datasketches/theta/CompactOperations.java +++ b/src/main/java/org/apache/datasketches/theta/CompactOperations.java @@ -326,7 +326,7 @@ static long[] compactCache(final long[] srcCache, final int curCount, /** * This corrects a temporary anomalous condition where compact() or toByteArray() is called on an UpdatableThetaSketch - * that was initialized with p < 1.0 and update() was never called. In this case Theta < 1.0, + * that was initialized with {@code p < 1.0} and update() was never called. In this case {@code Theta < 1.0}, * curCount = 0, and empty = true. The correction is to change Theta to 1.0, which makes the * returning sketch empty. This should only be used in the compaction or serialization of an * UpdatableThetaSketch. diff --git a/src/main/java/org/apache/datasketches/theta/ThetaSketch.java b/src/main/java/org/apache/datasketches/theta/ThetaSketch.java index 1b82ec76b..8dcefacdc 100644 --- a/src/main/java/org/apache/datasketches/theta/ThetaSketch.java +++ b/src/main/java/org/apache/datasketches/theta/ThetaSketch.java @@ -551,7 +551,7 @@ public static String toString(final MemorySegment seg) { * Gets the internal cache array. For on-heap sketches this will return a reference to the actual * cache array. For MemorySegment-based sketches this returns a copy. * - *
This can be an expensive operation and is intended for diagnostic & test applications. + *
This can be an expensive operation and is intended for diagnostic & test applications. * Use {@link #iterator() iterator()} instead.
* @return the internal cache array. */ diff --git a/src/main/java/org/apache/datasketches/thetacommon/BoundsOnRatiosInThetaSketchedSets.java b/src/main/java/org/apache/datasketches/thetacommon/BoundsOnRatiosInThetaSketchedSets.java index 5337efc44..36687b1b0 100644 --- a/src/main/java/org/apache/datasketches/thetacommon/BoundsOnRatiosInThetaSketchedSets.java +++ b/src/main/java/org/apache/datasketches/thetacommon/BoundsOnRatiosInThetaSketchedSets.java @@ -39,9 +39,9 @@ *The Sketching Core Library provides a range of stochastic streaming algorithms and closely @@ -33,9 +33,9 @@
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 +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. +The precise type of such an unchecked exception does not form part of any method's contract.