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 2016/05/05 08:54:53 UTC
[1/2] kylin git commit: KYLIN-1599 add shardBy in rowkey panel
Repository: kylin
Updated Branches:
refs/heads/yang-m1 19d497015 -> 42913ff40
KYLIN-1599 add shardBy in rowkey panel
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/f450414f
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/f450414f
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/f450414f
Branch: refs/heads/yang-m1
Commit: f450414fccabc739d6a74ddc15b39567abe6756b
Parents: 19d4970
Author: Jason <ji...@163.com>
Authored: Thu Apr 21 11:17:39 2016 +0800
Committer: Jason <ji...@163.com>
Committed: Thu May 5 16:53:11 2016 +0800
----------------------------------------------------------------------
webapp/app/js/controllers/cubeAdvanceSetting.js | 36 +++++++++++++++++---
webapp/app/js/controllers/cubeEdit.js | 6 ++--
webapp/app/js/controllers/cubeSchema.js | 10 ++++++
webapp/app/js/model/cubeConfig.js | 3 ++
.../cubeDesigner/advanced_settings.html | 14 ++++++++
5 files changed, 63 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/f450414f/webapp/app/js/controllers/cubeAdvanceSetting.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeAdvanceSetting.js b/webapp/app/js/controllers/cubeAdvanceSetting.js
index 189cab9..c3110b5 100644
--- a/webapp/app/js/controllers/cubeAdvanceSetting.js
+++ b/webapp/app/js/controllers/cubeAdvanceSetting.js
@@ -41,16 +41,24 @@ KylinApp.controller('CubeAdvanceSettingCtrl', function ($scope, $modal,cubeConfi
var rowkeyObj = {
column:item.column,
encoding:_encoding,
- valueLength:_valueLength
+ valueLength:_valueLength,
+ isShardBy:item.isShardBy
+
}
$scope.convertedRowkeys.push(rowkeyObj);
})
- $scope.refreshRowKey = function(list,index,item){
+
+ $scope.rule={
+ shardColumnAvailable:true
+ }
+
+ $scope.refreshRowKey = function(list,index,item,checkShard){
var encoding = "dict";
var column = item.column;
+ var isShardBy = item.isShardBy;
if(item.encoding!=="dict"){
if(item.encoding=="fixed_length" && item.valueLength){
encoding = "fixed_length:"+item.valueLength;
@@ -63,9 +71,27 @@ KylinApp.controller('CubeAdvanceSettingCtrl', function ($scope, $modal,cubeConfi
}
$scope.cubeMetaFrame.rowkey.rowkey_columns[index].column = column;
$scope.cubeMetaFrame.rowkey.rowkey_columns[index].encoding = encoding;
+ $scope.cubeMetaFrame.rowkey.rowkey_columns[index].isShardBy = isShardBy;
+ if(checkShard == true){
+ $scope.checkShardByColumn();
+ }
+ }
+ $scope.checkShardByColumn = function(){
+ var shardRowkeyList = [];
+ angular.forEach($scope.cubeMetaFrame.rowkey.rowkey_columns,function(rowkey){
+ if(rowkey.isShardBy == true){
+ shardRowkeyList.push(rowkey.column);
+ }
+ })
+ if(shardRowkeyList.length >1){
+ $scope.rule.shardColumnAvailable = false;
+ }else{
+ $scope.rule.shardColumnAvailable = true;
+ }
}
+
$scope.resortRowkey = function(){
for(var i=0;i<$scope.convertedRowkeys.length;i++){
$scope.refreshRowKey($scope.convertedRowkeys,i,$scope.convertedRowkeys[i]);
@@ -84,13 +110,15 @@ KylinApp.controller('CubeAdvanceSettingCtrl', function ($scope, $modal,cubeConfi
var rowkeyObj = {
column:"",
encoding:"dict",
- valueLength:0
+ valueLength:0,
+ isShardBy:"false"
}
$scope.convertedRowkeys.push(rowkeyObj);
$scope.cubeMetaFrame.rowkey.rowkey_columns.push({
column:'',
- encoding:'dict'
+ encoding:'dict',
+ isShardBy:'false'
});
};
http://git-wip-us.apache.org/repos/asf/kylin/blob/f450414f/webapp/app/js/controllers/cubeEdit.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeEdit.js b/webapp/app/js/controllers/cubeEdit.js
index 2cae518..eca6126 100755
--- a/webapp/app/js/controllers/cubeEdit.js
+++ b/webapp/app/js/controllers/cubeEdit.js
@@ -440,7 +440,8 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams, $locatio
if (i == tmpRowKeyColumns.length) {
tmpRowKeyColumns.push({
"column": fk,
- "encoding": "dict"
+ "encoding": "dict",
+ "isShardBy": "false"
});
tmpAggregationItems.push(fk);
@@ -467,7 +468,8 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams, $locatio
if (i == tmpRowKeyColumns.length) {
tmpRowKeyColumns.push({
"column": rowkeyColumn,
- "encoding": "dict"
+ "encoding": "dict",
+ "isShardBy": "false"
});
tmpAggregationItems.push(rowkeyColumn);
}
http://git-wip-us.apache.org/repos/asf/kylin/blob/f450414f/webapp/app/js/controllers/cubeSchema.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeSchema.js b/webapp/app/js/controllers/cubeSchema.js
index f9d9dc1..be0c826 100755
--- a/webapp/app/js/controllers/cubeSchema.js
+++ b/webapp/app/js/controllers/cubeSchema.js
@@ -275,6 +275,16 @@ KylinApp.controller('CubeSchemaCtrl', function ($scope, QueryService, UserServic
}
})
+ var shardRowkeyList = [];
+ angular.forEach($scope.cubeMetaFrame.rowkey.rowkey_columns,function(rowkey){
+ if(rowkey.isShardBy == true){
+ shardRowkeyList.push(rowkey.column);
+ }
+ })
+ if(shardRowkeyList.length >1){
+ errors.push("At most one 'shard by' column is allowed.");
+ }
+
if($scope.cubeMetaFrame.region_size<0.01 || $scope.cubeMetaFrame.region_size>100){
errors.push("Please input a region size between 0.01 and 100 (G).");
}
http://git-wip-us.apache.org/repos/asf/kylin/blob/f450414f/webapp/app/js/model/cubeConfig.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/model/cubeConfig.js b/webapp/app/js/model/cubeConfig.js
index b5c77f9..42bba48 100644
--- a/webapp/app/js/model/cubeConfig.js
+++ b/webapp/app/js/model/cubeConfig.js
@@ -94,5 +94,8 @@ KylinApp.constant('cubeConfig', {
'HH:mm:ss',
'HH:mm',
'HH'
+ ],
+ rowKeyShardOptions:[
+ true,false
]
});
http://git-wip-us.apache.org/repos/asf/kylin/blob/f450414f/webapp/app/partials/cubeDesigner/advanced_settings.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/cubeDesigner/advanced_settings.html b/webapp/app/partials/cubeDesigner/advanced_settings.html
index 0499b60..b6d710e 100755
--- a/webapp/app/partials/cubeDesigner/advanced_settings.html
+++ b/webapp/app/partials/cubeDesigner/advanced_settings.html
@@ -211,6 +211,7 @@
<th style="width:200px;">Column</th>
<th>Encoding</th>
<th>Length</th>
+ <th>Shard By</th>
<th ng-if="state.mode=='edit'"></th>
</tr>
</thead>
@@ -255,6 +256,19 @@
<span ng-if="state.mode=='view'">{{rowkey_column.valueLength}}</span>
</td>
+ <td>
+ <select ng-if="state.mode=='edit'" style="width:180px;"
+ chosen ng-model="rowkey_column.isShardBy"
+ tooltip="false by default"
+ data-placeholder="false by default"
+ ng-change="refreshRowKey(convertedRowkeys,$index,rowkey_column,true)"
+ ng-options="dt as dt for dt in cubeConfig.rowKeyShardOptions">
+ <option value=""></option>
+ </select>
+ <small class="help-block red" ng-show="state.mode=='edit' && rule.shardColumnAvailable==false && rowkey_column.isShardBy == true">at most one 'shard by' column is allowed.</small>
+ <span ng-if="state.mode=='view'">{{rowkey_column.isShardBy}}</span>
+ </td>
+
<td ng-if="state.mode=='edit'">
<button class="btn btn-xs btn-info"
ng-click="removeRowkey(convertedRowkeys, $index,rowkey_column)"><i
[2/2] kylin git commit: KYLIN-869 Enhance mail notification
Posted by zh...@apache.org.
KYLIN-869 Enhance mail notification
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/42913ff4
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/42913ff4
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/42913ff4
Branch: refs/heads/yang-m1
Commit: 42913ff4035e2efb89db856af04a8268a6e2ef28
Parents: f450414
Author: Jason <ji...@163.com>
Authored: Thu May 5 16:54:20 2016 +0800
Committer: Jason <ji...@163.com>
Committed: Thu May 5 16:54:20 2016 +0800
----------------------------------------------------------------------
.../org/apache/kylin/engine/mr/CubingJob.java | 2 +-
webapp/app/js/model/cubeConfig.js | 3 ++-
webapp/app/js/model/cubeDescModel.js | 1 +
webapp/app/partials/cubeDesigner/info.html | 24 ++++++++++++++++++++
4 files changed, 28 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/42913ff4/engine-mr/src/main/java/org/apache/kylin/engine/mr/CubingJob.java
----------------------------------------------------------------------
diff --git a/engine-mr/src/main/java/org/apache/kylin/engine/mr/CubingJob.java b/engine-mr/src/main/java/org/apache/kylin/engine/mr/CubingJob.java
index 7428a2f..70b6132 100644
--- a/engine-mr/src/main/java/org/apache/kylin/engine/mr/CubingJob.java
+++ b/engine-mr/src/main/java/org/apache/kylin/engine/mr/CubingJob.java
@@ -117,7 +117,7 @@ public class CubingJob extends DefaultChainedExecutable {
final Output output = jobService.getOutput(getId());
String logMsg;
state = output.getState();
- if (state != ExecutableState.ERROR && !cubeInstance.getDescriptor().getStatusNeedNotify().contains(state.toString().toLowerCase())) {
+ if (state != ExecutableState.ERROR && !cubeInstance.getDescriptor().getStatusNeedNotify().contains(state.toString())) {
logger.info("state:" + state + " no need to notify users");
return null;
}
http://git-wip-us.apache.org/repos/asf/kylin/blob/42913ff4/webapp/app/js/model/cubeConfig.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/model/cubeConfig.js b/webapp/app/js/model/cubeConfig.js
index 42bba48..3f97254 100644
--- a/webapp/app/js/model/cubeConfig.js
+++ b/webapp/app/js/model/cubeConfig.js
@@ -97,5 +97,6 @@ KylinApp.constant('cubeConfig', {
],
rowKeyShardOptions:[
true,false
- ]
+ ],
+ statusNeedNofity:['ERROR', 'DISCARDED', 'SUCCEED']
});
http://git-wip-us.apache.org/repos/asf/kylin/blob/42913ff4/webapp/app/js/model/cubeDescModel.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/model/cubeDescModel.js b/webapp/app/js/model/cubeDescModel.js
index a73ccf3..30821d3 100644
--- a/webapp/app/js/model/cubeDescModel.js
+++ b/webapp/app/js/model/cubeDescModel.js
@@ -53,6 +53,7 @@ KylinApp.service('CubeDescModel', function () {
"column_family": []
},
"retention_range": "0",
+ "status_need_notify":['ERROR', 'DISCARDED', 'SUCCEED'],
"auto_merge_time_ranges": [604800000, 2419200000],
"engine_type": 2,
"storage_type":2,
http://git-wip-us.apache.org/repos/asf/kylin/blob/42913ff4/webapp/app/partials/cubeDesigner/info.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/cubeDesigner/info.html b/webapp/app/partials/cubeDesigner/info.html
index a1d876b..ec9fc49 100644
--- a/webapp/app/partials/cubeDesigner/info.html
+++ b/webapp/app/partials/cubeDesigner/info.html
@@ -81,6 +81,29 @@
</div>
</div>
+ <div class="form-group">
+ <div class="row">
+ <label class="col-xs-12 col-sm-3 control-label no-padding-right font-color-default">
+ <b>Notification Status</b>
+ </label>
+ <div class="col-xs-12 col-sm-6">
+
+ <ui-select
+ autofocus="true"
+ close-on-select="false"
+ ng-if="state.mode=='edit'" style="width: 100%" multiple ng-model="cubeMetaFrame.status_need_notify">
+ <ui-select-match placeholder="Select Status...">{{$item}}</ui-select-match>
+ <ui-select-choices
+ repeat="status as status in cubeConfig.statusNeedNofity | filter:$select.search">
+ {{status}}
+ </ui-select-choices>
+ </ui-select>
+
+ <span ng-if="state.mode=='view'">{{cubeMetaFrame.status_need_notify}}</span>
+ </div>
+ </div>
+ </div>
+
<!--Description-->
<div class="form-group">
<div class="row">
@@ -110,6 +133,7 @@
<li>Cube name is unique name of entire system</li>
<li>Can not edit cube name after created</li>
<li>Cube must belong to project which you have privilege to create</li>
+ <li>Error status will notify by default</li>
</ol>
</div>
</div>