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 2017/03/29 13:03:26 UTC
[2/3] kylin git commit: KYLIN-2525 skip signature check for older
version of cubes
KYLIN-2525 skip signature check for older version of cubes
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/c6b4592f
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/c6b4592f
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/c6b4592f
Branch: refs/heads/master
Commit: c6b4592fca047d1fc4094a0812774ddd2d8917f9
Parents: a776ef6
Author: Li Yang <li...@apache.org>
Authored: Wed Mar 29 11:57:10 2017 +0800
Committer: Yang Li <li...@apache.org>
Committed: Wed Mar 29 21:02:16 2017 +0800
----------------------------------------------------------------------
.../src/main/java/org/apache/kylin/cube/CubeManager.java | 8 ++++----
.../main/java/org/apache/kylin/cube/model/CubeDesc.java | 11 +++++++++--
2 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/c6b4592f/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java b/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java
index 073f516..0a94fb2 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java
@@ -761,7 +761,7 @@ public class CubeManager implements IRealizationProvider {
CubeDesc cubeDesc = CubeDescManager.getInstance(config).getCubeDesc(cube.getDescName());
checkNotNull(cubeDesc, "cube descriptor '%s' (for cube '%s') not found", cube.getDescName(), cubeName);
- if (!isITTestCube(cubeName))
+ if (!isSpecialTestCube(cubeName))
checkState(cubeDesc.getName().equals(cubeName), "cube name '%s' must be same as descriptor name '%s', but it is not", cubeName, cubeDesc.getName());
if (!cubeDesc.getError().isEmpty()) {
@@ -791,9 +791,9 @@ public class CubeManager implements IRealizationProvider {
}
}
- private boolean isITTestCube(String cubeName) {
- return config.isDevEnv() //
- && (cubeName.startsWith("test_kylin_cube") || cubeName.startsWith("test_streaming"));
+ private boolean isSpecialTestCube(String cubeName) {
+ return cubeName.equals("kylin_sales_cube") //
+ || config.isDevEnv() && (cubeName.startsWith("test_kylin_cube") || cubeName.startsWith("test_streaming"));
}
private MetadataManager getMetadataManager() {
http://git-wip-us.apache.org/repos/asf/kylin/blob/c6b4592f/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java b/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
index c1469fe..b391055 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
@@ -479,8 +479,15 @@ public class CubeDesc extends RootPersistentEntity implements IEngineAware {
return true;
}
- if (KylinVersion.getCurrentVersion().isCompatibleWith(new KylinVersion(getVersion())) && !KylinVersion.getCurrentVersion().isSignatureCompatibleWith(new KylinVersion(getVersion()))) {
- logger.info("checkSignature on {} is skipped as the its version is {} (not signature compatible but compatible) ", getName(), getVersion());
+ KylinVersion cubeVersion = new KylinVersion(getVersion());
+ KylinVersion kylinVersion = KylinVersion.getCurrentVersion();
+ if (!kylinVersion.isCompatibleWith(cubeVersion)) {
+ logger.info("checkSignature on {} is skipped as the its version {} is different from kylin version {}", getName(), cubeVersion, kylinVersion);
+ return true;
+ }
+
+ if (kylinVersion.isCompatibleWith(cubeVersion) && !kylinVersion.isSignatureCompatibleWith(cubeVersion)) {
+ logger.info("checkSignature on {} is skipped as the its version is {} (not signature compatible but compatible) ", getName(), cubeVersion);
return true;
}