This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a commit to branch 2.5.x
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit 45cf111a3aea2f22f348d789132ce85368a5d71b
Author: shaofengshi <shaofeng...@apache.org>
AuthorDate: Thu Mar 19 12:21:32 2020 +0800

    use system level KylinConfig for migration
---
 .../main/java/org/apache/kylin/rest/service/CubeService.java  | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git 
a/server-base/src/main/java/org/apache/kylin/rest/service/CubeService.java 
b/server-base/src/main/java/org/apache/kylin/rest/service/CubeService.java
index e8f2934..72bca48 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/service/CubeService.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/service/CubeService.java
@@ -919,7 +919,7 @@ public class CubeService extends BasicService implements 
InitializingBean {
     @PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN
             + " or hasPermission(#cube, 'ADMINISTRATION') or 
hasPermission(#cube, 'MANAGEMENT')")
     public void migrateCube(CubeInstance cube, String projectName) {
-        KylinConfig config = cube.getConfig();
+        KylinConfig config = KylinConfig.getInstanceFromEnv();
         if (!config.isAllowAutoMigrateCube()) {
             throw new InternalErrorException("One click migration is disabled, 
please contact your ADMIN");
         }
@@ -939,13 +939,8 @@ public class CubeService extends BasicService implements 
InitializingBean {
                 "Destination configuration should not be empty.");
 
         String stringBuilder = ("%s/bin/kylin.sh 
org.apache.kylin.tool.CubeMigrationCLI %s %s %s %s %s %s true true");
-        String cmd = String.format(Locale.ROOT, stringBuilder, 
KylinConfig.getKylinHome(),
-                CliCommandExecutor.checkParameter(srcCfgUri),
-                CliCommandExecutor.checkParameter(dstCfgUri),
-                cube.getName(),
-                CliCommandExecutor.checkParameter(projectName),
-                config.isAutoMigrateCubeCopyAcl(),
-                config.isAutoMigrateCubePurge());
+        String cmd = String.format(Locale.ROOT, stringBuilder, 
KylinConfig.getKylinHome(), srcCfgUri, dstCfgUri,
+                cube.getName(), projectName, 
config.isAutoMigrateCubeCopyAcl(), config.isAutoMigrateCubePurge());
 
         logger.info("One click migration cmd: " + cmd);
 

Reply via email to