Return-Path: X-Original-To: apmail-kylin-commits-archive@minotaur.apache.org Delivered-To: apmail-kylin-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5F4CD1832F for ; Fri, 11 Mar 2016 02:58:54 +0000 (UTC) Received: (qmail 97459 invoked by uid 500); 11 Mar 2016 02:58:54 -0000 Delivered-To: apmail-kylin-commits-archive@kylin.apache.org Received: (qmail 97418 invoked by uid 500); 11 Mar 2016 02:58:54 -0000 Mailing-List: contact commits-help@kylin.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kylin.apache.org Delivered-To: mailing list commits@kylin.apache.org Received: (qmail 97408 invoked by uid 99); 11 Mar 2016 02:58:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Mar 2016 02:58:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E52E3DFC16; Fri, 11 Mar 2016 02:58:53 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: zhongjian@apache.org To: commits@kylin.apache.org Date: Fri, 11 Mar 2016 02:58:54 -0000 Message-Id: <019152e2b52d4c6aa309fed1a77192e6@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] kylin git commit: KYLIN-1431 load streaming table ui update add cluster info when add table KYLIN-1431 load streaming table ui update add cluster info when add table Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/890577da Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/890577da Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/890577da Branch: refs/heads/master Commit: 890577dad510587400640b40e16810e5caa43df2 Parents: 3569b22 Author: Jason Authored: Wed Mar 9 19:01:42 2016 +0800 Committer: Jason Committed: Fri Mar 11 10:58:35 2016 +0800 ---------------------------------------------------------------------- .../kylin/rest/controller/CubeController.java | 68 ----------- .../kylin/rest/service/StreamingService.java | 4 +- webapp/app/js/controllers/cubeEdit.js | 82 ++++++-------- webapp/app/js/controllers/cubeRefresh.js | 1 - webapp/app/js/controllers/cubeSchema.js | 2 +- webapp/app/js/controllers/sourceMeta.js | 82 ++++++++++++-- webapp/app/js/controllers/streamingConfig.js | 8 ++ webapp/app/js/model/modelsManager.js | 1 + webapp/app/less/app.less | 4 + .../partials/cubeDesigner/streamingConfig.html | 16 +-- .../app/partials/tables/loadStreamingTable.html | 89 +++++++++++++++ webapp/app/partials/tables/table_load.html | 112 +++++-------------- 12 files changed, 242 insertions(+), 227 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/890577da/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 e60f330..bc00795 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 @@ -356,74 +356,6 @@ public class CubeController extends BasicController { throw new InternalErrorException(e.getLocalizedMessage(), e); } - boolean createStreamingConfigSuccess = false, createKafkaConfigSuccess = false; - StreamingConfig streamingConfig = null; - KafkaConfig kafkaConfig = null; - - boolean isStreamingCube = cubeRequest.getStreamingCube() != null && cubeRequest.getStreamingCube().equals("true"); - try { - //streaming Cube - if (isStreamingCube) { - streamingConfig = deserializeStreamingDesc(cubeRequest); - kafkaConfig = deserializeKafkaDesc(cubeRequest); - // validate before create, rollback when error - if (kafkaConfig == null) { - cubeRequest.setMessage("No KafkaConfig info defined."); - return cubeRequest; - } - if (streamingConfig == null) { - cubeRequest.setMessage("No StreamingConfig info defined."); - return cubeRequest; - } - - try { - streamingConfig.setUuid(UUID.randomUUID().toString()); - streamingService.createStreamingConfig(streamingConfig); - createStreamingConfigSuccess = true; - } catch (IOException e) { - logger.error("Failed to save StreamingConfig:" + e.getLocalizedMessage(), e); - throw new InternalErrorException("Failed to save StreamingConfig: " + e.getLocalizedMessage()); - } - try { - kafkaConfig.setUuid(UUID.randomUUID().toString()); - kafkaConfigService.createKafkaConfig(kafkaConfig); - createKafkaConfigSuccess = true; - } catch (IOException e) { - logger.error("Failed to save KafkaConfig:" + e.getLocalizedMessage(), e); - throw new InternalErrorException("Failed to save KafkaConfig: " + e.getLocalizedMessage()); - } - - } - } finally { - //rollback if failed - if (isStreamingCube) { - if (createStreamingConfigSuccess == false || createKafkaConfigSuccess == false) { - try { - cubeService.deleteCube(cubeInstance); - } catch (Exception ex) { - throw new InternalErrorException("Failed to rollback on delete cube. " + " Caused by: " + ex.getMessage(), ex); - } - if (createStreamingConfigSuccess == true) { - try { - streamingService.dropStreamingConfig(streamingConfig); - } catch (IOException e) { - throw new InternalErrorException("Failed to create cube, and StreamingConfig created and failed to delete: " + e.getLocalizedMessage()); - } - } - if (createKafkaConfigSuccess == true) { - try { - kafkaConfigService.dropKafkaConfig(kafkaConfig); - } catch (IOException e) { - throw new InternalErrorException("Failed to create cube, and KafkaConfig created and failed to delete: " + e.getLocalizedMessage()); - } - } - - } - - } - - } - cubeRequest.setUuid(desc.getUuid()); cubeRequest.setSuccessful(true); return cubeRequest; http://git-wip-us.apache.org/repos/asf/kylin/blob/890577da/server/src/main/java/org/apache/kylin/rest/service/StreamingService.java ---------------------------------------------------------------------- diff --git a/server/src/main/java/org/apache/kylin/rest/service/StreamingService.java b/server/src/main/java/org/apache/kylin/rest/service/StreamingService.java index a0473e9..9627e8f 100644 --- a/server/src/main/java/org/apache/kylin/rest/service/StreamingService.java +++ b/server/src/main/java/org/apache/kylin/rest/service/StreamingService.java @@ -45,7 +45,9 @@ public class StreamingService extends BasicService { streamingConfigs = getStreamingManager().listAllStreaming(); } else { StreamingConfig config = getStreamingManager().getConfig(table); - streamingConfigs.add(config); + if(config!=null){ + streamingConfigs.add(config); + } } return streamingConfigs; http://git-wip-us.apache.org/repos/asf/kylin/blob/890577da/webapp/app/js/controllers/cubeEdit.js ---------------------------------------------------------------------- diff --git a/webapp/app/js/controllers/cubeEdit.js b/webapp/app/js/controllers/cubeEdit.js index 6f0df38..24bdf8d 100755 --- a/webapp/app/js/controllers/cubeEdit.js +++ b/webapp/app/js/controllers/cubeEdit.js @@ -171,24 +171,25 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams, $locatio if (!modelsManager.getModels().length) { ModelDescService.query({model_name: $scope.cubeMetaFrame.model_name}, function (_model) { $scope.metaModel.model = _model; + + StreamingService.getConfig({table:$scope.metaModel.model.fact_table}, function (kfkConfigs) { + if(!!kfkConfigs[0]){ + $scope.cubeState.isStreaming = true; + } + else{ + return; + } + $scope.streamingMeta = kfkConfigs[0]; + StreamingService.getKfkConfig({kafkaConfigName:$scope.streamingMeta.name}, function (streamings) { + $scope.kafkaMeta = streamings[0]; + }) + }) }); } - $scope.metaModel.model = modelsManager.getModel($scope.cubeMetaFrame.model_name); $scope.state.cubeSchema = angular.toJson($scope.cubeMetaFrame, true); - StreamingService.getConfig({cubeName:$scope.cubeMetaFrame.name}, function (kfkConfigs) { - if(!!kfkConfigs[0]){ - $scope.cubeState.isStreaming = true; - } - else{ - return; - } - $scope.streamingMeta = kfkConfigs[0]; - StreamingService.getKfkConfig({kafkaConfigName:$scope.streamingMeta.name}, function (streamings) { - $scope.kafkaMeta = streamings[0]; - }) - }) + } }); @@ -732,41 +733,32 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams, $locatio }); - $scope.streamingCfg = { - parseTsColumn:"{{}}", - columnOptions:[] - } //dimensions options is depend on the model input when add cube - $scope.$watch('cubeMetaFrame.model_name', function (newValue, oldValue) { - if (!newValue) { - return; - } - $scope.metaModel.model = modelsManager.getModel(newValue); + //$scope.$watch('cubeMetaFrame.model_name', function (newValue, oldValue) { + // if (!newValue) { + // return; + // } + // $scope.metaModel.model = modelsManager.getModel(newValue); + // + // if(!$scope.metaModel.model){ + // return; + // } + // + // var factTable = $scope.metaModel.model.fact_table; + // var cols = $scope.getColumnsByTable(factTable); + // + // for(var i=0;i -
-
- -
- -
-
- {{(!!cubeState.isStreaming)?'YES':'NO'}} -
-
-
-{{}} -
+
http://git-wip-us.apache.org/repos/asf/kylin/blob/890577da/webapp/app/partials/tables/loadStreamingTable.html ---------------------------------------------------------------------- diff --git a/webapp/app/partials/tables/loadStreamingTable.html b/webapp/app/partials/tables/loadStreamingTable.html new file mode 100644 index 0000000..5e6116c --- /dev/null +++ b/webapp/app/partials/tables/loadStreamingTable.html @@ -0,0 +1,89 @@ + + http://git-wip-us.apache.org/repos/asf/kylin/blob/890577da/webapp/app/partials/tables/table_load.html ---------------------------------------------------------------------- diff --git a/webapp/app/partials/tables/table_load.html b/webapp/app/partials/tables/table_load.html index 29a2e9a..1fd4751 100644 --- a/webapp/app/partials/tables/table_load.html +++ b/webapp/app/partials/tables/table_load.html @@ -33,98 +33,40 @@