You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by qh...@apache.org on 2015/05/18 13:17:15 UTC

[2/2] incubator-kylin git commit: KYLIN-770

KYLIN-770


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

Branch: refs/heads/streaming-localdict
Commit: f40d62bfad2dab207f2765dcaa305a0f81858559
Parents: 3b3e05e
Author: qianhao.zhou <qi...@ebay.com>
Authored: Mon May 18 19:17:00 2015 +0800
Committer: qianhao.zhou <qi...@ebay.com>
Committed: Mon May 18 19:17:00 2015 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/kylin/rest/service/CacheService.java   | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/f40d62bf/server/src/main/java/org/apache/kylin/rest/service/CacheService.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/kylin/rest/service/CacheService.java b/server/src/main/java/org/apache/kylin/rest/service/CacheService.java
index 6ce8b83..913ae35 100644
--- a/server/src/main/java/org/apache/kylin/rest/service/CacheService.java
+++ b/server/src/main/java/org/apache/kylin/rest/service/CacheService.java
@@ -26,6 +26,9 @@ import org.apache.kylin.invertedindex.IIManager;
 import org.apache.kylin.metadata.project.ProjectInstance;
 import org.apache.kylin.metadata.project.ProjectManager;
 import org.apache.kylin.metadata.realization.RealizationType;
+import org.apache.kylin.rest.controller.QueryController;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Caching;
 import org.springframework.stereotype.Component;
 
 import java.io.IOException;
@@ -36,6 +39,7 @@ import java.util.List;
 @Component("cacheService")
 public class CacheService extends BasicService {
 
+    @Caching(evict = { @CacheEvict(value = QueryController.SUCCESS_QUERY_CACHE, allEntries = true), @CacheEvict(value = QueryController.EXCEPTION_QUERY_CACHE, allEntries = true) })
     public void rebuildCache(Broadcaster.TYPE cacheType, String cacheKey) {
         final String log = "rebuild cache type: " + cacheType + " name:" + cacheKey;
         try {
@@ -93,6 +97,7 @@ public class CacheService extends BasicService {
         }
     }
 
+    @Caching(evict = { @CacheEvict(value = QueryController.SUCCESS_QUERY_CACHE, allEntries = true), @CacheEvict(value = QueryController.EXCEPTION_QUERY_CACHE, allEntries = true) })
     public void removeCache(Broadcaster.TYPE cacheType, String cacheKey) {
         final String log = "remove cache type: " + cacheType + " name:" + cacheKey;
         try {