kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mahong...@apache.org
Subject kylin git commit: KYLIN-2193 parameterise org.apache.kylin.storage.translate.DerivedFilterTranslator#IN_THRESHOLD
Date Tue, 15 Nov 2016 13:22:50 GMT
Repository: kylin
Updated Branches:
  refs/heads/yang21 61335d9ce -> 2e9a59d57


KYLIN-2193 parameterise org.apache.kylin.storage.translate.DerivedFilterTranslator#IN_THRESHOLD


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

Branch: refs/heads/yang21
Commit: 2e9a59d57712b6429e2bed71a14206e213162366
Parents: 61335d9
Author: Hongbin Ma <mahongbin@apache.org>
Authored: Tue Nov 15 21:06:21 2016 +0800
Committer: Hongbin Ma <mahongbin@apache.org>
Committed: Tue Nov 15 21:22:41 2016 +0800

----------------------------------------------------------------------
 .../java/org/apache/kylin/common/KylinConfigBase.java  |  5 ++++-
 .../storage/translate/DerivedFilterTranslator.java     | 13 +++++++++----
 2 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/2e9a59d5/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java
----------------------------------------------------------------------
diff --git a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java
index e703a07..a91e42b 100644
--- a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java
+++ b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java
@@ -480,7 +480,10 @@ abstract public class KylinConfigBase implements Serializable {
     public float getCubeVisitTimeoutTimes() {
         return Float.parseFloat(getOptional("kylin.query.cube.visit.timeout.times", "1"));
     }
-
+    
+    public int getDerivedInThreshold() {
+        return Integer.parseInt(getOptional("kylin.query.filter.derived_in.max", "20"));
+    }
     public int getBadQueryStackTraceDepth() {
         return Integer.parseInt(getOptional("kylin.query.badquery.stacktrace.depth", "10"));
     }

http://git-wip-us.apache.org/repos/asf/kylin/blob/2e9a59d5/core-storage/src/main/java/org/apache/kylin/storage/translate/DerivedFilterTranslator.java
----------------------------------------------------------------------
diff --git a/core-storage/src/main/java/org/apache/kylin/storage/translate/DerivedFilterTranslator.java
b/core-storage/src/main/java/org/apache/kylin/storage/translate/DerivedFilterTranslator.java
index 60c3a01..54b4c31 100644
--- a/core-storage/src/main/java/org/apache/kylin/storage/translate/DerivedFilterTranslator.java
+++ b/core-storage/src/main/java/org/apache/kylin/storage/translate/DerivedFilterTranslator.java
@@ -21,6 +21,7 @@ package org.apache.kylin.storage.translate;
 import java.util.List;
 import java.util.Set;
 
+import org.apache.kylin.common.KylinConfig;
 import org.apache.kylin.common.util.Array;
 import org.apache.kylin.common.util.Pair;
 import org.apache.kylin.cube.kv.RowKeyColumnOrder;
@@ -36,17 +37,18 @@ import org.apache.kylin.metadata.filter.TupleFilter;
 import org.apache.kylin.metadata.filter.TupleFilter.FilterOperatorEnum;
 import org.apache.kylin.metadata.model.TblColRef;
 import org.apache.kylin.metadata.tuple.IEvaluatableTuple;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 
 /**
  * @author yangli9
- * 
  */
 public class DerivedFilterTranslator {
-
-    private static final int IN_THRESHOLD = 5;
+    
+    private static final Logger logger = LoggerFactory.getLogger(DerivedFilterTranslator.class);
 
     public static Pair<TupleFilter, Boolean> translate(LookupStringTable lookup, DeriveInfo
hostInfo, CompareTupleFilter compf) {
 
@@ -83,7 +85,10 @@ public class DerivedFilterTranslator {
 
         TupleFilter translated;
         boolean loosened;
-        if (satisfyingHostRecords.size() > IN_THRESHOLD) {
+        if (satisfyingHostRecords.size() > KylinConfig.getInstanceFromEnv().getDerivedInThreshold())
{
+            logger.info("Deciding to loosen filter on derived filter as host candidates number
{} exceeds threshold {}",//
+                    satisfyingHostRecords.size(), KylinConfig.getInstanceFromEnv().getDerivedInThreshold()
+            );
             translated = buildRangeFilter(hostCols, satisfyingHostRecords);
             loosened = true;
         } else {


Mime
View raw message