Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions src/main/java/org/apache/datasketches/kll/KllFloatsSketch.java
Original file line number Diff line number Diff line change
Expand Up @@ -483,19 +483,6 @@ public long getN() {
return n_;
}

/**
* 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.
Expand All @@ -508,19 +495,6 @@ public double getNormalizedRankError(final boolean pmf) {
return getNormalizedRankError(minK_, pmf);
}

/**
* 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)}.
Expand Down
37 changes: 0 additions & 37 deletions src/main/java/org/apache/datasketches/quantiles/DoublesSketch.java
Original file line number Diff line number Diff line change
Expand Up @@ -425,32 +425,6 @@ public int getK() {
*/
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.
Expand All @@ -462,17 +436,6 @@ public double getNormalizedRankError(final boolean pmf) {
return Util.getNormalizedRankError(k_, pmf);
}

/**
* 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)}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package org.apache.datasketches.quantiles;

import org.apache.datasketches.memory.Memory;
import org.apache.datasketches.memory.WritableMemory;

/**
Expand Down Expand Up @@ -80,57 +79,4 @@ public DoublesUnion build(final WritableMemory dstMem) {
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);
}

}
37 changes: 0 additions & 37 deletions src/main/java/org/apache/datasketches/quantiles/ItemsSketch.java
Original file line number Diff line number Diff line change
Expand Up @@ -484,32 +484,6 @@ public long getN() {
return n_;
}

/**
* 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.
Expand All @@ -521,17 +495,6 @@ public double getNormalizedRankError(final boolean pmf) {
return Util.getNormalizedRankError(k_, pmf);
}

/**
* 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)}.
Expand Down
50 changes: 0 additions & 50 deletions src/main/java/org/apache/datasketches/quantiles/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,56 +64,6 @@ private Util() {}
*/
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
Expand Down
43 changes: 0 additions & 43 deletions src/main/java/org/apache/datasketches/theta/AnotB.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,47 +196,4 @@ public CompactSketch aNotB(final Sketch skA, final Sketch skB) {
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);
}

}
13 changes: 0 additions & 13 deletions src/main/java/org/apache/datasketches/theta/AnotBimpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,17 +222,4 @@ boolean isEmpty() {
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); }
}

}
13 changes: 0 additions & 13 deletions src/main/java/org/apache/datasketches/theta/Intersection.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,6 @@ public CompactSketch getResult() {
*/
public abstract byte[] toByteArray();

/**
* 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
* @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.
Expand Down
24 changes: 0 additions & 24 deletions src/main/java/org/apache/datasketches/theta/Sketch.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,18 +229,6 @@ public CompactSketch compact() {
*/
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>.
Expand All @@ -250,18 +238,6 @@ public int getCountLessThanThetaLong(final long thetaLong) {
return count(getCache(), thetaLong);
}

/**
* 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.
*
Expand Down
Loading