You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2014/05/20 03:21:56 UTC

[1/2] git commit: AMBARI-5711. 'Background operations' window displayed after attempt to switch HBase RegionServer to 'Decommission' state. (onechiporenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk 6b11e6d4b -> b6c56e807


AMBARI-5711. 'Background operations' window displayed after attempt to switch HBase RegionServer to 'Decommission' state. (onechiporenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2220427a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2220427a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2220427a

Branch: refs/heads/trunk
Commit: 2220427aae464b1fde616937457745fe9823177f
Parents: 6b11e6d
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Thu May 8 15:07:03 2014 +0300
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Mon May 19 18:19:02 2014 -0700

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host.js         | 47 +++++++++-----------
 ambari-web/app/controllers/main/host/details.js | 27 +----------
 ambari-web/app/messages.js                      |  2 +-
 .../test/controllers/main/host/details_test.js  |  4 +-
 4 files changed, 24 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2220427a/ambari-web/app/controllers/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host.js b/ambari-web/app/controllers/main/host.js
index 5f0c9af..31bc036 100644
--- a/ambari-web/app/controllers/main/host.js
+++ b/ambari-web/app/controllers/main/host.js
@@ -343,33 +343,28 @@ App.MainHostController = Em.ArrayController.extend({
       } else {
         hostsWithComponentInProperState = components.filterProperty('workStatus','STARTED').mapProperty('host.hostName');
         //For decommession
-        if (svcName == "HBASE") {
-          // HBASE service, decommission RegionServer in batch requests
-          App.router.get('mainHostDetailsController').warnBeforeDecommission(hostNames, svcName, masterName, slaveName);
-        } else {
-          var parameters = {
-            "slave_type": slaveName
-          };
-          var contextString = turn_off? 'hosts.host.' + slaveName.toLowerCase() + '.recommission':
-            'hosts.host.' + slaveName.toLowerCase() + '.decommission';
-          if (turn_off) {
-            parameters['included_hosts'] = hostsWithComponentInProperState.join(',')
-          }
-          else {
-            parameters['excluded_hosts'] = hostsWithComponentInProperState.join(',');
-          }
-          App.ajax.send({
-            name: 'bulk_request.decommission',
-            sender: this,
-            data: {
-              context: Em.I18n.t(contextString),
-              serviceName: service.get('serviceName'),
-              componentName: operationData.componentName,
-              parameters: parameters
-            },
-            success: 'bulkOperationForHostComponentsSuccessCallback'
-          });
+        var parameters = {
+          "slave_type": slaveName
+        };
+        var contextString = turn_off? 'hosts.host.' + slaveName.toLowerCase() + '.recommission':
+          'hosts.host.' + slaveName.toLowerCase() + '.decommission';
+        if (turn_off) {
+          parameters['included_hosts'] = hostsWithComponentInProperState.join(',')
+        }
+        else {
+          parameters['excluded_hosts'] = hostsWithComponentInProperState.join(',');
         }
+        App.ajax.send({
+          name: 'bulk_request.decommission',
+          sender: this,
+          data: {
+            context: Em.I18n.t(contextString),
+            serviceName: service.get('serviceName'),
+            componentName: operationData.componentName,
+            parameters: parameters
+          },
+          success: 'bulkOperationForHostComponentsSuccessCallback'
+        });
       }
     }
     else {

http://git-wip-us.apache.org/repos/asf/ambari/blob/2220427a/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js
index 3113889..cfbf086 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -940,7 +940,7 @@ App.MainHostDetailsController = Em.Controller.extend({
         this.doDecommission(hostName, svcName, "JOBTRACKER", "TASKTRACKER");
         break;
       case 'HBASE':
-        this.warnBeforeDecommission(hostName, svcName, "HBASE_MASTER", "HBASE_REGIONSERVER");
+        this.doDecommission(hostName, svcName, "HBASE_MASTER", "HBASE_REGIONSERVER");
     }
     this.showBackgroundOperationsPopup();
   },
@@ -1007,31 +1007,6 @@ App.MainHostDetailsController = Em.Controller.extend({
   },
 
   /**
-   * Recommend user to put component in MM before decommission (for HBASE only)
-   * @method warnBeforeDecommission
-   * @param {string[]} hostNames - list of host when run from bulk operations or current host
-   * @param {string} serviceName - serviceName
-   * @param {string} componentName - master component name
-   * @param {string} slaveType - slave component name
-   */
-  warnBeforeDecommission: function(hostNames, serviceName, componentName, slaveType) {
-    if (App.HostComponent.find().findProperty('componentName', componentName).get('passiveState') == "OFF") {
-      App.ModalPopup.show({
-        header: Em.I18n.t('common.warning'),
-        message: function () {
-          return Em.I18n.t('hostPopup.reccomendation.beforeDecommission').format(App.format.components[componentName]);
-        }.property(),
-        bodyClass: Em.View.extend({
-          template: Em.Handlebars.compile('<div class="alert alert-warning">{{message}}</div>')
-        }),
-        secondary: false
-      });
-    } else {
-      this.doDecommissionRegionServer(hostNames, serviceName, componentName, slaveType);
-    }
-  },
-
-  /**
    * Performs Decommission (for RegionServer)
    * @method doDecommissionRegionServer
    * @param {string[]} hostNames - list of host when run from bulk operations or current host

http://git-wip-us.apache.org/repos/asf/ambari/blob/2220427a/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 7df4930..575047c 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1555,7 +1555,7 @@ Em.I18n.translations = {
   'hosts.host.regionserver.decommission.batch2':'Decommission RegionServer - Stop RegionServer',
   'hosts.host.regionserver.decommission.batch3':'Decommission RegionServer - Turn drain mode off',
   'hosts.host.hbase_regionserver.recommission':'Recommission RegionServer',
-  'hosts.host.hbase_regionserver.decommsion':'Decommission RegionServer',
+  'hosts.host.hbase_regionserver.decommission':'Decommission RegionServer',
   'hosts.host.decommissioned':'Decommissioned',
   'hosts.host.decommissioning':'Decommissioning',
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2220427a/ambari-web/test/controllers/main/host/details_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/host/details_test.js b/ambari-web/test/controllers/main/host/details_test.js
index 4c0d29c..d5d04db 100644
--- a/ambari-web/test/controllers/main/host/details_test.js
+++ b/ambari-web/test/controllers/main/host/details_test.js
@@ -905,13 +905,11 @@ describe('App.MainHostDetailsController', function () {
 
     beforeEach(function () {
       sinon.stub(controller, "doDecommission", Em.K);
-      sinon.stub(controller, "warnBeforeDecommission", Em.K);
       sinon.stub(controller, "showBackgroundOperationsPopup", Em.K);
     });
 
     afterEach(function () {
       controller.doDecommission.restore();
-      controller.warnBeforeDecommission.restore();
       controller.showBackgroundOperationsPopup.restore();
     });
 
@@ -932,7 +930,7 @@ describe('App.MainHostDetailsController', function () {
     });
     it('HBASE service', function () {
       controller.runDecommission('host1', 'HBASE');
-      expect(controller.warnBeforeDecommission.calledWith('host1', 'HBASE', "HBASE_MASTER", "HBASE_REGIONSERVER")).to.be.true;
+      expect(controller.doDecommission.calledWith('host1', 'HBASE', "HBASE_MASTER", "HBASE_REGIONSERVER")).to.be.true;
       expect(controller.showBackgroundOperationsPopup.calledOnce).to.be.true;
     });
   });


[2/2] git commit: AMBARI-5818. Decommission of RegionServer is failed.(xiwang)

Posted by yu...@apache.org.
AMBARI-5818. Decommission of RegionServer is failed.(xiwang)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b6c56e80
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b6c56e80
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b6c56e80

Branch: refs/heads/trunk
Commit: b6c56e80730c5847d08c0cc0243858188ad86cf8
Parents: 2220427
Author: Xi Wang <xi...@apache.org>
Authored: Mon May 19 17:39:09 2014 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Mon May 19 18:19:17 2014 -0700

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host.js         | 47 +++++++++++---------
 ambari-web/app/controllers/main/host/details.js |  2 +-
 2 files changed, 27 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b6c56e80/ambari-web/app/controllers/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host.js b/ambari-web/app/controllers/main/host.js
index 31bc036..a99b56a 100644
--- a/ambari-web/app/controllers/main/host.js
+++ b/ambari-web/app/controllers/main/host.js
@@ -343,28 +343,33 @@ App.MainHostController = Em.ArrayController.extend({
       } else {
         hostsWithComponentInProperState = components.filterProperty('workStatus','STARTED').mapProperty('host.hostName');
         //For decommession
-        var parameters = {
-          "slave_type": slaveName
-        };
-        var contextString = turn_off? 'hosts.host.' + slaveName.toLowerCase() + '.recommission':
-          'hosts.host.' + slaveName.toLowerCase() + '.decommission';
-        if (turn_off) {
-          parameters['included_hosts'] = hostsWithComponentInProperState.join(',')
-        }
-        else {
-          parameters['excluded_hosts'] = hostsWithComponentInProperState.join(',');
+        if (svcName == "HBASE") {
+          // HBASE service, decommission RegionServer in batch requests
+          App.router.get('mainHostDetailsController').doDecommissionRegionServer(hostNames, svcName, masterName, slaveName);
+        } else {
+          var parameters = {
+            "slave_type": slaveName
+          };
+          var contextString = turn_off? 'hosts.host.' + slaveName.toLowerCase() + '.recommission':
+            'hosts.host.' + slaveName.toLowerCase() + '.decommission';
+          if (turn_off) {
+            parameters['included_hosts'] = hostsWithComponentInProperState.join(',')
+          }
+          else {
+            parameters['excluded_hosts'] = hostsWithComponentInProperState.join(',');
+          }
+          App.ajax.send({
+            name: 'bulk_request.decommission',
+            sender: this,
+            data: {
+              context: Em.I18n.t(contextString),
+              serviceName: service.get('serviceName'),
+              componentName: operationData.componentName,
+              parameters: parameters
+            },
+            success: 'bulkOperationForHostComponentsSuccessCallback'
+          });
         }
-        App.ajax.send({
-          name: 'bulk_request.decommission',
-          sender: this,
-          data: {
-            context: Em.I18n.t(contextString),
-            serviceName: service.get('serviceName'),
-            componentName: operationData.componentName,
-            parameters: parameters
-          },
-          success: 'bulkOperationForHostComponentsSuccessCallback'
-        });
       }
     }
     else {

http://git-wip-us.apache.org/repos/asf/ambari/blob/b6c56e80/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js
index cfbf086..430feaf 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -940,7 +940,7 @@ App.MainHostDetailsController = Em.Controller.extend({
         this.doDecommission(hostName, svcName, "JOBTRACKER", "TASKTRACKER");
         break;
       case 'HBASE':
-        this.doDecommission(hostName, svcName, "HBASE_MASTER", "HBASE_REGIONSERVER");
+        this.doDecommissionRegionServer(hostName, svcName, "HBASE_MASTER", "HBASE_REGIONSERVER");
     }
     this.showBackgroundOperationsPopup();
   },