You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by zh...@apache.org on 2015/11/24 06:38:58 UTC
incubator-kylin git commit: KYLIN-1161,add get cube api
Repository: incubator-kylin
Updated Branches:
refs/heads/1.x-staging 01a78b1ab -> f3214dd8b
KYLIN-1161,add get cube api
Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/f3214dd8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/f3214dd8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/f3214dd8
Branch: refs/heads/1.x-staging
Commit: f3214dd8b5a3b56014584c260673f77a67ddc64e
Parents: 01a78b1
Author: Zhong <ji...@lm-shc-16501192.corp.ebay.com>
Authored: Tue Nov 24 13:38:15 2015 +0800
Committer: Zhong <ji...@lm-shc-16501192.corp.ebay.com>
Committed: Tue Nov 24 13:38:42 2015 +0800
----------------------------------------------------------------------
.../org/apache/kylin/rest/controller/CubeController.java | 10 ++++++++++
webapp/app/js/services/cubes.js | 1 +
2 files changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/f3214dd8/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 2f87c4f..9d1dfad 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
@@ -91,6 +91,16 @@ public class CubeController extends BasicController {
return cubeService.getCubes(cubeName, projectName, (null == limit) ? 20 : limit, offset);
}
+ @RequestMapping(value = "/get_cube", method = { RequestMethod.GET })
+ @ResponseBody
+ public CubeInstance getCube(@RequestParam(value = "cubeName", required = true) String cubeName) {
+ CubeInstance cube = cubeService.getCubeManager().getCube(cubeName);
+ if (cube == null) {
+ throw new InternalErrorException("Cannot find cube " + cubeName);
+ }
+ return cube;
+ }
+
/**
* Get hive SQL of the cube
*
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/f3214dd8/webapp/app/js/services/cubes.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/services/cubes.js b/webapp/app/js/services/cubes.js
index 3431c9a..3dfd2c5 100644
--- a/webapp/app/js/services/cubes.js
+++ b/webapp/app/js/services/cubes.js
@@ -19,6 +19,7 @@
KylinApp.factory('CubeService', ['$resource', function ($resource, config) {
return $resource(Config.service.url + 'cubes/:cubeId/:propName/:propValue/:action', {}, {
list: {method: 'GET', params: {}, isArray: true},
+ getCube: {method: 'GET', params: {action:'get_cube'}, isArray: false},
getSql: {method: 'GET', params: {propName: 'segs', action: 'sql'}, isArray: false},
updateNotifyList: {method: 'PUT', params: {propName: 'notify_list'}, isArray: false},
cost: {method: 'PUT', params: {action: 'cost'}, isArray: false},