From 2f736a179a64a63feb239ee8f3200856a05c49ba Mon Sep 17 00:00:00 2001
From: Lee Rhodes
This implementation uses xxHash64 and follows the approach in Kirsch and Mitzenmacher, - * "Less Hashing, Same Performance: Building a Better Bloom Filter," Wiley Interscience, 2008, - * pp. 187-218.
+ * "Less Hashing, Same Performance: Building a Better Bloom Filter," Wiley Interscience, 2008, pp. 187-218. */ public final class BloomFilter { + /** + * The maximum size of a bloom filter in bits. + */ public static final long MAX_SIZE_BITS = (Integer.MAX_VALUE - Family.BLOOMFILTER.getMaxPreLongs()) * (long) Long.SIZE; private static final int SER_VER = 1; private static final int EMPTY_FLAG_MASK = 4; @@ -133,11 +135,23 @@ public static BloomFilter heapify(final Memory mem) { return internalHeapifyOrWrap((WritableMemory) mem, false, false); } + /** + * Wraps the given Memory into this filter class. The class itself only contains a few metadata items and holds + * a reference to the Memory object, which contains all the data. + * @param mem the given Memory object + * @return the wrapping BloomFilter class. + */ public static BloomFilter wrap(final Memory mem) { // casting to writable, but tracking that the object is read-only return internalHeapifyOrWrap((WritableMemory) mem, true, false); } + /** + * Wraps the given WritableMemory into this filter class. The class itself only contains a few metadata items and holds + * a reference to the Memory object, which contains all the data. + * @param wmem the given WritableMemory object + * @return the wrapping BloomFilter class. + */ public static BloomFilter writableWrap(final WritableMemory wmem) { return internalHeapifyOrWrap(wmem, true, true); } diff --git a/src/main/java/org/apache/datasketches/filters/bloomfilter/DirectBitArrayR.java b/src/main/java/org/apache/datasketches/filters/bloomfilter/DirectBitArrayR.java index 19c495af6..8acc36be2 100644 --- a/src/main/java/org/apache/datasketches/filters/bloomfilter/DirectBitArrayR.java +++ b/src/main/java/org/apache/datasketches/filters/bloomfilter/DirectBitArrayR.java @@ -24,6 +24,9 @@ import org.apache.datasketches.memory.Memory; import org.apache.datasketches.memory.WritableMemory; +/** + * This class can maintain the BitArray object off-heap. + */ public class DirectBitArrayR extends BitArray { final static protected long NUM_BITS_OFFSET = Long.BYTES; final static protected long DATA_OFFSET = 2L * Long.BYTES; diff --git a/src/main/java/org/apache/datasketches/hll/TgtHllType.java b/src/main/java/org/apache/datasketches/hll/TgtHllType.java index a0ee79a45..a5dc395ce 100644 --- a/src/main/java/org/apache/datasketches/hll/TgtHllType.java +++ b/src/main/java/org/apache/datasketches/hll/TgtHllType.java @@ -50,10 +50,27 @@ * * @author Lee Rhodes */ -public enum TgtHllType { HLL_4, HLL_6, HLL_8; +public enum TgtHllType { + /** + * An HLL sketch with a bin size of 4 bits + */ + HLL_4, + /** + * An HLL sketch with a bin size of 6 bits + */ + HLL_6, + /** + * An Hll Sketch with a bin size of 8 bits + */ + HLL_8; private static final TgtHllType values[] = values(); + /** + * Convert the typeId to the enum type + * @param typeId the given typeId + * @return the enum type + */ public static final TgtHllType fromOrdinal(final int typeId) { return values[typeId]; } diff --git a/src/main/java/org/apache/datasketches/kll/KllItemsSketch.java b/src/main/java/org/apache/datasketches/kll/KllItemsSketch.java index 392da0673..6fb9772fb 100644 --- a/src/main/java/org/apache/datasketches/kll/KllItemsSketch.java +++ b/src/main/java/org/apache/datasketches/kll/KllItemsSketch.java @@ -290,6 +290,10 @@ public void reset() { itemsSV = null; } + /** + * Export the current sketch as a compact byte array. + * @return the current sketch as a compact byte array. + */ public byte[] toByteArray() { return KllHelper.toByteArray(this, false); } diff --git a/src/main/java/org/apache/datasketches/kll/KllItemsSketchIterator.java b/src/main/java/org/apache/datasketches/kll/KllItemsSketchIterator.java index 3a0a8da0f..02bda7a20 100644 --- a/src/main/java/org/apache/datasketches/kll/KllItemsSketchIterator.java +++ b/src/main/java/org/apache/datasketches/kll/KllItemsSketchIterator.java @@ -23,6 +23,7 @@ /** * Iterator over KllItemsSketch. The order is not defined. + * @paramThe sample may be smaller than k and the resulting size of the sample potentially includes
* a probabilistic component, meaning the resulting sample size is not always constant.
- *
+ * @param Please refer to the documentation in the package-info: Please refer to the documentation in the package-info: Here is what we do for each level: It can be proved that generalCompress returns a sketch that satisfies the space constraints
+ * no matter how much data is passed in.
+ * We are pretty sure that it works correctly when inBuf and outBuf are the same.
+ * All levels except for level zero must be sorted before calling this, and will still be
+ * sorted afterwards.
+ * Level zero is not required to be sorted before, and may not be sorted afterwards. This trashes inBuf and inLevels and modifies outBuf and outLevels. The parameter k will not change. The resulting approximations have a probabilistic guarantee that can be obtained from the
+ * getNormalizedRankError(false) function. 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: It is not recommended to include either the minimum or maximum items of the input stream. The resulting approximations have a probabilistic guarantee that can be obtained from the
+ * getNormalizedRankError(true) function. 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: It is not recommended to include either the minimum or maximum items of the input stream. Don't call this before calling next() for the first time
+ * or after getting false from next(). The resulting approximations have a probabilistic guarantee that can be obtained from the
+ * getNormalizedRankError(false) function. 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: It is not recommended to include either the minimum or maximum items of the input stream. The resulting approximations have a probabilistic guarantee that can be obtained from the
+ * getNormalizedRankError(true) function. 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: It is not recommended to include either the minimum or maximum items of the input stream. 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. 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. Don't call this before calling next() for the first time
+ * or after getting false from next(). Please refer to the documentation in the package-info: 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. 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. [*] Note that obtaining epsilon may require using a similar function but with more parameters
* based on the specific sketch implementation. Note: Only certain set operators during stateful operations can be serialized.
- * Only when they are stored into Memory will this be relevant. A Bloom filter is a data structure that can be used for probabilistic
- * set membership. When querying a Bloom filter, there are no false positives. Specifically:
* When querying an item that has already been inserted to the filter, the filter will
diff --git a/src/main/java/org/apache/datasketches/filters/bloomfilter/BloomFilterBuilder.java b/src/main/java/org/apache/datasketches/filters/bloomfilter/BloomFilterBuilder.java
index f865a3350..ee17a9918 100644
--- a/src/main/java/org/apache/datasketches/filters/bloomfilter/BloomFilterBuilder.java
+++ b/src/main/java/org/apache/datasketches/filters/bloomfilter/BloomFilterBuilder.java
@@ -25,8 +25,8 @@
import org.apache.datasketches.memory.WritableMemory;
/**
- * This class provides methods to help estimate the correct parameters when
- * creating a Bloom filter, and methods to create the filter using those values.
- * The intent of the design of this class was to isolate the detailed knowledge of the bit and byte
+ * The intent of the design of this class was to isolate the detailed knowledge of the bit and byte
* layout of the serialized form of the sketches derived from the Sketch class into one place. This
* allows the possibility of the introduction of different serialization schemes with minimal impact
- * on the rest of the library.
- * S[] copySummaryArray(final S[] summaryArr) {
return tmpSummaryArr;
}
+ /**
+ * Creates a new Summary Array with the specified length
+ * @param summaryArr example array, only used to obtain the component type. It has no data.
+ * @param length the desired length of the returned array.
+ * @param the summary class type
+ * @return a new Summary Array with the specified length
+ */
@SuppressWarnings("unchecked")
public static S[] newSummaryArray(final S[] summaryArr, final int length) {
final Class summaryType = (Class) summaryArr.getClass().getComponentType();
From 6c469cb197c960673c51a00694051d87a4474da8 Mon Sep 17 00:00:00 2001
From: Lee Rhodes
+ * {@link org.apache.datasketches.kll}
+ * {@link org.apache.datasketches.kll}
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
* {@link org.apache.datasketches.kll}The DataSketches™ HLL sketch family package
+ * The DataSketches™ HLL sketch family package
* {@link org.apache.datasketches.hll.HllSketch HllSketch} and {@link org.apache.datasketches.hll.Union 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
diff --git a/src/main/java/org/apache/datasketches/quantiles/CompactDoublesSketch.java b/src/main/java/org/apache/datasketches/quantiles/CompactDoublesSketch.java
index f6df9e87e..18e05d315 100644
--- a/src/main/java/org/apache/datasketches/quantiles/CompactDoublesSketch.java
+++ b/src/main/java/org/apache/datasketches/quantiles/CompactDoublesSketch.java
@@ -20,7 +20,6 @@
package org.apache.datasketches.quantiles;
import org.apache.datasketches.common.SketchesStateException;
-import org.apache.datasketches.memory.Memory;
/**
* Compact sketches are inherently read only.
@@ -31,10 +30,6 @@ public abstract class CompactDoublesSketch extends DoublesSketch {
super(k);
}
- public static CompactDoublesSketch heapify(final Memory srcMem) {
- return HeapCompactDoublesSketch.heapifyInstance(srcMem);
- }
-
@Override
boolean isCompact() {
return true;
diff --git a/src/main/java/org/apache/datasketches/quantiles/DoublesSketch.java b/src/main/java/org/apache/datasketches/quantiles/DoublesSketch.java
index 03f84116a..49e7c5fbb 100644
--- a/src/main/java/org/apache/datasketches/quantiles/DoublesSketch.java
+++ b/src/main/java/org/apache/datasketches/quantiles/DoublesSketch.java
@@ -140,7 +140,7 @@ public static final DoublesSketchBuilder builder() {
*/
public static DoublesSketch heapify(final Memory srcMem) {
if (checkIsCompactMemory(srcMem)) {
- return CompactDoublesSketch.heapify(srcMem);
+ return HeapCompactDoublesSketch.heapifyInstance(srcMem);
}
return UpdateDoublesSketch.heapify(srcMem);
}
diff --git a/src/main/java/org/apache/datasketches/quantiles/UpdateDoublesSketch.java b/src/main/java/org/apache/datasketches/quantiles/UpdateDoublesSketch.java
index 155001c87..f56c3b352 100644
--- a/src/main/java/org/apache/datasketches/quantiles/UpdateDoublesSketch.java
+++ b/src/main/java/org/apache/datasketches/quantiles/UpdateDoublesSketch.java
@@ -49,6 +49,13 @@ public static UpdateDoublesSketch wrap(final WritableMemory srcMem) {
@Override
public abstract void update(double item);
+ /**
+ * 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.
+ * @param srcMem a compact Memory image of a sketch serialized by this sketch.
+ * See Memory
+ * @return a heap-based sketch based on the given Memory.
+ */
public static UpdateDoublesSketch heapify(final Memory srcMem) {
return HeapUpdateDoublesSketch.heapifyInstance(srcMem);
}
diff --git a/src/main/java/org/apache/datasketches/quantilescommon/QuantilesAPI.java b/src/main/java/org/apache/datasketches/quantilescommon/QuantilesAPI.java
index 9943fefee..3dc0651a7 100644
--- a/src/main/java/org/apache/datasketches/quantilescommon/QuantilesAPI.java
+++ b/src/main/java/org/apache/datasketches/quantilescommon/QuantilesAPI.java
@@ -205,11 +205,22 @@
@SuppressWarnings("javadoc")
public interface QuantilesAPI {
+ /** The sketch must not be empty for this operation. */
static String EMPTY_MSG = "The sketch must not be empty for this operation. ";
+
+ /** Unsupported operation for this Sketch Type. */
static String UNSUPPORTED_MSG = "Unsupported operation for this Sketch Type. ";
+
+ /** Sketch does not have just one item. */
static String NOT_SINGLE_ITEM_MSG = "Sketch does not have just one item. ";
+
+ /** MemoryRequestServer must not be null. */
static String MEM_REQ_SVR_NULL_MSG = "MemoryRequestServer must not be null. ";
+
+ /** Target sketch is Read Only, cannot write. */
static String TGT_IS_READ_ONLY_MSG = "Target sketch is Read Only, cannot write. ";
+
+ /** A sketch cannot merge with itself. */
static String SELF_MERGE_MSG = "A sketch cannot merge with itself. ";
/**
diff --git a/src/main/java/org/apache/datasketches/req/BaseReqSketch.java b/src/main/java/org/apache/datasketches/req/BaseReqSketch.java
index 2460308fc..05d4d3ce2 100644
--- a/src/main/java/org/apache/datasketches/req/BaseReqSketch.java
+++ b/src/main/java/org/apache/datasketches/req/BaseReqSketch.java
@@ -89,11 +89,23 @@ public static double getRSE(final int k, final double rank, final boolean hra, f
@Override
public abstract float getQuantileLowerBound(double rank);
+ /**
+ * Gets an approximate lower bound of the quantile associated with the given rank.
+ * @param rank the given normalized rank, a number between 0 and 1.0.
+ * @param numStdDev the number of standard deviations. Must be 1, 2, or 3.
+ * @return an approximate lower bound quantile, if it exists.
+ */
public abstract float getQuantileLowerBound(double rank, int numStdDev);
@Override
public abstract float getQuantileUpperBound(double rank);
+ /**
+ * Gets an approximate upper bound of the quantile associated with the given rank.
+ * @param rank the given normalized rank, a number between 0 and 1.0.
+ * @param numStdDev the number of standard deviations. Must be 1, 2, or 3.
+ * @return an approximate upper bound quantile, if it exists.
+ */
public abstract float getQuantileUpperBound(double rank, int numStdDev);
@Override
@@ -101,7 +113,7 @@ public static double getRSE(final int k, final double rank, final boolean hra, f
/**
* Gets an approximate lower bound rank of the given normalized rank.
- * @param rank the given rank, a number between 0 and 1.0.
+ * @param rank the given normalized rank, a number between 0 and 1.0.
* @param numStdDev the number of standard deviations. Must be 1, 2, or 3.
* @return an approximate lower bound rank.
*/
diff --git a/src/main/java/org/apache/datasketches/thetacommon/SetOperationCornerCases.java b/src/main/java/org/apache/datasketches/thetacommon/SetOperationCornerCases.java
index 20dd6ee7d..72a98565d 100644
--- a/src/main/java/org/apache/datasketches/thetacommon/SetOperationCornerCases.java
+++ b/src/main/java/org/apache/datasketches/thetacommon/SetOperationCornerCases.java
@@ -46,10 +46,18 @@ private IntersectAction(final String actionId, final String actionDescription) {
this.actionDescription = actionDescription;
}
+ /**
+ * Gets the Action ID
+ * @return the actionId
+ */
public String getActionId() {
return actionId;
}
+ /**
+ * Gets the Action Description
+ * @return the actionDescription
+ */
public String getActionDescription() {
return actionDescription;
}
@@ -72,24 +80,42 @@ private AnotbAction(final String actionId, final String actionDescription) {
this.actionDescription = actionDescription;
}
+ /**
+ * Gets the Action ID
+ * @return the actionId
+ */
public String getActionId() {
return actionId;
}
+ /**
+ * Gets the action description
+ * @return the action description
+ */
public String getActionDescription() {
return actionDescription;
}
}
+ /** List of union actions */
public enum UnionAction {
+ /** Sketch A Exactly */
SKETCH_A("A", "Sketch A Exactly"),
+ /** Trim Sketch A by MinTheta */
TRIM_A("TA", "Trim Sketch A by MinTheta"),
+ /** Sketch B Exactly */
SKETCH_B("B", "Sketch B Exactly"),
+ /** Trim Sketch B by MinTheta */
TRIM_B("TB", "Trim Sketch B by MinTheta"),
+ /** Degenerate{MinTheta, 0, F} */
DEGEN_MIN_0_F("D", "Degenerate{MinTheta, 0, F}"),
+ /** Degenerate{ThetaA, 0, F} */
DEGEN_THA_0_F("DA", "Degenerate{ThetaA, 0, F}"),
+ /** Degenerate{ThetaB, 0, F} */
DEGEN_THB_0_F("DB", "Degenerate{ThetaB, 0, F}"),
+ /** Empty{1.0, 0, T} */
EMPTY_1_0_T("E", "Empty{1.0, 0, T}"),
+ /** Full Union */
FULL_UNION("N", "Full Union");
private String actionId;
@@ -100,49 +126,74 @@ private UnionAction(final String actionId, final String actionDescription) {
this.actionDescription = actionDescription;
}
+ /**
+ * Gets the action ID
+ * @return the actionId
+ */
public String getActionId() {
return actionId;
}
+ /**
+ * Gets the action description
+ * @return the actionDescription
+ */
public String getActionDescription() {
return actionDescription;
}
}
+ /** List of corner cases */
public enum CornerCase {
+ /** Empty Empty */
Empty_Empty(055, "A{ 1.0, 0, T} ; B{ 1.0, 0, T}",
IntersectAction.EMPTY_1_0_T, AnotbAction.EMPTY_1_0_T, UnionAction.EMPTY_1_0_T),
+ /** Empty Exact */
Empty_Exact(056, "A{ 1.0, 0, T} ; B{ 1.0,>0, F}",
IntersectAction.EMPTY_1_0_T, AnotbAction.EMPTY_1_0_T, UnionAction.SKETCH_B),
+ /** Empty Estimation */
Empty_Estimation(052, "A{ 1.0, 0, T} ; B{<1.0,>0, F",
IntersectAction.EMPTY_1_0_T, AnotbAction.EMPTY_1_0_T, UnionAction.SKETCH_B),
+ /** Empty Degen */
Empty_Degen(050, "A{ 1.0, 0, T} ; B{<1.0, 0, F}",
IntersectAction.EMPTY_1_0_T, AnotbAction.EMPTY_1_0_T, UnionAction.DEGEN_THB_0_F),
+ /** Exact Empty */
Exact_Empty(065, "A{ 1.0,>0, F} ; B{ 1.0, 0, T}",
IntersectAction.EMPTY_1_0_T, AnotbAction.SKETCH_A, UnionAction.SKETCH_A),
+ /** Exact Exact */
Exact_Exact(066, "A{ 1.0,>0, F} ; B{ 1.0,>0, F}",
IntersectAction.FULL_INTERSECT, AnotbAction.FULL_ANOTB, UnionAction.FULL_UNION),
+ /** Exact Estimation */
Exact_Estimation(062, "A{ 1.0,>0, F} ; B{<1.0,>0, F}",
IntersectAction.FULL_INTERSECT, AnotbAction.FULL_ANOTB, UnionAction.FULL_UNION),
+ /** Exact Degen */
Exact_Degen(060, "A{ 1.0,>0, F} ; B{<1.0, 0, F}",
IntersectAction.DEGEN_MIN_0_F, AnotbAction.TRIM_A, UnionAction.TRIM_A),
+ /** Estimation_Empty */
Estimation_Empty(025, "A{<1.0,>0, F} ; B{ 1.0, 0, T}",
IntersectAction.EMPTY_1_0_T, AnotbAction.SKETCH_A, UnionAction.SKETCH_A),
+ /** Estimation_Exact */
Estimation_Exact(026, "A{<1.0,>0, F} ; B{ 1.0,>0, F}",
IntersectAction.FULL_INTERSECT, AnotbAction.FULL_ANOTB, UnionAction.FULL_UNION),
+ /** Estimation_Estimation */
Estimation_Estimation(022, "A{<1.0,>0, F} ; B{<1.0,>0, F}",
IntersectAction.FULL_INTERSECT, AnotbAction.FULL_ANOTB, UnionAction.FULL_UNION),
+ /** Estimation_Degen */
Estimation_Degen(020, "A{<1.0,>0, F} ; B{<1.0, 0, F}",
IntersectAction.DEGEN_MIN_0_F, AnotbAction.TRIM_A, UnionAction.TRIM_A),
+ /** Degen_Empty */
Degen_Empty(005, "A{<1.0, 0, F} ; B{ 1.0, 0, T}",
IntersectAction.EMPTY_1_0_T, AnotbAction.DEGEN_THA_0_F, UnionAction.DEGEN_THA_0_F),
+ /** Degen_Exact */
Degen_Exact(006, "A{<1.0, 0, F} ; B{ 1.0,>0, F}",
IntersectAction.DEGEN_MIN_0_F, AnotbAction.DEGEN_THA_0_F, UnionAction.TRIM_B),
+ /** Degen_Estimation */
Degen_Estimation(002, "A{<1.0, 0, F} ; B{<1.0,>0, F}",
IntersectAction.DEGEN_MIN_0_F, AnotbAction.DEGEN_MIN_0_F, UnionAction.TRIM_B),
+ /** Degen_Degen */
Degen_Degen(000, "A{<1.0, 0, F} ; B{<1.0, 0, F}",
IntersectAction.DEGEN_MIN_0_F, AnotbAction.DEGEN_MIN_0_F, UnionAction.DEGEN_MIN_0_F);
@@ -168,27 +219,52 @@ private CornerCase(final int caseId, final String caseDescription,
this.unionAction = unionAction;
}
+ /**
+ * Gets the case ID
+ * @return the caseId
+ */
public int getId() {
return caseId;
}
+ /**
+ * Gets the case description
+ * @return the caseDescription
+ */
public String getCaseDescription() {
return caseDescription;
}
+ /**
+ * Gets the intersect action
+ * @return the intersectAction
+ */
public IntersectAction getIntersectAction() {
return intersectAction;
}
+ /**
+ * Gets the AnotB action
+ * @return the anotbAction
+ */
public AnotbAction getAnotbAction() {
return anotbAction;
}
+ /**
+ * Gets the union action
+ * @return the unionAction
+ */
public UnionAction getUnionAction() {
return unionAction;
}
//See checkById test in /tuple/MiscTest.
+ /**
+ * Converts caseId to CornerCaseId
+ * @param id the case ID
+ * @return the Corner Case ID
+ */
public static CornerCase caseIdToCornerCase(final int id) {
final CornerCase cc = caseIdToCornerCaseMap.get(id);
if (cc == null) {
@@ -198,12 +274,29 @@ public static CornerCase caseIdToCornerCase(final int id) {
}
} //end of enum CornerCase
+ /**
+ * Creates the CornerCase ID
+ * @param thetaLongA the theta of A as a long
+ * @param countA the count of A
+ * @param emptyA true if A is empty
+ * @param thetaLongB the theta of B as a long
+ * @param countB the count of B
+ * @param emptyB true if B is empty
+ * @return the Corner Case ID
+ */
public static int createCornerCaseId(
final long thetaLongA, final int countA, final boolean emptyA,
final long thetaLongB, final int countB, final boolean emptyB) {
return (sketchStateId(emptyA, countA, thetaLongA) << 3) | sketchStateId(emptyB, countB, thetaLongB);
}
+ /**
+ * Returns the sketch state ID
+ * @param isEmpty true if empty
+ * @param numRetained the number of items retained
+ * @param thetaLong the value of theta as a long
+ * @return the sketch state ID
+ */
public static int sketchStateId(final boolean isEmpty, final int numRetained, final long thetaLong) {
// assume thetaLong = MAX if empty
return (((thetaLong == MAX) || isEmpty) ? 4 : 0) | ((numRetained > 0) ? 2 : 0) | (isEmpty ? 1 : 0);
diff --git a/src/main/java/org/apache/datasketches/tuple/SerializerDeserializer.java b/src/main/java/org/apache/datasketches/tuple/SerializerDeserializer.java
index 44d1d9cc0..9b0ca33cb 100644
--- a/src/main/java/org/apache/datasketches/tuple/SerializerDeserializer.java
+++ b/src/main/java/org/apache/datasketches/tuple/SerializerDeserializer.java
@@ -32,8 +32,17 @@ public final class SerializerDeserializer {
* Defines the sketch classes that this SerializerDeserializer can handle.
*/
@SuppressWarnings("javadoc")
- public static enum SketchType { QuickSelectSketch, CompactSketch, ArrayOfDoublesQuickSelectSketch,
- ArrayOfDoublesCompactSketch, ArrayOfDoublesUnion }
+ public static enum SketchType {
+ /** QuickSelectSketch */
+ QuickSelectSketch,
+ /** CompactSketch */
+ CompactSketch,
+ /** ArrayOfDoublesQuickSelectSketch */
+ ArrayOfDoublesQuickSelectSketch,
+ /** ArrayOfDoublesCompactSketch */
+ ArrayOfDoublesCompactSketch,
+ /** ArrayOfDoublesUnion */
+ ArrayOfDoublesUnion }
static final int TYPE_BYTE_OFFSET = 3;
diff --git a/src/test/java/org/apache/datasketches/quantiles/QuantilesSketchCrossLanguageTest.java b/src/test/java/org/apache/datasketches/quantiles/QuantilesSketchCrossLanguageTest.java
index 8c80f4399..68347ffb8 100644
--- a/src/test/java/org/apache/datasketches/quantiles/QuantilesSketchCrossLanguageTest.java
+++ b/src/test/java/org/apache/datasketches/quantiles/QuantilesSketchCrossLanguageTest.java
@@ -249,7 +249,7 @@ private static void getAndCheck(String ver, int n, double quantile) {
Assert.assertEquals(q2, quantile, 0.0);
// same thing with compact sketch
- qs2 = CompactDoublesSketch.heapify(srcMem);
+ qs2 = HeapCompactDoublesSketch.heapifyInstance(srcMem);
//Test the quantile
q2 = qs2.getQuantile(nf, EXCLUSIVE);
println("New Median: " + q2);
From f42af451b38c096d0d4af5f45814c86ef252e78e Mon Sep 17 00:00:00 2001
From: Lee Rhodes The DataSketches™ HLL sketch family package
+ * The DataSketches™ HLL sketch family package
* {@link org.apache.datasketches.hll.HllSketch HllSketch} and {@link org.apache.datasketches.hll.Union 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
diff --git a/src/main/java/org/apache/datasketches/thetacommon/SetOperationCornerCases.java b/src/main/java/org/apache/datasketches/thetacommon/SetOperationCornerCases.java
index 72a98565d..d9fda48bb 100644
--- a/src/main/java/org/apache/datasketches/thetacommon/SetOperationCornerCases.java
+++ b/src/main/java/org/apache/datasketches/thetacommon/SetOperationCornerCases.java
@@ -34,8 +34,11 @@ public class SetOperationCornerCases {
/** Intersection actions */
public enum IntersectAction {
+ /** Degenerate{MinTheta, 0, F} */
DEGEN_MIN_0_F("D", "Degenerate{MinTheta, 0, F}"),
+ /** Empty{1.0, 0, T */
EMPTY_1_0_T("E", "Empty{1.0, 0, T}"),
+ /** Full Intersect */
FULL_INTERSECT("I", "Full Intersect");
private String actionId;
@@ -65,11 +68,17 @@ public String getActionDescription() {
/** A not B actions */
public enum AnotbAction {
+ /** Sketch A Exact */
SKETCH_A("A", "Sketch A Exactly"),
+ /** Trim Sketch A by MinTheta */
TRIM_A("TA", "Trim Sketch A by MinTheta"),
+ /** Degenerate{MinTheta, 0, F} */
DEGEN_MIN_0_F("D", "Degenerate{MinTheta, 0, F}"),
+ /** Degenerate{ThetaA, 0, F} */
DEGEN_THA_0_F("DA", "Degenerate{ThetaA, 0, F}"),
+ /** Empty{1.0, 0, T} */
EMPTY_1_0_T("E", "Empty{1.0, 0, T}"),
+ /** Full AnotB */
FULL_ANOTB("N", "Full AnotB");
private String actionId;
From 34aaa8baf679cccdac2ea6bdefef46870e5bc004 Mon Sep 17 00:00:00 2001
From: Lee Rhodes
- * MAP: Low significance bytes of this long data structure are on the right. However, the + *
MAP: Low significance bytes of this long data structure are on the right. However, the * multi-byte integers (int and long) are stored in native byte order. The byte - * values are treated as unsigned. - *
+ * values are treated as unsigned. * - *- * An empty FrequentItems only requires 8 bytes. All others require 32 bytes of preamble. - *
+ *An empty FrequentItems only requires 8 bytes. All others require 32 bytes of preamble.
* *
* * Long || Start Byte Adr:
diff --git a/src/main/java/org/apache/datasketches/quantiles/DoublesByteArrayImpl.java b/src/main/java/org/apache/datasketches/quantiles/DoublesByteArrayImpl.java
index f4df5aa8b..8451bad33 100644
--- a/src/main/java/org/apache/datasketches/quantiles/DoublesByteArrayImpl.java
+++ b/src/main/java/org/apache/datasketches/quantiles/DoublesByteArrayImpl.java
@@ -58,7 +58,7 @@ static byte[] toByteArray(final DoublesSketch sketch, final boolean ordered, fin
| (ordered ? ORDERED_FLAG_MASK : 0)
| (compact ? (COMPACT_FLAG_MASK | READ_ONLY_FLAG_MASK) : 0);
- if (empty && !sketch.hasMemory()) { //empty & has Memory
+ if (empty && !sketch.hasMemory()) { //empty & !has Memory
final byte[] outByteArr = new byte[Long.BYTES];
final WritableMemory memOut = WritableMemory.writableWrap(outByteArr);
final int preLongs = 1;
@@ -79,15 +79,7 @@ static byte[] toByteArray(final DoublesSketch sketch, final boolean ordered, fin
*/
private static byte[] convertToByteArray(final DoublesSketch sketch, final int flags,
final boolean ordered, final boolean compact) {
- final int preLongs = 2;
- final int extra = 2; // extra space for min and max quantiles
- final int prePlusExtraBytes = (preLongs + extra) << 3;
- final int k = sketch.getK();
- final long n = sketch.getN();
-
- // If not-compact, have accessor always report full levels. Then use level size to determine
- // whether to copy data out.
- final DoublesSketchAccessor dsa = DoublesSketchAccessor.wrap(sketch, !compact);
+ final int preLongs = sketch.isEmpty() ? 1 : 2;
final int outBytes = (compact ? sketch.getCurrentCompactSerializedSizeBytes()
: sketch.getCurrentUpdatableSerializedSizeBytes());
@@ -95,15 +87,23 @@ private static byte[] convertToByteArray(final DoublesSketch sketch, final int f
final byte[] outByteArr = new byte[outBytes];
final WritableMemory memOut = WritableMemory.writableWrap(outByteArr);
- //insert preamble-0, N, min, max
+ //insert pre0
+ final int k = sketch.getK();
insertPre0(memOut, preLongs, flags, k);
if (sketch.isEmpty()) { return outByteArr; }
+ //insert N, min, max
+ final long n = sketch.getN();
insertN(memOut, n);
insertMinDouble(memOut, sketch.isEmpty() ? Double.NaN : sketch.getMinItem());
insertMaxDouble(memOut, sketch.isEmpty() ? Double.NaN : sketch.getMaxItem());
- long memOffsetBytes = prePlusExtraBytes;
+ // If not-compact, have accessor always report full levels. Then use level size to determine
+ // whether to copy data out.
+ final DoublesSketchAccessor dsa = DoublesSketchAccessor.wrap(sketch, !compact);
+
+ final int minAndMax = 2; // extra space for min and max quantiles
+ long memOffsetBytes = (preLongs + minAndMax) << 3;
// might need to sort base buffer but don't want to change input sketch
final int bbCnt = computeBaseBufferItems(k, n);
diff --git a/src/main/java/org/apache/datasketches/tdigest/TDigestDouble.java b/src/main/java/org/apache/datasketches/tdigest/TDigestDouble.java
index 1e3408511..951bd7244 100644
--- a/src/main/java/org/apache/datasketches/tdigest/TDigestDouble.java
+++ b/src/main/java/org/apache/datasketches/tdigest/TDigestDouble.java
@@ -32,6 +32,7 @@
import org.apache.datasketches.memory.WritableBuffer;
import org.apache.datasketches.memory.WritableMemory;
import org.apache.datasketches.quantilescommon.QuantilesAPI;
+import org.apache.datasketches.quantilescommon.QuantilesUtil;
/**
* t-Digest for estimating quantiles and ranks.
@@ -125,7 +126,7 @@ public void merge(final TDigestDouble other) {
/**
* Process buffered values and merge centroids if needed
*/
- public void compress() {
+ private void compress() {
if (numBuffered_ == 0) { return; }
final int num = numBuffered_ + numCentroids_;
final double[] values = new double[num];
@@ -277,6 +278,51 @@ public double getQuantile(final double rank) {
return weightedAverage(centroidWeights_[numCentroids_ - 1], w1, maxValue_, w2);
}
+ /**
+ * Returns an approximation to the Probability Mass Function (PMF) of the input stream
+ * given a set of split points.
+ *
+ * @param splitPoints an array of m unique, monotonically increasing values
+ * that divide the input domain into m+1 consecutive disjoint intervals (bins).
+ *
+ * @return an array of m+1 doubles each of which is an approximation
+ * to the fraction of the input stream values (the mass) that fall into one of those intervals.
+ * @throws SketchesStateException if sketch is empty.
+ */
+ public double[] getPMF(final double[] splitPoints) {
+ final double[] buckets = getCDF(splitPoints);
+ for (int i = buckets.length; i-- > 1; ) {
+ buckets[i] -= buckets[i - 1];
+ }
+ return buckets;
+ }
+
+ /**
+ * Returns an approximation to the Cumulative Distribution Function (CDF), which is the
+ * cumulative analog of the PMF, of the input stream given a set of split points.
+ *
+ * @param splitPoints an array of m unique, monotonically increasing values
+ * that divide the input domain into m+1 consecutive disjoint intervals.
+ *
+ * @return an array of m+1 doubles, which are a consecutive approximation to the CDF
+ * of the input stream given the splitPoints. The value at array position j of the returned
+ * CDF array is the sum of the returned values in positions 0 through j of the returned PMF
+ * array. This can be viewed as array of ranks of the given split points plus one more value
+ * that is always 1.
+ * @throws SketchesStateException if sketch is empty.
+ */
+ public double[] getCDF(final double[] splitPoints) {
+ if (isEmpty()) { throw new SketchesStateException(QuantilesAPI.EMPTY_MSG); }
+ QuantilesUtil.checkDoublesSplitPointsOrder(splitPoints);
+ final int len = splitPoints.length + 1;
+ final double[] ranks = new double[len];
+ for (int i = 0; i < len - 1; i++) {
+ ranks[i] = getRank(splitPoints[i]);
+ }
+ ranks[len - 1] = 1.0;
+ return ranks;
+ }
+
/**
* Computes size needed to serialize the current state.
* @return size in bytes needed to serialize this tdigest
diff --git a/src/test/java/org/apache/datasketches/filters/bloomfilter/DirectBitArrayTest.java b/src/test/java/org/apache/datasketches/filters/bloomfilter/DirectBitArrayTest.java
index 1df6cc9d9..8327a0d5e 100644
--- a/src/test/java/org/apache/datasketches/filters/bloomfilter/DirectBitArrayTest.java
+++ b/src/test/java/org/apache/datasketches/filters/bloomfilter/DirectBitArrayTest.java
@@ -139,7 +139,7 @@ public void basicWritableWrapTest() {
@Test
public void countWritableWrappedBitsWhenDirty() {
// like basicOperationTest but with setBit which does
- // not neecssarily track numBitsSet_
+ // not necessarily track numBitsSet_
final HeapBitArray hba = new HeapBitArray(128);
assertFalse(hba.getAndSetBit(1));
assertFalse(hba.getAndSetBit(2));
diff --git a/src/test/java/org/apache/datasketches/hll/DirectCouponListTest.java b/src/test/java/org/apache/datasketches/hll/DirectCouponListTest.java
index 985cdf798..09eebabf7 100644
--- a/src/test/java/org/apache/datasketches/hll/DirectCouponListTest.java
+++ b/src/test/java/org/apache/datasketches/hll/DirectCouponListTest.java
@@ -31,7 +31,6 @@
import org.apache.datasketches.memory.DefaultMemoryRequestServer;
import org.apache.datasketches.memory.Memory;
-//import org.apache.datasketches.memory.WritableHandle;
import org.apache.datasketches.memory.WritableMemory;
/**
@@ -74,8 +73,6 @@ private static void promotions(int lgConfigK, int n, TgtHllType tgtHllType, bool
byte[] barr1;
WritableMemory wmem;
try (ResourceScope scope = (wmem = WritableMemory.allocateDirect(bytes)).scope()) {
- //byte[] byteArr = new byte[bytes];
- //WritableMemory wmem = WritableMemory.wrap(byteArr);
hllSketch = new HllSketch(lgConfigK, tgtHllType, wmem);
assertTrue(hllSketch.isEmpty());
diff --git a/src/test/java/org/apache/datasketches/hll/PreambleUtilTest.java b/src/test/java/org/apache/datasketches/hll/PreambleUtilTest.java
index deb8c5be5..17f3d0d0f 100644
--- a/src/test/java/org/apache/datasketches/hll/PreambleUtilTest.java
+++ b/src/test/java/org/apache/datasketches/hll/PreambleUtilTest.java
@@ -109,7 +109,6 @@ public void checkCorruptMemoryInput() {
HllSketch sk = new HllSketch(12);
byte[] memObj = sk.toCompactByteArray();
WritableMemory wmem = WritableMemory.writableWrap(memObj);
- //long memAdd = wmem.getCumulativeOffset(0);
HllSketch bad;
//checkFamily
@@ -148,7 +147,6 @@ public void checkCorruptMemoryInput() {
for (int i = 1; i <= 15; i++) { sk.update(i); }
memObj = sk.toCompactByteArray();
wmem = WritableMemory.writableWrap(memObj);
- //memAdd = wmem.getCumulativeOffset(0);
//check wrong PreInts and SET
try {
@@ -162,7 +160,6 @@ public void checkCorruptMemoryInput() {
for (int i = 15; i <= 1000; i++) { sk.update(i); }
memObj = sk.toCompactByteArray();
wmem = WritableMemory.writableWrap(memObj);
- //memAdd = wmem.getCumulativeOffset(0);
//check wrong PreInts and HLL
try {
@@ -179,7 +176,6 @@ public void checkExtractFlags() {
int bytes = HllSketch.getMaxUpdatableSerializationBytes(4, TgtHllType.HLL_4);
WritableMemory wmem = WritableMemory.allocate(bytes);
Object memObj = wmem.getArray();
- //long memAdd = wmem.getCumulativeOffset(0L);
HllSketch sk = new HllSketch(4, TgtHllType.HLL_4, wmem);
int flags = extractFlags(wmem);
assertEquals(flags, EMPTY_FLAG_MASK);
diff --git a/src/test/java/org/apache/datasketches/kll/KllCrossLanguageTest.java b/src/test/java/org/apache/datasketches/kll/KllCrossLanguageTest.java
index 078f3503b..53b422b7c 100644
--- a/src/test/java/org/apache/datasketches/kll/KllCrossLanguageTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllCrossLanguageTest.java
@@ -67,6 +67,16 @@ public void generateKllFloatsSketchBinaries() throws IOException {
}
}
+ @Test(groups = {GENERATE_JAVA_FILES})
+ public void generateKllLongsSketchBinaries() throws IOException {
+ final int[] nArr = {0, 1, 10, 100, 1_000, 10_000, 100_000, 1_000_000};
+ for (int n: nArr) {
+ final KllLongsSketch sk = KllLongsSketch.newHeapInstance();
+ for (int i = 1; i <= n; i++) { sk.update(i); }
+ Files.newOutputStream(javaPath.resolve("kll_long_n" + n + "_java.sk")).write(sk.toByteArray());
+ }
+ }
+
@Test(groups = {GENERATE_JAVA_FILES})
public void generateKllItemsSketchBinaries() throws IOException {
final int[] nArr = {0, 1, 10, 100, 1_000, 10_000, 100_000, 1_000_000};
diff --git a/src/test/java/org/apache/datasketches/kll/KllDirectCompactDoublesSketchTest.java b/src/test/java/org/apache/datasketches/kll/KllDirectCompactDoublesSketchTest.java
index 9831c2f57..7a4d061ad 100644
--- a/src/test/java/org/apache/datasketches/kll/KllDirectCompactDoublesSketchTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllDirectCompactDoublesSketchTest.java
@@ -110,13 +110,13 @@ public void checkDirectCompactGetDoubleItemsArray() {
KllDoublesSketch sk2 = KllDoublesSketch.wrap(Memory.wrap(sk.toByteArray()));
double[] itemsArr = sk2.getDoubleItemsArray();
- for (int i = 0; i < 20; i++) { assertEquals(itemsArr[i], 0F); }
+ for (int i = 0; i < 20; i++) { assertEquals(itemsArr[i], 0.0); }
sk.update(1);
sk2 = KllDoublesSketch.wrap(Memory.wrap(sk.toByteArray()));
itemsArr = sk2.getDoubleItemsArray();
- for (int i = 0; i < 19; i++) { assertEquals(itemsArr[i], 0F); }
- assertEquals(itemsArr[19], 1F);
+ for (int i = 0; i < 19; i++) { assertEquals(itemsArr[i], 0.0); }
+ assertEquals(itemsArr[19], 1.0);
for (int i = 2; i <= 21; i++) { sk.update(i); }
sk2 = KllDoublesSketch.wrap(Memory.wrap(sk.toByteArray()));
@@ -169,12 +169,12 @@ public void checkMinAndMax() {
try { sk2.getMaxItem(); fail(); } catch (SketchesArgumentException e) {}
sk.update(1);
sk2 = KllDoublesSketch.wrap(Memory.wrap(sk.toByteArray()));
- assertEquals(sk2.getMaxItem(),1.0F);
- assertEquals(sk2.getMinItem(),1.0F);
+ assertEquals(sk2.getMaxItem(),1.0);
+ assertEquals(sk2.getMinItem(),1.0);
for (int i = 2; i <= 21; i++) { sk.update(i); }
sk2 = KllDoublesSketch.wrap(Memory.wrap(sk.toByteArray()));
- assertEquals(sk2.getMaxItem(),21.0F);
- assertEquals(sk2.getMinItem(),1.0F);
+ assertEquals(sk2.getMaxItem(),21.0);
+ assertEquals(sk2.getMinItem(),1.0);
}
@Test
diff --git a/src/test/java/org/apache/datasketches/kll/KllDirectDoublesSketchIteratorTest.java b/src/test/java/org/apache/datasketches/kll/KllDirectDoublesSketchIteratorTest.java
index 78a3b9cd5..4bfdfa4fc 100644
--- a/src/test/java/org/apache/datasketches/kll/KllDirectDoublesSketchIteratorTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllDirectDoublesSketchIteratorTest.java
@@ -41,7 +41,7 @@ public void oneItemSketch() {
sketch.update(0);
QuantilesDoublesSketchIterator it = sketch.iterator();
Assert.assertTrue(it.next());
- Assert.assertEquals(it.getQuantile(), 0f);
+ Assert.assertEquals(it.getQuantile(), 0);
Assert.assertEquals(it.getWeight(), 1);
Assert.assertFalse(it.next());
}
diff --git a/src/test/java/org/apache/datasketches/kll/KllDirectDoublesSketchTest.java b/src/test/java/org/apache/datasketches/kll/KllDirectDoublesSketchTest.java
index 33219a806..6342ac33d 100644
--- a/src/test/java/org/apache/datasketches/kll/KllDirectDoublesSketchTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllDirectDoublesSketchTest.java
@@ -189,11 +189,11 @@ public void mergeLowerK() {
sketch2.update(2 * n - i - 1);
}
- assertEquals(sketch1.getMinItem(), 0.0f);
- assertEquals(sketch1.getMaxItem(), n - 1f);
+ assertEquals(sketch1.getMinItem(), 0.0);
+ assertEquals(sketch1.getMaxItem(), n - 1.0);
assertEquals(sketch2.getMinItem(), n);
- assertEquals(sketch2.getMaxItem(), 2f * n - 1f);
+ assertEquals(sketch2.getMaxItem(), 2.0 * n - 1.0);
assertTrue(sketch1.getNormalizedRankError(false) < sketch2.getNormalizedRankError(false));
assertTrue(sketch1.getNormalizedRankError(true) < sketch2.getNormalizedRankError(true));
@@ -613,7 +613,7 @@ public void checkWritableWrapOfCompactForm() {
public void checkReadOnlyExceptions() {
int k = 20;
double[] dblArr = new double[0];
- double dblV = 1.0f;
+ double dblV = 1.0;
int idx = 1;
boolean bool = true;
KllDoublesSketch sk = KllDoublesSketch.newHeapInstance(k);
diff --git a/src/test/java/org/apache/datasketches/kll/KllDoublesSketchSerDeTest.java b/src/test/java/org/apache/datasketches/kll/KllDoublesSketchSerDeTest.java
index e07a395da..007cc8370 100644
--- a/src/test/java/org/apache/datasketches/kll/KllDoublesSketchSerDeTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllDoublesSketchSerDeTest.java
@@ -64,7 +64,7 @@ public void serializeDeserializeEmpty() {
@Test
public void serializeDeserializeOneValue() {
final KllDoublesSketch sk1 = KllDoublesSketch.newHeapInstance();
- sk1.update(1);
+ sk1.update(1.0);
//from heap -> byte[] -> heap
final byte[] bytes = sk1.toByteArray();
diff --git a/src/test/java/org/apache/datasketches/kll/KllDoublesSketchTest.java b/src/test/java/org/apache/datasketches/kll/KllDoublesSketchTest.java
index 0b3818f1f..e143577f4 100644
--- a/src/test/java/org/apache/datasketches/kll/KllDoublesSketchTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllDoublesSketchTest.java
@@ -165,8 +165,8 @@ public void manyValuesEstimationMode() {
assertEquals(pmf[0], 0.5, PMF_EPS_FOR_K_256);
assertEquals(pmf[1], 0.5, PMF_EPS_FOR_K_256);
- assertEquals(sketch.getMinItem(), 0f); // min value is exact
- assertEquals(sketch.getMaxItem(), n - 1f); // max value is exact
+ assertEquals(sketch.getMinItem(), 0.0); // min value is exact
+ assertEquals(sketch.getMaxItem(), n - 1.0); // max value is exact
// check at every 0.1 percentage point
final double[] fractions = new double[1001];
@@ -261,11 +261,11 @@ public void mergeLowerK() {
sketch2.update(2 * n - i - 1);
}
- assertEquals(sketch1.getMinItem(), 0.0f);
- assertEquals(sketch1.getMaxItem(), n - 1f);
+ assertEquals(sketch1.getMinItem(), 0.0);
+ assertEquals(sketch1.getMaxItem(), n - 1);
assertEquals(sketch2.getMinItem(), n);
- assertEquals(sketch2.getMaxItem(), 2f * n - 1.0);
+ assertEquals(sketch2.getMaxItem(), 2.0 * n - 1.0);
assertTrue(sketch1.getNormalizedRankError(false) < sketch2.getNormalizedRankError(false));
assertTrue(sketch1.getNormalizedRankError(true) < sketch2.getNormalizedRankError(true));
@@ -306,7 +306,7 @@ public void mergeEmptyLowerK() {
sketch2.merge(sketch1);
assertFalse(sketch1.isEmpty());
assertEquals(sketch1.getN(), n);
- assertEquals(sketch1.getMinItem(), 0f);
+ assertEquals(sketch1.getMinItem(), 0.0);
assertEquals(sketch1.getMaxItem(), n - 1.0);
assertEquals(sketch1.getQuantile(0.5), n / 2.0, n * PMF_EPS_FOR_K_256);
}
@@ -424,7 +424,7 @@ public void checkNewDirectInstanceAndSize() {
KllDoublesSketch.newDirectInstance(wmem, memReqSvr);
try { KllDoublesSketch.newDirectInstance(null, memReqSvr); fail(); }
catch (NullPointerException e) { }
- try { KllFloatsSketch.newDirectInstance(wmem, null); fail(); }
+ try { KllDoublesSketch.newDirectInstance(wmem, null); fail(); }
catch (NullPointerException e) { }
int updateSize = KllSketch.getMaxSerializedSizeBytes(200, 0, DOUBLES_SKETCH, true);
int compactSize = KllSketch.getMaxSerializedSizeBytes(200, 0, DOUBLES_SKETCH, false);
diff --git a/src/test/java/org/apache/datasketches/kll/KllItemsSketchTest.java b/src/test/java/org/apache/datasketches/kll/KllItemsSketchTest.java
index 00028e341..9fc74d97b 100644
--- a/src/test/java/org/apache/datasketches/kll/KllItemsSketchTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllItemsSketchTest.java
@@ -570,7 +570,7 @@ public void checkCDF_PDF() {
}
@Test
- public void checkWrapCase1Floats() {
+ public void checkWrapCase1Items() {
KllItemsSketch sk = KllItemsSketch.newHeapInstance(20, Comparator.naturalOrder(), serDe);
final int n = 21;
final int digits = Util.numDigits(n);
diff --git a/src/test/java/org/apache/datasketches/kll/KllMiscDoublesTest.java b/src/test/java/org/apache/datasketches/kll/KllMiscDoublesTest.java
index e58c27419..4ce988d22 100644
--- a/src/test/java/org/apache/datasketches/kll/KllMiscDoublesTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllMiscDoublesTest.java
@@ -100,8 +100,8 @@ public void checkHeapifyExceptions2() {
@Test(expectedExceptions = SketchesArgumentException.class)
public void checkHeapifyExceptions3() {
KllDoublesSketch sk = KllDoublesSketch.newHeapInstance();
- sk.update(1.0f);
- sk.update(2.0f);
+ sk.update(1.0);
+ sk.update(2.0);
WritableMemory wmem = WritableMemory.writableWrap(sk.toByteArray());
wmem.putByte(0, (byte) 1); //corrupt preamble ints, should be 5
KllDoublesSketch.heapify(wmem);
diff --git a/src/test/java/org/apache/datasketches/kll/KllMiscItemsTest.java b/src/test/java/org/apache/datasketches/kll/KllMiscItemsTest.java
index acf3343d9..5f51a7f1a 100644
--- a/src/test/java/org/apache/datasketches/kll/KllMiscItemsTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllMiscItemsTest.java
@@ -293,7 +293,7 @@ public void checkSketchInitializeItemsHeap() {
final int digits = Util.numDigits(n);
KllItemsSketch sk;
- println("#### CASE: FLOAT FULL HEAP");
+ println("#### CASE: ITEM FULL HEAP");
sk = KllItemsSketch.newHeapInstance(k, Comparator.naturalOrder(), serDe);
for (int i = 1; i <= n; i++) { sk.update(Util.longToFixedLengthString(i, digits)); }
println(sk.toString(true, true));
@@ -310,7 +310,7 @@ public void checkSketchInitializeItemsHeap() {
assertEquals(sk.getNumLevels(), 2);
assertFalse(sk.isLevelZeroSorted());
- println("#### CASE: FLOAT HEAP EMPTY");
+ println("#### CASE: ITEM HEAP EMPTY");
sk = KllItemsSketch.newHeapInstance(k, Comparator.naturalOrder(), serDe);
println(sk.toString(true, true));
assertEquals(sk.getK(), k);
@@ -326,7 +326,7 @@ public void checkSketchInitializeItemsHeap() {
assertEquals(sk.getNumLevels(), 1);
assertFalse(sk.isLevelZeroSorted());
- println("#### CASE: FLOAT HEAP SINGLE");
+ println("#### CASE: ITEM HEAP SINGLE");
sk = KllItemsSketch.newHeapInstance(k, Comparator.naturalOrder(), serDe);
sk.update("1");
println(sk.toString(true, true));
@@ -354,7 +354,7 @@ public void checkSketchInitializeItemsHeapifyCompactMem() {
byte[] compBytes;
Memory mem;
- println("#### CASE: FLOAT FULL HEAPIFIED FROM COMPACT");
+ println("#### CASE: ITEM FULL HEAPIFIED FROM COMPACT");
sk2 = KllItemsSketch.newHeapInstance(k, Comparator.naturalOrder(), serDe);
for (int i = 1; i <= n; i++) { sk2.update(Util.longToFixedLengthString(i, digits)); }
println(sk2.toString(true, true));
@@ -375,7 +375,7 @@ public void checkSketchInitializeItemsHeapifyCompactMem() {
assertEquals(sk.getNumLevels(), 2);
assertFalse(sk.isLevelZeroSorted());
- println("#### CASE: FLOAT EMPTY HEAPIFIED FROM COMPACT");
+ println("#### CASE: ITEM EMPTY HEAPIFIED FROM COMPACT");
sk2 = KllItemsSketch.newHeapInstance(k, Comparator.naturalOrder(), serDe);
//println(sk.toString(true, true));
compBytes = sk2.toByteArray();
@@ -395,7 +395,7 @@ public void checkSketchInitializeItemsHeapifyCompactMem() {
assertEquals(sk.getNumLevels(), 1);
assertFalse(sk.isLevelZeroSorted());
- println("#### CASE: FLOAT SINGLE HEAPIFIED FROM COMPACT");
+ println("#### CASE: ITEM SINGLE HEAPIFIED FROM COMPACT");
sk2 = KllItemsSketch.newHeapInstance(k, Comparator.naturalOrder(), serDe);
sk2.update("1");
//println(sk2.toString(true, true));
@@ -417,7 +417,7 @@ public void checkSketchInitializeItemsHeapifyCompactMem() {
assertFalse(sk.isLevelZeroSorted());
}
- //public void checkSketchInitializeFloatHeapifyUpdatableMem() Not Supported
+ //public void checkSketchInitializeItemHeapifyUpdatableMem() Not Supported
@Test //set static enablePrinting = true for visual checking
public void checkMemoryToStringItemsCompact() {
@@ -431,7 +431,7 @@ public void checkMemoryToStringItemsCompact() {
Memory mem;
String s;
- println("#### CASE: FLOAT FULL COMPACT");
+ println("#### CASE: ITEM FULL COMPACT");
sk = KllItemsSketch.newHeapInstance(k, Comparator.naturalOrder(), serDe);
for (int i = 1; i <= n; i++) { sk.update(Util.longToFixedLengthString(i, digits)); }
compBytes = sk.toByteArray();
@@ -447,7 +447,7 @@ public void checkMemoryToStringItemsCompact() {
println(s);
assertEquals(compBytes, compBytes2);
- println("#### CASE: FLOAT EMPTY COMPACT");
+ println("#### CASE: ITEM EMPTY COMPACT");
sk = KllItemsSketch.newHeapInstance(k, Comparator.naturalOrder(), serDe);
compBytes = sk.toByteArray();
mem = Memory.wrap(compBytes);
@@ -462,7 +462,7 @@ public void checkMemoryToStringItemsCompact() {
println(s);
assertEquals(compBytes, compBytes2);
- println("#### CASE: FLOAT SINGLE COMPACT");
+ println("#### CASE: ITEM SINGLE COMPACT");
sk = KllItemsSketch.newHeapInstance(k, Comparator.naturalOrder(), serDe);
sk.update("1");
compBytes = sk.toByteArray();
diff --git a/src/test/java/org/apache/datasketches/quantiles/DebugUnionTest.java b/src/test/java/org/apache/datasketches/quantiles/DebugUnionTest.java
index b1bd5818d..636105ef8 100644
--- a/src/test/java/org/apache/datasketches/quantiles/DebugUnionTest.java
+++ b/src/test/java/org/apache/datasketches/quantiles/DebugUnionTest.java
@@ -31,7 +31,6 @@
import jdk.incubator.foreign.ResourceScope;
import org.apache.datasketches.memory.DefaultMemoryRequestServer;
-//import org.apache.datasketches.memory.WritableHandle;
import org.apache.datasketches.memory.WritableMemory;
import org.apache.datasketches.quantilescommon.QuantilesDoublesSketchIterator;
diff --git a/src/test/java/org/apache/datasketches/quantiles/DirectQuantilesMemoryRequestTest.java b/src/test/java/org/apache/datasketches/quantiles/DirectQuantilesMemoryRequestTest.java
index c252eef3c..d896bbefa 100644
--- a/src/test/java/org/apache/datasketches/quantiles/DirectQuantilesMemoryRequestTest.java
+++ b/src/test/java/org/apache/datasketches/quantiles/DirectQuantilesMemoryRequestTest.java
@@ -30,7 +30,6 @@
import org.testng.annotations.Test;
import org.apache.datasketches.memory.Memory;
-//import org.apache.datasketches.memory.WritableHandle;
import org.apache.datasketches.memory.WritableMemory;
import jdk.incubator.foreign.ResourceScope;
diff --git a/src/test/java/org/apache/datasketches/quantiles/DoublesSketchTest.java b/src/test/java/org/apache/datasketches/quantiles/DoublesSketchTest.java
index ea928ba02..8cdc7bf71 100644
--- a/src/test/java/org/apache/datasketches/quantiles/DoublesSketchTest.java
+++ b/src/test/java/org/apache/datasketches/quantiles/DoublesSketchTest.java
@@ -141,7 +141,6 @@ public void checkEmptyExceptions() {
@Test
public void directSketchShouldMoveOntoHeapEventually() {
-
WritableMemory wmem = WritableMemory.allocateDirect(1000, 1, ByteOrder.nativeOrder(), new DefaultMemoryRequestServer());
WritableMemory wmem2 = wmem;
UpdateDoublesSketch sketch = DoublesSketch.builder().build(wmem);
diff --git a/src/test/java/org/apache/datasketches/tdigest/TDigestDoubleTest.java b/src/test/java/org/apache/datasketches/tdigest/TDigestDoubleTest.java
index db043cff6..e1c6914c7 100644
--- a/src/test/java/org/apache/datasketches/tdigest/TDigestDoubleTest.java
+++ b/src/test/java/org/apache/datasketches/tdigest/TDigestDoubleTest.java
@@ -41,6 +41,8 @@ public void empty() {
assertThrows(SketchesStateException.class, () -> td.getMaxValue());
assertThrows(SketchesStateException.class, () -> td.getRank(0));
assertThrows(SketchesStateException.class, () -> td.getQuantile(0.5));
+ assertThrows(SketchesStateException.class, () -> td.getPMF(new double[]{0}));
+ assertThrows(SketchesStateException.class, () -> td.getCDF(new double[]{0}));
}
@Test
@@ -82,6 +84,14 @@ public void manyValues() {
assertEquals(td.getQuantile(0.9), n * 0.9, n * 0.9 * 0.01);
assertEquals(td.getQuantile(0.95), n * 0.95, n * 0.95 * 0.01);
assertEquals(td.getQuantile(1), n - 1);
+ final double[] pmf = td.getPMF(new double[] {n / 2});
+ assertEquals(pmf.length, 2);
+ assertEquals(pmf[0], 0.5, 0.0001);
+ assertEquals(pmf[1], 0.5, 0.0001);
+ final double[] cdf = td.getCDF(new double[] {n / 2});
+ assertEquals(cdf.length, 2);
+ assertEquals(cdf[0], 0.5, 0.0001);
+ assertEquals(cdf[1], 1.0);
}
@Test
diff --git a/src/test/java/org/apache/datasketches/theta/CompactSketchTest.java b/src/test/java/org/apache/datasketches/theta/CompactSketchTest.java
index 1e2089b51..188dbf427 100644
--- a/src/test/java/org/apache/datasketches/theta/CompactSketchTest.java
+++ b/src/test/java/org/apache/datasketches/theta/CompactSketchTest.java
@@ -32,7 +32,6 @@
import org.apache.datasketches.common.SketchesArgumentException;
import org.apache.datasketches.memory.DefaultMemoryRequestServer;
import org.apache.datasketches.memory.Memory;
-//import org.apache.datasketches.memory.WritableHandle;
import org.apache.datasketches.memory.WritableMemory;
import org.testng.annotations.Test;
diff --git a/src/test/java/org/apache/datasketches/theta/ConcurrentDirectQuickSelectSketchTest.java b/src/test/java/org/apache/datasketches/theta/ConcurrentDirectQuickSelectSketchTest.java
index e4c112281..6d6af7047 100644
--- a/src/test/java/org/apache/datasketches/theta/ConcurrentDirectQuickSelectSketchTest.java
+++ b/src/test/java/org/apache/datasketches/theta/ConcurrentDirectQuickSelectSketchTest.java
@@ -119,7 +119,6 @@ public void checkHeapifyByteArrayExact() {
// That is, this is being run for its side-effect of accessing things.
// If something is wonky, it will generate an exception and fail the test.
local2.toString(true, true, 8, true);
-
}
@Test
diff --git a/src/test/java/org/apache/datasketches/theta/ConcurrentHeapQuickSelectSketchTest.java b/src/test/java/org/apache/datasketches/theta/ConcurrentHeapQuickSelectSketchTest.java
index 2261edc3b..84ddcb80e 100644
--- a/src/test/java/org/apache/datasketches/theta/ConcurrentHeapQuickSelectSketchTest.java
+++ b/src/test/java/org/apache/datasketches/theta/ConcurrentHeapQuickSelectSketchTest.java
@@ -114,7 +114,7 @@ public void checkIllegalSketchID_UpdateSketch() {
WritableMemory mem = WritableMemory.writableWrap(byteArray);
mem.putByte(FAMILY_BYTE, (byte) 0); //corrupt the Sketch ID byte
- //try to heapify the corruped mem
+ //try to heapify the corrupted mem
Sketch.heapify(mem, sl.seed);
}
diff --git a/src/test/java/org/apache/datasketches/theta/DirectQuickSelectSketchTest.java b/src/test/java/org/apache/datasketches/theta/DirectQuickSelectSketchTest.java
index ef6004a1b..f36597b7c 100644
--- a/src/test/java/org/apache/datasketches/theta/DirectQuickSelectSketchTest.java
+++ b/src/test/java/org/apache/datasketches/theta/DirectQuickSelectSketchTest.java
@@ -47,7 +47,6 @@
import org.apache.datasketches.common.SketchesReadOnlyException;
import org.apache.datasketches.memory.DefaultMemoryRequestServer;
import org.apache.datasketches.memory.Memory;
-//import org.apache.datasketches.memory.WritableHandle;
import org.apache.datasketches.memory.WritableMemory;
import org.apache.datasketches.thetacommon.HashOperations;
import org.apache.datasketches.thetacommon.ThetaUtil;
@@ -86,7 +85,7 @@ public void checkBadSerVer() {
}
}
- @Test//(expectedExceptions = SketchesArgumentException.class)
+ @Test
public void checkConstructorKtooSmall() {
int k = 8;
WritableMemory wmem;
@@ -98,7 +97,7 @@ public void checkConstructorKtooSmall() {
}
}
- @Test//(expectedExceptions = SketchesArgumentException.class)
+ @Test
public void checkConstructorMemTooSmall() {
int k = 16;
WritableMemory wmem;
@@ -195,7 +194,7 @@ public void checkWrapIllegalFamilyID_direct() {
DirectQuickSelectSketch.writableWrap(mem, ThetaUtil.DEFAULT_UPDATE_SEED);
}
- @Test //(expectedExceptions = SketchesArgumentException.class)
+ @Test
public void checkHeapifySeedConflict() {
int k = 512;
long seed1 = 1021;
@@ -213,7 +212,7 @@ public void checkHeapifySeedConflict() {
}
}
- @Test//(expectedExceptions = SketchesArgumentException.class)
+ @Test
public void checkCorruptLgNomLongs() {
int k = 16;
WritableMemory wmem;
diff --git a/src/test/java/org/apache/datasketches/theta/HeapifyWrapSerVer1and2Test.java b/src/test/java/org/apache/datasketches/theta/HeapifyWrapSerVer1and2Test.java
index 5e81b1808..c0cff6eb2 100644
--- a/src/test/java/org/apache/datasketches/theta/HeapifyWrapSerVer1and2Test.java
+++ b/src/test/java/org/apache/datasketches/theta/HeapifyWrapSerVer1and2Test.java
@@ -41,29 +41,29 @@ public void checkHeapifyCompactSketchAssumedDefaultSeed() {
final int k = 64;
final long seed = ThetaUtil.DEFAULT_UPDATE_SEED;
final short seedHash = Util.computeSeedHash(seed);
- UpdateSketch sv3usk = UpdateSketch.builder().setNominalEntries(k).setSeed(seed).build();
- for (int i=0; i
-
+
From 14174086dfdac3b8b586b9cf2d3aaaf7b7cabacb Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Wed, 18 Dec 2024 14:51:14 -0800
Subject: [PATCH 32/58] update GHA workflows
---
.github/workflows/auto-check_cpp_files.yml | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/auto-check_cpp_files.yml b/.github/workflows/auto-check_cpp_files.yml
index b9e05ae97..4b06687e0 100644
--- a/.github/workflows/auto-check_cpp_files.yml
+++ b/.github/workflows/auto-check_cpp_files.yml
@@ -12,33 +12,33 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
-
+
- name: Checkout C++
uses: actions/checkout@v4
with:
repository: apache/datasketches-cpp
path: cpp
-
+
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
-
+
- name: Configure C++ build
run: cd cpp/build && cmake .. -DGENERATE=true
-
+
- name: Build C++ unit tests
run: cd cpp && cmake --build build --config Release
-
+
- name: Run C++ tests
run: cd cpp && cmake --build build --config Release --target test
-
+
- name: Make dir
run: mkdir -p serialization_test_data/cpp_generated_files
-
+
- name: Copy files
run: cp cpp/build/*/test/*_cpp.sk serialization_test_data/cpp_generated_files
-
+
- name: Run Java tests
run: mvn test -P check-cpp-files
From 341de43f1ee347621020785091d8a7c81344d68f Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Wed, 18 Dec 2024 15:26:32 -0800
Subject: [PATCH 33/58] update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 547df3e9d..b6db7f89e 100644
--- a/README.md
+++ b/README.md
@@ -53,7 +53,7 @@ and, as a result, must be compiled with JDK17 and this dependency:
If your application only relies on the APIs of datasketches-java no special JVM arguments are required.
However, if your application also directly relies on the APIs of the *datasketches-memory* component,
-you may need the additional JVM argument **--enable-preview**.
+you may need the additional JVM argument **--add-modules=jdk.incubator.foreign**.
### Recommended Build Tool
This DataSketches component is structured as a Maven project and Maven is the recommended Build Tool.
From babbe129bd1a994709cbbfe702596117b88d4919 Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Wed, 18 Dec 2024 15:54:59 -0800
Subject: [PATCH 34/58] Release Process: update pom to 7.0.0
update the version for the maven-javadoc-plugin and the
versions-maven-plugin
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 4c5532e54..0ab6e9fcc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@ under the License.
org.apache.datasketches
datasketches-java
- 7.0.0-SNAPSHOT
+ 7.0.0
jar
${project.artifactId}
@@ -128,7 +128,7 @@ under the License.
0.8.12
- 2.17.1
+ 2.18.0
1.0.0
From 5819b40fb53edaaf47538a0787bcf02437fe4e5d Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Wed, 18 Dec 2024 15:58:30 -0800
Subject: [PATCH 35/58] fix maven-javadoc-plugin version
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 0ab6e9fcc..35022e3b1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -112,7 +112,7 @@ under the License.
3.5.0
3.2.7
3.4.2
- 3.11.1
+ 3.11.2
3.1.1
3.2.0
3.3.1
From dc232771abcd402b335f906958c335a14c606e78 Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Wed, 18 Dec 2024 17:49:20 -0800
Subject: [PATCH 36/58] Correct indentation in GHAW auto-check_cpp_files.yml
---
.github/workflows/auto-check_cpp_files.yml | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/auto-check_cpp_files.yml b/.github/workflows/auto-check_cpp_files.yml
index 4b06687e0..068b12f4d 100644
--- a/.github/workflows/auto-check_cpp_files.yml
+++ b/.github/workflows/auto-check_cpp_files.yml
@@ -13,32 +13,32 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- - name: Checkout C++
+ - name: Checkout C++
uses: actions/checkout@v4
with:
repository: apache/datasketches-cpp
path: cpp
- - name: Setup Java
+ - name: Setup Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- - name: Configure C++ build
+ - name: Configure C++ build
run: cd cpp/build && cmake .. -DGENERATE=true
- - name: Build C++ unit tests
+ - name: Build C++ unit tests
run: cd cpp && cmake --build build --config Release
- - name: Run C++ tests
+ - name: Run C++ tests
run: cd cpp && cmake --build build --config Release --target test
- - name: Make dir
+ - name: Make dir
run: mkdir -p serialization_test_data/cpp_generated_files
- name: Copy files
run: cp cpp/build/*/test/*_cpp.sk serialization_test_data/cpp_generated_files
- - name: Run Java tests
+ - name: Run Java tests
run: mvn test -P check-cpp-files
From d9539b051a485e2c583ba99a6735c4a14fbc400b Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Wed, 18 Dec 2024 18:28:23 -0800
Subject: [PATCH 37/58] Fix two minor errors in the GHA javadoc workflow
---
.github/workflows/manual-javadoc.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/manual-javadoc.yml b/.github/workflows/manual-javadoc.yml
index 5f6ac6aec..e65824e7e 100644
--- a/.github/workflows/manual-javadoc.yml
+++ b/.github/workflows/manual-javadoc.yml
@@ -25,12 +25,12 @@ jobs:
cat .github/workflows/manual-javadoc.yml
- name: Generate JavaDoc
- run: mvn javadoc:javadoc
+ run: mvn clean javadoc:javadoc
- name: Deploy JavaDoc
uses: JamesIves/github-pages-deploy-action@v4.6.8
with:
token: ${{ secrets.GITHUB_TOKEN }}
- folder: target/site/apidocs
+ folder: target/reports/apidocs
target-folder: docs/${{ github.ref_name }}
branch: gh-pages
From 12ec5c3a4d2d18aa7cc7863a44ccb5662eacd317 Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Wed, 18 Dec 2024 19:09:06 -0800
Subject: [PATCH 38/58] fix indentations in all workflows
---
.github/workflows/auto-check_cpp_files.yml | 3 +-
.github/workflows/auto-jdk-matrix.yml | 96 ++++++++--------
.github/workflows/auto-os-matrix.yml | 114 +++++++++----------
.github/workflows/manual-codeql-analysis.yml | 70 ++++++------
.github/workflows/manual-javadoc.yml | 2 +-
5 files changed, 143 insertions(+), 142 deletions(-)
diff --git a/.github/workflows/auto-check_cpp_files.yml b/.github/workflows/auto-check_cpp_files.yml
index 068b12f4d..858e760fb 100644
--- a/.github/workflows/auto-check_cpp_files.yml
+++ b/.github/workflows/auto-check_cpp_files.yml
@@ -1,8 +1,9 @@
name: Serialization Compatibility Test
on:
+ pull_request:
push:
- branches: [ master, main ]
+ branches: [ 7.0.X ]
workflow_dispatch:
jobs:
diff --git a/.github/workflows/auto-jdk-matrix.yml b/.github/workflows/auto-jdk-matrix.yml
index f8220bbe2..49be43018 100644
--- a/.github/workflows/auto-jdk-matrix.yml
+++ b/.github/workflows/auto-jdk-matrix.yml
@@ -1,67 +1,67 @@
name: DataSketches-Java Auto JDK Matrix Test & Install
on:
- pull_request:
- push:
- branches: [ master, main ]
- workflow_dispatch:
+ pull_request:
+ push:
+ branches: [ 7.0.X ]
+ workflow_dispatch:
env:
- MAVEN_OPTS: -Xmx4g -Xms1g
+ MAVEN_OPTS: -Xmx4g -Xms1g
jobs:
- build:
- name: Build, Test, Install
- runs-on: ubuntu-latest
+ build:
+ name: Build, Test, Install
+ runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- jdk: [ 17 ]
+ strategy:
+ fail-fast: false
+ matrix:
+ jdk: [ 17 ]
- env:
- JDK_VERSION: ${{ matrix.jdk }}
+ env:
+ JDK_VERSION: ${{ matrix.jdk }}
- steps:
- - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
- uses: actions/checkout@v4
- with:
- persist-credentials: false
+ steps:
+ - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
+ uses: actions/checkout@v4
+ with:
+ persist-credentials: false
- - name: Print Current workflow
- run: >
- cat .github/workflows/auto-jdk-matrix.yml
+ - name: Print Current workflow
+ run: >
+ cat .github/workflows/auto-jdk-matrix.yml
- - name: Cache local Maven repository
- uses: actions/cache@v4
- with:
- path: ~/.m2/repository
- key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: build-${{ runner.os }}-maven-
+ - name: Cache local Maven repository
+ uses: actions/cache@v4
+ with:
+ path: ~/.m2/repository
+ key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: build-${{ runner.os }}-maven-
- - name: Install Matrix JDK
- uses: actions/setup-java@v4
- with:
- java-version: ${{ matrix.jdk }}
- distribution: 'temurin'
- java-package: jdk
- architecture: x64
+ - name: Install Matrix JDK
+ uses: actions/setup-java@v4
+ with:
+ java-version: ${{ matrix.jdk }}
+ distribution: 'temurin'
+ java-package: jdk
+ architecture: x64
- - name: Echo Java Version
- run: >
- java -version
+ - name: Echo Java Version
+ run: >
+ java -version
- - name: Test
- run: >
- mvn clean test -B
- -Dmaven.javadoc.skip=true
- -Dgpg.skip=true
+ - name: Test
+ run: >
+ mvn clean test -B
+ -Dmaven.javadoc.skip=true
+ -Dgpg.skip=true
- - name: Install
- run: >
- mvn clean install -B
- -DskipTests=true
- -Dgpg.skip=true
+ - name: Install
+ run: >
+ mvn clean install -B
+ -DskipTests=true
+ -Dgpg.skip=true
# Architecture options: x86, x64, armv7, aarch64, ppc64le
# setup-java@v4 has a "with cache" option
diff --git a/.github/workflows/auto-os-matrix.yml b/.github/workflows/auto-os-matrix.yml
index d9f5bc4c5..b7d703a08 100644
--- a/.github/workflows/auto-os-matrix.yml
+++ b/.github/workflows/auto-os-matrix.yml
@@ -1,77 +1,77 @@
name: DataSketches-Java Auto OS Matrix Test & Install
on:
- pull_request:
- push:
- branches: [ master, main ]
- workflow_dispatch:
+ pull_request:
+ push:
+ branches: [ 7.0.X ]
+ workflow_dispatch:
env:
- MAVEN_OPTS: -Xmx1g -Xms1g
+ MAVEN_OPTS: -Xmx1g -Xms1g
jobs:
- build:
- name: Build, Test, Install
+ build:
+ name: Build, Test, Install
- strategy:
- fail-fast: false
+ strategy:
+ fail-fast: false
- matrix:
- jdk: [ 17 ]
- os: [ windows-latest, ubuntu-latest, macos-latest ]
- include:
- - os: windows-latest
- skip_javadoc: "`-Dmaven`.javadoc`.skip=true"
- skip_gpg: "`-Dgpg`.skip=true"
- - os: ubuntu-latest
- skip_javadoc: -Dmaven.javadoc.skip=true
- skip_gpg: -Dgpg.skip=true
- - os: macos-latest
- skip_javadoc: -Dmaven.javadoc.skip=true
- skip_gpg: -Dgpg.skip=true
+ matrix:
+ jdk: [ 17 ]
+ os: [ windows-latest, ubuntu-latest, macos-latest ]
+ include:
+ - os: windows-latest
+ skip_javadoc: "`-Dmaven`.javadoc`.skip=true"
+ skip_gpg: "`-Dgpg`.skip=true"
+ - os: ubuntu-latest
+ skip_javadoc: -Dmaven.javadoc.skip=true
+ skip_gpg: -Dgpg.skip=true
+ - os: macos-latest
+ skip_javadoc: -Dmaven.javadoc.skip=true
+ skip_gpg: -Dgpg.skip=true
- runs-on: ${{matrix.os}}
+ runs-on: ${{matrix.os}}
- env:
- JDK_VERSION: ${{ matrix.jdk }}
+ env:
+ JDK_VERSION: ${{ matrix.jdk }}
- steps:
- - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
- uses: actions/checkout@v4
- with:
- persist-credentials: false
+ steps:
+ - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
+ uses: actions/checkout@v4
+ with:
+ persist-credentials: false
- - name: Cache local Maven repository
- uses: actions/cache@v4
- with:
- path: ~/.m2/repository
- key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: build-${{ runner.os }}-maven-
+ - name: Cache local Maven repository
+ uses: actions/cache@v4
+ with:
+ path: ~/.m2/repository
+ key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: build-${{ runner.os }}-maven-
- - name: Install Matrix JDK
- uses: actions/setup-java@v4
- with:
- java-version: ${{ matrix.jdk }}
- distribution: 'temurin'
- java-package: jdk
- architecture: x64
+ - name: Install Matrix JDK
+ uses: actions/setup-java@v4
+ with:
+ java-version: ${{ matrix.jdk }}
+ distribution: 'temurin'
+ java-package: jdk
+ architecture: x64
- - name: Echo Java Version
- run: >
- java -version
+ - name: Echo Java Version
+ run: >
+ java -version
- - name: Test
- run: >
- mvn clean test
- ${{matrix.os.skip_javadoc}}
- ${{matrix.os.skip_gpg}}
+ - name: Test
+ run: >
+ mvn clean test
+ ${{matrix.os.skip_javadoc}}
+ ${{matrix.os.skip_gpg}}
- - name: Install
- run: >
- mvn clean install -B
- ${{matrix.os.skip_javadoc}}
- -D skipTests=true
- ${{matrix.os.skip_gpg}}
+ - name: Install
+ run: >
+ mvn clean install -B
+ ${{matrix.os.skip_javadoc}}
+ -D skipTests=true
+ ${{matrix.os.skip_gpg}}
# Architecture options: x86, x64, armv7, aarch64, ppc64le
# setup-java@v4 has a "with cache" option
diff --git a/.github/workflows/manual-codeql-analysis.yml b/.github/workflows/manual-codeql-analysis.yml
index 1b94d13a3..a68d4cfff 100644
--- a/.github/workflows/manual-codeql-analysis.yml
+++ b/.github/workflows/manual-codeql-analysis.yml
@@ -20,38 +20,38 @@ jobs:
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- - name: Checkout repository
- uses: actions/checkout@v4
-
- # Initializes the CodeQL tools for scanning.
- - name: Initialize CodeQL
- uses: github/codeql-action/init@v4
- with:
- languages: ${{ matrix.language }}
- # If you wish to specify custom queries, you can do so here or in a config file.
- # By default, queries listed here will override any specified in a config file.
- # Prefix the list here with "+" to use these queries and those in the config file.
-
- # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
- queries: +security-and-quality
-
-
- # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
- # If this step fails, then you should remove it and run the build manually (see below)
- - name: Autobuild
- uses: github/codeql-action/autobuild@v4
-
- # Command-line programs to run using the OS shell.
- # See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
-
- # If the Autobuild fails above, remove it and uncomment the following three lines.
- # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
-
- # - run: |
- # echo "Run, Build Application using script"
- # ./location_of_script_within_repo/buildscript.sh
-
- - name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v4
- with:
- category: "/language:${{matrix.language}}"
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v4
+ with:
+ languages: ${{ matrix.language }}
+ # If you wish to specify custom queries, you can do so here or in a config file.
+ # By default, queries listed here will override any specified in a config file.
+ # Prefix the list here with "+" to use these queries and those in the config file.
+
+ # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
+ queries: +security-and-quality
+
+
+ # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
+ # If this step fails, then you should remove it and run the build manually (see below)
+ - name: Autobuild
+ uses: github/codeql-action/autobuild@v4
+
+ # Command-line programs to run using the OS shell.
+ # See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
+
+ # If the Autobuild fails above, remove it and uncomment the following three lines.
+ # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
+
+ # - run: |
+ # echo "Run, Build Application using script"
+ # ./location_of_script_within_repo/buildscript.sh
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v4
+ with:
+ category: "/language:${{matrix.language}}"
diff --git a/.github/workflows/manual-javadoc.yml b/.github/workflows/manual-javadoc.yml
index e65824e7e..dfcfb1152 100644
--- a/.github/workflows/manual-javadoc.yml
+++ b/.github/workflows/manual-javadoc.yml
@@ -22,7 +22,7 @@ jobs:
- name: Print Current workflow
run: >
- cat .github/workflows/manual-javadoc.yml
+ cat .github/workflows/manual-javadoc.yml
- name: Generate JavaDoc
run: mvn clean javadoc:javadoc
From 7a4b6868d593a294a96f5d9dd90f4bb1485e8806 Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Thu, 19 Dec 2024 09:00:25 -0800
Subject: [PATCH 39/58] Try to fix CodeQL workflow
---
.github/workflows/manual-codeql-analysis.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/manual-codeql-analysis.yml b/.github/workflows/manual-codeql-analysis.yml
index a68d4cfff..54eb56f89 100644
--- a/.github/workflows/manual-codeql-analysis.yml
+++ b/.github/workflows/manual-codeql-analysis.yml
@@ -25,7 +25,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@v4
+ uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -39,7 +39,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
- uses: github/codeql-action/autobuild@v4
+ uses: github/codeql-action/autobuild@v3
# Command-line programs to run using the OS shell.
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -52,6 +52,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v4
+ uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
From c0fcb55045ce210fce4f6dd44e3e1ecaf56ec9f3 Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Thu, 19 Dec 2024 11:21:52 -0800
Subject: [PATCH 40/58] Modify CodeQL with manual java build. Hopefully this
will work.
Updated Checkstyle configuration, adding more comments and removing
unused modules.
---
.github/workflows/manual-codeql-analysis.yml | 15 +++++-
tools/CloverConfig.txt | 50 --------------------
tools/SketchesCheckstyle.xml | 15 +++---
tools/suppressions.xml | 29 ------------
4 files changed, 19 insertions(+), 90 deletions(-)
delete mode 100644 tools/CloverConfig.txt
delete mode 100644 tools/suppressions.xml
diff --git a/.github/workflows/manual-codeql-analysis.yml b/.github/workflows/manual-codeql-analysis.yml
index 54eb56f89..b428865d0 100644
--- a/.github/workflows/manual-codeql-analysis.yml
+++ b/.github/workflows/manual-codeql-analysis.yml
@@ -38,8 +38,9 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- - name: Autobuild
- uses: github/codeql-action/autobuild@v3
+
+ # -name: Autobuild
+ # uses: github/codeql-action/autobuild@v3
# Command-line programs to run using the OS shell.
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -51,6 +52,16 @@ jobs:
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
+ # Note: Autobuild fails thus the following manual build
+ - name: Manual Build With Java 17
+ uses: actions/setup-java@v4
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+
+ - name: Java Compile
+ run: mvn clean compile
+
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
diff --git a/tools/CloverConfig.txt b/tools/CloverConfig.txt
deleted file mode 100644
index 845fede8c..000000000
--- a/tools/CloverConfig.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-Clover Config for Eclipse:
-
-At Project Level Properties:
-Clover:
- Instrumentation:
- Initstring: Default value
- Output Folder: ...project output dir(s)
- Flush Policy: At JVM shutdown ...
- Misc: Fully qualify ... , Instrument and compile at statement level
- Contexts:
- Check: assert statements
- Add Custom Coverage Context Filter:
- private-constructor: also see link below
- Method
- (.* )?private +[a-zA-Z0-9_$]+ *\( *\).*
- Source Files
- Only look ...
- [check] src/main/java[includes=**/*.java][excludes=]
- [check] src/test/java[includes=**/*.java][excludes=]
- Test Classes
- Assume all source in the specified folders are tests or test utility classes
- [check] src/test/java
-
-At Clover "down-triangle" menu:
- Columns:
- Element
- % TOTAL Coverage
- Uncovered Elements: Custom: %UncoveredElements * TotalElements / 100
- Total Elements
-
-
-
-http://alexruizlog.blogspot.com/2009/04/how-to-make-clover-ignore-private_21.html
\ No newline at end of file
diff --git a/tools/SketchesCheckstyle.xml b/tools/SketchesCheckstyle.xml
index 184a05ad3..53726a2c1 100644
--- a/tools/SketchesCheckstyle.xml
+++ b/tools/SketchesCheckstyle.xml
@@ -49,10 +49,12 @@ under the License.
+
-
+
+
@@ -67,6 +69,7 @@ under the License.
+
@@ -80,13 +83,6 @@ under the License.
-
-
@@ -230,7 +226,8 @@ under the License.
-
+
+
diff --git a/tools/suppressions.xml b/tools/suppressions.xml
deleted file mode 100644
index 91b8833c4..000000000
--- a/tools/suppressions.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
From 55f1d5622aa411744a15f1c28ca9872ba8b0ac0b Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Thu, 19 Dec 2024 11:35:28 -0800
Subject: [PATCH 41/58] Update workflow names to make them more identifiable
---
.github/workflows/auto-check_cpp_files.yml | 2 +-
.github/workflows/auto-jdk-matrix.yml | 2 +-
.github/workflows/auto-os-matrix.yml | 2 +-
.github/workflows/manual-codeql-analysis.yml | 2 +-
.github/workflows/manual-javadoc.yml | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/auto-check_cpp_files.yml b/.github/workflows/auto-check_cpp_files.yml
index 858e760fb..9e577d71c 100644
--- a/.github/workflows/auto-check_cpp_files.yml
+++ b/.github/workflows/auto-check_cpp_files.yml
@@ -1,4 +1,4 @@
-name: Serialization Compatibility Test
+name: C++ Serialization Compatibility Test
on:
pull_request:
diff --git a/.github/workflows/auto-jdk-matrix.yml b/.github/workflows/auto-jdk-matrix.yml
index 49be43018..873ce59f6 100644
--- a/.github/workflows/auto-jdk-matrix.yml
+++ b/.github/workflows/auto-jdk-matrix.yml
@@ -1,4 +1,4 @@
-name: DataSketches-Java Auto JDK Matrix Test & Install
+name: Auto JDK Matrix Test, Install
on:
pull_request:
diff --git a/.github/workflows/auto-os-matrix.yml b/.github/workflows/auto-os-matrix.yml
index b7d703a08..473211f67 100644
--- a/.github/workflows/auto-os-matrix.yml
+++ b/.github/workflows/auto-os-matrix.yml
@@ -1,4 +1,4 @@
-name: DataSketches-Java Auto OS Matrix Test & Install
+name: Auto OS Matrix Test, Install
on:
pull_request:
diff --git a/.github/workflows/manual-codeql-analysis.yml b/.github/workflows/manual-codeql-analysis.yml
index b428865d0..a05e5696d 100644
--- a/.github/workflows/manual-codeql-analysis.yml
+++ b/.github/workflows/manual-codeql-analysis.yml
@@ -1,4 +1,4 @@
-name: "CodeQL"
+name: "CodeQL Analysis"
on:
workflow_dispatch:
diff --git a/.github/workflows/manual-javadoc.yml b/.github/workflows/manual-javadoc.yml
index dfcfb1152..7358cc3de 100644
--- a/.github/workflows/manual-javadoc.yml
+++ b/.github/workflows/manual-javadoc.yml
@@ -1,4 +1,4 @@
-name: JavaDoc
+name: Publish JavaDoc
on:
workflow_dispatch:
From 6b85284e63501f214b78ffd87c3deeed4e07f5dd Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Thu, 19 Dec 2024 11:46:01 -0800
Subject: [PATCH 42/58] Name must not be quoted
---
.github/workflows/auto-check_cpp_files.yml | 2 +-
.github/workflows/manual-codeql-analysis.yml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/auto-check_cpp_files.yml b/.github/workflows/auto-check_cpp_files.yml
index 9e577d71c..f80403e53 100644
--- a/.github/workflows/auto-check_cpp_files.yml
+++ b/.github/workflows/auto-check_cpp_files.yml
@@ -1,4 +1,4 @@
-name: C++ Serialization Compatibility Test
+name: Auto C++ Serialization Compatibility Test
on:
pull_request:
diff --git a/.github/workflows/manual-codeql-analysis.yml b/.github/workflows/manual-codeql-analysis.yml
index a05e5696d..5ed7b46a9 100644
--- a/.github/workflows/manual-codeql-analysis.yml
+++ b/.github/workflows/manual-codeql-analysis.yml
@@ -1,4 +1,4 @@
-name: "CodeQL Analysis"
+name: Manual CodeQL Analysis
on:
workflow_dispatch:
From 401b1fb47c6e419fb0578d6351e01869b7ef8c6e Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Thu, 19 Dec 2024 11:58:29 -0800
Subject: [PATCH 43/58] Make all workflows auto so they show up for testing.
---
.github/workflows/manual-codeql-analysis.yml | 3 +++
.github/workflows/manual-javadoc.yml | 3 +++
2 files changed, 6 insertions(+)
diff --git a/.github/workflows/manual-codeql-analysis.yml b/.github/workflows/manual-codeql-analysis.yml
index 5ed7b46a9..9e7110454 100644
--- a/.github/workflows/manual-codeql-analysis.yml
+++ b/.github/workflows/manual-codeql-analysis.yml
@@ -1,6 +1,9 @@
name: Manual CodeQL Analysis
on:
+ pull_request:
+ push:
+ branches: [ 7.0.X ]
workflow_dispatch:
jobs:
diff --git a/.github/workflows/manual-javadoc.yml b/.github/workflows/manual-javadoc.yml
index 7358cc3de..f1cd56e75 100644
--- a/.github/workflows/manual-javadoc.yml
+++ b/.github/workflows/manual-javadoc.yml
@@ -1,6 +1,9 @@
name: Publish JavaDoc
on:
+ pull_request:
+ push:
+ branches: [ 7.0.X ]
workflow_dispatch:
jobs:
From e264d3ff8d734ca498c9411a1730bdcefe4627c1 Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Thu, 19 Dec 2024 12:11:02 -0800
Subject: [PATCH 44/58] revert workfile name and yml file name to what they
were before.
---
.../{manual-codeql-analysis.yml => codeql-analysis.yml} | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
rename .github/workflows/{manual-codeql-analysis.yml => codeql-analysis.yml} (97%)
diff --git a/.github/workflows/manual-codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
similarity index 97%
rename from .github/workflows/manual-codeql-analysis.yml
rename to .github/workflows/codeql-analysis.yml
index 9e7110454..aaceefd82 100644
--- a/.github/workflows/manual-codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -1,10 +1,10 @@
-name: Manual CodeQL Analysis
+name: "CodeQL"
on:
- pull_request:
push:
branches: [ 7.0.X ]
- workflow_dispatch:
+ pull_request: [ 7.0.X ]
+ workflow_dispatch:
jobs:
analyze:
From eb5fe28a663b42eac5ef3c02542a7d6d6128e057 Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Thu, 19 Dec 2024 12:13:44 -0800
Subject: [PATCH 45/58] Fix indent on codeql-analysis
---
.github/workflows/codeql-analysis.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index aaceefd82..230bd8f8e 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -3,8 +3,8 @@ name: "CodeQL"
on:
push:
branches: [ 7.0.X ]
- pull_request: [ 7.0.X ]
- workflow_dispatch:
+ pull_request: [ 7.0.X ]
+ workflow_dispatch:
jobs:
analyze:
From de840df7f5b032ac48b477e0d7b2f00f92e3973f Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Thu, 19 Dec 2024 12:27:44 -0800
Subject: [PATCH 46/58] fix indent
---
.github/workflows/codeql-analysis.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 230bd8f8e..cf1cc9d7f 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -58,9 +58,9 @@ jobs:
# Note: Autobuild fails thus the following manual build
- name: Manual Build With Java 17
uses: actions/setup-java@v4
- with:
- java-version: '17'
- distribution: 'temurin'
+ with:
+ java-version: '17'
+ distribution: 'temurin'
- name: Java Compile
run: mvn clean compile
From ef3310db8644e22cb00ed52ea347fd303c0da355 Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Thu, 19 Dec 2024 14:05:29 -0800
Subject: [PATCH 47/58] Trying codeql again.
---
.github/workflows/codeql-analysis.yml | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index cf1cc9d7f..427faa7cd 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -2,8 +2,15 @@ name: "CodeQL"
on:
push:
- branches: [ 7.0.X ]
- pull_request: [ 7.0.X ]
+ branches:
+ - '7.0.X'
+ - 'main'
+ pull_request_target:
+ types:
+ - opened
+ branches:
+ - '7.0.X'
+ - 'main'
workflow_dispatch:
jobs:
From 868d33d696bcfef755bc9a605905421e246640f1 Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Thu, 19 Dec 2024 15:17:49 -0800
Subject: [PATCH 48/58] update pom version on main
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 35022e3b1..c72af4f39 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@ under the License.
org.apache.datasketches
datasketches-java
- 7.0.0
+ 7.1.0-SNAPSHOT
jar
${project.artifactId}
From 763c58a5fd0ed006a52ae1bdd439efdca8e5dfbd Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Sat, 28 Dec 2024 12:53:14 -0800
Subject: [PATCH 49/58] Fix workflows in main.
---
.github/workflows/auto-jdk-matrix.yml | 100 ++++++++-------
.github/workflows/auto-os-matrix.yml | 118 +++++++++---------
...heck_cpp_files.yml => check_cpp_files.yml} | 7 +-
.github/workflows/codeql-analysis.yml | 83 ++++++++++++
.../{manual-javadoc.yml => javadoc.yml} | 0
.github/workflows/manual-codeql-analysis.yml | 57 ---------
6 files changed, 202 insertions(+), 163 deletions(-)
rename .github/workflows/{auto-check_cpp_files.yml => check_cpp_files.yml} (70%)
create mode 100644 .github/workflows/codeql-analysis.yml
rename .github/workflows/{manual-javadoc.yml => javadoc.yml} (100%)
delete mode 100644 .github/workflows/manual-codeql-analysis.yml
diff --git a/.github/workflows/auto-jdk-matrix.yml b/.github/workflows/auto-jdk-matrix.yml
index f8220bbe2..9312589df 100644
--- a/.github/workflows/auto-jdk-matrix.yml
+++ b/.github/workflows/auto-jdk-matrix.yml
@@ -1,67 +1,71 @@
name: DataSketches-Java Auto JDK Matrix Test & Install
on:
- pull_request:
- push:
- branches: [ master, main ]
- workflow_dispatch:
+ push:
+ paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/.*', '**/LICENSE', '**/NOTICE' ]
+ branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
+ pull_request:
+ paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/.*', '**/LICENSE', '**/NOTICE' ]
+ # The branches below must be a subset of the branches above
+ branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
+ workflow_dispatch:
env:
- MAVEN_OPTS: -Xmx4g -Xms1g
+ MAVEN_OPTS: -Xmx4g -Xms1g
jobs:
- build:
- name: Build, Test, Install
- runs-on: ubuntu-latest
+ build:
+ name: Build, Test, Install
+ runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- jdk: [ 17 ]
+ strategy:
+ fail-fast: false
+ matrix:
+ jdk: [ 17 ]
- env:
- JDK_VERSION: ${{ matrix.jdk }}
+ env:
+ JDK_VERSION: ${{ matrix.jdk }}
- steps:
- - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
- uses: actions/checkout@v4
- with:
- persist-credentials: false
+ steps:
+ - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
+ uses: actions/checkout@v4
+ with:
+ persist-credentials: false
- - name: Print Current workflow
- run: >
- cat .github/workflows/auto-jdk-matrix.yml
+ - name: Print Current workflow
+ run: >
+ cat .github/workflows/auto-jdk-matrix.yml
- - name: Cache local Maven repository
- uses: actions/cache@v4
- with:
- path: ~/.m2/repository
- key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: build-${{ runner.os }}-maven-
+ - name: Cache local Maven repository
+ uses: actions/cache@v4
+ with:
+ path: ~/.m2/repository
+ key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: build-${{ runner.os }}-maven-
- - name: Install Matrix JDK
- uses: actions/setup-java@v4
- with:
- java-version: ${{ matrix.jdk }}
- distribution: 'temurin'
- java-package: jdk
- architecture: x64
+ - name: Install Matrix JDK
+ uses: actions/setup-java@v4
+ with:
+ java-version: ${{ matrix.jdk }}
+ distribution: 'temurin'
+ java-package: jdk
+ architecture: x64
- - name: Echo Java Version
- run: >
- java -version
+ - name: Echo Java Version
+ run: >
+ java -version
- - name: Test
- run: >
- mvn clean test -B
- -Dmaven.javadoc.skip=true
- -Dgpg.skip=true
+ - name: Test
+ run: >
+ mvn clean test -B
+ -Dmaven.javadoc.skip=true
+ -Dgpg.skip=true
- - name: Install
- run: >
- mvn clean install -B
- -DskipTests=true
- -Dgpg.skip=true
+ - name: Install
+ run: >
+ mvn clean install -B
+ -DskipTests=true
+ -Dgpg.skip=true
# Architecture options: x86, x64, armv7, aarch64, ppc64le
# setup-java@v4 has a "with cache" option
diff --git a/.github/workflows/auto-os-matrix.yml b/.github/workflows/auto-os-matrix.yml
index d9f5bc4c5..9fb6f2812 100644
--- a/.github/workflows/auto-os-matrix.yml
+++ b/.github/workflows/auto-os-matrix.yml
@@ -1,77 +1,81 @@
name: DataSketches-Java Auto OS Matrix Test & Install
on:
- pull_request:
- push:
- branches: [ master, main ]
- workflow_dispatch:
+ push:
+ paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/.*', '**/LICENSE', '**/NOTICE' ]
+ branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
+ pull_request:
+ paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/.*', '**/LICENSE', '**/NOTICE' ]
+ # The branches below must be a subset of the branches above
+ branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
+ workflow_dispatch:
env:
- MAVEN_OPTS: -Xmx1g -Xms1g
+ MAVEN_OPTS: -Xmx4g -Xms1g
jobs:
- build:
- name: Build, Test, Install
+ build:
+ name: Build, Test, Install
- strategy:
- fail-fast: false
+ strategy:
+ fail-fast: false
- matrix:
- jdk: [ 17 ]
- os: [ windows-latest, ubuntu-latest, macos-latest ]
- include:
- - os: windows-latest
- skip_javadoc: "`-Dmaven`.javadoc`.skip=true"
- skip_gpg: "`-Dgpg`.skip=true"
- - os: ubuntu-latest
- skip_javadoc: -Dmaven.javadoc.skip=true
- skip_gpg: -Dgpg.skip=true
- - os: macos-latest
- skip_javadoc: -Dmaven.javadoc.skip=true
- skip_gpg: -Dgpg.skip=true
+ matrix:
+ jdk: [ 17 ]
+ os: [ windows-latest, ubuntu-latest, macos-latest ]
+ include:
+ - os: windows-latest
+ skip_javadoc: "`-Dmaven`.javadoc`.skip=true"
+ skip_gpg: "`-Dgpg`.skip=true"
+ - os: ubuntu-latest
+ skip_javadoc: -Dmaven.javadoc.skip=true
+ skip_gpg: -Dgpg.skip=true
+ - os: macos-latest
+ skip_javadoc: -Dmaven.javadoc.skip=true
+ skip_gpg: -Dgpg.skip=true
- runs-on: ${{matrix.os}}
+ runs-on: ${{matrix.os}}
- env:
- JDK_VERSION: ${{ matrix.jdk }}
+ env:
+ JDK_VERSION: ${{ matrix.jdk }}
- steps:
- - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
- uses: actions/checkout@v4
- with:
- persist-credentials: false
+ steps:
+ - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
+ uses: actions/checkout@v4
+ with:
+ persist-credentials: false
- - name: Cache local Maven repository
- uses: actions/cache@v4
- with:
- path: ~/.m2/repository
- key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: build-${{ runner.os }}-maven-
+ - name: Cache local Maven repository
+ uses: actions/cache@v4
+ with:
+ path: ~/.m2/repository
+ key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: build-${{ runner.os }}-maven-
- - name: Install Matrix JDK
- uses: actions/setup-java@v4
- with:
- java-version: ${{ matrix.jdk }}
- distribution: 'temurin'
- java-package: jdk
- architecture: x64
+ - name: Install Matrix JDK
+ uses: actions/setup-java@v4
+ with:
+ java-version: ${{ matrix.jdk }}
+ distribution: 'temurin'
+ java-package: jdk
+ architecture: x64
- - name: Echo Java Version
- run: >
- java -version
+ - name: Echo Java Version
+ run: >
+ java -version
- - name: Test
- run: >
- mvn clean test
- ${{matrix.os.skip_javadoc}}
- ${{matrix.os.skip_gpg}}
+ - name: Test
+ run: >
+ mvn clean test
+ ${{matrix.os.skip_javadoc}}
+ ${{matrix.os.skip_gpg}}
- - name: Install
- run: >
- mvn clean install -B
- ${{matrix.os.skip_javadoc}}
- -D skipTests=true
- ${{matrix.os.skip_gpg}}
+ - name: Install
+ run: >
+ mvn clean install -B
+ ${{matrix.os.skip_javadoc}}
+ -D skipTests=true
+ ${{matrix.os.skip_gpg}}
# Architecture options: x86, x64, armv7, aarch64, ppc64le
# setup-java@v4 has a "with cache" option
diff --git a/.github/workflows/auto-check_cpp_files.yml b/.github/workflows/check_cpp_files.yml
similarity index 70%
rename from .github/workflows/auto-check_cpp_files.yml
rename to .github/workflows/check_cpp_files.yml
index 068b12f4d..4ca9e0aa4 100644
--- a/.github/workflows/auto-check_cpp_files.yml
+++ b/.github/workflows/check_cpp_files.yml
@@ -2,7 +2,12 @@ name: Serialization Compatibility Test
on:
push:
- branches: [ master, main ]
+ paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/.*', '**/LICENSE', '**/NOTICE' ]
+ branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
+ pull_request:
+ paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/.*', '**/LICENSE', '**/NOTICE' ]
+ # The branches below must be a subset of the branches above
+ branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
workflow_dispatch:
jobs:
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
new file mode 100644
index 000000000..e6589b243
--- /dev/null
+++ b/.github/workflows/codeql-analysis.yml
@@ -0,0 +1,83 @@
+name: "CodeQL"
+
+on:
+ push:
+ paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/.*', '**/LICENSE', '**/NOTICE' ]
+ branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
+ pull_request:
+ paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/.*', '**/LICENSE', '**/NOTICE' ]
+ # The branches below must be a subset of the branches above
+ branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
+ workflow_dispatch:
+
+jobs:
+ analyze:
+ name: Analyze
+ runs-on: ubuntu-latest
+ permissions:
+ actions: read
+ contents: read
+ security-events: write
+
+ strategy:
+ fail-fast: false
+ matrix:
+ language: [ 'java' ]
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
+ # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ - name: Setup Java
+ uses: actions/setup-java@v4
+ with:
+ distribution: 'temurin'
+ cache: 'maven'
+ java-version: '17'
+
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v3
+ with:
+ languages: ${{ matrix.language }}
+ queries: +security-and-quality
+
+ # If you wish to specify custom queries, you can do so here or in a config file.
+ # By default, queries listed here will override any specified in a config file.
+ # Prefix the list here with "+" to use these queries and those in the config file.
+ # Details on CodeQL's query packs refer to link below.
+
+ - name: Custom building using maven
+ run: >
+ mvn clean package -f "pom.xml" -B -V -e
+ -Dfindbugs.skip=true
+ -Dcheckstyle.skip=true
+ -Dpmd.skip=true
+ -Denforcer.skip
+ -Dmaven.javadoc.skip
+ -DskipTests=true
+ -Dmaven.test.skip.exec
+ -Dlicense.skip=true
+ -Dweb.console.skip=true
+ -Dgpg.skip=true
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v3
+ with:
+ category: "/language:${{matrix.language}}"
+
+
+# CodeQL's Query Packs:
+# https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
+
+# Command-line programs to run using the OS shell.
+# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
+
+# Architecture options: x86, x64, armv7, aarch64, ppc64le
+# Lifecycles: validate, compile, test, package, verify, install, deploy
+# -B batch mode, never stops for user input
+# -V show Version without stopping
+# -X debug mode
+# -q quiet, only show errors
+# -e produce execution error messages
\ No newline at end of file
diff --git a/.github/workflows/manual-javadoc.yml b/.github/workflows/javadoc.yml
similarity index 100%
rename from .github/workflows/manual-javadoc.yml
rename to .github/workflows/javadoc.yml
diff --git a/.github/workflows/manual-codeql-analysis.yml b/.github/workflows/manual-codeql-analysis.yml
deleted file mode 100644
index 1b94d13a3..000000000
--- a/.github/workflows/manual-codeql-analysis.yml
+++ /dev/null
@@ -1,57 +0,0 @@
-name: "CodeQL"
-
-on:
- workflow_dispatch:
-
-jobs:
- analyze:
- name: Analyze
- runs-on: ubuntu-latest
- permissions:
- actions: read
- contents: read
- security-events: write
-
- strategy:
- fail-fast: false
- matrix:
- language: [ 'java' ]
- # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
- # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v4
-
- # Initializes the CodeQL tools for scanning.
- - name: Initialize CodeQL
- uses: github/codeql-action/init@v4
- with:
- languages: ${{ matrix.language }}
- # If you wish to specify custom queries, you can do so here or in a config file.
- # By default, queries listed here will override any specified in a config file.
- # Prefix the list here with "+" to use these queries and those in the config file.
-
- # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
- queries: +security-and-quality
-
-
- # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
- # If this step fails, then you should remove it and run the build manually (see below)
- - name: Autobuild
- uses: github/codeql-action/autobuild@v4
-
- # Command-line programs to run using the OS shell.
- # See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
-
- # If the Autobuild fails above, remove it and uncomment the following three lines.
- # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
-
- # - run: |
- # echo "Run, Build Application using script"
- # ./location_of_script_within_repo/buildscript.sh
-
- - name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v4
- with:
- category: "/language:${{matrix.language}}"
From 4ace77e9fa449825be917610c248bf8edb919d1a Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Thu, 2 Jan 2025 10:45:01 -0800
Subject: [PATCH 50/58] change step indentations
---
.github/workflows/auto-jdk-matrix.yml | 66 +++++++++++++--------------
1 file changed, 33 insertions(+), 33 deletions(-)
diff --git a/.github/workflows/auto-jdk-matrix.yml b/.github/workflows/auto-jdk-matrix.yml
index 9312589df..7468a3e0e 100644
--- a/.github/workflows/auto-jdk-matrix.yml
+++ b/.github/workflows/auto-jdk-matrix.yml
@@ -27,45 +27,45 @@ jobs:
JDK_VERSION: ${{ matrix.jdk }}
steps:
- - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
- uses: actions/checkout@v4
- with:
- persist-credentials: false
+ - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
+ uses: actions/checkout@v4
+ with:
+ persist-credentials: false
- - name: Print Current workflow
- run: >
- cat .github/workflows/auto-jdk-matrix.yml
+ - name: Print Current workflow
+ run: >
+ cat .github/workflows/auto-jdk-matrix.yml
- - name: Cache local Maven repository
- uses: actions/cache@v4
- with:
- path: ~/.m2/repository
- key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: build-${{ runner.os }}-maven-
+ - name: Cache local Maven repository
+ uses: actions/cache@v4
+ with:
+ path: ~/.m2/repository
+ key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: build-${{ runner.os }}-maven-
- - name: Install Matrix JDK
- uses: actions/setup-java@v4
- with:
- java-version: ${{ matrix.jdk }}
- distribution: 'temurin'
- java-package: jdk
- architecture: x64
+ - name: Install Matrix JDK
+ uses: actions/setup-java@v4
+ with:
+ java-version: ${{ matrix.jdk }}
+ distribution: 'temurin'
+ java-package: jdk
+ architecture: x64
- - name: Echo Java Version
- run: >
- java -version
+ - name: Echo Java Version
+ run: >
+ java -version
- - name: Test
- run: >
- mvn clean test -B
- -Dmaven.javadoc.skip=true
- -Dgpg.skip=true
+ - name: Test
+ run: >
+ mvn clean test -B
+ -Dmaven.javadoc.skip=true
+ -Dgpg.skip=true
- - name: Install
- run: >
- mvn clean install -B
- -DskipTests=true
- -Dgpg.skip=true
+ - name: Install
+ run: >
+ mvn clean install -B
+ -DskipTests=true
+ -Dgpg.skip=true
# Architecture options: x86, x64, armv7, aarch64, ppc64le
# setup-java@v4 has a "with cache" option
From f5b99618f24cc048450ef0dc4b20ab99ebf20889 Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Thu, 2 Jan 2025 13:35:34 -0800
Subject: [PATCH 51/58] repair indentations
---
.github/workflows/auto-jdk-matrix.yml | 68 +++++++++++++--------------
1 file changed, 34 insertions(+), 34 deletions(-)
diff --git a/.github/workflows/auto-jdk-matrix.yml b/.github/workflows/auto-jdk-matrix.yml
index 7468a3e0e..5adbbbe08 100644
--- a/.github/workflows/auto-jdk-matrix.yml
+++ b/.github/workflows/auto-jdk-matrix.yml
@@ -26,46 +26,46 @@ jobs:
env:
JDK_VERSION: ${{ matrix.jdk }}
- steps:
- - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
- uses: actions/checkout@v4
- with:
- persist-credentials: false
+ steps:
+ - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
+ uses: actions/checkout@v4
+ with:
+ persist-credentials: false
- - name: Print Current workflow
- run: >
- cat .github/workflows/auto-jdk-matrix.yml
+ - name: Print Current workflow
+ run: >
+ cat .github/workflows/auto-jdk-matrix.yml
- - name: Cache local Maven repository
- uses: actions/cache@v4
- with:
- path: ~/.m2/repository
- key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: build-${{ runner.os }}-maven-
+ - name: Cache local Maven repository
+ uses: actions/cache@v4
+ with:
+ path: ~/.m2/repository
+ key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: build-${{ runner.os }}-maven-
- - name: Install Matrix JDK
- uses: actions/setup-java@v4
- with:
- java-version: ${{ matrix.jdk }}
- distribution: 'temurin'
- java-package: jdk
- architecture: x64
+ - name: Install Matrix JDK
+ uses: actions/setup-java@v4
+ with:
+ java-version: ${{ matrix.jdk }}
+ distribution: 'temurin'
+ java-package: jdk
+ architecture: x64
- - name: Echo Java Version
- run: >
- java -version
+ - name: Echo Java Version
+ run: >
+ java -version
- - name: Test
- run: >
- mvn clean test -B
- -Dmaven.javadoc.skip=true
- -Dgpg.skip=true
+ - name: Test
+ run: >
+ mvn clean test -B
+ -Dmaven.javadoc.skip=true
+ -Dgpg.skip=true
- - name: Install
- run: >
- mvn clean install -B
- -DskipTests=true
- -Dgpg.skip=true
+ - name: Install
+ run: >
+ mvn clean install -B
+ -DskipTests=true
+ -Dgpg.skip=true
# Architecture options: x86, x64, armv7, aarch64, ppc64le
# setup-java@v4 has a "with cache" option
From 1fd781f5eb7500e5db5465e15282016da9eddb15 Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Thu, 2 Jan 2025 16:38:42 -0800
Subject: [PATCH 52/58] fix indents again
---
.github/workflows/auto-jdk-matrix.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/auto-jdk-matrix.yml b/.github/workflows/auto-jdk-matrix.yml
index 5adbbbe08..49c7cf1dc 100644
--- a/.github/workflows/auto-jdk-matrix.yml
+++ b/.github/workflows/auto-jdk-matrix.yml
@@ -23,8 +23,8 @@ jobs:
matrix:
jdk: [ 17 ]
- env:
- JDK_VERSION: ${{ matrix.jdk }}
+ env:
+ JDK_VERSION: ${{ matrix.jdk }}
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
From 35526df5935776f14b4a2fd18019f8e42e4d6683 Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Thu, 2 Jan 2025 16:52:43 -0800
Subject: [PATCH 53/58] adjust indents & titles
---
.github/workflows/auto-jdk-matrix.yml | 4 +-
.github/workflows/auto-os-matrix.yml | 64 +++++++++++++--------------
2 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/.github/workflows/auto-jdk-matrix.yml b/.github/workflows/auto-jdk-matrix.yml
index 49c7cf1dc..9043932ce 100644
--- a/.github/workflows/auto-jdk-matrix.yml
+++ b/.github/workflows/auto-jdk-matrix.yml
@@ -1,4 +1,4 @@
-name: DataSketches-Java Auto JDK Matrix Test & Install
+name: Auto JDK Matrix Test & Install
on:
push:
@@ -24,7 +24,7 @@ jobs:
jdk: [ 17 ]
env:
- JDK_VERSION: ${{ matrix.jdk }}
+ addJDK_VERSION: ${{ matrix.jdk }}
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
diff --git a/.github/workflows/auto-os-matrix.yml b/.github/workflows/auto-os-matrix.yml
index 9fb6f2812..b56e5aa22 100644
--- a/.github/workflows/auto-os-matrix.yml
+++ b/.github/workflows/auto-os-matrix.yml
@@ -1,4 +1,4 @@
-name: DataSketches-Java Auto OS Matrix Test & Install
+name: Auto OS Matrix Test & Install
on:
push:
@@ -40,42 +40,42 @@ jobs:
JDK_VERSION: ${{ matrix.jdk }}
steps:
- - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
- uses: actions/checkout@v4
- with:
- persist-credentials: false
+ - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
+ uses: actions/checkout@v4
+ with:
+ persist-credentials: false
- - name: Cache local Maven repository
- uses: actions/cache@v4
- with:
- path: ~/.m2/repository
- key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: build-${{ runner.os }}-maven-
+ - name: Cache local Maven repository
+ uses: actions/cache@v4
+ with:
+ path: ~/.m2/repository
+ key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: build-${{ runner.os }}-maven-
- - name: Install Matrix JDK
- uses: actions/setup-java@v4
- with:
- java-version: ${{ matrix.jdk }}
- distribution: 'temurin'
- java-package: jdk
- architecture: x64
+ - name: Install Matrix JDK
+ uses: actions/setup-java@v4
+ with:
+ java-version: ${{ matrix.jdk }}
+ distribution: 'temurin'
+ java-package: jdk
+ architecture: x64
- - name: Echo Java Version
- run: >
- java -version
+ - name: Echo Java Version
+ run: >
+ java -version
- - name: Test
- run: >
- mvn clean test
- ${{matrix.os.skip_javadoc}}
- ${{matrix.os.skip_gpg}}
+ - name: Test
+ run: >
+ mvn clean test
+ ${{matrix.os.skip_javadoc}}
+ ${{matrix.os.skip_gpg}}
- - name: Install
- run: >
- mvn clean install -B
- ${{matrix.os.skip_javadoc}}
- -D skipTests=true
- ${{matrix.os.skip_gpg}}
+ - name: Install
+ run: >
+ mvn clean install -B
+ ${{matrix.os.skip_javadoc}}
+ -D skipTests=true
+ ${{matrix.os.skip_gpg}}
# Architecture options: x86, x64, armv7, aarch64, ppc64le
# setup-java@v4 has a "with cache" option
From e412cfd5e67414d905e246f8b2cd83d72994f47b Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Thu, 2 Jan 2025 17:04:04 -0800
Subject: [PATCH 54/58] correct indents
---
.github/workflows/check_cpp_files.yml | 2 +-
.github/workflows/codeql-analysis.yml | 60 +++++++++++++--------------
2 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/.github/workflows/check_cpp_files.yml b/.github/workflows/check_cpp_files.yml
index 4ca9e0aa4..00a9e5255 100644
--- a/.github/workflows/check_cpp_files.yml
+++ b/.github/workflows/check_cpp_files.yml
@@ -1,4 +1,4 @@
-name: Serialization Compatibility Test
+name: CPP SerDe Compatibility Test
on:
push:
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index e6589b243..28c17a1f6 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -27,45 +27,45 @@ jobs:
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- - name: Checkout repository
- uses: actions/checkout@v4
+ - name: Checkout repository
+ uses: actions/checkout@v4
- - name: Setup Java
- uses: actions/setup-java@v4
- with:
- distribution: 'temurin'
- cache: 'maven'
- java-version: '17'
+ - name: Setup Java
+ uses: actions/setup-java@v4
+ with:
+ distribution: 'temurin'
+ cache: 'maven'
+ java-version: '17'
- - name: Initialize CodeQL
- uses: github/codeql-action/init@v3
- with:
- languages: ${{ matrix.language }}
- queries: +security-and-quality
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v3
+ with:
+ languages: ${{ matrix.language }}
+ queries: +security-and-quality
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Details on CodeQL's query packs refer to link below.
- - name: Custom building using maven
- run: >
- mvn clean package -f "pom.xml" -B -V -e
- -Dfindbugs.skip=true
- -Dcheckstyle.skip=true
- -Dpmd.skip=true
- -Denforcer.skip
- -Dmaven.javadoc.skip
- -DskipTests=true
- -Dmaven.test.skip.exec
- -Dlicense.skip=true
- -Dweb.console.skip=true
- -Dgpg.skip=true
+ - name: Custom building using maven
+ run: >
+ mvn clean package -f "pom.xml" -B -V -e
+ -Dfindbugs.skip=true
+ -Dcheckstyle.skip=true
+ -Dpmd.skip=true
+ -Denforcer.skip
+ -Dmaven.javadoc.skip
+ -DskipTests=true
+ -Dmaven.test.skip.exec
+ -Dlicense.skip=true
+ -Dweb.console.skip=true
+ -Dgpg.skip=true
- - name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v3
- with:
- category: "/language:${{matrix.language}}"
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v3
+ with:
+ category: "/language:${{matrix.language}}"
# CodeQL's Query Packs:
From 62939a21b8d085a6fa9beff5eaa9f8080aac8e4d Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Thu, 2 Jan 2025 17:24:35 -0800
Subject: [PATCH 55/58] fix cat of workflow
---
.github/workflows/javadoc.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/javadoc.yml b/.github/workflows/javadoc.yml
index 5f6ac6aec..fc1507a2c 100644
--- a/.github/workflows/javadoc.yml
+++ b/.github/workflows/javadoc.yml
@@ -22,7 +22,7 @@ jobs:
- name: Print Current workflow
run: >
- cat .github/workflows/manual-javadoc.yml
+ cat .github/workflows/javadoc.yml
- name: Generate JavaDoc
run: mvn javadoc:javadoc
From fd0ede4f063358ed573f24155ce15adf6e7f6847 Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Thu, 2 Jan 2025 17:30:42 -0800
Subject: [PATCH 56/58] fix target directory path
---
.github/workflows/javadoc.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/javadoc.yml b/.github/workflows/javadoc.yml
index fc1507a2c..0381f43b8 100644
--- a/.github/workflows/javadoc.yml
+++ b/.github/workflows/javadoc.yml
@@ -31,6 +31,6 @@ jobs:
uses: JamesIves/github-pages-deploy-action@v4.6.8
with:
token: ${{ secrets.GITHUB_TOKEN }}
- folder: target/site/apidocs
+ folder: target/reports/apidocs
target-folder: docs/${{ github.ref_name }}
branch: gh-pages
From b5d2d04fd36ab7c71fc45e532a2ddc4b29dbe72d Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Thu, 2 Jan 2025 18:05:44 -0800
Subject: [PATCH 57/58] fix typo
---
.github/workflows/auto-jdk-matrix.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/auto-jdk-matrix.yml b/.github/workflows/auto-jdk-matrix.yml
index 9043932ce..7e1d26c70 100644
--- a/.github/workflows/auto-jdk-matrix.yml
+++ b/.github/workflows/auto-jdk-matrix.yml
@@ -24,7 +24,7 @@ jobs:
jdk: [ 17 ]
env:
- addJDK_VERSION: ${{ matrix.jdk }}
+ JDK_VERSION: ${{ matrix.jdk }}
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
From 855716358f385e1c2a52773725bf643ac9eabd9b Mon Sep 17 00:00:00 2001
From: Lee Rhodes
Date: Fri, 3 Jan 2025 10:08:36 -0800
Subject: [PATCH 58/58] push changes into 7.0.X
---
.github/workflows/auto-check_cpp_files.yml | 45 ----------------------
.github/workflows/manual-javadoc.yml | 39 -------------------
pom.xml | 2 +-
3 files changed, 1 insertion(+), 85 deletions(-)
delete mode 100644 .github/workflows/auto-check_cpp_files.yml
delete mode 100644 .github/workflows/manual-javadoc.yml
diff --git a/.github/workflows/auto-check_cpp_files.yml b/.github/workflows/auto-check_cpp_files.yml
deleted file mode 100644
index f80403e53..000000000
--- a/.github/workflows/auto-check_cpp_files.yml
+++ /dev/null
@@ -1,45 +0,0 @@
-name: Auto C++ Serialization Compatibility Test
-
-on:
- pull_request:
- push:
- branches: [ 7.0.X ]
- workflow_dispatch:
-
-jobs:
- build:
- name: SerDe Test
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Checkout C++
- uses: actions/checkout@v4
- with:
- repository: apache/datasketches-cpp
- path: cpp
-
- - name: Setup Java
- uses: actions/setup-java@v4
- with:
- java-version: '17'
- distribution: 'temurin'
-
- - name: Configure C++ build
- run: cd cpp/build && cmake .. -DGENERATE=true
-
- - name: Build C++ unit tests
- run: cd cpp && cmake --build build --config Release
-
- - name: Run C++ tests
- run: cd cpp && cmake --build build --config Release --target test
-
- - name: Make dir
- run: mkdir -p serialization_test_data/cpp_generated_files
-
- - name: Copy files
- run: cp cpp/build/*/test/*_cpp.sk serialization_test_data/cpp_generated_files
-
- - name: Run Java tests
- run: mvn test -P check-cpp-files
diff --git a/.github/workflows/manual-javadoc.yml b/.github/workflows/manual-javadoc.yml
deleted file mode 100644
index f1cd56e75..000000000
--- a/.github/workflows/manual-javadoc.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-name: Publish JavaDoc
-
-on:
- pull_request:
- push:
- branches: [ 7.0.X ]
- workflow_dispatch:
-
-jobs:
- javadoc:
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Setup Java
- uses: actions/setup-java@v4
- with:
- java-version: '17'
- distribution: 'temurin'
-
- - name: Echo Java Version
- run: java -version
-
- - name: Print Current workflow
- run: >
- cat .github/workflows/manual-javadoc.yml
-
- - name: Generate JavaDoc
- run: mvn clean javadoc:javadoc
-
- - name: Deploy JavaDoc
- uses: JamesIves/github-pages-deploy-action@v4.6.8
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
- folder: target/reports/apidocs
- target-folder: docs/${{ github.ref_name }}
- branch: gh-pages
diff --git a/pom.xml b/pom.xml
index c72af4f39..35022e3b1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@ under the License.
org.apache.datasketches
datasketches-java
- 7.1.0-SNAPSHOT
+ 7.0.0
jar
${project.artifactId}