You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2016/12/04 07:45:02 UTC

[3/6] kylin git commit: minor: TopN merge performance improvement further

minor: TopN merge performance improvement further


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

Branch: refs/heads/yang21-cdh5.7
Commit: 698b542a1201b55f8176f1822d47b1783853304c
Parents: e7d3193
Author: shaofengshi <sh...@apache.org>
Authored: Sun Dec 4 10:39:37 2016 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Sun Dec 4 10:39:37 2016 +0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/kylin/measure/topn/TopNCounter.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/698b542a/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNCounter.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNCounter.java b/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNCounter.java
index 0d0726c..eabc941 100644
--- a/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNCounter.java
+++ b/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNCounter.java
@@ -173,8 +173,8 @@ public class TopNCounter<T> implements Iterable<Counter<T>> {
         }
 
         for (Map.Entry<T, Counter<T>> entry : another.counterMap.entrySet()) {
-            if (counterMap.containsKey(entry.getKey())) {
-                this.offer(entry.getValue().getItem(), anotherFull ? (thisFull ? entry.getValue().count - m2 - m1 : entry.getValue().count - m2) : (thisFull ? (entry.getValue().count - m1) : entry.getValue().count));
+            if (this.counterMap.containsKey(entry.getKey())) {
+                this.offer(entry.getValue().getItem(), (entry.getValue().count - m2 - m1));
             } else {
                 this.offer(entry.getValue().getItem(), entry.getValue().count);
             }