You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by le...@apache.org on 2019/12/24 07:11:40 UTC

[incubator-datasketches-java] 05/10: Interim updates

This is an automated email from the ASF dual-hosted git repository.

leerho pushed a commit to branch NewHllIterator
in repository https://gitbox.apache.org/repos/asf/incubator-datasketches-java.git

commit e5b8a4263c4ba5f3b0c8e3183cc5d256e8999de4
Author: Lee Rhodes <le...@users.noreply.github.com>
AuthorDate: Thu Dec 19 14:06:22 2019 -0800

    Interim updates
---
 .../apache/datasketches/hll/DirectCouponList.java  |  2 -
 .../java/org/apache/datasketches/hll/HllArray.java |  2 +
 .../apache/datasketches/hll/HllPairIterator.java   |  2 -
 .../org/apache/datasketches/hll/HllSketch.java     |  1 +
 .../org/apache/datasketches/hll/MiscTests.java     | 72 ----------------------
 5 files changed, 3 insertions(+), 76 deletions(-)

diff --git a/src/main/java/org/apache/datasketches/hll/DirectCouponList.java b/src/main/java/org/apache/datasketches/hll/DirectCouponList.java
index 52c8f93..26b5572 100644
--- a/src/main/java/org/apache/datasketches/hll/DirectCouponList.java
+++ b/src/main/java/org/apache/datasketches/hll/DirectCouponList.java
@@ -339,6 +339,4 @@ class DirectCouponList extends AbstractCoupons {
     return dirHllArr;
   }
 
-
-
 }
diff --git a/src/main/java/org/apache/datasketches/hll/HllArray.java b/src/main/java/org/apache/datasketches/hll/HllArray.java
index 37cbbe7..39ee5eb 100644
--- a/src/main/java/org/apache/datasketches/hll/HllArray.java
+++ b/src/main/java/org/apache/datasketches/hll/HllArray.java
@@ -28,6 +28,7 @@ import static org.apache.datasketches.hll.PreambleUtil.extractKxQ0;
 import static org.apache.datasketches.hll.PreambleUtil.extractKxQ1;
 import static org.apache.datasketches.hll.PreambleUtil.extractNumAtCurMin;
 import static org.apache.datasketches.hll.PreambleUtil.extractOooFlag;
+import static org.apache.datasketches.hll.PreambleUtil.extractRebuildCurMinNumKxQFlag;
 import static org.apache.datasketches.hll.TgtHllType.HLL_4;
 import static org.apache.datasketches.hll.TgtHllType.HLL_6;
 
@@ -255,6 +256,7 @@ abstract class HllArray extends AbstractHllArray {
     hllArray.putKxQ0(extractKxQ0(srcMem));
     hllArray.putKxQ1(extractKxQ1(srcMem));
     hllArray.putNumAtCurMin(extractNumAtCurMin(srcMem));
+    hllArray.putRebuildCurMinNumKxQFlag(extractRebuildCurMinNumKxQFlag(srcMem));
 
     //load Hll array
     srcMem.getByteArray(HLL_BYTE_ARR_START, hllArray.hllByteArr, 0, hllArray.hllByteArr.length);
diff --git a/src/main/java/org/apache/datasketches/hll/HllPairIterator.java b/src/main/java/org/apache/datasketches/hll/HllPairIterator.java
index b7d0c51..3d401a9 100644
--- a/src/main/java/org/apache/datasketches/hll/HllPairIterator.java
+++ b/src/main/java/org/apache/datasketches/hll/HllPairIterator.java
@@ -96,6 +96,4 @@ abstract class HllPairIterator extends PairIterator {
 
   abstract int value();
 
-
-
 }
diff --git a/src/main/java/org/apache/datasketches/hll/HllSketch.java b/src/main/java/org/apache/datasketches/hll/HllSketch.java
index ba1e222..e41ae0b 100644
--- a/src/main/java/org/apache/datasketches/hll/HllSketch.java
+++ b/src/main/java/org/apache/datasketches/hll/HllSketch.java
@@ -416,6 +416,7 @@ public class HllSketch extends BaseHllSketch {
         sb.append("  HipAccum       : ").append(absHll.getHipAccum()).append(LS);
         sb.append("  KxQ0           : ").append(absHll.getKxQ0()).append(LS);
         sb.append("  KxQ1           : ").append(absHll.getKxQ1()).append(LS);
+        sb.append("  Rebuild HIP Flg: ").append(absHll.isRebuildCurMinNumKxQFlag()).append(LS);
       } else {
         sb.append("  Coupon Count   : ")
           .append(((AbstractCoupons)hllSketchImpl).getCouponCount()).append(LS);
diff --git a/src/test/java/org/apache/datasketches/hll/MiscTests.java b/src/test/java/org/apache/datasketches/hll/MiscTests.java
deleted file mode 100644
index 0ded712..0000000
--- a/src/test/java/org/apache/datasketches/hll/MiscTests.java
+++ /dev/null
@@ -1,72 +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.hll;
-
-import org.testng.annotations.Test;
-
-/**
- * @author Lee Rhodes
- */
-@SuppressWarnings("javadoc")
-public class MiscTests {
-  long v = 0;
-
-  //@Test
-  public void checkSrcGTTgt() {
-    int unionLgK = 5;
-    int delLgK = 1;
-    int srcLgK = unionLgK + delLgK;
-    TgtHllType srcType = TgtHllType.HLL_8;
-
-    Union union = buildUnion(unionLgK, 1 << unionLgK);
-    HllSketch sk = build(srcLgK, srcType, 1 << srcLgK);
-    union.update(sk);
-
-  }
-
-
-
-
-  private Union buildUnion(int lgMaxK, int n) {
-    Union u = new Union(lgMaxK);
-    for (int i = 0; i < n; i++) { u.update(i + v); }
-    v += n;
-    return u;
-  }
-
-  private HllSketch build(int lgK, TgtHllType tgtHllType, int n) {
-    HllSketch sk = new HllSketch(lgK, tgtHllType);
-    for (int i = 0; i < n; i++) { sk.update(i + v); }
-    v += n;
-    return sk;
-  }
-
-  @Test
-  public void printlnTest() {
-    println("PRINTING: "+this.getClass().getName());
-  }
-
-  /**
-   * @param s value to print
-   */
-  static void println(String s) {
-    //System.out.println(s); //disable here
-  }
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org