Skip to content
Permalink
Browse files
Merge pull request #392 from apache/RemoveExtraEmptyLines
This does not affect any code, This is a cosmetic fix to remove extra
  • Loading branch information
leerho committed Apr 19, 2022
2 parents 89eb91d + fa70f52 commit 75580631ac3ed3d28a370791293a91e0a838d2af
Showing 41 changed files with 2 additions and 57 deletions.
@@ -1,4 +1,3 @@
github:
homepage: https://datasketches.apache.org
collaborators:
- will-lauer
collaborators:
@@ -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.
@@ -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.
@@ -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.
@@ -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),
@@ -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
@@ -67,7 +67,6 @@ public class CompressionCharacterization {
private CompressedState[] compressedStates2;
private CpcSketch[] unCompressedSketches;


public CompressionCharacterization(
final int lgMinK,
final int lgMaxK,
@@ -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;
@@ -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);
@@ -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); }
@@ -50,7 +50,6 @@ public class StreamingValidation {
private PrintStream printStream;
private PrintWriter printWriter;


//sketches
private CpcSketch sketch = null;
private BitMatrix matrix = null;
@@ -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.
@@ -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
@@ -400,6 +400,4 @@ private static final int coupon(final long[] hash) {
return (value << KEY_BITS_26) | addr26;
}



}
@@ -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
{
@@ -38,5 +38,4 @@ public static CurMode fromOrdinal(final int ordinal) {
return values[ordinal];
}


}
@@ -34,7 +34,6 @@
*/
class Hll6Array extends HllArray {


/**
* Standard constructor for new instance
* @param lgConfigK the configured Lg K
@@ -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 {
@@ -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));
@@ -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.
@@ -56,7 +56,6 @@
final class DirectUpdateDoublesSketch extends DirectUpdateDoublesSketchR {
MemoryRequestServer memReqSvr = null;


private DirectUpdateDoublesSketch(final int k) {
super(k); //Checks k
}
@@ -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:
@@ -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.
@@ -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.
@@ -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.
@@ -105,7 +105,6 @@ private PreambleUtil() {}

// ###### TO HERE.


// STRINGS
/**
* Returns a human readable string summary of the internal state of the given byte array.
@@ -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>
*
@@ -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
@@ -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);
@@ -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);
@@ -37,7 +37,6 @@ final class SamplingUtil {
*/
private static final double DEFAULT_KAPPA = 2.0;


private SamplingUtil() {}

/**
@@ -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;
@@ -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.
@@ -220,5 +220,4 @@ UpdateReturnState hashUpdate(final long hash) {
return state;
}


}
@@ -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.
@@ -239,8 +238,6 @@ WritableMemory getMemory() {
return wmem_;
}



@Override
short getSeedHash() {
return (short) PreambleUtil.extractSeedHash(wmem_);
@@ -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>
@@ -286,7 +284,6 @@ public AnotB buildANotB() {
return (AnotB) build(Family.A_NOT_B);
}


@Override
public String toString() {
final StringBuilder sb = new StringBuilder();
@@ -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; }
@@ -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
@@ -31,7 +31,6 @@
*/
public abstract class Union extends SetOperation {


/**
* Returns the number of storage bytes required for this union in its current state.
*
@@ -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).
@@ -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
@@ -31,7 +31,6 @@

import org.apache.datasketches.SketchesArgumentException;


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


}