You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by le...@apache.org on 2019/08/27 01:31:36 UTC

[incubator-datasketches-java] 01/02: Fix all but one javadoc warnings in main tree.

This is an automated email from the ASF dual-hosted git repository.

leerho pushed a commit to branch FixJavadocWarningsMain
in repository https://gitbox.apache.org/repos/asf/incubator-datasketches-java.git

commit a95434dd7307410d2fd459bd608b5637a319140d
Author: Lee Rhodes <le...@users.noreply.github.com>
AuthorDate: Mon Aug 26 18:26:14 2019 -0700

    Fix all but one javadoc warnings in main tree.
---
 src/main/java/com/yahoo/sketches/ByteArrayUtil.java         |  4 ++++
 src/main/java/com/yahoo/sketches/cpc/CpcSketch.java         |  4 ++++
 src/main/java/com/yahoo/sketches/fdt/Group.java             |  9 ++++-----
 src/main/java/com/yahoo/sketches/fdt/PostProcessor.java     |  2 +-
 src/main/java/com/yahoo/sketches/hash/XxHash.java           |  9 ++++++++-
 src/main/java/com/yahoo/sketches/hll/HllSketch.java         |  8 ++++++++
 src/main/java/com/yahoo/sketches/hll/TgtHllType.java        |  1 +
 src/main/java/com/yahoo/sketches/kll/KllFloatsSketch.java   |  8 +++++++-
 .../java/com/yahoo/sketches/quantiles/DoublesSketch.java    |  3 +++
 src/main/java/com/yahoo/sketches/quantiles/ItemsSketch.java |  9 +++++++++
 .../com/yahoo/sketches/quantiles/UpdateDoublesSketch.java   |  3 +++
 .../com/yahoo/sketches/sampling/SampleSubsetSummary.java    | 12 ++++++++++++
 .../com/yahoo/sketches/sampling/VarOptItemsSamples.java     |  4 +++-
 .../sketches/tuple/ArrayOfDoublesSetOperationBuilder.java   | 13 ++++++++++---
 14 files changed, 77 insertions(+), 12 deletions(-)

diff --git a/src/main/java/com/yahoo/sketches/ByteArrayUtil.java b/src/main/java/com/yahoo/sketches/ByteArrayUtil.java
index 5c973b4..000a6c7 100644
--- a/src/main/java/com/yahoo/sketches/ByteArrayUtil.java
+++ b/src/main/java/com/yahoo/sketches/ByteArrayUtil.java
@@ -19,6 +19,10 @@
 
 package com.yahoo.sketches;
 
