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/09/19 05:35:46 UTC

[kylin] branch 2.5.x updated (7e2391d -> 8a43777)

This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a change to branch 2.5.x
in repository https://gitbox.apache.org/repos/asf/kylin.git.


    from 7e2391d  KYLIN-3527 fix hybrid couldn't save when there is only 1 cube
     new f3da677  KYLIN-3543 Export HBase configuration only for Spark engine
     new b62b457  KYLIN-3565 User login error message is inaccurate
     new 11387ab  KYLIN-3439, make default kylin.web.timezone in KylinConfigBase the same with kylin-defaults.properties
     new 683b0d9  KYLIN-3531 Save uppercase of usernames to metadata
     new 01f45f0  KYLIN-3526 Add check for hybrid name with special character
     new 8a43777  KYLIN-3528 Add details page for hybrid

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/kylin/common/KylinConfigBase.java   |  7 ++-
 .../src/main/resources/kylin-defaults.properties   |  2 +-
 .../kylin/rest/security/KylinUserManager.java      |  4 +-
 .../kylin/rest/service/KylinUserService.java       |  2 +-
 .../kylin/rest/service/AdminServiceTest.java       |  3 +-
 .../kylin/storage/hbase/steps/CreateHTableJob.java |  7 ++-
 webapp/app/js/controllers/auth.js                  |  4 +-
 webapp/app/js/controllers/hybridInstance.js        | 26 +++++++-
 webapp/app/js/controllers/hybridInstanceSchema.js  |  1 +
 webapp/app/less/app.less                           | 11 +++-
 webapp/app/partials/cubes/hybrid_detail.html       | 71 ++++++++++++++++++++++
 webapp/app/partials/cubes/hybrid_edit.html         |  9 +--
 webapp/app/partials/models/models_tree.html        |  3 +-
 13 files changed, 135 insertions(+), 15 deletions(-)
 create mode 100644 webapp/app/partials/cubes/hybrid_detail.html


[kylin] 04/06: KYLIN-3531 Save uppercase of usernames to metadata

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a commit to branch 2.5.x
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit 683b0d997674ef8c82c64878ea94a7c576a3adff
Author: Yichen Zhou <zh...@gmail.com>
AuthorDate: Tue Sep 18 14:40:39 2018 +0800

    KYLIN-3531 Save uppercase of usernames to metadata
---
 .../main/java/org/apache/kylin/rest/security/KylinUserManager.java    | 4 +++-
 .../src/main/java/org/apache/kylin/rest/service/KylinUserService.java | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/server-base/src/main/java/org/apache/kylin/rest/security/KylinUserManager.java b/server-base/src/main/java/org/apache/kylin/rest/security/KylinUserManager.java
index c4b457d..acbc008 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/security/KylinUserManager.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/security/KylinUserManager.java
@@ -25,6 +25,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
+import java.util.Locale;
 
 import org.apache.kylin.common.KylinConfig;
 import org.apache.kylin.common.persistence.ResourceStore;
