You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2015/06/30 12:23:02 UTC
incubator-kylin git commit: KYLIN-865 flush cache on cube update
Repository: incubator-kylin
Updated Branches:
refs/heads/0.7-staging 3ce0233d4 -> 231fcc497
KYLIN-865 flush cache on cube update
Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/231fcc49
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/231fcc49
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/231fcc49
Branch: refs/heads/0.7-staging
Commit: 231fcc4976914fe0b717612ab1e34763f9574813
Parents: 3ce0233
Author: shaofengshi <sh...@apache.org>
Authored: Tue Jun 30 18:06:19 2015 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Tue Jun 30 18:22:46 2015 +0800
----------------------------------------------------------------------
.../org/apache/kylin/common/util/AbstractKylinTestCase.java | 2 +-
.../java/org/apache/kylin/rest/controller/CacheController.java | 2 ++
.../main/java/org/apache/kylin/rest/service/BasicService.java | 5 ++---
.../main/java/org/apache/kylin/rest/service/CacheService.java | 6 ++++--
.../java/org/apache/kylin/rest/service/ServiceTestBase.java | 2 ++
5 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/231fcc49/common/src/test/java/org/apache/kylin/common/util/AbstractKylinTestCase.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/kylin/common/util/AbstractKylinTestCase.java b/common/src/test/java/org/apache/kylin/common/util/AbstractKylinTestCase.java
index 36a9287..a4a6dc4 100644
--- a/common/src/test/java/org/apache/kylin/common/util/AbstractKylinTestCase.java
+++ b/common/src/test/java/org/apache/kylin/common/util/AbstractKylinTestCase.java
@@ -36,7 +36,7 @@ public abstract class AbstractKylinTestCase {
public static final String SANDBOX_TEST_DATA = "../examples/test_case_data/sandbox";
- public static final String[] SERVICES_WITH_CACHE = { "org.apache.kylin.cube.CubeManager", "org.apache.kylin.cube.CubeDescManager", "org.apache.kylin.metadata.project.ProjectManager", "org.apache.kylin.metadata.MetadataManager", "org.apache.kylin.metadata.realization.RealizationRegistry" };
+ public static final String[] SERVICES_WITH_CACHE = { "org.apache.kylin.metadata.MetadataManager", "org.apache.kylin.cube.CubeManager", "org.apache.kylin.cube.CubeDescManager", "org.apache.kylin.invertedindex.IIDescManager", "org.apache.kylin.invertedindex.IIManager", "org.apache.kylin.metadata.realization.RealizationRegistry", "org.apache.kylin.metadata.project.ProjectManager" };
public abstract void createTestMetadata() throws Exception;
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/231fcc49/server/src/main/java/org/apache/kylin/rest/controller/CacheController.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/kylin/rest/controller/CacheController.java b/server/src/main/java/org/apache/kylin/rest/controller/CacheController.java
index 912d5bc..3ed30c5 100644
--- a/server/src/main/java/org/apache/kylin/rest/controller/CacheController.java
+++ b/server/src/main/java/org/apache/kylin/rest/controller/CacheController.java
@@ -67,9 +67,11 @@ public class CacheController extends BasicController {
case CREATE:
case UPDATE:
cacheService.rebuildCache(wipeType, name);
+ cacheService.cleanDataCache();
break;
case DROP:
cacheService.removeCache(wipeType, name);
+ cacheService.cleanDataCache();
break;
default:
throw new RuntimeException("invalid type:" + wipeEvent);
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/231fcc49/server/src/main/java/org/apache/kylin/rest/service/BasicService.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/kylin/rest/service/BasicService.java b/server/src/main/java/org/apache/kylin/rest/service/BasicService.java
index 6043edb..f248e95 100644
--- a/server/src/main/java/org/apache/kylin/rest/service/BasicService.java
+++ b/server/src/main/java/org/apache/kylin/rest/service/BasicService.java
@@ -37,6 +37,7 @@ import org.apache.kylin.job.manager.ExecutableManager;
import org.apache.kylin.metadata.MetadataManager;
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.query.enumerator.OLAPQuery;
import org.apache.kylin.query.relnode.OLAPContext;
@@ -131,9 +132,7 @@ public abstract class BasicService {
*/
@Caching(evict = { @CacheEvict(value = QueryController.SUCCESS_QUERY_CACHE, allEntries = true), @CacheEvict(value = QueryController.EXCEPTION_QUERY_CACHE, allEntries = true) })
public void cleanDataCache() {
- CubeManager.clearCache();
- ProjectManager.clearCache();
- BasicService.resetOLAPDataSources();
+ logger.debug("clean query cache...");
}
public final KylinConfig getKylinConfig() {
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/231fcc49/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 164ca12..9ec1621 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
@@ -23,8 +23,10 @@ import org.apache.kylin.cube.CubeDescManager;
import org.apache.kylin.cube.CubeManager;
import org.apache.kylin.invertedindex.IIDescManager;
import org.apache.kylin.invertedindex.IIManager;
+import org.apache.kylin.metadata.MetadataManager;
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.springframework.stereotype.Component;
@@ -69,14 +71,14 @@ public class CacheService extends BasicService {
CubeDescManager.clearCache();
break;
case ALL:
- getMetadataManager().reload();
+ MetadataManager.clearCache();
CubeDescManager.clearCache();
CubeManager.clearCache();
IIDescManager.clearCache();
IIManager.clearCache();
+ RealizationRegistry.clearCache();
ProjectManager.clearCache();
BasicService.resetOLAPDataSources();
- cleanDataCache();
break;
default:
throw new RuntimeException("invalid cacheType:" + cacheType);
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/231fcc49/server/src/test/java/org/apache/kylin/rest/service/ServiceTestBase.java
----------------------------------------------------------------------
diff --git a/server/src/test/java/org/apache/kylin/rest/service/ServiceTestBase.java b/server/src/test/java/org/apache/kylin/rest/service/ServiceTestBase.java
index cc0dfc6..7865ac0 100644
--- a/server/src/test/java/org/apache/kylin/rest/service/ServiceTestBase.java
+++ b/server/src/test/java/org/apache/kylin/rest/service/ServiceTestBase.java
@@ -26,6 +26,7 @@ import org.apache.kylin.invertedindex.IIDescManager;
import org.apache.kylin.invertedindex.IIManager;
import org.apache.kylin.metadata.MetadataManager;
import org.apache.kylin.metadata.project.ProjectManager;
+import org.apache.kylin.metadata.realization.RealizationRegistry;
import org.junit.*;
import org.junit.runner.RunWith;
import org.springframework.security.authentication.TestingAuthenticationToken;
@@ -64,6 +65,7 @@ public class ServiceTestBase extends HBaseMetadataTestCase {
CubeManager.clearCache();
IIDescManager.clearCache();
IIManager.clearCache();
+ RealizationRegistry.clearCache();
ProjectManager.clearCache();
}