+/**
+ * Useful methods for byte arrays.
+ * @author Lee Rhodes
+ */
 public final class ByteArrayUtil {
 
   /**
diff --git a/src/main/java/com/yahoo/sketches/cpc/CpcSketch.java b/src/main/java/com/yahoo/sketches/cpc/CpcSketch.java
index f05b8c7..d884adb 100644
--- a/src/main/java/com/yahoo/sketches/cpc/CpcSketch.java
+++ b/src/main/java/com/yahoo/sketches/cpc/CpcSketch.java
@@ -64,6 +64,10 @@ import com.yahoo.sketches.Family;
 public final class CpcSketch {
   private static final String LS = System.getProperty("line.separator");
   private static final double[] kxpByteLookup = new double[256];
+
+  /**
+   * The default Log_base2 of K
+   */
   public static final int DEFAULT_LG_K = 11;
   final long seed;
   //common variables
diff --git a/src/main/java/com/yahoo/sketches/fdt/Group.java b/src/main/java/com/yahoo/sketches/fdt/Group.java
index 5561131..f94f825 100644
--- a/src/main/java/com/yahoo/sketches/fdt/Group.java
+++ b/src/main/java/com/yahoo/sketches/fdt/Group.java
@@ -38,12 +38,11 @@ public class Group implements Comparable<Group> {
   private final static String hfmt =
       "%12s"  + "%15s"    + "%15s"    + "%15s"    + "%12s"   + "%12s"   + " %s";
 
+  /**
+   * Construct an empty Group
+   */
   public Group() { }
 
-  public Group copy() {
-    return new Group();
-  }
-
   /**
    * Specifies the parameters to be listed as columns
    * @param priKey the primary key of the FDT sketch
@@ -117,7 +116,7 @@ public class Group implements Comparable<Group> {
   /**
    * Note: this class has a natural ordering that is inconsistent with equals.
    * Ignore FindBugs EQ_COMPARETO_USE_OBJECT_EQUALS warning.
-   * @param that the Group to compare to
+   * @param that The Group to compare to
    */
   @Override
   public int compareTo(final Group that) {
diff --git a/src/main/java/com/yahoo/sketches/fdt/PostProcessor.java b/src/main/java/com/yahoo/sketches/fdt/PostProcessor.java
index 1a3bf08..9d7c038 100644
--- a/src/main/java/com/yahoo/sketches/fdt/PostProcessor.java
+++ b/src/main/java/com/yahoo/sketches/fdt/PostProcessor.java
@@ -140,7 +140,7 @@ public class PostProcessor {
         final double lb = sketch.getLowerBound(numStdDev, count);
         final double thresh = (double) count / sketch.getRetainedEntries();
         final double rse = (sketch.getUpperBound(1, count) / est) - 1.0;
-        final Group gp = group.copy();
+        final Group gp = new Group();
         gp.init(priKey, count, est, ub, lb, thresh, rse);
         list.add(gp);
       }
diff --git a/src/main/java/com/yahoo/sketches/hash/XxHash.java b/src/main/java/com/yahoo/sketches/hash/XxHash.java
index 13ff437..eb36ef8 100644
--- a/src/main/java/com/yahoo/sketches/hash/XxHash.java
+++ b/src/main/java/com/yahoo/sketches/hash/XxHash.java
@@ -47,7 +47,14 @@ public class XxHash {
   private static final long P4 = -8796714831421723037L;
   private static final long P5 =  2870177450012600261L;
 
-
+  /**
+   * Compute the has of the given Memory object.
+   * @param mem The given Memory object
+   * @param offsetBytes Starting at this offset in bytes
+   * @param lengthBytes Continuing for this number of bytes
+   * @param seed use this seed for the hash function
+   * @return return the resulting 64-bit hash value.
+   */
   public static long hash(final Memory mem, final long offsetBytes, final long lengthBytes,
       final long seed) {
     return mem.xxHash64(offsetBytes, lengthBytes, seed);
diff --git a/src/main/java/com/yahoo/sketches/hll/HllSketch.java b/src/main/java/com/yahoo/sketches/hll/HllSketch.java
index c052c7d..c38f17d 100644
--- a/src/main/java/com/yahoo/sketches/hll/HllSketch.java
+++ b/src/main/java/com/yahoo/sketches/hll/HllSketch.java
@@ -63,7 +63,15 @@ import com.yahoo.sketches.SketchesArgumentException;
  * @author Kevin Lang
  */
 public class HllSketch extends BaseHllSketch {
+
+  /**
+   * The default Log_base2 of K
+   */
   public static final int DEFAULT_LG_K = 12;
+
+  /**
+   * The default HLL-TYPE is HLL_4
+   */
   public static final TgtHllType DEFAULT_HLL_TYPE = TgtHllType.HLL_4;
 
   private static final String LS = System.getProperty("line.separator");
diff --git a/src/main/java/com/yahoo/sketches/hll/TgtHllType.java b/src/main/java/com/yahoo/sketches/hll/TgtHllType.java
index 515069c..50bbafc 100644
--- a/src/main/java/com/yahoo/sketches/hll/TgtHllType.java
+++ b/src/main/java/com/yahoo/sketches/hll/TgtHllType.java
@@ -51,6 +51,7 @@ package com.yahoo.sketches.hll;
 
  * @author Lee Rhodes
  */
+@SuppressWarnings("javadoc")
 public enum TgtHllType { HLL_4, HLL_6, HLL_8;
 
   static final TgtHllType values[] = values();
diff --git a/src/main/java/com/yahoo/sketches/kll/KllFloatsSketch.java b/src/main/java/com/yahoo/sketches/kll/KllFloatsSketch.java
index 9e6a820..6ca4b9b 100644
--- a/src/main/java/com/yahoo/sketches/kll/KllFloatsSketch.java
+++ b/src/main/java/com/yahoo/sketches/kll/KllFloatsSketch.java
@@ -150,6 +150,9 @@ import com.yahoo.sketches.Util;
  */
 public class KllFloatsSketch {
 
+  /**
+   * The default value of K.
+   */
   public static final int DEFAULT_K = 200;
   static final int DEFAULT_M = 8;
   static final int MIN_K = DEFAULT_M;
@@ -479,7 +482,7 @@ public class KllFloatsSketch {
     final float[] quantiles = new float[fractions.length];
     for (int i = 0; i < fractions.length; i++) {
       final double fraction = fractions[i];
-      if (fraction < 0.0 || fraction > 1.0) {
+      if ((fraction < 0.0) || (fraction > 1.0)) {
         throw new SketchesArgumentException("Fraction cannot be less than zero or greater than 1.0");
       }
       if      (fraction == 0.0) { quantiles[i] = minValue_; }
@@ -848,6 +851,9 @@ public class KllFloatsSketch {
     return new KllFloatsSketch(mem);
   }
 
+  /**
+   * @return the iterator for this class
+   */
   public KllFloatsSketchIterator iterator() {
     return new KllFloatsSketchIterator(items_, levels_, numLevels_);
   }
diff --git a/src/main/java/com/yahoo/sketches/quantiles/DoublesSketch.java b/src/main/java/com/yahoo/sketches/quantiles/DoublesSketch.java
index 5706e0a..6405ebb 100644
--- a/src/main/java/com/yahoo/sketches/quantiles/DoublesSketch.java
+++ b/src/main/java/com/yahoo/sketches/quantiles/DoublesSketch.java
@@ -720,6 +720,9 @@ public abstract class DoublesSketch {
     }
   }
 
+  /**
+   * @return the iterator for this class
+   */
   public DoublesSketchIterator iterator() {
     return new DoublesSketchIterator(this, getBitPattern());
   }
diff --git a/src/main/java/com/yahoo/sketches/quantiles/ItemsSketch.java b/src/main/java/com/yahoo/sketches/quantiles/ItemsSketch.java
index aeebea8..a3b56b9 100644
--- a/src/main/java/com/yahoo/sketches/quantiles/ItemsSketch.java
+++ b/src/main/java/com/yahoo/sketches/quantiles/ItemsSketch.java
@@ -567,11 +567,17 @@ public final class ItemsSketch<T> {
    return getN() == 0;
   }
 
+  /**
+   * @return true if this sketch is off-heap
+   */
   @SuppressWarnings("static-method")
   public boolean isDirect() {
     return false;
   }
 
+  /**
+   * @return true if in estimation mode
+   */
   public boolean isEstimationMode() {
     return getN() >= (2L * k_);
   }
@@ -684,6 +690,9 @@ public final class ItemsSketch<T> {
     dstMem.putByteArray(0, byteArr, 0, byteArr.length);
   }
 
+  /**
+   * @return the iterator for this class
+   */
   public ItemsSketchIterator<T> iterator() {
     return new ItemsSketchIterator<>(this, bitPattern_);
   }
diff --git a/src/main/java/com/yahoo/sketches/quantiles/UpdateDoublesSketch.java b/src/main/java/com/yahoo/sketches/quantiles/UpdateDoublesSketch.java
index 0278805..47b1de7 100644
--- a/src/main/java/com/yahoo/sketches/quantiles/UpdateDoublesSketch.java
+++ b/src/main/java/com/yahoo/sketches/quantiles/UpdateDoublesSketch.java
@@ -56,6 +56,9 @@ public abstract class UpdateDoublesSketch extends DoublesSketch {
     return HeapUpdateDoublesSketch.heapifyInstance(srcMem);
   }
 
+  /**
+   * @return a CompactDoublesSketch of this class
+   */
   public CompactDoublesSketch compact() {
     return compact(null);
   }
diff --git a/src/main/java/com/yahoo/sketches/sampling/SampleSubsetSummary.java b/src/main/java/com/yahoo/sketches/sampling/SampleSubsetSummary.java
index a56db37..05f3806 100644
--- a/src/main/java/com/yahoo/sketches/sampling/SampleSubsetSummary.java
+++ b/src/main/java/com/yahoo/sketches/sampling/SampleSubsetSummary.java
@@ -40,18 +40,30 @@ public class SampleSubsetSummary {
     this.totalSketchWeight = totalSketchWeight;
   }
 
+  /**
+   * @return the Lower Bound
+   */
   public double getLowerBound() {
     return lowerBound;
   }
 
+  /**
+   * @return the total sketch weight
+   */
   public double getTotalSketchWeight() {
     return totalSketchWeight;
   }
 
+  /**
+   * @return the Upper Bound
+   */
   public double getUpperBound() {
     return upperBound;
   }
 
+  /**
+   * @return the unique count estimate
+   */
   public double getEstimate() {
     return estimate;
   }
diff --git a/src/main/java/com/yahoo/sketches/sampling/VarOptItemsSamples.java b/src/main/java/com/yahoo/sketches/sampling/VarOptItemsSamples.java
index 58cc4f1..44dbbda 100644
--- a/src/main/java/com/yahoo/sketches/sampling/VarOptItemsSamples.java
+++ b/src/main/java/com/yahoo/sketches/sampling/VarOptItemsSamples.java
@@ -95,7 +95,9 @@ public class VarOptItemsSamples<T> implements Iterable<VarOptItemsSamples<T>.Wei
     boolean getMark() { return sketch_.getMark(idx_); }
   }
 
-  // standard iterator
+  /**
+   * The standard iterator
+   */
   public class VarOptItemsIterator implements Iterator<WeightedSample> {
     int currIdx_;
     int finalIdx_; // inclusive final index
diff --git a/src/main/java/com/yahoo/sketches/tuple/ArrayOfDoublesSetOperationBuilder.java b/src/main/java/com/yahoo/sketches/tuple/ArrayOfDoublesSetOperationBuilder.java
index fc1a658..20d2e21 100644
--- a/src/main/java/com/yahoo/sketches/tuple/ArrayOfDoublesSetOperationBuilder.java
+++ b/src/main/java/com/yahoo/sketches/tuple/ArrayOfDoublesSetOperationBuilder.java
@@ -32,7 +32,14 @@ public class ArrayOfDoublesSetOperationBuilder {
   private int numValues_;
   private long seed_;
 
+  /**
+   * Default Nominal Entries (a.k.a. K)
+   */
   public static final int DEFAULT_NOMINAL_ENTRIES = 4096;
+
+  /**
+   * Default number of values
+   */
   public static final int DEFAULT_NUMBER_OF_VALUES = 1;
 
   /**
@@ -46,7 +53,7 @@ public class ArrayOfDoublesSetOperationBuilder {
 
   /**
    * This is to set the nominal number of entries.
-   * @param nomEntries Nominal number of entries. Forced to the nearest power of 2 greater than 
+   * @param nomEntries Nominal number of entries. Forced to the nearest power of 2 greater than
    * given value.
    * @return this builder
    */
@@ -95,7 +102,7 @@ public class ArrayOfDoublesSetOperationBuilder {
   }
 
   /**
-   * Creates an instance of ArrayOfDoublesIntersection based on the current configuration of the 
+   * 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.
@@ -106,7 +113,7 @@ public class ArrayOfDoublesSetOperationBuilder {
   }
 
   /**
-   * Creates an instance of ArrayOfDoublesIntersection based on the current configuration of the 
+   * 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.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org