@@ -119,6 +120,7 @@ public class KylinUserManager {
             if (exist != null) {
                 user.setLastModified(exist.getLastModified());
             }
+            user.setUsername(user.getUsername().toUpperCase(Locale.ROOT));
             crud.save(user);
         } catch (IOException e) {
             throw new RuntimeException("Can not update user.", e);
@@ -127,7 +129,7 @@ public class KylinUserManager {
 
     public void delete(String username) {
         try (AutoReadWriteLock.AutoLock l = lock.lockForWrite()) {
-            crud.delete(username);
+            crud.delete(username.toUpperCase(Locale.ROOT));
         } catch (IOException e) {
             throw new RuntimeException("Can not delete user.", e);
         }
diff --git a/server-base/src/main/java/org/apache/kylin/rest/service/KylinUserService.java b/server-base/src/main/java/org/apache/kylin/rest/service/KylinUserService.java
index a67fb4c..0cc48a9 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/service/KylinUserService.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/service/KylinUserService.java
@@ -89,7 +89,7 @@ public class KylinUserService implements UserService {
 
     @Override
     public void deleteUser(String userName) {
-        if (userName.equals(SUPER_ADMIN)) {
+        if (userName.equalsIgnoreCase(SUPER_ADMIN)) {
             throw new InternalErrorException("User " + userName + " is not allowed to be deleted.");
         }
 


[kylin] 02/06: KYLIN-3565 User login error message is inaccurate

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a commit to branch 2.5.x
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit b62b457a595c8201381c373764e370363bb6994b
Author: Emiya0306 <wo...@qq.com>
AuthorDate: Wed Sep 19 10:55:01 2018 +0800

    KYLIN-3565 User login error message is inaccurate
---
 webapp/app/js/controllers/auth.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/webapp/app/js/controllers/auth.js b/webapp/app/js/controllers/auth.js
index 6e5fa30..949093e 100644
--- a/webapp/app/js/controllers/auth.js
+++ b/webapp/app/js/controllers/auth.js
@@ -36,7 +36,9 @@ KylinApp.controller('LoginCtrl', function ($scope, $rootScope, $location, $base6
       $location.path(UserService.getHomePage());
     }, function (error) {
       $scope.loading = false;
-      $scope.error = "Unable to login, please check your username/password.";
+      $scope.error = error.status < 500
+        ? "Unable to login, please check your username/password."
+        : "System error, please contact your administrator.";
     });
   };
 });


[kylin] 06/06: KYLIN-3528 Add details page for hybrid

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a commit to branch 2.5.x
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit 8a437773a4366919e2409ad870823c3b820952e0
Author: Emiya0306 <wo...@qq.com>
AuthorDate: Tue Sep 18 18:13:44 2018 +0800

    KYLIN-3528 Add details page for hybrid
---
 webapp/app/js/controllers/hybridInstance.js  | 26 +++++++++-
 webapp/app/less/app.less                     | 11 ++++-
 webapp/app/partials/cubes/hybrid_detail.html | 71 ++++++++++++++++++++++++++++
 webapp/app/partials/models/models_tree.html  |  3 +-
 4 files changed, 107 insertions(+), 4 deletions(-)

diff --git a/webapp/app/js/controllers/hybridInstance.js b/webapp/app/js/controllers/hybridInstance.js
index cdf1e40..236eefc 100644
--- a/webapp/app/js/controllers/hybridInstance.js
+++ b/webapp/app/js/controllers/hybridInstance.js
@@ -19,7 +19,7 @@
 'use strict';
 
 KylinApp.controller('HybridInstanceCtrl', function (
-  $scope, $q, $location,
+  $scope, $q, $location, $modal,
   ProjectModel, hybridInstanceManager, SweetAlert, HybridInstanceService, loadingRequest, MessageBox
 ) {
   $scope.projectModel = ProjectModel;
@@ -52,6 +52,30 @@ KylinApp.controller('HybridInstanceCtrl', function (
     $scope.list();
   });
 
+  var HybridDetailModalCtrl = function ($scope, $modalInstance, hybrid) {
+    $scope.hybrid = hybrid;
+    $scope.hybridModels = [{
+      name: hybrid.model
+    }];
+
+    $scope.cancel = function () {
+      $modalInstance.dismiss('cancel');
+    };
+  };
+
+  $scope.openHybridDetailModal = function (hybrid) {
+    $modal.open({
+      templateUrl: 'hybridDetail.html',
+      controller: HybridDetailModalCtrl,
+      resolve: {
+        hybrid: function () {
+          return hybrid;
+        }
+      },
+      windowClass: 'hybrid-detail'
+    });
+  };
+
   $scope.editHybridInstance = function(hybridInstance){
     // check for empty project of header, break the operation.
     if (ProjectModel.selectedProject === null) {
diff --git a/webapp/app/less/app.less b/webapp/app/less/app.less
index cb59fab..7a0ca18 100644
--- a/webapp/app/less/app.less
+++ b/webapp/app/less/app.less
@@ -963,7 +963,8 @@ div[ng-controller="ModelConditionsSettingsCtrl"] {
   min-height: 100vh;
 }
 
-div[ng-controller="HybridInstanceSchema"] {
+div[ng-controller="HybridInstanceSchema"],
+div.hybrid-detail {
   .form-title {
     margin-bottom: 43px;
   }
@@ -1056,4 +1057,10 @@ div[ng-controller="HybridInstanceSchema"] {
 .text-info {
   font-size: 18px;
   color: #263238;
-}
\ No newline at end of file
+}
+
+div.hybrid-detail {
+  .modal-dialog {
+    width: 600px;
+  }
+}
diff --git a/webapp/app/partials/cubes/hybrid_detail.html b/webapp/app/partials/cubes/hybrid_detail.html
new file mode 100644
index 0000000..72e77a7
--- /dev/null
+++ b/webapp/app/partials/cubes/hybrid_detail.html
@@ -0,0 +1,71 @@
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+<script type="text/ng-template" id="hybridDetail.html">
+  <div class="modal-header">
+    <h4>Hybrid Detail</h4>
+  </div>
+
+  <div class="modal-body">
+    <div class="form-group row">
+      <label class="col-xs-4 control-label no-padding-right font-color-default">Hybrid Name</label>
+      <div class="col-xs-8">
+        <input type="text" class="form-control" placeholder="Hybrid Name" ng-disabled="true" ng-model="hybrid.name">
+      </div>
+    </div>
+
+    <div class="split-line"></div>
+
+    <div class="row edit-operator">
+      <div class="col-xs-12">
+        <div class="dataTables_wrapper no-footer">
+          <div class="row table-header">
+            <label class="col-xs-4 control-label no-padding-right font-color-default" for="modelName">Model</label>
+            <div class="col-xs-8">
+              <div>
+                <select width="'100%'" chosen ng-options="model.name as model.name for model in hybridModels" ng-model="hybrid.model" ng-disabled="true"></select>
+              </div>
+            </div>
+          </div>
+          <div class="row fix-height-table">
+            <table class="table table-striped table-bordered table-hover dataTable no-footer ng-scope" ng-if="hybrid.realizations.length">
+              <thead>
+                <tr>
+                  <th>Name</th>
+                </tr>
+              </thead>
+              <tbody>
+                <tr ng-repeat="realization in hybrid.realizations">
+                  <td>{{ realization.realization }}</td>
+                </tr>
+              </tbody>
+            </table>
+          </div>
+
+          <div class="data-empty" ng-if="!hybrid.realizations.length">
+            Empty
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+
+  <div class="modal-footer">
+    <button class="btn btn-warning" ng-click="cancel()">Close</button>
+  </div>
+</script>
\ No newline at end of file
diff --git a/webapp/app/partials/models/models_tree.html b/webapp/app/partials/models/models_tree.html
index d2064a2..c064525 100644
--- a/webapp/app/partials/models/models_tree.html
+++ b/webapp/app/partials/models/models_tree.html
@@ -90,7 +90,7 @@
               </ul>
             </div>
           </div>
-          <span class="strong"><a style="cursor: pointer;word-break:break-all;" ng-click="openHybridInstance(hybridInstance)">{{hybridInstance.name}}</a></span>
+          <span class="strong"><a style="cursor: pointer;word-break:break-all;" ng-click="openHybridDetailModal(hybridInstance)">{{hybridInstance.name}}</a></span>
         </li>
       </ul>
       <div ng-if="hybridInstanceManager.loading === true"><i class="fa fa-2x fa-spinner fa-spin"></i> Loading..</div>
@@ -100,3 +100,4 @@
 </div>
 
 <div ng-include="'partials/models/model_detail.html'"></div>
+<div ng-include="'partials/cubes/hybrid_detail.html'"></div>


[kylin] 03/06: KYLIN-3439, make default kylin.web.timezone in KylinConfigBase the same with kylin-defaults.properties

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a commit to branch 2.5.x
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit 11387aba88d81fea074563d85125e820b8d74202
Author: tttMelody <24...@qq.com>
AuthorDate: Thu Jul 5 13:38:16 2018 +0800

    KYLIN-3439, make default kylin.web.timezone in KylinConfigBase the same with kylin-defaults.properties
---
 .../src/main/java/org/apache/kylin/common/KylinConfigBase.java     | 7 ++++++-
 core-common/src/main/resources/kylin-defaults.properties           | 2 +-
 .../test/java/org/apache/kylin/rest/service/AdminServiceTest.java  | 3 ++-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java
index 79750e0..aa776e4 100644
--- a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java
+++ b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java
@@ -27,6 +27,7 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Properties;
 import java.util.SortedSet;
+import java.util.TimeZone;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -1610,7 +1611,11 @@ abstract public class KylinConfigBase implements Serializable {
     // ============================================================================
 
     public String getTimeZone() {
-        return getOptional("kylin.web.timezone", "PST");
+        String timezone = getOptional("kylin.web.timezone");
+        if (StringUtils.isBlank(timezone)) {
+            timezone = TimeZone.getDefault().getID();
+        }
+        return timezone;
     }
 
     public boolean isWebCrossDomainEnabled() {
diff --git a/core-common/src/main/resources/kylin-defaults.properties b/core-common/src/main/resources/kylin-defaults.properties
index 66e2fca..6f2db9a 100644
--- a/core-common/src/main/resources/kylin-defaults.properties
+++ b/core-common/src/main/resources/kylin-defaults.properties
@@ -41,7 +41,7 @@ kylin.server.mode=all
 kylin.server.cluster-servers=localhost:7070
 
 # Display timezone on UI,format like[GMT+N or GMT-N]
-kylin.web.timezone=GMT+8
+kylin.web.timezone=
 
 # Timeout value for the queries submitted through the Web UI, in milliseconds
 kylin.web.query-timeout=300000
diff --git a/server/src/test/java/org/apache/kylin/rest/service/AdminServiceTest.java b/server/src/test/java/org/apache/kylin/rest/service/AdminServiceTest.java
index 2ea5339..2a98991 100644
--- a/server/src/test/java/org/apache/kylin/rest/service/AdminServiceTest.java
+++ b/server/src/test/java/org/apache/kylin/rest/service/AdminServiceTest.java
@@ -47,6 +47,7 @@ public class AdminServiceTest extends ServiceTestBase {
         String path = Thread.currentThread().getContextClassLoader().getResource("kylin.properties").getPath();
 
         KylinConfig config = KylinConfig.createInstanceFromUri(path);
+        String timeZone = config.getTimeZone();
         try (SetAndUnsetThreadLocalConfig autoUnset = KylinConfig.setAndUnsetThreadLocalConfig(config)) {
         
             String expected = "kylin.web.link-streaming-guide=http://kylin.apache.org/\n" +
@@ -55,7 +56,7 @@ public class AdminServiceTest extends ServiceTestBase {
                     "kylin.query.cache-enabled=true\n" +
                     "kylin.web.link-diagnostic=\n" +
                     "kylin.web.help.length=4\n" +
-                    "kylin.web.timezone=GMT+8\n" +
+                    "kylin.web.timezone=\n" +
                     "kylin.server.external-acl-provider=\n" +
                     "kylin.tool.auto-migrate-cube.enabled=\n" +
                     "kylin.storage.default=2\n" +


[kylin] 01/06: KYLIN-3543 Export HBase configuration only for Spark engine

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a commit to branch 2.5.x
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit f3da67746e730b9f69a8bf128854c5c9d2a207a0
Author: Yichen Zhou <zh...@gmail.com>
AuthorDate: Tue Sep 18 10:30:02 2018 +0800

    KYLIN-3543 Export HBase configuration only for Spark engine
---
 .../java/org/apache/kylin/storage/hbase/steps/CreateHTableJob.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/CreateHTableJob.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/CreateHTableJob.java
index 5e17a4c..37e36ac 100644
--- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/CreateHTableJob.java
+++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/CreateHTableJob.java
@@ -52,6 +52,7 @@ import org.apache.kylin.engine.mr.common.AbstractHadoopJob;
 import org.apache.kylin.engine.mr.common.CubeStatsReader;
 import org.apache.kylin.engine.mr.common.CuboidShardUtil;
 import org.apache.kylin.job.exception.ExecuteException;
+import org.apache.kylin.metadata.model.IEngineAware;
 import org.apache.kylin.storage.hbase.HBaseConnection;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -118,7 +119,11 @@ public class CreateHTableJob extends AbstractHadoopJob {
                 partitionFilePath.getParent());
 
         CubeHTableUtil.createHTable(cubeSegment, splitKeys);
-        exportHBaseConfiguration(cubeSegment.getStorageLocationIdentifier());
+
+        // export configuration in advance to avoid connecting to hbase from spark
+        if (cubeDesc.getEngineType()== IEngineAware.ID_SPARK){
+            exportHBaseConfiguration(cubeSegment.getStorageLocationIdentifier());
+        }
         return 0;
     }
 


[kylin] 05/06: KYLIN-3526 Add check for hybrid name with special character

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a commit to branch 2.5.x
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit 01f45f0b1b1fefb8651e6e8bf99ad671080dccc1
Author: Emiya0306 <wo...@qq.com>
AuthorDate: Mon Sep 17 18:54:51 2018 +0800

    KYLIN-3526 Add check for hybrid name with special character
---
 webapp/app/js/controllers/hybridInstanceSchema.js | 1 +
 webapp/app/partials/cubes/hybrid_edit.html        | 9 +++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/webapp/app/js/controllers/hybridInstanceSchema.js b/webapp/app/js/controllers/hybridInstanceSchema.js
index 668f6dc..e03bb01 100644
--- a/webapp/app/js/controllers/hybridInstanceSchema.js
+++ b/webapp/app/js/controllers/hybridInstanceSchema.js
@@ -48,6 +48,7 @@ KylinApp.controller('HybridInstanceSchema', function (
     name: '',
     model: ''
   };
+  $scope.$validator = {}
 
   resetPageData();
 
diff --git a/webapp/app/partials/cubes/hybrid_edit.html b/webapp/app/partials/cubes/hybrid_edit.html
index 21b130f..2903460 100644
--- a/webapp/app/partials/cubes/hybrid_edit.html
+++ b/webapp/app/partials/cubes/hybrid_edit.html
@@ -33,7 +33,7 @@
 
   <div class="row" ng-controller="HybridInstanceSchema">
     <div class="col-xs-12">
-      <form role="form" name="hybrid_cube_form form-inline" novalidate>
+      <ng-form role="form" name="$validator" novalidate>
 
         <h1 class="form-title">Hybrid Designer</h1>
 
@@ -41,8 +41,9 @@
           <div class="col-xs-5 form-group">
             <div class="row">
               <label class="col-xs-3 control-label no-padding-right font-color-default" for="hybridName">Hybrid Name</label>
-              <div class="col-xs-9">
-                <input type="text" class="form-control" id="hybridName" placeholder="Hybrid Name" ng-disabled="isFormDisabled || isEdit" ng-model="form.name">
+              <div class="col-xs-9" ng-class="{ 'has-error': $validator.name.$invalid && $validator.name.$dirty }">
+                <input type="text" name="name" class="form-control" id="hybridName" placeholder="Hybrid Name" ng-disabled="isFormDisabled || isEdit" ng-model="form.name" ng-pattern="/^\w+$/">
+                <small class="help-block" ng-show="!$validator.name.$error.required && $validator.name.$invalid && $validator.name.$dirty">Hybrid name is invalid.</small>
               </div>
             </div>
           </div>
@@ -170,7 +171,7 @@
           </div>
         </div>
 
-      </form>
+      </ng-form>
     </div>
   </div>
 </div>
\ No newline at end of file