Skip to content

Commit f6c44f9

Browse files
authored
Merge pull request #272 from apache/FixJavadocWarningsMain
Fix javadoc warnings main
2 parents d70f391 + a8d94f0 commit f6c44f9

14 files changed

Lines changed: 77 additions & 12 deletions

src/main/java/com/yahoo/sketches/ByteArrayUtil.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919

2020
package com.yahoo.sketches;
2121

22+
/**
23+
* Useful methods for byte arrays.
24+
* @author Lee Rhodes
25+
*/
2226
public final class ByteArrayUtil {
2327

2428
/**

src/main/java/com/yahoo/sketches/cpc/CpcSketch.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@
6464
public final class CpcSketch {
6565
private static final String LS = System.getProperty("line.separator");
6666
private static final double[] kxpByteLookup = new double[256];
67+
68+
/**
69+
* The default Log_base2 of K
70+
*/
6771
public static final int DEFAULT_LG_K = 11;
6872
final long seed;
6973
//common variables

src/main/java/com/yahoo/sketches/fdt/Group.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,11 @@ public class Group implements Comparable<Group> {
3838
private final static String hfmt =
3939
"%12s" + "%15s" + "%15s" + "%15s" + "%12s" + "%12s" + " %s";
4040

41+
/**
42+
* Construct an empty Group
43+
*/
4144
public Group() { }
4245

43-
public Group copy() {
44-
return new Group();
45-
}
46-
4746
/**
4847
* Specifies the parameters to be listed as columns
4948
* @param priKey the primary key of the FDT sketch
@@ -117,7 +116,7 @@ public String toString() {
117116
/**
118117
* Note: this class has a natural ordering that is inconsistent with equals.
119118
* Ignore FindBugs EQ_COMPARETO_USE_OBJECT_EQUALS warning.
120-
* @param that the Group to compare to
119+
* @param that The Group to compare to
121120
*/
122121
@Override
123122
public int compareTo(final Group that) {

src/main/java/com/yahoo/sketches/fdt/PostProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ private List<Group> populateList(final int numStdDev, final int limit) {
140140
final double lb = sketch.getLowerBound(numStdDev, count);
141141
final double thresh = (double) count / sketch.getRetainedEntries();
142142
final double rse = (sketch.getUpperBound(1, count) / est) - 1.0;
143-
final Group gp = group.copy();
143+
final Group gp = new Group();
144144
gp.init(priKey, count, est, ub, lb, thresh, rse);
145145
list.add(gp);
146146
}

src/main/java/com/yahoo/sketches/hash/XxHash.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,14 @@ public class XxHash {
4747
private static final long P4 = -8796714831421723037L;
4848
private static final long P5 = 2870177450012600261L;
4949

50-
50+
/**
51+
* Compute the has of the given Memory object.
52+
* @param mem The given Memory object
53+
* @param offsetBytes Starting at this offset in bytes
54+
* @param lengthBytes Continuing for this number of bytes
55+
* @param seed use this seed for the hash function
56+
* @return return the resulting 64-bit hash value.
57+
*/
5158
public static long hash(final Memory mem, final long offsetBytes, final long lengthBytes,
5259
final long seed) {
5360
return mem.xxHash64(offsetBytes, lengthBytes, seed);

src/main/java/com/yahoo/sketches/hll/HllSketch.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,15 @@
6363
* @author Kevin Lang
6464
*/
6565
public class HllSketch extends BaseHllSketch {
66+
67+
/**
68+
* The default Log_base2 of K
69+
*/
6670
public static final int DEFAULT_LG_K = 12;
71+
72+
/**
73+
* The default HLL-TYPE is HLL_4
74+
*/
6775
public static final TgtHllType DEFAULT_HLL_TYPE = TgtHllType.HLL_4;
6876

6977
private static final String LS = System.getProperty("line.separator");

src/main/java/com/yahoo/sketches/hll/TgtHllType.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
5252
* @author Lee Rhodes
5353
*/
54+
@SuppressWarnings("javadoc")
5455
public enum TgtHllType { HLL_4, HLL_6, HLL_8;
5556

5657
static final TgtHllType values[] = values();

src/main/java/com/yahoo/sketches/kll/KllFloatsSketch.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@
150150
*/
151151
public class KllFloatsSketch {
152152

153+
/**
154+
* The default value of K.
155+
*/
153156
public static final int DEFAULT_K = 200;
154157
static final int DEFAULT_M = 8;
155158
static final int MIN_K = DEFAULT_M;
@@ -479,7 +482,7 @@ public float[] getQuantiles(final double[] fractions) {
479482
final float[] quantiles = new float[fractions.length];
480483
for (int i = 0; i < fractions.length; i++) {
481484
final double fraction = fractions[i];
482-
if (fraction < 0.0 || fraction > 1.0) {
485+
if ((fraction < 0.0) || (fraction > 1.0)) {
483486
throw new SketchesArgumentException("Fraction cannot be less than zero or greater than 1.0");
484487
}
485488
if (fraction == 0.0) { quantiles[i] = minValue_; }
@@ -848,6 +851,9 @@ public static KllFloatsSketch heapify(final Memory mem) {
848851
return new KllFloatsSketch(mem);
849852
}
850853

854+
/**
855+
* @return the iterator for this class
856+
*/
851857
public KllFloatsSketchIterator iterator() {
852858
return new KllFloatsSketchIterator(items_, levels_, numLevels_);
853859
}

src/main/java/com/yahoo/sketches/quantiles/DoublesSketch.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,9 @@ public void putMemory(final WritableMemory dstMem, final boolean compact) {
720720
}
721721
}
722722

723+
/**
724+
* @return the iterator for this class
725+
*/
723726
public DoublesSketchIterator iterator() {
724727
return new DoublesSketchIterator(this, getBitPattern());
725728
}

src/main/java/com/yahoo/sketches/quantiles/ItemsSketch.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,11 +567,17 @@ public boolean isEmpty() {
567567
return getN() == 0;
568568
}
569569

570+
/**
571+
* @return true if this sketch is off-heap
572+
*/
570573
@SuppressWarnings("static-method")
571574
public boolean isDirect() {
572575
return false;
573576
}
574577

578+
/**
579+
* @return true if in estimation mode
580+
*/
575581
public boolean isEstimationMode() {
576582
return getN() >= (2L * k_);
577583
}
@@ -684,6 +690,9 @@ public void putMemory(final WritableMemory dstMem, final ArrayOfItemsSerDe<T> se
684690
dstMem.putByteArray(0, byteArr, 0, byteArr.length);
685691
}
686692

693+
/**
694+
* @return the iterator for this class
695+
*/
687696
public ItemsSketchIterator<T> iterator() {
688697
return new ItemsSketchIterator<>(this, bitPattern_);
689698
}

0 commit comments

Comments
 (0)