Skip to content

Commit

Permalink
Merge fa70f52 into 89eb91d
Browse files Browse the repository at this point in the history
  • Loading branch information
leerho committed Apr 19, 2022
2 parents 89eb91d + fa70f52 commit 0b40699
Show file tree
Hide file tree
Showing 41 changed files with 2 additions and 57 deletions.
3 changes: 1 addition & 2 deletions .asf.yaml
@@ -1,4 +1,3 @@
github:
homepage: https://datasketches.apache.org
collaborators:
- will-lauer
collaborators:
1 change: 0 additions & 1 deletion src/main/java/org/apache/datasketches/BinarySearch.java
Expand Up @@ -26,7 +26,6 @@
*/
public final class BinarySearch {


/**
* Binary Search for the index of the exact float value in the given search range.
* If -1 is returned there are no values in the search range that equals the given value.
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/apache/datasketches/InequalitySearch.java
Expand Up @@ -524,7 +524,6 @@ String desc(final long[] arr, final int low, final int high, final long v, final
*/
abstract int compare(long[] arr, int a, int b, long v);


/**
* If the compare operation returns 0, which means "found", this returns the index of the
* found value that satisfies the selected criteria.
Expand Down Expand Up @@ -558,7 +557,6 @@ String desc(final long[] arr, final int low, final int high, final long v, final
*/
abstract int getIndex(long[] arr, int a, int b, long v);


/**
* Called to resolve what to do if not found. In the search algorithm this occurs when the
* <i>lo</i> and <i>hi</i> indices become inverted at the ends of the array.
Expand Down
Expand Up @@ -100,7 +100,6 @@ public String getActionDescription() {
}
}


public enum CornerCase {
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),
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/apache/datasketches/Util.java
Expand Up @@ -668,7 +668,6 @@ public static int pwr2LawPrev(final int ppo, final int curPoint) {
return prev;
}


/**
* The log base 2 of the value
* @param value the given value
Expand Down
Expand Up @@ -67,7 +67,6 @@ public class CompressionCharacterization {
private CompressedState[] compressedStates2;
private CpcSketch[] unCompressedSketches;


public CompressionCharacterization(
final int lgMinK,
final int lgMaxK,
Expand Down
Expand Up @@ -832,7 +832,6 @@ private static long floorLog2ofLong(final long x) { //not a good name
}
}


private static long divideBy32RoundingUp(final long x) {
final long tmp = x >>> 5;
return ((tmp << 5) == x) ? tmp : tmp + 1;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/apache/datasketches/cpc/CpcSketch.java
Expand Up @@ -649,7 +649,6 @@ else if (col < (sketch.windowOffset + 8)) { // track the 8 bits inside the windo
}
}


//also used in test
static CpcSketch uncompress(final CompressedState source, final long seed) {
checkSeedHashes(computeSeedHash(seed), source.seedHash);
Expand Down
Expand Up @@ -134,7 +134,6 @@ void quickTest(final int lgK, final long cA, final long cB) {
updA_mS, updB_mS, mrgA_mS, mrgB_mS, rslt_mS);
}


private void printf(final String format, final Object ... args) {
if (printStream != null) { printStream.printf(format, args); }
if (printWriter != null) { printWriter.printf(format, args); }
Expand Down
Expand Up @@ -50,7 +50,6 @@ public class StreamingValidation {
private PrintStream printStream;
private PrintWriter printWriter;


//sketches
private CpcSketch sketch = null;
private BitMatrix matrix = null;
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/apache/datasketches/hash/MurmurHash3.java
Expand Up @@ -190,7 +190,6 @@ public static long[] hash(final int[] key, final int offsetInts, final int lengt
return hashState.finalMix128(k1, k2, lengthInts << 2); //convert to bytes
}


//--Hash of char[]-------------------------------------------------------
/**
* Hash the given char[] array.
Expand Down Expand Up @@ -219,7 +218,6 @@ public static long[] hash(final char[] key, final int offsetChars, final int len
Util.checkBounds(offsetChars, lengthChars, arrLen);
final HashState hashState = new HashState(seed, seed);


// Number of full 128-bit blocks of 8 chars.
// Possible exclusion of a remainder of up to 7 chars.
final int nblocks = lengthChars >>> 3; //chars / 8
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/apache/datasketches/hll/BaseHllSketch.java
Expand Up @@ -400,6 +400,4 @@ private static final int coupon(final long[] hash) {
return (value << KEY_BITS_26) | addr26;
}



}
Expand Up @@ -32,7 +32,6 @@ final class CompositeInterpolationXTable {
static final int[] yStrides =
{1, 2, 3, 5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560, 5120, 10240, 20480, 40960, 81920 };


static final double xArrs[][] = {
// log K = 4
{
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/apache/datasketches/hll/CurMode.java
Expand Up @@ -38,5 +38,4 @@ public static CurMode fromOrdinal(final int ordinal) {
return values[ordinal];
}


}
3 changes: 0 additions & 3 deletions src/main/java/org/apache/datasketches/hll/Hll6Array.java
Expand Up @@ -34,7 +34,6 @@
*/
class Hll6Array extends HllArray {


/**
* Standard constructor for new instance
* @param lgConfigK the configured Lg K
Expand Down Expand Up @@ -134,8 +133,6 @@ private static final int get6Bit(final byte[] arr, final int offsetBytes, final
return (byte) ((getShortLE(arr, byteIdx) >>> shift) & 0X3F);
}



//ITERATOR

private final class HeapHll6Iterator extends HllPairIterator {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/apache/datasketches/hll/HllArray.java
Expand Up @@ -253,7 +253,6 @@ byte[] toUpdatableByteArray() {
return ToByteArrayImpl.toHllByteArray(this, false);
}


//used by heapify by all Heap HLL
static final void extractCommonHll(final Memory srcMem, final HllArray hllArray) {
hllArray.putOutOfOrder(extractOooFlag(srcMem));
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/apache/datasketches/hll/HllSketch.java
Expand Up @@ -269,8 +269,6 @@ public static final HllSketch wrap(final Memory srcMem) {
return directSketch;
}



/**
* Return a copy of this sketch onto the Java heap.
* @return a copy of this sketch onto the Java heap.
Expand Down
Expand Up @@ -56,7 +56,6 @@
final class DirectUpdateDoublesSketch extends DirectUpdateDoublesSketchR {
MemoryRequestServer memReqSvr = null;


private DirectUpdateDoublesSketch(final int k) {
super(k); //Checks k
}
Expand Down
Expand Up @@ -114,7 +114,6 @@ static void bilinearTimeIncrementHistogramCounters(final DoublesBufferAccessor s
}
}


/**
* This one does a linear time simultaneous walk of the samples and splitPoints. Because this
* internal procedure is called multiple times, we require the caller to ensure these 3 properties:
Expand Down
Expand Up @@ -106,7 +106,6 @@ public static DoublesUnion wrap(final WritableMemory mem) {
*/
public abstract int getEffectiveK();


/**
* Iterative union operation, which means this method can be repeatedly called.
* Merges the given sketch into this union object.
Expand Down
Expand Up @@ -306,7 +306,6 @@ private static <T> void blockyTandemMergeSortRecursion(final T[] keySrc, final l
arrStart1, comparator); // which will be arrStart3
}


/**
* Performs two merges in tandem. One of them provides the sort keys
* while the other one passively undergoes the same data motion.
Expand Down
Expand Up @@ -612,7 +612,6 @@ public static String toString(final Memory mem) {
return PreambleUtil.toString(mem, false);
}


/**
* From an existing sketch, this creates a new sketch that can have a smaller value of K.
* The original sketch is not modified.
Expand Down
Expand Up @@ -105,7 +105,6 @@ private PreambleUtil() {}

// ###### TO HERE.


// STRINGS
/**
* Returns a human readable string summary of the internal state of the given byte array.
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/apache/datasketches/req/ReqSerDe.java
Expand Up @@ -31,9 +31,8 @@
import org.apache.datasketches.memory.WritableBuffer;
import org.apache.datasketches.memory.WritableMemory;


/**
* This class handles serialization and desserialization.
* This class handles serialization and deserialization.
*
* <p>ReqSketch SERIALIZATION FORMAT.</p>
*
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/apache/datasketches/req/ReqSketch.java
Expand Up @@ -26,7 +26,6 @@
import org.apache.datasketches.SketchesArgumentException;
import org.apache.datasketches.memory.Memory;


/**
* This Relative Error Quantiles Sketch is the Java implementation based on the paper
* "Relative Error Streaming Quantiles", https://arxiv.org/abs/2004.01668, and loosely derived from
Expand Down
Expand Up @@ -427,7 +427,6 @@ private void twoWayMergeInternalWeighted(final ReservoirItemsSketch<T> source) {
} // end of inlined weight update
} // end of loop over source samples


// targetTotal was fractional but should now be an integer again. Could validate with low
// tolerance, but for now just round to check.
final long checkN = (long) Math.floor(0.5 + targetTotal);
Expand Down
Expand Up @@ -379,7 +379,6 @@ private void twoWayMergeInternalWeighted(final ReservoirLongsSketch source) {
} // end of inlined weight update
} // end of loop over source samples


// targetTotal was fractional but should now be an integer again. Could validate with
// low tolerance, but for now just round to check.
final long checkN = (long) Math.floor(0.5 + targetTotal);
Expand Down
Expand Up @@ -37,7 +37,6 @@ final class SamplingUtil {
*/
private static final double DEFAULT_KAPPA = 2.0;


private SamplingUtil() {}

/**
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/apache/datasketches/theta/AnotBimpl.java
Expand Up @@ -135,7 +135,6 @@ public CompactSketch aNotB(final Sketch skA, final Sketch skB, final boolean dst
final long[] hashArrA = getHashArrA(skA);
final int countA = hashArrA.length;


//process B
final long[] hashArrOut = getResultHashArr(minThetaLong, countA, hashArrA, skB); //out is clone
final int countOut = hashArrOut.length;
Expand Down
Expand Up @@ -39,15 +39,13 @@ class ConcurrentBackgroundThetaPropagation implements Runnable {
// local buffer. Updated when the propagation completes.
private final AtomicBoolean localPropagationInProgress;


// Sketch to be propagated to shared sketch. Can be null if only a single hash is propagated
private final Sketch sketchIn;

// Hash of the datum to be propagated to shared sketch. Can be ConcurrentSharedThetaSketch.NOT_SINGLE_HASH
// if the data is propagated through a sketch.
private final long singleHash;


// The propagation epoch. The data can be propagated only within the context of this epoch.
// The data should not be propagated if this epoch is not equal to the
// shared sketch epoch.
Expand Down
Expand Up @@ -220,5 +220,4 @@ UpdateReturnState hashUpdate(final long hash) {
return state;
}


}
Expand Up @@ -89,7 +89,6 @@ static DirectQuickSelectSketchR readOnlyWrap(final Memory srcMem, final long see
return dqssr;
}


/**
* Fast-wrap a sketch around the given source Memory containing sketch data that originated from
* this sketch. This does NO validity checking of the given Memory.
Expand Down Expand Up @@ -239,8 +238,6 @@ WritableMemory getMemory() {
return wmem_;
}



@Override
short getSeedHash() {
return (short) PreambleUtil.extractSeedHash(wmem_);
Expand Down
Expand Up @@ -104,8 +104,6 @@ public int getLgNominalEntries() {
return bLgNomLongs;
}



/**
* Sets the long seed value that is require by the hashing function.
* @param seed <a href="{@docRoot}/resources/dictionary.html#seed">See seed</a>
Expand Down Expand Up @@ -286,7 +284,6 @@ public AnotB buildANotB() {
return (AnotB) build(Family.A_NOT_B);
}


@Override
public String toString() {
final StringBuilder sb = new StringBuilder();
Expand Down
Expand Up @@ -90,7 +90,6 @@ static SingleItemSketch heapify(final Memory srcMem, final short expectedSeedHas
throw new SketchesArgumentException("Input Memory is not a SingleItemSketch.");
}


@Override
public CompactSketch compact(final boolean dstOrdered, final WritableMemory dstMem) {
if (dstMem == null) { return this; }
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/apache/datasketches/theta/Sketch.java
Expand Up @@ -47,7 +47,6 @@
public abstract class Sketch {
static final int DEFAULT_LG_RESIZE_FACTOR = 3; //Unique to Heap


Sketch() {}

//public static factory constructor-type methods
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/apache/datasketches/theta/Union.java
Expand Up @@ -31,7 +31,6 @@
*/
public abstract class Union extends SetOperation {


/**
* Returns the number of storage bytes required for this union in its current state.
*
Expand Down Expand Up @@ -113,7 +112,6 @@ public CompactSketch union(final Sketch sketchA, final Sketch sketchB) {
public abstract CompactSketch union(Sketch sketchA, Sketch sketchB, boolean dstOrdered,
WritableMemory dstMem);


/**
* 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).
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/apache/datasketches/tuple/Sketch.java
Expand Up @@ -23,7 +23,6 @@

import org.apache.datasketches.BinomialBoundsN;


/**
* This is an equivalent to org.apache.datasketches.theta.Sketch with
* addition of a user-defined Summary object associated with every unique entry
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/apache/datasketches/tuple/Util.java
Expand Up @@ -31,7 +31,6 @@

import org.apache.datasketches.SketchesArgumentException;


/**
* Common utility functions for Tuples
*/
Expand Down Expand Up @@ -162,5 +161,4 @@ public static <S extends Summary> S[] newSummaryArray(final S[] summaryArr, fina
return tmpSummaryArr;
}


}
Expand Up @@ -37,7 +37,6 @@
import org.apache.datasketches.memory.WritableMemory;
import org.apache.datasketches.tuple.Util;


/**
* Computes a set difference, A-AND-NOT-B, of two ArrayOfDoublesSketches.
*
Expand Down Expand Up @@ -193,7 +192,6 @@ private static DataArrays getResultArrays(
return daR;
}


private static class DataArrays {
long[] hashArr;
double[] valuesArr;
Expand Down
Expand Up @@ -181,7 +181,6 @@ public void reset() {
setUnionThetaLong(gadget_.getThetaLong());
}


// Layout of first 16 bytes:
// Long || Start Byte Adr:
// Adr:
Expand Down
Expand Up @@ -34,7 +34,6 @@
import org.apache.datasketches.tuple.SerializerDeserializer;
import org.apache.datasketches.tuple.Util;


/**
* The on-heap implementation of the tuple QuickSelect sketch of type ArrayOfDoubles.
*/
Expand Down

0 comments on commit 0b40699

Please sign in to comment.