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 2015/09/03 03:31:22 UTC
[07/50] [abbrv] incubator-kylin git commit: KYLIN-771
KYLIN-771
Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/cc4fdf12
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/cc4fdf12
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/cc4fdf12
Branch: refs/heads/0.7
Commit: cc4fdf12af158dbc9d110cdbfa7f1b19a2e04bdc
Parents: 7a3941d
Author: qianhao.zhou <qi...@ebay.com>
Authored: Wed Aug 19 15:57:25 2015 +0800
Committer: qianhao.zhou <qi...@ebay.com>
Committed: Wed Aug 19 15:57:25 2015 +0800
----------------------------------------------------------------------
.../main/java/org/apache/kylin/rest/service/CacheService.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/cc4fdf12/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 fd919d6..ac17728 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
@@ -31,8 +31,11 @@ import org.apache.kylin.metadata.project.ProjectInstance;
import org.apache.kylin.metadata.project.ProjectManager;
import org.apache.kylin.metadata.realization.RealizationRegistry;
import org.apache.kylin.metadata.realization.RealizationType;
+import org.apache.kylin.rest.controller.QueryController;
import org.apache.kylin.storage.hybrid.HybridManager;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Caching;
import org.springframework.stereotype.Component;
/**
@@ -44,6 +47,7 @@ public class CacheService extends BasicService {
@Autowired
private CubeService cubeService;
+ @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 {
@@ -106,6 +110,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 {
@@ -116,7 +121,7 @@ public class CacheService extends BasicService {
case CUBE_DESC:
getCubeDescManager().removeLocalCubeDesc(cacheKey);
break;
- case PROJECT:
+ case PROJECT:
ProjectManager.clearCache();
break;
case INVERTED_INDEX: