Skip to content

Main21-2 to main #657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ under the License.
<configuration>
<rules>
<requireJavaVersion>
<version>${java.version}</version>
<version>[21,)</version> <!-- java.version -->
</requireJavaVersion>
<requireMavenVersion>
<version>[${maven.version},4.0.0)</version>
Expand Down Expand Up @@ -237,9 +237,10 @@ under the License.
<configuration>
<docfilessubdirs>true</docfilessubdirs>
<show>public</show>
<additionalOptions>
<additionalOption>${jvm-ffm-flag}</additionalOption>
</additionalOptions>
<doclint>all,-missing</doclint>
<additionalJOptions>
<additionalJOption>${jvm-ffm-flag}</additionalJOption>
</additionalJOptions>
</configuration>
<executions>
<execution>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/datasketches/common/Family.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public int getID() {
}

/**
*
* Checks the given Family ID
* @param id the given id, a value &lt; 128.
*/
public void checkFamilyID(final int id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class MergingValidation {
private PrintWriter printWriter;

/**
*
* Constructor
* @param lgMinK lgMinK
* @param lgMaxK lgMaxK
* @param lgMulK lgMulK
Expand All @@ -79,7 +79,7 @@ public MergingValidation(final int lgMinK, final int lgMaxK, final int lgMulK, f
}

/**
*
* Start the merging validation process
*/
public void start() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That this class exists in the main code at all is kind of ugly, imho. Sigh.

printf(hfmt, (Object[]) hStrArr); //print header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class QuickMergingValidation {
private PrintWriter printWriter;

/**
*
* Constructor
* @param lgMinK lgMinK
* @param lgMaxK lgMaxK
* @param incLgK incLgK
Expand All @@ -73,7 +73,7 @@ public QuickMergingValidation(final int lgMinK, final int lgMaxK, final int incL
}

/**
*
* Start the Quick Merging Validation process
*/
public void start() {
printf(hfmt, (Object[]) hStrArr); //print header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class StreamingValidation {
private BitMatrix matrix = null;

/**
*
* Constructor
* @param lgMinK lgMinK
* @param lgMaxK lgMaxK
* @param trials trials
Expand All @@ -78,7 +78,7 @@ public StreamingValidation(final int lgMinK, final int lgMaxK, final int trials,
}

/**
*
* Start the streaming validation process
*/
public void start() {
printf(hfmt, (Object[]) hStrArr);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/apache/datasketches/cpc/TestUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import static org.apache.datasketches.cpc.RuntimeAsserts.rtAssertEquals;

/**
* Utility methods for Test
* @author Lee Rhodes
*/
public class TestUtil {
Expand Down
14 changes: 9 additions & 5 deletions src/main/java/org/apache/datasketches/fdt/Group.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,41 +66,49 @@ public Group init(final String priKey, final int count, final double estimate, f
}

/**
* @return priKey of type T
* Gets the primary key of type String
* @return priKey of type String
*/
public String getPrimaryKey() { return priKey; }

/**
* Returns the count
* @return the count
*/
public int getCount() { return count; }

/**
* Returns the estimate
* @return the estimate
*/
public double getEstimate() { return est; }

/**
* Returns the upper bound
* @return the upper bound
*/
public double getUpperBound() { return ub; }

/**
* Returns the lower bound
* @return the lower bound
*/
public double getLowerBound() { return lb; }

/**
* Returns the fraction for this group
* @return the fraction for this group
*/
public double getFraction() { return fraction; }

/**
* Returns the RSE
* @return the RSE
*/
public double getRse() { return rse; }

/**
* Returns the descriptive header
* @return the descriptive header
*/
public String getHeader() {
Expand All @@ -112,9 +120,6 @@ public String toString() {
return String.format(fmt, count, est, ub, lb, fraction, rse, priKey);
}

/**
* @param that The Group to compare to
*/
@Override
public int compareTo(final Group that) {
return that.count - count; //decreasing
Expand All @@ -133,4 +138,3 @@ public int hashCode() {
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ public Row<T>[] getFrequentItems(final ErrorType errorType) {
}

/**
* Returns an upper bound on the maximum error of getEstimate(item) for any item.
* @return 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.
Expand All @@ -415,6 +416,7 @@ public int getMaximumMapCapacity() {
}

/**
* Returns the number of active items in the sketch.
* @return the number of active items in the sketch.
*/
public int getNumActiveItems() {
Expand Down Expand Up @@ -624,26 +626,31 @@ public static class Row<T> implements Comparable<Row<T>> {
}

/**
* Returns an item of type T
* @return item of type T
*/
public T getItem() { return item; }

/**
* Returns the estimate
* @return the estimate
*/
public long getEstimate() { return est; }

/**
* Returns the upper bound
* @return the upper bound
*/
public long getUpperBound() { return ub; }

/**
* Returns the lower bound
* @return return the lower bound
*/
public long getLowerBound() { return lb; }

/**
* Returns the descriptive row header
* @return the descriptive row header
*/
public static String getRowHeader() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ public Row[] getFrequentItems(final ErrorType errorType) {
}

/**
* Returns an upper bound on the maximum error of getEstimate(item) for any item.
* @return 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.
Expand All @@ -457,6 +458,7 @@ public int getMaximumMapCapacity() {
}

/**
* Returns the number of active items in the sketch.
* @return the number of active items in the sketch.
*/
public int getNumActiveItems() {
Expand Down Expand Up @@ -693,26 +695,31 @@ public static class Row implements Comparable<Row> {
}

/**
* @return item of type T
* Returns item of type long
* @return item of type long
*/
public long getItem() { return item; }

/**
* Returns the estimate
* @return the estimate
*/
public long getEstimate() { return est; }

/**
* Returns the upper bound
* @return the upper bound
*/
public long getUpperBound() { return ub; }

/**
* Returns the lower bound
* @return return the lower bound
*/
public long getLowerBound() { return lb; }

/**
* Returns the descriptive row header
* @return the descriptive row header
*/
public static String getRowHeader() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.apache.datasketches.memory.WritableMemory;

/**
* Extends DoubleSketch
* @author Jon Malkin
*/
public abstract class UpdateDoublesSketch extends DoublesSketch {
Expand Down Expand Up @@ -61,6 +62,7 @@ public static UpdateDoublesSketch heapify(final Memory srcMem) {
}

/**
* Returns a CompactDoublesSketch of this class
* @return a CompactDoublesSketch of this class
*/
public CompactDoublesSketch compact() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ default double[] getCDF(T[] splitPoints) {
double[] getCDF(T[] splitPoints, QuantileSearchCriteria searchCrit);

/**
* Returns the sketch item class
* @return the sketch item class
*/
Class<T> getClassOfT();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,31 @@ public class SampleSubsetSummary {
}

/**
* @return the Lower Bound
* Returns the lower bound
* @return the lower bound
*/
public double getLowerBound() {
return lowerBound;
}

/**
* Returns the total sketch weight
* @return the total sketch weight
*/
public double getTotalSketchWeight() {
return totalSketchWeight;
}

/**
* @return the Upper Bound
* Returns the upper bound
* @return the upper bound
*/
public double getUpperBound() {
return upperBound;
}

/**
* Returns the unique count estimate
* @return the unique count estimate
*/
public double getEstimate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public TDigestDouble(final short k) {
}

/**
* Returns parameter k (compression) that was used to configure this TDigest
* @return parameter k (compression) that was used to configure this TDigest
*/
public short getK() {
Expand Down Expand Up @@ -137,13 +138,15 @@ private void compress() {
}

/**
* Returns true if TDigest has not seen any data
* @return true if TDigest has not seen any data
*/
public boolean isEmpty() {
return numCentroids_ == 0 && numBuffered_ == 0;
}

/**
* Returns minimum value seen by TDigest
* @return minimum value seen by TDigest
*/
public double getMinValue() {
Expand All @@ -152,6 +155,7 @@ public double getMinValue() {
}

/**
* Returns maximum value seen by TDigest
* @return maximum value seen by TDigest
*/
public double getMaxValue() {
Expand All @@ -160,6 +164,7 @@ public double getMaxValue() {
}

/**
* Returns total weight
* @return total weight
*/
public long getTotalWeight() {
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/apache/datasketches/theta/AnotB.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@
*/
public abstract class AnotB extends SetOperation {

/**
* Constructor
*/
AnotB() {}

@Override
public Family getFamily() {
return Family.A_NOT_B;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/apache/datasketches/theta/SetOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
public abstract class SetOperation implements MemoryStatus {
static final int CONST_PREAMBLE_LONGS = 3;

/**
* Constructor
*/
SetOperation() {}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ public static int hashSearchOrInsertMemory(final WritableMemory wmem, final int
//Other related methods

/**
* Checks that the given theta is not negative nor zero.
* @param thetaLong must be greater than zero otherwise throws an exception.
* <a href="{@docRoot}/resources/dictionary.html#thetaLong">See Theta Long</a>
*/
Expand All @@ -299,6 +300,7 @@ public static void checkThetaCorruption(final long thetaLong) {
}

/**
* Checks that the given hash value is not negative.
* @param 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.
*/
Expand Down
Loading
Loading