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 2018/01/04 08:12:16 UTC

[1/2] kylin git commit: minor, format code

Repository: kylin
Updated Branches:
  refs/heads/master fb706854a -> e44f95e63


minor, format code

Signed-off-by: shaofengshi <sh...@apache.org>


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

Branch: refs/heads/master
Commit: 7f3fdbe11d09a866c2e69776a84eb1c3a8d9d4ff
Parents: fb70685
Author: etherge <et...@163.com>
Authored: Thu Jan 4 10:29:50 2018 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Thu Jan 4 11:25:16 2018 +0800

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


http://git-wip-us.apache.org/repos/asf/kylin/blob/7f3fdbe1/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java b/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
index 20ba9ae..e823ebe 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
@@ -184,7 +184,6 @@ public class CubeController extends BasicController {
         return cube;
     }
 
-
     /**
      * Get SQL of a Cube
      *
@@ -192,8 +191,7 @@ public class CubeController extends BasicController {
      * @return
      * @throws IOException
      */
-    @RequestMapping(value = "/{cubeName}/sql", method = { RequestMethod.GET }, produces = {
-            "application/json" })
+    @RequestMapping(value = "/{cubeName}/sql", method = { RequestMethod.GET }, produces = { "application/json" })
     @ResponseBody
     public GeneralResponse getSql(@PathVariable String cubeName) {
         CubeInstance cube = cubeService.getCubeManager().getCube(cubeName);
@@ -805,7 +803,7 @@ public class CubeController extends BasicController {
 
         if (cuboidList == null || cuboidList.isEmpty()) {
             logger.info("Cannot get recommended cuboid list for cube " + cubeName);
-        }else {
+        } else {
             if (cuboidList.size() < top) {
                 logger.info("Require " + top + " recommended cuboids, but only " + cuboidList.size() + " is found.");
             }


[2/2] kylin git commit: KYLIN-1925, forbid cloning cubes across projects

Posted by sh...@apache.org.
KYLIN-1925, forbid cloning cubes across projects

Signed-off-by: shaofengshi <sh...@apache.org>


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

Branch: refs/heads/master
Commit: e44f95e632bb11dad6c2df16f8e0398b09e3e8c3
Parents: 7f3fdbe
Author: etherge <et...@163.com>
Authored: Thu Jan 4 10:13:49 2018 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Thu Jan 4 11:25:35 2018 +0800

----------------------------------------------------------------------
 .../java/org/apache/kylin/rest/controller/CubeController.java    | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/e44f95e6/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java b/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
index e823ebe..a23c9b7 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
@@ -507,6 +507,10 @@ public class CubeController extends BasicController {
         if (project == null) {
             throw new BadRequestException("Project " + projectName + " doesn't exist");
         }
+        // KYLIN-1925, forbid cloning cross projects
+        if (!project.getName().equals(cube.getProject())) {
+            throw new BadRequestException("Cloning cubes across projects is not supported.");
+        }
 
         CubeDesc cubeDesc = cube.getDescriptor();
         CubeDesc newCubeDesc = CubeDesc.getCopyOf(cubeDesc);