kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaofeng...@apache.org
Subject incubator-kylin git commit: KYLIN-1068 remove the sanity check in TopNAggregator
Date Mon, 26 Oct 2015 02:07:05 GMT
Repository: incubator-kylin
Updated Branches:
  refs/heads/KYLIN-1068 35c7e4d06 -> f9a8fc54a


KYLIN-1068 remove the sanity check in TopNAggregator

Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/f9a8fc54
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/f9a8fc54
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/f9a8fc54

Branch: refs/heads/KYLIN-1068
Commit: f9a8fc54a163a64075a04796e93883dd7c36a9b3
Parents: 35c7e4d
Author: shaofengshi <shaofengshi@apache.org>
Authored: Mon Oct 26 09:57:36 2015 +0800
Committer: shaofengshi <shaofengshi@apache.org>
Committed: Mon Oct 26 09:57:36 2015 +0800

----------------------------------------------------------------------
 build/script/compress.sh                        | 19 +++++++------
 .../kylin/metadata/measure/TopNAggregator.java  | 29 --------------------
 2 files changed, 10 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/f9a8fc54/build/script/compress.sh
----------------------------------------------------------------------
diff --git a/build/script/compress.sh b/build/script/compress.sh
index c70e567..cfd3c18 100755
--- a/build/script/compress.sh
+++ b/build/script/compress.sh
@@ -13,16 +13,17 @@ fi
 
 #package tar.gz
 echo 'package tar.gz'
+package_name=apache-kylin-${version}-bin
 cd build/
-rm -rf kylin-${version}
-mkdir kylin-${version}
-cp -r lib bin conf tomcat ../examples/sample_cube commit_SHA1 kylin-${version}
+rm -rf ${package_name}
+mkdir ${package_name}
+cp -r lib bin conf tomcat ../examples/sample_cube commit_SHA1 ${package_name}
 rm -rf lib tomcat commit_SHA1
-find kylin-${version} -type d -exec chmod 755 {} \;
-find kylin-${version} -type f -exec chmod 644 {} \;
-find kylin-${version} -type f -name "*.sh" -exec chmod 755 {} \;
+find ${package_name} -type d -exec chmod 755 {} \;
+find ${package_name} -type f -exec chmod 644 {} \;
+find ${package_name} -type f -name "*.sh" -exec chmod 755 {} \;
 mkdir -p ../dist
-tar -cvzf ../dist/kylin-${version}.tar.gz kylin-${version}
-rm -rf kylin-${version}
+tar -cvzf ../dist/${package_name}.tar.gz ${package_name}
+rm -rf ${package_name}
 
-echo "Package ready: dist/kylin-${version}.tar.gz"
+echo "Package ready: dist/${package_name}.tar.gz"

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/f9a8fc54/core-metadata/src/main/java/org/apache/kylin/metadata/measure/TopNAggregator.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/measure/TopNAggregator.java
b/core-metadata/src/main/java/org/apache/kylin/metadata/measure/TopNAggregator.java
index 11e71f3..3a8d85a 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/measure/TopNAggregator.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/measure/TopNAggregator.java
@@ -47,42 +47,13 @@ public class TopNAggregator extends MeasureAggregator<TopNCounter<ByteArray>>
{
             sum = new TopNCounter<>(capacity);
             sanityCheckMap = Maps.newHashMap();
         }
-        addToSanityCheckMap(value);
         sum.merge(value);
     }
-    
-    private void addToSanityCheckMap(TopNCounter<ByteArray> value) {
-
-        Iterator<Counter<ByteArray>> iterator = value.iterator();
-        while (iterator.hasNext()) {
-            Counter<ByteArray> counter = iterator.next();
-            if (sanityCheckMap.get(counter.getItem()) == null) {
-                sanityCheckMap.put(counter.getItem(), counter.getCount());
-            } else {
-                sanityCheckMap.put(counter.getItem(), counter.getCount() + sanityCheckMap.get(counter.getItem()));
-            }
-                
-        }
-        
-    }
-    
-    private void sanityCheck() {
-        Iterator<Counter<ByteArray>> iterator = sum.iterator();
-        while (iterator.hasNext()) {
-            Counter<ByteArray> counter = iterator.next();
-            double expectedValue = sanityCheckMap.get(counter.getItem());
-            double actualValue = counter.getCount();
-            if (Math.abs(actualValue - expectedValue) > 1) {
-                throw new IllegalStateException("TopNAggregator sanity check failed, expected:
" + expectedValue + ", actual: " + actualValue + ", key:" + counter.getItem() + ", delta is:
" + (expectedValue - actualValue));
-            }
-        }
-    }
 
     @Override
     public TopNCounter getState() {
         
         //sum.retain(capacity);
-        sanityCheck();
         return sum;
     }
 


Mime
View raw message