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/30 08:10:44 UTC

[19/50] [abbrv] kylin git commit: KYLIN-2318 bug fix

KYLIN-2318 bug fix


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

Branch: refs/heads/master-hbase1.x
Commit: 1563eb945d0f3c68874934beca18579c96acc100
Parents: bfe8b1a
Author: Hongbin Ma <ma...@apache.org>
Authored: Tue Dec 27 12:47:08 2016 +0800
Committer: Hongbin Ma <ma...@apache.org>
Committed: Tue Dec 27 22:17:33 2016 +0800

----------------------------------------------------------------------
 .../org/apache/kylin/common/debug/BackdoorToggles.java    | 10 ++++++++++
 .../java/org/apache/kylin/rest/service/QueryService.java  |  1 +
 2 files changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/1563eb94/core-common/src/main/java/org/apache/kylin/common/debug/BackdoorToggles.java
----------------------------------------------------------------------
diff --git a/core-common/src/main/java/org/apache/kylin/common/debug/BackdoorToggles.java b/core-common/src/main/java/org/apache/kylin/common/debug/BackdoorToggles.java
index 8109cf2..95d5d62 100644
--- a/core-common/src/main/java/org/apache/kylin/common/debug/BackdoorToggles.java
+++ b/core-common/src/main/java/org/apache/kylin/common/debug/BackdoorToggles.java
@@ -23,6 +23,8 @@ import java.util.Map;
 import org.apache.commons.lang.StringUtils;
 import org.apache.kylin.common.util.Pair;
 
+import com.google.common.collect.Maps;
+
 /**
  * BackdoorToggles and QueryContext are similar because they're both hosting per-query thread local variables.
  * The difference is that BackdoorToggles are specified by user input and work for debug purpose. QueryContext
@@ -38,6 +40,14 @@ public class BackdoorToggles {
         _backdoorToggles.set(toggles);
     }
 
+    public static void addToggles(Map<String, String> toggles) {
+        Map<String, String> map = _backdoorToggles.get();
+        if (map == null) {
+            setToggles(Maps.<String, String> newHashMap());
+        }
+        _backdoorToggles.get().putAll(toggles);
+    }
+
     public static String getCoprocessorBehavior() {
         return getString(DEBUG_TOGGLE_COPROCESSOR_BEHAVIOR);
     }

http://git-wip-us.apache.org/repos/asf/kylin/blob/1563eb94/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java b/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java
index bb0342f..de28b17 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java
@@ -327,6 +327,7 @@ public class QueryService extends BasicService {
         }
 
         final String queryId = UUID.randomUUID().toString();
+        BackdoorToggles.addToggles(sqlRequest.getBackdoorToggles());
         QueryContext.setQueryId(queryId);
 
         try (SetThreadName ignored = new SetThreadName("Query %s", queryId)) {