Return-Path: X-Original-To: apmail-kylin-commits-archive@minotaur.apache.org Delivered-To: apmail-kylin-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A3D6518752 for ; Mon, 26 Oct 2015 02:07:13 +0000 (UTC) Received: (qmail 85490 invoked by uid 500); 26 Oct 2015 02:07:13 -0000 Delivered-To: apmail-kylin-commits-archive@kylin.apache.org Received: (qmail 85461 invoked by uid 500); 26 Oct 2015 02:07:13 -0000 Mailing-List: contact commits-help@kylin.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kylin.incubator.apache.org Delivered-To: mailing list commits@kylin.incubator.apache.org Received: (qmail 85452 invoked by uid 99); 26 Oct 2015 02:07:13 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Oct 2015 02:07:13 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 0D69518286A for ; Mon, 26 Oct 2015 02:07:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.771 X-Spam-Level: * X-Spam-Status: No, score=1.771 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id jXymFZSoTtit for ; Mon, 26 Oct 2015 02:07:06 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id 761D6439E2 for ; Mon, 26 Oct 2015 02:07:06 +0000 (UTC) Received: (qmail 85382 invoked by uid 99); 26 Oct 2015 02:07:06 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Oct 2015 02:07:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C903BDF99E; Mon, 26 Oct 2015 02:07:05 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: shaofengshi@apache.org To: commits@kylin.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: incubator-kylin git commit: KYLIN-1068 remove the sanity check in TopNAggregator Date: Mon, 26 Oct 2015 02:07:05 +0000 (UTC) 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 Authored: Mon Oct 26 09:57:36 2015 +0800 Committer: shaofengshi 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> { sum = new TopNCounter<>(capacity); sanityCheckMap = Maps.newHashMap(); } - addToSanityCheckMap(value); sum.merge(value); } - - private void addToSanityCheckMap(TopNCounter value) { - - Iterator> iterator = value.iterator(); - while (iterator.hasNext()) { - Counter 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> iterator = sum.iterator(); - while (iterator.hasNext()) { - Counter 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; }