You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ch...@apache.org on 2018/07/04 06:37:52 UTC

[kylin] branch 2.4.x updated: KYLIN-3440 Couldn't merge if there is an empty segment (#163)

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

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


The following commit(s) were added to refs/heads/2.4.x by this push:
     new 037d64d  KYLIN-3440 Couldn't merge if there is an empty segment (#163)
037d64d is described below

commit 037d64d287878e9e5ab10c68b3fa59c04baca54f
Author: luguosheng1314 <55...@qq.com>
AuthorDate: Wed Jul 4 14:37:50 2018 +0800

    KYLIN-3440 Couldn't merge if there is an empty segment (#163)
---
 webapp/app/js/controllers/cubes.js | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/webapp/app/js/controllers/cubes.js b/webapp/app/js/controllers/cubes.js
index 136d86e..d5541fb 100644
--- a/webapp/app/js/controllers/cubes.js
+++ b/webapp/app/js/controllers/cubes.js
@@ -640,19 +640,15 @@ var jobSubmitCtrl = function ($scope, $modalInstance, CubeService, MessageServic
     startTime = cube.segments[cube.segments.length-1].date_range_end;
   }
   $scope.jobBuildRequest.startTime=startTime;
-  $scope.rebuild = function () {
-
+  $scope.rebuild = function (isForce) {
     $scope.message = null;
-
     if ($scope.jobBuildRequest.startTime >= $scope.jobBuildRequest.endTime) {
       $scope.message = "WARNING: End time should be later than the start time.";
-
       return;
     }
-
+    $scope.jobBuildRequest.forceMergeEmptySegment = !!isForce;
     loadingRequest.show();
     CubeService.rebuildCube({cubeId: cube.name}, $scope.jobBuildRequest, function (job) {
-
       loadingRequest.hide();
       $modalInstance.dismiss('cancel');
       SweetAlert.swal('Success!', 'Rebuild job was submitted successfully', 'success');
@@ -660,8 +656,6 @@ var jobSubmitCtrl = function ($scope, $modalInstance, CubeService, MessageServic
           $scope.cubeList.cubes[$scope.cubeList.cubes.indexOf(cube)] = _cube;
         });
     }, function (e) {
-
-
       loadingRequest.hide();
       if (e.data && e.data.exception) {
         var message = e.data.exception;
@@ -677,14 +671,11 @@ var jobSubmitCtrl = function ($scope, $modalInstance, CubeService, MessageServic
             closeOnConfirm: true
           }, function (isConfirm) {
             if (isConfirm) {
-              $scope.jobBuildRequest.forceMergeEmptySegment = true;
-              $scope.rebuild();
-              delete $scope.jobBuildRequest.forceMergeEmptySegment;
+              $scope.rebuild(true);
             }
           });
           return;
         }
-
         if(message.indexOf("Merging segments must not have gaps between")!=-1){
           SweetAlert.swal({
             title:'',
@@ -695,9 +686,7 @@ var jobSubmitCtrl = function ($scope, $modalInstance, CubeService, MessageServic
             closeOnConfirm: true
           }, function (isConfirm) {
             if (isConfirm) {
-              $scope.jobBuildRequest.forceMergeEmptySegment = true;
-              $scope.rebuild();
-              delete $scope.jobBuildRequest.forceMergeEmptySegment;
+              $scope.rebuild(true);
             }
           });
           return;