ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiw...@apache.org
Subject ambari git commit: AMBARI-13380. HDFS Checkpoint window does not appear for restart all reconfigured operation on host.(xiwang)
Date Fri, 09 Oct 2015 19:51:29 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 fb3076352 -> dab7b37d9


AMBARI-13380. HDFS Checkpoint window does not appear for restart all reconfigured operation
on host.(xiwang)


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

Branch: refs/heads/branch-2.1
Commit: dab7b37d92d36f12922a696ed1302be189aca826
Parents: fb30763
Author: Xi Wang <xiwang@apache.org>
Authored: Fri Oct 9 11:44:37 2015 -0700
Committer: Xi Wang <xiwang@apache.org>
Committed: Fri Oct 9 12:51:01 2015 -0700

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host/details.js   | 18 ++++++++++++++----
 .../test/controllers/main/host/details_test.js    | 18 ++++++++++++++++++
 2 files changed, 32 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/dab7b37d/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 c49705a..d2e7e20 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -2220,10 +2220,20 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
    */
   restartAllStaleConfigComponents: function () {
     var self = this;
-    return App.showConfirmationPopup(function () {
-      var staleComponents = self.get('content.componentsWithStaleConfigs');
-      batchUtils.restartHostComponents(staleComponents, Em.I18n.t('rollingrestart.context.allWithStaleConfigsOnSelectedHost').format(self.get('content.hostName')),
"HOST");
-    });
+    var staleComponents = self.get('content.componentsWithStaleConfigs');
+    if (staleComponents.someProperty('componentName', 'NAMENODE') &&
+      this.get('content.hostComponents').filterProperty('componentName', 'NAMENODE').someProperty('workStatus',
App.HostComponentStatus.started)) {
+      this.checkNnLastCheckpointTime(function () {
+        App.showConfirmationPopup(function () {
+          batchUtils.restartHostComponents(staleComponents, Em.I18n.t('rollingrestart.context.allWithStaleConfigsOnSelectedHost').format(self.get('content.hostName')),
"HOST");
+        });
+      });
+    } else {
+      return App.showConfirmationPopup(function () {
+        batchUtils.restartHostComponents(staleComponents, Em.I18n.t('rollingrestart.context.allWithStaleConfigsOnSelectedHost').format(self.get('content.hostName')),
"HOST");
+      });
+    }
+
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/dab7b37d/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 be86410..05574df 100644
--- a/ambari-web/test/controllers/main/host/details_test.js
+++ b/ambari-web/test/controllers/main/host/details_test.js
@@ -1843,10 +1843,14 @@ describe('App.MainHostDetailsController', function () {
     beforeEach(function () {
       sinon.spy(App, "showConfirmationPopup");
       sinon.stub(batchUtils, "restartHostComponents", Em.K);
+      sinon.stub(controller, 'checkNnLastCheckpointTime', function(callback){
+        callback();
+      });
     });
     afterEach(function () {
       App.showConfirmationPopup.restore();
       batchUtils.restartHostComponents.restore();
+      controller.checkNnLastCheckpointTime.restore();
     });
 
     it('popup should be displayed', function () {
@@ -1862,6 +1866,20 @@ describe('App.MainHostDetailsController', function () {
         {}
       ])).to.be.true;
     });
+
+    it('popup ro check NameNode checkpoint should be displayed first', function () {
+      controller.set('content.componentsWithStaleConfigs', [Em.Object.create({
+        componentName: 'NAMENODE',
+        workStatus: 'STARTED'
+      })]);
+      controller.set('content.hostComponents', [Em.Object.create({
+        componentName: 'NAMENODE',
+        workStatus: 'STARTED'
+      })]);
+      controller.restartAllStaleConfigComponents();
+      expect(controller.checkNnLastCheckpointTime.calledOnce).to.be.true;
+      expect(App.showConfirmationPopup.calledOnce).to.be.true;
+    });
   });
 
   describe.skip('#moveComponent()', function () {


Mime
View raw message