kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaofeng...@apache.org
Subject [1/2] incubator-kylin git commit: KYLIN-958 allow to save non-structure change in DataModelDesc
Date Thu, 08 Oct 2015 08:31:16 GMT
Repository: incubator-kylin
Updated Branches:
  refs/heads/1.x-staging a64759c38 -> 1955a2f9a


KYLIN-958 allow to save non-structure change in DataModelDesc

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

Branch: refs/heads/1.x-staging
Commit: b545f00ababb6a20623f7c40e7966f75256db9d0
Parents: a64759c
Author: shaofengshi <shaofengshi@apache.org>
Authored: Thu Oct 8 15:59:38 2015 +0800
Committer: shaofengshi <shaofengshi@apache.org>
Committed: Thu Oct 8 15:59:38 2015 +0800

----------------------------------------------------------------------
 .../org/apache/kylin/rest/controller/CubeController.java     | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/b545f00a/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java b/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java
index 3d0fca3..8193f5e 100644
--- a/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java
+++ b/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java
@@ -349,9 +349,10 @@ public class CubeController extends BasicController {
         }
 
         MetadataManager metadataManager = MetadataManager.getInstance(KylinConfig.getInstanceFromEnv());
-        // KYLIN-958: disallow data model change
+        // KYLIN-958: disallow data model structure change
+        DataModelDesc modelDesc = null;
         if (StringUtils.isNotEmpty(cubeRequest.getModelDescData())) {
-            DataModelDesc modelDesc = deserializeDataModelDesc(cubeRequest);
+            modelDesc = deserializeDataModelDesc(cubeRequest);
             if (modelDesc == null) {
                 return cubeRequest;
             }
@@ -380,6 +381,9 @@ public class CubeController extends BasicController {
         }
 
         try {
+            if (modelDesc != null)
+                metadataManager.updateDataModelDesc(modelDesc);
+            
             CubeInstance cube = cubeService.getCubeManager().getCube(cubeName);
             String projectName = (null == cubeRequest.getProject()) ? ProjectInstance.DEFAULT_PROJECT_NAME
: cubeRequest.getProject();
             desc = cubeService.updateCubeAndDesc(cube, desc, projectName);


Mime
View raw message