Merge pull request #367 from apache/remove-deprecated-methods
Remove deprecated methods
diff --git a/src/main/java/org/apache/datasketches/kll/KllFloatsSketch.java b/src/main/java/org/apache/datasketches/kll/KllFloatsSketch.java
index 32390d9..33098eb 100644
--- a/src/main/java/org/apache/datasketches/kll/KllFloatsSketch.java
+++ b/src/main/java/org/apache/datasketches/kll/KllFloatsSketch.java
@@ -484,19 +484,6 @@
}
/**
- * Gets the approximate "double-sided" rank error for the <i>getPMF()</i> function of this
- * sketch normalized as a fraction between zero and one.
- *
- * @return the rank error normalized as a fraction between zero and one.
- * @deprecated v2.0.0. Replaced by {@link #getNormalizedRankError(boolean)}
- * @see KllFloatsSketch
- */
- @Deprecated
- public double getNormalizedRankError() {
- return getNormalizedRankError(true);
- }
-
- /**
* Gets the approximate rank error of this sketch normalized as a fraction between zero and one.
* @param pmf if true, returns the "double-sided" normalized rank error for the getPMF() function.
* Otherwise, it is the "single-sided" normalized rank error for all the other queries.
@@ -509,19 +496,6 @@
}
/**
- * Static method version of the double-sided {@link #getNormalizedRankError()} that
- * specifies <em>k</em>.
- * @param k the configuration parameter
- * @return the normalized "double-sided" rank error as a function of <em>k</em>.
- * @see KllFloatsSketch
- * @deprecated v2.0.0. Replaced by {@link #getNormalizedRankError(int, boolean)}
- */
- @Deprecated
- public static double getNormalizedRankError(final int k) {
- return getNormalizedRankError(k, true);
- }
-
- /**
* Gets the normalized rank error given k and pmf.
* Static method version of the {@link #getNormalizedRankError(boolean)}.
* @param k the configuation parameter
diff --git a/src/main/java/org/apache/datasketches/quantiles/DoublesSketch.java b/src/main/java/org/apache/datasketches/quantiles/DoublesSketch.java
index ec6df57..9f72070 100644
--- a/src/main/java/org/apache/datasketches/quantiles/DoublesSketch.java
+++ b/src/main/java/org/apache/datasketches/quantiles/DoublesSketch.java
@@ -426,32 +426,6 @@
public abstract long getN();
/**
- * Get the rank error normalized as a fraction between zero and one.
- * The error of this sketch is specified as a fraction of the normalized rank of the hypothetical
- * sorted stream of items presented to the sketch.
- *
- * <p>Suppose the sketch is presented with N values. The raw rank (0 to N-1) of an item
- * would be its index position in the sorted version of the input stream. If we divide the
- * raw rank by N, it becomes the normalized rank, which is between 0 and 1.0.
- *
- * <p>For example, choosing a K of 256 yields a normalized rank error of less than 1%.
- * The upper bound on the median value obtained by getQuantile(0.5) would be the value in the
- * hypothetical ordered stream of values at the normalized rank of 0.51.
- * The lower bound would be the value in the hypothetical ordered stream of values at the
- * normalized rank of 0.49.
- *
- * <p>The error of this sketch cannot be translated into an error (relative or absolute) of the
- * returned quantile values.
- *
- * @return the rank error normalized as a fraction between zero and one.
- * @deprecated v2.0.0. Replaced by {@link #getNormalizedRankError(boolean)}
- */
- @Deprecated
- public double getNormalizedRankError() {
- return Util.getNormalizedRankError(getK(), true);
- }
-
- /**
* Gets the approximate rank error of this sketch normalized as a fraction between zero and one.
* @param pmf if true, returns the "double-sided" normalized rank error for the getPMF() function.
* Otherwise, it is the "single-sided" normalized rank error for all the other queries.
@@ -463,17 +437,6 @@
}
/**
- * Static method version of {@link #getNormalizedRankError()}
- * @param k the configuration parameter of a DoublesSketch
- * @return the rank error normalized as a fraction between zero and one.
- * @deprecated v2.0.0. Replaced by {@link #getNormalizedRankError(int, boolean)}
- */
- @Deprecated
- public static double getNormalizedRankError(final int k) {
- return Util.getNormalizedRankError(k, true);
- }
-
- /**
* Gets the normalized rank error given k and pmf.
* Static method version of the {@link #getNormalizedRankError(boolean)}.
* @param k the configuation parameter
diff --git a/src/main/java/org/apache/datasketches/quantiles/DoublesUnionBuilder.java b/src/main/java/org/apache/datasketches/quantiles/DoublesUnionBuilder.java
index fa8f7db..906ee14 100644
--- a/src/main/java/org/apache/datasketches/quantiles/DoublesUnionBuilder.java
+++ b/src/main/java/org/apache/datasketches/quantiles/DoublesUnionBuilder.java
@@ -19,7 +19,6 @@
package org.apache.datasketches.quantiles;
-import org.apache.datasketches.memory.Memory;
import org.apache.datasketches.memory.WritableMemory;
/**
@@ -80,57 +79,4 @@
return DoublesUnionImpl.directInstance(bMaxK, dstMem);
}
- /**
- * Returns a Heap Union object that has been initialized with the data from the given sketch.
- * @param sketch A DoublesSketch to be used as a source of data only and will not be modified.
- * @return a DoublesUnion object
- * @deprecated v2.0.0. Moved to DoublesUnion
- */
- @Deprecated
- public static DoublesUnion heapify(final DoublesSketch sketch) {
- return DoublesUnionImpl.heapifyInstance(sketch);
- }
-
- /**
- * Returns a Heap Union object that has been initialized with the data from the given memory
- * image of a sketch.
- *
- * @param srcMem A memory image of a DoublesSketch to be used as a source of data,
- * but will not be modified.
- * @return a Union object
- * @deprecated v2.0.0. Moved to DoublesUnion
- */
- @Deprecated
- public static DoublesUnion heapify(final Memory srcMem) {
- return DoublesUnionImpl.heapifyInstance(srcMem);
- }
-
- /**
- * Returns a read-only Union object that wraps off-heap data of the given memory image of
- * a sketch. The data structures of the Union remain off-heap.
- *
- * @param mem A memory region to be used as the data structure for the sketch
- * and will be modified.
- * @return a Union object
- * @deprecated v2.0.0. Moved to DoublesUnion
- */
- @Deprecated
- public static DoublesUnion wrap(final Memory mem) {
- return DoublesUnionImplR.wrapInstance(mem);
- }
-
- /**
- * Returns an updatable Union object that wraps off-heap data of the given memory image of
- * a sketch. The data structures of the Union remain off-heap.
- *
- * @param mem A memory region to be used as the data structure for the sketch
- * and will be modified.
- * @return a Union object
- * @deprecated v2.0.0. Moved to DoublesUnion
- */
- @Deprecated
- public static DoublesUnion wrap(final WritableMemory mem) {
- return DoublesUnionImpl.wrapInstance(mem);
- }
-
}
diff --git a/src/main/java/org/apache/datasketches/quantiles/ItemsSketch.java b/src/main/java/org/apache/datasketches/quantiles/ItemsSketch.java
index bf72bf6..6d384b7 100644
--- a/src/main/java/org/apache/datasketches/quantiles/ItemsSketch.java
+++ b/src/main/java/org/apache/datasketches/quantiles/ItemsSketch.java
@@ -485,32 +485,6 @@
}
/**
- * Get the rank error normalized as a fraction between zero and one.
- * The error of this sketch is specified as a fraction of the normalized rank of the hypothetical
- * sorted stream of items presented to the sketch.
- *
- * <p>Suppose the sketch is presented with N values. The raw rank (0 to N-1) of an item
- * would be its index position in the sorted version of the input stream. If we divide the
- * raw rank by N, it becomes the normalized rank, which is between 0 and 1.0.
- *
- * <p>For example, choosing a K of 227 yields a normalized rank error of about 1%.
- * The upper bound on the median value obtained by getQuantile(0.5) would be the value in the
- * hypothetical ordered stream of values at the normalized rank of 0.51.
- * The lower bound would be the value in the hypothetical ordered stream of values at the
- * normalized rank of 0.49.
- *
- * <p>The error of this sketch cannot be translated into an error (relative or absolute) of the
- * returned quantile values.
- *
- * @return the rank error normalized as a fraction between zero and one.
- * @deprecated v2.0.0. Replaced by {@link #getNormalizedRankError(boolean)}
- */
- @Deprecated
- public double getNormalizedRankError() {
- return Util.getNormalizedRankError(getK(), true);
- }
-
- /**
* Gets the approximate rank error of this sketch normalized as a fraction between zero and one.
* @param pmf if true, returns the "double-sided" normalized rank error for the getPMF() function.
* Otherwise, it is the "single-sided" normalized rank error for all the other queries.
@@ -522,17 +496,6 @@
}
/**
- * Static method version of {@link #getNormalizedRankError()}
- * @param k the configuration parameter of a ItemsSketch
- * @return the rank error normalized as a fraction between zero and one.
- * @deprecated v2.0.0. Replaced by {@link #getNormalizedRankError(int, boolean)}
- */
- @Deprecated
- public static double getNormalizedRankError(final int k) {
- return Util.getNormalizedRankError(k, true);
- }
-
- /**
* Gets the normalized rank error given k and pmf.
* Static method version of the {@link #getNormalizedRankError(boolean)}.
* @param k the configuation parameter
diff --git a/src/main/java/org/apache/datasketches/quantiles/Util.java b/src/main/java/org/apache/datasketches/quantiles/Util.java
index 03a70b4..2067e20 100644
--- a/src/main/java/org/apache/datasketches/quantiles/Util.java
+++ b/src/main/java/org/apache/datasketches/quantiles/Util.java
@@ -65,56 +65,6 @@
static final char TAB = '\t';
/**
- * Computes the raw delta area between two quantile sketches for the
- * <i>kolmogorovSmirnovTest(DoublesSketch, DoublesSketch, double)</i>
- * method.
- * @param sketch1 Input DoubleSketch 1
- * @param sketch2 Input DoubleSketch 2
- * @return the raw delta area between two quantile sketches
- * @deprecated 2.0.0 See class <i>KolmogorovSmirnov</i>
- */
- @Deprecated
- public static double computeKSDelta(final DoublesSketch sketch1, final DoublesSketch sketch2) {
- return KolmogorovSmirnov.computeKSDelta(sketch1, sketch2);
- }
-
- /**
- * Computes the adjusted delta area threshold for the
- * <i>kolmogorovSmirnovTest(DoublesSketch, DoublesSketch, double)</i>
- * method.
- * This adjusts the computed threshold by the error epsilons of the two given sketches.
- * See <a href="https://en.wikipedia.org/wiki/Kolmogorov-Smirnov_test">Kolmogorov–Smirnov Test</a>
- * @param sketch1 Input DoubleSketch 1
- * @param sketch2 Input DoubleSketch 2
- * @param tgtPvalue Target p-value. Typically .001 to .1, e.g., .05.
- * @return the adjusted threshold to be compared with the raw delta area.
- * @deprecated 2.0.0 See class <i>KolmogorovSmirnov</i>
- */
- @Deprecated
- public static double computeKSThreshold(final DoublesSketch sketch1,
- final DoublesSketch sketch2,
- final double tgtPvalue) {
- return KolmogorovSmirnov.computeKSThreshold(sketch1, sketch2, tgtPvalue);
- }
-
- /**
- * Performs the Kolmogorov-Smirnov Test between two quantiles sketches.
- * Note: if the given sketches have insufficient data or if the sketch sizes are too small,
- * this will return false.
- * @param sketch1 Input DoubleSketch 1
- * @param sketch2 Input DoubleSketch 2
- * @param tgtPvalue Target p-value. Typically .001 to .1, e.g., .05.
- * @return Boolean indicating whether we can reject the null hypothesis (that the sketches
- * reflect the same underlying distribution) using the provided tgtPValue.
- * @deprecated 2.0.0 See class <i>KolmogorovSmirnov</i>
- */
- @Deprecated
- public static boolean kolmogorovSmirnovTest(final DoublesSketch sketch1,
- final DoublesSketch sketch2, final double tgtPvalue) {
- return KolmogorovSmirnov.kolmogorovSmirnovTest(sketch1, sketch2, tgtPvalue);
- }
-
- /**
* Gets the normalized rank error given k and pmf for the Quantiles DoubleSketch and ItemsSketch.
* @param k the configuration parameter
* @param pmf if true, returns the "double-sided" normalized rank error for the getPMF() function.
diff --git a/src/main/java/org/apache/datasketches/theta/AnotB.java b/src/main/java/org/apache/datasketches/theta/AnotB.java
index 7ecc3bd..783294d 100644
--- a/src/main/java/org/apache/datasketches/theta/AnotB.java
+++ b/src/main/java/org/apache/datasketches/theta/AnotB.java
@@ -196,47 +196,4 @@
public abstract CompactSketch aNotB(Sketch skA, Sketch skB, boolean dstOrdered,
WritableMemory dstMem);
- //Deprecated methods
-
- /**
- * @see #aNotB(Sketch, Sketch)
- *
- * @param skA The incoming sketch for the first argument
- * @param skB The incoming sketch for the second argument
- * @deprecated v2.0.0. Instead use {@link #aNotB(Sketch, Sketch)}.
- */
- @Deprecated
- public abstract void update(Sketch skA, Sketch skB);
-
- /**
- * Gets the result of the stateful operations, {@link #setA(Sketch)} and {@link #notB(Sketch)},
- * as an ordered CompactSketch on the Java heap.
- * This clears the state of this operator after the result is returned.
- * @return the result of the stateful operations as an ordered CompactSketch on the Java heap.
- * @deprecated v2.0.0. Instead use {@link #getResult(boolean)} or
- * {@link #getResult(boolean, WritableMemory, boolean)}.
- */
- @Deprecated
- public CompactSketch getResult() {
- return getResult(true, null, true);
- }
-
- /**
- * Gets the result of the stateful operations {@link #setA(Sketch)} and {@link #notB(Sketch)}.
- * This clears the state of this operator after the result is returned.
- * @param dstOrdered
- * <a href="{@docRoot}/resources/dictionary.html#dstOrdered">See Destination Ordered</a>.
- *
- * @param dstMem
- * <a href="{@docRoot}/resources/dictionary.html#dstMem">See Destination Memory</a>.
- *
- * @return the result of this set operation as a CompactSketch of the chosen form.
- * @deprecated v2.0.0. Instead use {@link #getResult(boolean)} or
- * {@link #getResult(boolean, WritableMemory, boolean)}.
- */
- @Deprecated
- public CompactSketch getResult(final boolean dstOrdered, final WritableMemory dstMem) {
- return getResult(dstOrdered, dstMem, true);
- }
-
}
diff --git a/src/main/java/org/apache/datasketches/theta/AnotBimpl.java b/src/main/java/org/apache/datasketches/theta/AnotBimpl.java
index 8d5f9e6..35e3241 100644
--- a/src/main/java/org/apache/datasketches/theta/AnotBimpl.java
+++ b/src/main/java/org/apache/datasketches/theta/AnotBimpl.java
@@ -222,17 +222,4 @@
return empty_;
}
- //Deprecated methods
-
- @Deprecated //v2.0.0.
- @Override
- public void update(final Sketch skA, final Sketch skB) {
- //duplicate old behavior
- reset();
- if (skA == null) { return; }
- else { setA(skA); }
- if (skB == null) { return; }
- else { notB(skB); }
- }
-
}
diff --git a/src/main/java/org/apache/datasketches/theta/Intersection.java b/src/main/java/org/apache/datasketches/theta/Intersection.java
index 9ebcad1..bc10a11 100644
--- a/src/main/java/org/apache/datasketches/theta/Intersection.java
+++ b/src/main/java/org/apache/datasketches/theta/Intersection.java
@@ -110,19 +110,6 @@
* If the given sketch is null the internal state becomes the empty sketch.
* Theta will become the minimum of thetas seen so far.
* @param sketchIn the given sketch
- * @deprecated v2.0.0. Use {@link #intersect(Sketch)} instead.
- */
- @Deprecated
- public void update(final Sketch sketchIn) {
- intersect(sketchIn);
- }
-
- /**
- * Intersect the given sketch with the internal state.
- * This method can be repeatedly called.
- * If the given sketch is null the internal state becomes the empty sketch.
- * Theta will become the minimum of thetas seen so far.
- * @param sketchIn the given sketch
*/
public abstract void intersect(Sketch sketchIn);
diff --git a/src/main/java/org/apache/datasketches/theta/Sketch.java b/src/main/java/org/apache/datasketches/theta/Sketch.java
index 46298f0..604ea9a 100644
--- a/src/main/java/org/apache/datasketches/theta/Sketch.java
+++ b/src/main/java/org/apache/datasketches/theta/Sketch.java
@@ -230,18 +230,6 @@
public abstract int getCompactBytes();
/**
- * Gets the number of hash values less than the given theta.
- * @param theta the given theta as a double between zero and one.
- * @return the number of hash values less than the given theta.
- * @deprecated v2.0.0. Use {@link #getCountLessThanThetaLong(long)}. It is more accurate.
- */
- @Deprecated
- public int getCountLessThanTheta(final double theta) {
- final long thetaLong = (long) (LONG_MAX_VALUE_AS_DOUBLE * theta);
- return count(getCache(), thetaLong);
- }
-
- /**
* Gets the number of hash values less than the given theta expressed as a long.
* @param thetaLong the given theta as a long between zero and <i>Long.MAX_VALUE</i>.
* @return the number of hash values less than the given thetaLong.
@@ -251,18 +239,6 @@
}
/**
- * Returns the number of storage bytes required for this Sketch in its current state.
- * @param compact if true, returns the bytes required for compact form.
- * If this sketch is already in compact form this parameter is ignored.
- * @return the number of storage bytes required for this sketch
- * @deprecated v2.0.0. use either {@link #getCompactBytes()} or {@link #getCurrentBytes()}.
- */
- @Deprecated
- public int getCurrentBytes(final boolean compact) {
- return compact ? getCompactBytes() : getCurrentBytes();
- }
-
- /**
* Returns the number of storage bytes required for this sketch in its current state.
*
* @return the number of storage bytes required for this sketch
diff --git a/src/main/java/org/apache/datasketches/theta/Union.java b/src/main/java/org/apache/datasketches/theta/Union.java
index 1229927..4e039b8 100644
--- a/src/main/java/org/apache/datasketches/theta/Union.java
+++ b/src/main/java/org/apache/datasketches/theta/Union.java
@@ -112,21 +112,6 @@
*/
public abstract void union(Sketch sketchIn);
-
- /**
- * Perform a Union operation with <i>this</i> union and the given on-heap sketch of the Theta Family.
- * This method is not valid for the older SetSketch, which was prior to Open Source (August, 2015).
- *
- * <p>This method can be repeatedly called.
- *
- * <p>Nulls and empty sketches are ignored.</p>
- *
- * @param sketchIn The incoming sketch.
- * @deprecated 2.0.0. Use {@link #union(Sketch)} instead.
- */
- @Deprecated
- public abstract void update(Sketch sketchIn);
-
/**
* Perform a Union operation with <i>this</i> union and the given Memory image of any sketch of the
* Theta Family. The input image may be from earlier versions of the Theta Compact Sketch,
@@ -141,21 +126,6 @@
public abstract void union(Memory mem);
/**
- * Perform a Union operation with <i>this</i> union and the given Memory image of any sketch of the
- * Theta Family. The input image may be from earlier versions of the Theta Compact Sketch,
- * called the SetSketch (circa 2012), which was prior to Open Source and are compact and ordered.
- *
- * <p>This method can be repeatedly called.
- *
- * <p>Nulls and empty sketches are ignored.</p>
- *
- * @param mem Memory image of sketch to be merged
- * @deprecated 2.0.0. Use {@link #union(Memory)} instead.
- */
- @Deprecated
- public abstract void update(Memory mem);
-
- /**
* Update <i>this</i> union with the given long data item.
*
* @param datum The given long datum.
diff --git a/src/main/java/org/apache/datasketches/theta/UnionImpl.java b/src/main/java/org/apache/datasketches/theta/UnionImpl.java
index 83888f6..8573cbb 100644
--- a/src/main/java/org/apache/datasketches/theta/UnionImpl.java
+++ b/src/main/java/org/apache/datasketches/theta/UnionImpl.java
@@ -280,12 +280,6 @@
return csk;
}
- @Deprecated
- @Override
- public void update(final Sketch sketchIn) {
- union(sketchIn);
- }
-
@Override
public void union(final Sketch sketchIn) { //Only valid for theta Sketches using SerVer = 3
//UNION Empty Rule: AND the empty states.
@@ -346,12 +340,6 @@
}
}
- @Deprecated
- @Override
- public void update(final Memory skMem) {
- union(skMem);
- }
-
@Override
public void union(final Memory skMem) {
if (skMem == null) { return; }
diff --git a/src/main/java/org/apache/datasketches/tuple/AnotB.java b/src/main/java/org/apache/datasketches/tuple/AnotB.java
index a7fe752..1a355e2 100644
--- a/src/main/java/org/apache/datasketches/tuple/AnotB.java
+++ b/src/main/java/org/apache/datasketches/tuple/AnotB.java
@@ -384,7 +384,6 @@
return daB;
}
-
@SuppressWarnings("unchecked")
private static <S extends Summary> DataArrays<S> getResultArraysTheta(
final long minThetaLong,
@@ -432,7 +431,6 @@
return daB;
}
-
/**
* Resets this sketch back to the empty state.
*/
@@ -444,38 +442,4 @@
curCount_ = 0;
}
- //Deprecated methods
-
- /**
- * Perform A-and-not-B set operation on the two given sketches.
- * A null sketch is interpreted as an empty sketch.
- * This is not an accumulating update. Calling this update() more than once
- * without calling getResult() will discard the result of previous update() by this method.
- * The result is obtained by calling getResult();
- *
- * @param skA The incoming sketch for the first argument
- * @param skB The incoming sketch for the second argument
- * @deprecated v2.0.0. Instead please use {@link #aNotB(Sketch, Sketch)}.
- */
- @Deprecated
- public void update(final Sketch<S> skA, final Sketch<S> skB) {
- //duplicate old behavior
- reset();
- if (skA == null) { return; }
- else { setA(skA); }
- if (skB == null) { return; }
- else { notB(skB); }
- }
-
- /**
- * Gets the result of this operation. This clears the state of this operator after the result is
- * returned.
- * @return the result of this operation as an unordered {@link CompactSketch}
- * @deprecated v2.0.0. Instead use {@link #getResult(boolean)}.
- */
- @Deprecated
- public CompactSketch<S> getResult() {
- return getResult(true);
- }
-
}
diff --git a/src/main/java/org/apache/datasketches/tuple/Intersection.java b/src/main/java/org/apache/datasketches/tuple/Intersection.java
index 90eba09..9494580 100644
--- a/src/main/java/org/apache/datasketches/tuple/Intersection.java
+++ b/src/main/java/org/apache/datasketches/tuple/Intersection.java
@@ -102,16 +102,6 @@
/**
* Performs a stateful intersection of the internal set with the given tupleSketch.
* @param tupleSketch input sketch to intersect with the internal state. It must not be null.
- * @deprecated 2.0.0. Please use {@link #intersect(Sketch)}.
- */
- @Deprecated
- public void update(final Sketch<S> tupleSketch) {
- intersect(tupleSketch);
- }
-
- /**
- * Performs a stateful intersection of the internal set with the given tupleSketch.
- * @param tupleSketch input sketch to intersect with the internal state. It must not be null.
*/
public void intersect(final Sketch<S> tupleSketch) {
if (tupleSketch == null) { throw new SketchesArgumentException("Sketch must not be null"); }
@@ -179,20 +169,6 @@
* @param thetaSketch input theta sketch to intersect with the internal state. It must not be null.
* @param summary the given proxy summary for the theta sketch, which doesn't have one.
* It will be copied for each matching index. It must not be null.
- * @deprecated 2.0.0. Please use intersect(org.apache.datasketches.theta.Sketch, S).
- */
- @Deprecated //note the {at_link} does not work in the above
- public void update(final org.apache.datasketches.theta.Sketch thetaSketch, final S summary) {
- intersect(thetaSketch, summary);
- }
-
- /**
- * Performs a stateful intersection of the internal set with the given thetaSketch by combining entries
- * using the hashes from the theta sketch and summary values from the given summary and rules
- * from the summarySetOps defined by the Intersection constructor.
- * @param thetaSketch input theta sketch to intersect with the internal state. It must not be null.
- * @param summary the given proxy summary for the theta sketch, which doesn't have one.
- * It will be copied for each matching index. It must not be null.
*/
public void intersect(final org.apache.datasketches.theta.Sketch thetaSketch, final S summary) {
if (thetaSketch == null) { throw new SketchesArgumentException("Sketch must not be null"); }
diff --git a/src/main/java/org/apache/datasketches/tuple/SketchIterator.java b/src/main/java/org/apache/datasketches/tuple/SketchIterator.java
index 7453dd8..614112f 100644
--- a/src/main/java/org/apache/datasketches/tuple/SketchIterator.java
+++ b/src/main/java/org/apache/datasketches/tuple/SketchIterator.java
@@ -57,19 +57,6 @@
* retained. Don't call this before calling next() for the first time
* or after getting false from next().
* @return hash from the current entry
- * @deprecated v2.0.0. Please use {@link #getHash()}
- */
- @Deprecated
- public long getKey() {
- return hashArrTbl_[i_];
- }
-
- /**
- * Gets the hash from the current entry in the sketch, which is a hash
- * of the original key passed to update(). The original keys are not
- * retained. Don't call this before calling next() for the first time
- * or after getting false from next().
- * @return hash from the current entry
*/
public long getHash() {
return hashArrTbl_[i_];
diff --git a/src/main/java/org/apache/datasketches/tuple/Union.java b/src/main/java/org/apache/datasketches/tuple/Union.java
index 467507f..147c44b 100644
--- a/src/main/java/org/apache/datasketches/tuple/Union.java
+++ b/src/main/java/org/apache/datasketches/tuple/Union.java
@@ -104,19 +104,6 @@
/**
* Performs a stateful union of the internal set with the given tupleSketch.
- * @param tupleSketch input tuple sketch to add to the internal set.
- *
- * <p>Nulls and empty sketches are ignored.</p>
- *
- * @deprecated 2.0.0. Please use {@link #union(org.apache.datasketches.tuple.Sketch)}.
- */
- @Deprecated
- public void update(final Sketch<S> tupleSketch) {
- union(tupleSketch);
- }
-
- /**
- * Performs a stateful union of the internal set with the given tupleSketch.
* @param tupleSketch input tuple sketch to merge with the internal set.
*
* <p>Nulls and empty sketches are ignored.</p>
@@ -141,20 +128,6 @@
* @param thetaSketch the given theta sketch input. If null or empty, it is ignored.
* @param summary the given proxy summary for the theta sketch, which doesn't have one. This may
* not be null.
- * @deprecated 2.0.0. Please use union(org.apache.datasketches.theta.Sketch, S).
- */
- @Deprecated //note the {at_link} does not work in the above
- public void update(final org.apache.datasketches.theta.Sketch thetaSketch, final S summary) {
- union(thetaSketch, summary);
- }
-
- /**
- * Performs a stateful union of the internal set with the given thetaSketch by combining entries
- * using the hashes from the theta sketch and summary values from the given summary and rules
- * from the summarySetOps defined by the Union constructor.
- * @param thetaSketch the given theta sketch input. If null or empty, it is ignored.
- * @param summary the given proxy summary for the theta sketch, which doesn't have one. This may
- * not be null.
*/
@SuppressWarnings("unchecked")
public void union(final org.apache.datasketches.theta.Sketch thetaSketch, final S summary) {
diff --git a/src/main/java/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesIntersection.java b/src/main/java/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesIntersection.java
index 8224b5b..027892e 100644
--- a/src/main/java/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesIntersection.java
+++ b/src/main/java/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesIntersection.java
@@ -54,17 +54,6 @@
* Performs a stateful intersection of the internal set with the given tupleSketch.
* @param tupleSketch Input sketch to intersect with the internal set.
* @param combiner Method of combining two arrays of double values
- * @deprecated 2.0.0 Please use {@link #intersect(ArrayOfDoublesSketch, ArrayOfDoublesCombiner)}.
- */
- @Deprecated
- public void update(final ArrayOfDoublesSketch tupleSketch, final ArrayOfDoublesCombiner combiner) {
- intersect(tupleSketch, combiner);
- }
-
- /**
- * Performs a stateful intersection of the internal set with the given tupleSketch.
- * @param tupleSketch Input sketch to intersect with the internal set.
- * @param combiner Method of combining two arrays of double values
*/
public void intersect(final ArrayOfDoublesSketch tupleSketch, final ArrayOfDoublesCombiner combiner) {
final boolean isFirstCall = isFirstCall_;
diff --git a/src/main/java/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesUnion.java b/src/main/java/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesUnion.java
index ec781f9..8e5a8e6 100644
--- a/src/main/java/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesUnion.java
+++ b/src/main/java/org/apache/datasketches/tuple/arrayofdoubles/ArrayOfDoublesUnion.java
@@ -119,19 +119,6 @@
}
/**
- * Performs a stateful union of the internal set with the given tupleSketch.
- * @param tupleSketch input tuple sketch to add to the internal set.
- *
- * <p>Nulls and empty sketches are ignored.</p>
- *
- * @deprecated 2.0.0. Please use {@link #union(ArrayOfDoublesSketch)}.
- */
- @Deprecated
- public void update(final ArrayOfDoublesSketch tupleSketch) {
- union(tupleSketch);
- }
-
- /**
* Updates the union by adding a set of entries from a given sketch
*
* <p>Nulls and empty sketches are ignored.</p>
diff --git a/src/test/java/org/apache/datasketches/kll/DeprecatedAndMiscTest.java b/src/test/java/org/apache/datasketches/kll/MiscTest.java
similarity index 83%
rename from src/test/java/org/apache/datasketches/kll/DeprecatedAndMiscTest.java
rename to src/test/java/org/apache/datasketches/kll/MiscTest.java
index 14ab96c..f6a087b 100644
--- a/src/test/java/org/apache/datasketches/kll/DeprecatedAndMiscTest.java
+++ b/src/test/java/org/apache/datasketches/kll/MiscTest.java
@@ -27,19 +27,7 @@
* @author Lee Rhodes
*/
@SuppressWarnings("javadoc")
-public class DeprecatedAndMiscTest {
-
- @SuppressWarnings("deprecation")
- @Test
- public void checkDeprecatedRankError() {
- final KllFloatsSketch sketch = new KllFloatsSketch();
- final int k = KllFloatsSketch.DEFAULT_K;
- final double eps1 = sketch.getNormalizedRankError(); //v2.0.0.
- final double eps2 = KllFloatsSketch.getNormalizedRankError(k); //v2.0.0.
- final double expectEps = KllFloatsSketch.getNormalizedRankError(k, true);
- assertEquals(eps1, expectEps);
- assertEquals(eps2, expectEps);
- }
+public class MiscTest {
@Test
public void checkGetKFromEps() {
diff --git a/src/test/java/org/apache/datasketches/quantiles/DeprecatedAndMiscTest.java b/src/test/java/org/apache/datasketches/quantiles/DeprecatedAndMiscTest.java
deleted file mode 100644
index 9eb84e5..0000000
--- a/src/test/java/org/apache/datasketches/quantiles/DeprecatedAndMiscTest.java
+++ /dev/null
@@ -1,57 +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.
- */
-
-package org.apache.datasketches.quantiles;
-
-import static org.apache.datasketches.quantiles.HeapUpdateDoublesSketchTest.buildAndLoadQS;
-
-import java.util.Comparator;
-
-import org.apache.datasketches.memory.Memory;
-import org.apache.datasketches.memory.WritableMemory;
-import org.testng.annotations.Test;
-
-/**
- * @author Lee Rhodes
- */
-@SuppressWarnings("javadoc")
-public class DeprecatedAndMiscTest {
-
- @SuppressWarnings({ "deprecation", "unused" })
- @Test
- public void checkDeprecatedRankError() {
- final DoublesSketch ds = buildAndLoadQS(64, 64);
- double err = ds.getNormalizedRankError(); //v2.0.0.
- err = DoublesSketch.getNormalizedRankError(64); //v2.0.0.
- final DoublesUnion du1 = DoublesUnionBuilder.heapify(ds); //v2.0.0.
-
- final Memory mem = Memory.wrap(ds.toByteArray());
- final DoublesUnion du2 = DoublesUnionBuilder.heapify(mem); //v2.0.0.
-
- final DoublesUnion du3 = DoublesUnionBuilder.wrap(mem); //v2.0.0.
-
- final WritableMemory wmem = WritableMemory.writableWrap(ds.toByteArray());
- final DoublesUnion du4 = DoublesUnionBuilder.wrap(wmem); //v2.0.0.
-
- final ItemsSketch<String> is = ItemsSketch.getInstance(64, Comparator.naturalOrder());
- err = is.getNormalizedRankError(); //v2.0.0.
- err = ItemsSketch.getNormalizedRankError(64); //v2.0.0.
- }
-
-}
diff --git a/src/test/java/org/apache/datasketches/theta/HeapIntersectionTest.java b/src/test/java/org/apache/datasketches/theta/HeapIntersectionTest.java
index 894864f..b6046c9 100644
--- a/src/test/java/org/apache/datasketches/theta/HeapIntersectionTest.java
+++ b/src/test/java/org/apache/datasketches/theta/HeapIntersectionTest.java
@@ -41,7 +41,6 @@
@SuppressWarnings("javadoc")
public class HeapIntersectionTest {
- @SuppressWarnings("deprecation")
@Test
public void checkExactIntersectionNoOverlap() {
final int lgK = 9;
@@ -60,7 +59,7 @@
final Intersection inter = SetOperation.builder().buildIntersection();
inter.intersect(usk1);
- inter.update(usk2); //check deprecated v2.0.0.
+ inter.intersect(usk2);
CompactSketch rsk1;
final boolean ordered = true;
diff --git a/src/test/java/org/apache/datasketches/theta/PairwiseSetOperationsTest.java b/src/test/java/org/apache/datasketches/theta/PairwiseSetOperationsTest.java
index 7af4f52..4315b2f 100644
--- a/src/test/java/org/apache/datasketches/theta/PairwiseSetOperationsTest.java
+++ b/src/test/java/org/apache/datasketches/theta/PairwiseSetOperationsTest.java
@@ -204,8 +204,8 @@
CompactSketch csk1 = usk1.compact(true, null);
CompactSketch csk2 = usk2.compact(true, null);
- union.update(csk1);
- union.update(csk2);
+ union.union(csk1);
+ union.union(csk2);
Sketch stdSk = union.getResult(true, null);
Sketch pwSk = PairwiseSetOperations.union(csk1, csk2, k);
@@ -258,8 +258,8 @@
Sketch pwSk = PairwiseSetOperations.union(csk1, csk2, 2 * k);
double pwEst = pwSk.getEstimate();
- union.update(csk1);
- union.update(csk2);
+ union.union(csk1);
+ union.union(csk2);
CompactSketch stdSk = union.getResult(true, null);
double stdEst = stdSk.getEstimate();
@@ -292,8 +292,8 @@
Sketch pwSk = PairwiseSetOperations.union(csk1, csk2, k);
double pwEst = pwSk.getEstimate();
- union.update(csk1);
- union.update(csk2);
+ union.union(csk1);
+ union.union(csk2);
CompactSketch stdSk = union.getResult(true, null);
double stdEst = stdSk.getEstimate();
@@ -370,8 +370,8 @@
}
private static void checkUnion(Union union, CompactSketch cskA, CompactSketch cskB, int k) {
- union.update(cskA);
- union.update(cskB);
+ union.union(cskA);
+ union.union(cskB);
CompactSketch cskU = union.getResult();
CompactSketch cskP = PairwiseSetOperations.union(cskA, cskB, k);
assertEquals(cskU.isEmpty(), cskP.isEmpty());
diff --git a/src/test/java/org/apache/datasketches/theta/SetOpsCornerCasesTest.java b/src/test/java/org/apache/datasketches/theta/SetOpsCornerCasesTest.java
index 1365160..8ebd549 100644
--- a/src/test/java/org/apache/datasketches/theta/SetOpsCornerCasesTest.java
+++ b/src/test/java/org/apache/datasketches/theta/SetOpsCornerCasesTest.java
@@ -166,8 +166,8 @@
private static CompactSketch doStdUnion(Sketch tskA, Sketch tskB, int k, WritableMemory wmem) {
Union union = Sketches.setOperationBuilder().setNominalEntries(k).buildUnion();
- union.update(tskA);
- union.update(tskB);
+ union.union(tskA);
+ union.union(tskB);
return union.getResult(true, wmem);
}
diff --git a/src/test/java/org/apache/datasketches/theta/SingleItemSketchTest.java b/src/test/java/org/apache/datasketches/theta/SingleItemSketchTest.java
index bb50617..150e8d0 100644
--- a/src/test/java/org/apache/datasketches/theta/SingleItemSketchTest.java
+++ b/src/test/java/org/apache/datasketches/theta/SingleItemSketchTest.java
@@ -36,23 +36,23 @@
/**
* @author Lee Rhodes
*/
-@SuppressWarnings({"javadoc","deprecation"})
+@SuppressWarnings("javadoc")
public class SingleItemSketchTest {
final static short DEFAULT_SEED_HASH = (short) (computeSeedHash(DEFAULT_UPDATE_SEED) & 0XFFFFL);
@Test
public void check1() {
Union union = Sketches.setOperationBuilder().buildUnion();
- union.update(SingleItemSketch.create(1));
- union.update(SingleItemSketch.create(1.0));
- union.update(SingleItemSketch.create(0.0));
- union.update(SingleItemSketch.create("1"));
- union.update(SingleItemSketch.create(new byte[] {1,2,3,4}));
- union.update(SingleItemSketch.create(new char[] {'a'}));
- union.update(SingleItemSketch.create(new int[] {2}));
- union.update(SingleItemSketch.create(new long[] {3}));
+ union.union(SingleItemSketch.create(1));
+ union.union(SingleItemSketch.create(1.0));
+ union.union(SingleItemSketch.create(0.0));
+ union.union(SingleItemSketch.create("1"));
+ union.union(SingleItemSketch.create(new byte[] {1,2,3,4}));
+ union.union(SingleItemSketch.create(new char[] {'a'}));
+ union.union(SingleItemSketch.create(new int[] {2}));
+ union.union(SingleItemSketch.create(new long[] {3}));
- union.update(SingleItemSketch.create(-0.0)); //duplicate
+ union.union(SingleItemSketch.create(-0.0)); //duplicate
double est = union.getResult().getEstimate();
println(""+est);
@@ -83,16 +83,16 @@
public void check2() {
long seed = DEFAULT_UPDATE_SEED;
Union union = Sketches.setOperationBuilder().buildUnion();
- union.update(SingleItemSketch.create(1, seed));
- union.update(SingleItemSketch.create(1.0, seed));
- union.update(SingleItemSketch.create(0.0, seed));
- union.update(SingleItemSketch.create("1", seed));
- union.update(SingleItemSketch.create(new byte[] {1,2,3,4}, seed));
- union.update(SingleItemSketch.create(new char[] {'a'}, seed));
- union.update(SingleItemSketch.create(new int[] {2}, seed));
- union.update(SingleItemSketch.create(new long[] {3}, seed));
+ union.union(SingleItemSketch.create(1, seed));
+ union.union(SingleItemSketch.create(1.0, seed));
+ union.union(SingleItemSketch.create(0.0, seed));
+ union.union(SingleItemSketch.create("1", seed));
+ union.union(SingleItemSketch.create(new byte[] {1,2,3,4}, seed));
+ union.union(SingleItemSketch.create(new char[] {'a'}, seed));
+ union.union(SingleItemSketch.create(new int[] {2}, seed));
+ union.union(SingleItemSketch.create(new long[] {3}, seed));
- union.update(SingleItemSketch.create(-0.0, seed)); //duplicate
+ union.union(SingleItemSketch.create(-0.0, seed)); //duplicate
double est = union.getResult().getEstimate();
println(""+est);
@@ -157,9 +157,9 @@
assertEquals(sis2.getEstimate(), 1.0);
Union union = Sketches.setOperationBuilder().buildUnion();
- union.update(sis);
- union.update(sis2);
- union.update(sis3);
+ union.union(sis);
+ union.union(sis2);
+ union.union(sis3);
assertEquals(union.getResult().getEstimate(), 1.0);
}
@@ -175,7 +175,7 @@
Sketch sketch = SingleItemSketch.create(1);
Union union = Sketches.setOperationBuilder().buildUnion();
Memory mem = Memory.wrap(sketch.toByteArray());
- union.update(mem);
+ union.union(mem);
assertEquals(union.getResult().getEstimate(), 1, 0);
}
@@ -250,8 +250,8 @@
sk1.update(1);
sk2.update(1);
Union union = Sketches.setOperationBuilder().buildUnion();
- union.update(sk1);
- union.update(sk2);
+ union.union(sk1);
+ union.union(sk2);
csk = union.getResult(true, null);
assertTrue(csk instanceof SingleItemSketch);
@@ -259,8 +259,8 @@
bytes = Sketches.getMaxUnionBytes(32);
WritableMemory wmem = WritableMemory.writableWrap(new byte[bytes]);
union = Sketches.setOperationBuilder().buildUnion(wmem);
- union.update(sk1);
- union.update(sk2);
+ union.union(sk1);
+ union.union(sk2);
csk = union.getResult(true, null);
assertTrue(csk instanceof SingleItemSketch);
csk = union.getResult(false, null);
@@ -277,8 +277,9 @@
sk1.update(1);
sk2.update(2);
AnotB aNotB = Sketches.setOperationBuilder().buildANotB();
- aNotB.update(sk1, sk2);
- csk = aNotB.getResult(true, null);
+ aNotB.setA(sk1);
+ aNotB.notB(sk2);
+ csk = aNotB.getResult(true, null, true);
assertTrue(csk instanceof SingleItemSketch);
//not AnotB off-heap form
}
diff --git a/src/test/java/org/apache/datasketches/theta/SketchTest.java b/src/test/java/org/apache/datasketches/theta/SketchTest.java
index 9317767..57e7af9 100644
--- a/src/test/java/org/apache/datasketches/theta/SketchTest.java
+++ b/src/test/java/org/apache/datasketches/theta/SketchTest.java
@@ -26,8 +26,7 @@
import static org.apache.datasketches.ResizeFactor.X2;
import static org.apache.datasketches.ResizeFactor.X4;
import static org.apache.datasketches.ResizeFactor.X8;
-import static org.apache.datasketches.Util.DEFAULT_NOMINAL_ENTRIES;
-import static org.apache.datasketches.Util.DEFAULT_UPDATE_SEED;
+import static org.apache.datasketches.Util.*;
import static org.apache.datasketches.theta.BackwardConversions.convertSerVer3toSerVer1;
import static org.apache.datasketches.theta.BackwardConversions.convertSerVer3toSerVer2;
import static org.apache.datasketches.theta.CompactOperations.computeCompactPreLongs;
@@ -51,7 +50,7 @@
/**
* @author Lee Rhodes
*/
-@SuppressWarnings({"javadoc","deprecation"})
+@SuppressWarnings("javadoc")
public class SketchTest {
@Test
@@ -347,7 +346,8 @@
for (int i = 0; i < (2*k); i++) { sketch1.update(i); }
double theta = sketch1.rebuild().getTheta();
- int count = sketch1.getCountLessThanTheta(theta);
+ final long thetaLong = (long) (LONG_MAX_VALUE_AS_DOUBLE * theta);
+ int count = sketch1.getCountLessThanThetaLong(thetaLong);
assertEquals(count, k);
}
@@ -415,8 +415,8 @@
public void check2Methods() {
int k = 16;
Sketch sk = Sketches.updateSketchBuilder().setNominalEntries(k).build();
- int bytes1 = sk.getCurrentBytes(true);
- int bytes2 = sk.getCurrentBytes(false);
+ int bytes1 = sk.getCompactBytes();
+ int bytes2 = sk.getCurrentBytes();
assertEquals(bytes1, 8);
assertEquals(bytes2, 280); //32*8 + 24
int retEnt = sk.getRetainedEntries();
diff --git a/src/test/java/org/apache/datasketches/tuple/adouble/AdoubleAnotBTest.java b/src/test/java/org/apache/datasketches/tuple/adouble/AdoubleAnotBTest.java
index a2eae9d..a1b804d 100644
--- a/src/test/java/org/apache/datasketches/tuple/adouble/AdoubleAnotBTest.java
+++ b/src/test/java/org/apache/datasketches/tuple/adouble/AdoubleAnotBTest.java
@@ -44,7 +44,6 @@
private static final DoubleSummary.Mode mode = Mode.Sum;
private final Results results = new Results();
- @SuppressWarnings("deprecation")
private static void threeMethodsWithTheta(
final AnotB<DoubleSummary> aNotB,
final Sketch<DoubleSummary> skA,
@@ -54,11 +53,16 @@
{
CompactSketch<DoubleSummary> result;
- //Deprecated v2.0.0., Stateless, A = Tuple, B = Tuple
- //Old behavior is tolerant of nulls
- aNotB.update(skA, skB);
- result = aNotB.getResult();
- results.check(result);
+ //Stateful, A = Tuple, B = Tuple
+ if (skA != null) {
+ try {
+ aNotB.setA(skA);
+ aNotB.notB(skB);
+ result = aNotB.getResult(true);
+ results.check(result);
+ }
+ catch (final SketchesArgumentException e) { }
+ }
//Stateless A = Tuple, B = Tuple
if (skA == null || skB == null) {
@@ -155,12 +159,11 @@
/*****************************************/
- @SuppressWarnings("deprecation")
@Test
public void aNotBNullEmptyCombinations() {
final AnotB<DoubleSummary> aNotB = new AnotB<>();
// calling getResult() before calling update() should yield an empty set
- final CompactSketch<DoubleSummary> result = aNotB.getResult();
+ final CompactSketch<DoubleSummary> result = aNotB.getResult(true);
results.set(0, true, 0.0, 0.0, 0.0).check(result);
final UpdatableSketch<Double, DoubleSummary> sketch = buildUpdatableTuple();
diff --git a/src/test/java/org/apache/datasketches/tuple/adouble/AdoubleIntersectionTest.java b/src/test/java/org/apache/datasketches/tuple/adouble/AdoubleIntersectionTest.java
index d6f67b9..8ec6bf0 100644
--- a/src/test/java/org/apache/datasketches/tuple/adouble/AdoubleIntersectionTest.java
+++ b/src/test/java/org/apache/datasketches/tuple/adouble/AdoubleIntersectionTest.java
@@ -82,7 +82,6 @@
Assert.assertEquals(result.getUpperBound(1), 0.0);
}
- @SuppressWarnings("deprecation")
@Test
public void intersectionExactMode() {
UpdatableSketch<Double, DoubleSummary> sketch1 =
@@ -101,8 +100,8 @@
final Intersection<DoubleSummary> intersection =
new Intersection<>(new DoubleSummarySetOperations(mode, mode));
- intersection.update(sketch1);
- intersection.update(sketch2);
+ intersection.intersect(sketch1);
+ intersection.intersect(sketch2);
final CompactSketch<DoubleSummary> result = intersection.getResult();
Assert.assertEquals(result.getRetainedEntries(), 1);
Assert.assertFalse(result.isEmpty());
@@ -112,13 +111,12 @@
final SketchIterator<DoubleSummary> it = result.iterator();
Assert.assertTrue(it.next());
Assert.assertTrue(it.getHash() > 0);
- Assert.assertTrue(it.getKey() > 0);
Assert.assertEquals(it.getSummary().getValue(), 4.0);
Assert.assertFalse(it.next());
intersection.reset();
sketch1 = null;
- try { intersection.update(sketch1); fail();}
+ try { intersection.intersect(sketch1); fail();}
catch (final SketchesArgumentException e) { }
}
diff --git a/src/test/java/org/apache/datasketches/tuple/aninteger/IntegerSketchTest.java b/src/test/java/org/apache/datasketches/tuple/aninteger/IntegerSketchTest.java
index d12339c..74bb984 100644
--- a/src/test/java/org/apache/datasketches/tuple/aninteger/IntegerSketchTest.java
+++ b/src/test/java/org/apache/datasketches/tuple/aninteger/IntegerSketchTest.java
@@ -70,7 +70,6 @@
assertEquals(csk.getEstimate(), K * 1.0, K * .03);
}
- @SuppressWarnings("deprecation")
@Test
public void aNotBTest() {
final int lgK = 4;
@@ -82,8 +81,9 @@
for (int i = 0; i < u; i++) {
a1Sk1.update(i, 1);
}
- anotb.update(a1Sk1, a1Sk2);
- final CompactSketch<IntegerSummary> cSk = anotb.getResult();
+ anotb.setA(a1Sk1);
+ anotb.notB(a1Sk2);
+ final CompactSketch<IntegerSummary> cSk = anotb.getResult(true);
assertEquals((int)cSk.getEstimate(), u);
}
diff --git a/src/test/java/org/apache/datasketches/tuple/strings/ArrayOfStringsSketchTest.java b/src/test/java/org/apache/datasketches/tuple/strings/ArrayOfStringsSketchTest.java
index 00e2bd4..9bc1e45 100644
--- a/src/test/java/org/apache/datasketches/tuple/strings/ArrayOfStringsSketchTest.java
+++ b/src/test/java/org/apache/datasketches/tuple/strings/ArrayOfStringsSketchTest.java
@@ -37,7 +37,6 @@
public class ArrayOfStringsSketchTest {
private static final String LS = System.getProperty("line.separator");
- @SuppressWarnings("deprecation")
@Test
public void checkSketch() {
ArrayOfStringsSketch sketch1 = new ArrayOfStringsSketch();
@@ -58,22 +57,23 @@
sketch2.update(strArr3, strArr3);
Union<ArrayOfStringsSummary> union = new Union<>(new ArrayOfStringsSummarySetOperations());
- union.update(sketch1);
- union.update(sketch2);
+ union.union(sketch1);
+ union.union(sketch2);
CompactSketch<ArrayOfStringsSummary> csk = union.getResult();
//printSummaries(csk.iterator());
assertEquals(csk.getRetainedEntries(), 4);
Intersection<ArrayOfStringsSummary> inter =
new Intersection<>(new ArrayOfStringsSummarySetOperations());
- inter.update(sketch1);
- inter.update(sketch2);
+ inter.intersect(sketch1);
+ inter.intersect(sketch2);
csk = inter.getResult();
assertEquals(csk.getRetainedEntries(), 3);
AnotB<ArrayOfStringsSummary> aNotB = new AnotB<>();
- aNotB.update(sketch2, sketch1);
- csk = aNotB.getResult();
+ aNotB.setA(sketch2);
+ aNotB.notB(sketch1);
+ csk = aNotB.getResult(true);
assertEquals(csk.getRetainedEntries(), 1);
}