You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by GitBox <gi...@apache.org> on 2021/03/29 04:03:27 UTC

[GitHub] [kylin] Ted-Jiang commented on a change in pull request #1615: [KYLIN-4939] Transform lookup table snapshot from segment level to cu…

Ted-Jiang commented on a change in pull request #1615:
URL: https://github.com/apache/kylin/pull/1615#discussion_r603002314



##########
File path: server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
##########
@@ -346,6 +346,35 @@ public JobInstance rebuildLookupSnapshot(@PathVariable String cubeName,
         }
     }
 
+    /**
+     * Force change a cube's lookup table to be global
+     *
+     *@throws IOException
+     */
+    @RequestMapping(value = "/{cubeNames}/{tableName}/change_lookup_global", method = {
+            RequestMethod.PUT }, produces = { "application/json" })
+    @ResponseBody
+    public List<CubeInstance> globalLookupSnapshot(@PathVariable String cubeNames, @PathVariable String tableName) {
+
+        List<CubeInstance> result = new ArrayList<>();
+
+        final CubeManager cubeMgr = cubeService.getCubeManager();
+        String[] changeCubes = cubeNames.toUpperCase(Locale.ROOT).split(",");
+        for (String cubeName : changeCubes) {
+            try {
+                checkCubeExists(cubeName);
+                final CubeInstance cube = cubeMgr.getCube(cubeName);
+                CubeInstance cubeInstance = cubeService.changeLookupSnapshotBeGlobal(cube, tableName);
+                logger.info("cube %s change snapshotTable %s global Success", cubeName, tableName);

Review comment:
       fix




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org