Skip to content
Permalink
Browse files
Initial interim commit
  • Loading branch information
leerho committed Feb 18, 2022
1 parent 402a36a commit a7e8d67a2bd2a78e694f188d08c1e2f3064fe9ac
Showing 3 changed files with 14 additions and 15 deletions.
8 NOTICE
@@ -1,12 +1,12 @@
Apache DataSketches Java
Copyright 2022 The Apache Software Foundation

Copyright 2015-2018 Yahoo
Copyright 2019 Verizon Media
Copyright 2021 Yahoo
Copyright 2015-2018 Yahoo Inc.
Copyright 2019-2020 Verizon Media
Copyright 2021 Yahoo Inc.

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

Prior to moving to ASF, the software for this project was developed at
Yahoo, Inc. (https://developer.yahoo.com).
Yahoo Inc. (https://developer.yahoo.com).
@@ -218,7 +218,7 @@ public class KllDoublesSketch {

// Other static values
private static final byte serialVersionUID1 = 1;
private static final byte serialVersionUID2 = 2;
private static final byte serialVersionUID2 = 2; //only used to specify the empty and single-item format
private static final int PREAMBLE_INTS_SMALL = 2; // for empty and single item
private static final int PREAMBLE_INTS_FULL = 6; // if using items larger than 4 bytes, use 6

@@ -769,8 +769,8 @@ public void merge(final KllDoublesSketch other) {
}

/**
* Returns serialized sketch in a byte array form.
* @return serialized sketch in a byte array form.
* Returns serialized sketch in a compact byte array form.
* @return serialized sketch in a compact byte array form.
*/
public byte[] toByteArray() {
final byte[] bytes = new byte[getSerializedSizeBytes()];
@@ -120,18 +120,17 @@ public void checkMisc() {
}

//@Test //requires visual check
public void checkNumRetainedAboveLevelZero() {
public void visualCheck() {
final KllDoublesSketch sketch = new KllDoublesSketch(20);
for (int i = 0; i < 10; i++) { sketch.update(i + 1); }
final String s1 = sketch.toString(true, true);
println(s1);
println(sketch.toString(true, true));

final KllDoublesSketch sketch2 = new KllDoublesSketch(20);
for (int i = 0; i < 400; i++) {
sketch2.update(i + 1);
}
for (int i = 0; i < 400; i++) { sketch2.update(i + 1); }
println("\n" + sketch2.toString(true, true));

sketch2.merge(sketch);
final String s2 = sketch2.toString(true, true);
println(s2);
println("\n" + sketch2.toString(true, true));
}

@Test

0 comments on commit a7e8d67

Please sign in to comment.