kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mahong...@apache.org
Subject kylin git commit: only cache ScanOutOfLimitException exceptions
Date Thu, 03 Dec 2015 09:43:47 GMT
Repository: kylin
Updated Branches:
  refs/heads/1.x-staging 9e069eed0 -> 4c7bb8de9


only cache ScanOutOfLimitException exceptions


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

Branch: refs/heads/1.x-staging
Commit: 4c7bb8de94d4e910674366cf2922545443c1288c
Parents: 9e069ee
Author: honma <honma@ebay.com>
Authored: Thu Dec 3 17:48:59 2015 +0800
Committer: honma <honma@ebay.com>
Committed: Thu Dec 3 17:49:32 2015 +0800

----------------------------------------------------------------------
 .../org/apache/kylin/rest/controller/QueryController.java   | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/4c7bb8de/server/src/main/java/org/apache/kylin/rest/controller/QueryController.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/kylin/rest/controller/QueryController.java b/server/src/main/java/org/apache/kylin/rest/controller/QueryController.java
index 5ac8296..c7499bd 100644
--- a/server/src/main/java/org/apache/kylin/rest/controller/QueryController.java
+++ b/server/src/main/java/org/apache/kylin/rest/controller/QueryController.java
@@ -44,6 +44,7 @@ import org.apache.kylin.rest.request.SaveSqlRequest;
 import org.apache.kylin.rest.response.SQLResponse;
 import org.apache.kylin.rest.service.QueryService;
 import org.apache.kylin.rest.util.QueryUtil;
+import org.apache.kylin.storage.hbase.ScanOutOfLimitException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -191,18 +192,18 @@ public class QueryController extends BasicController {
 
             sqlResponse = new SQLResponse(null, null, 0, true, errMsg);
 
-            // Access exception is bind with each user, it will not be cached
-            if ((e instanceof AccessDeniedException) == false) {
+            // for exception queries, only cache ScanOutOfLimitException
+            if (e instanceof ScanOutOfLimitException) {
                 Cache exceptionCache = cacheManager.getCache(EXCEPTION_QUERY_CACHE);
                 exceptionCache.put(new Element(sqlRequest, sqlResponse));
             }
         }
 
         queryService.logQuery(sqlRequest, sqlResponse);
-        
+
         if (sqlResponse.getIsException())
             throw new InternalErrorException(sqlResponse.getExceptionMessage());
-        
+
         return sqlResponse;
     }
 


Mime
View raw message