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

git commit: AMBARI-5018 Rolling restart should work on a Service that is in MaintMode. (ababiichuk)

Repository: ambari
Updated Branches:
  refs/heads/trunk e1035d145 -> e788c8b81


AMBARI-5018 Rolling restart should work on a Service that is in MaintMode. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: e788c8b816930f6b8108c4323bac03513a25d924
Parents: e1035d1
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Tue Mar 11 15:02:46 2014 +0200
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Tue Mar 11 15:02:46 2014 +0200

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service/item.js     | 2 +-
 ambari-web/app/utils/batch_scheduled_requests.js    | 8 +++++---
 ambari-web/app/views/common/rolling_restart_view.js | 9 ++++++++-
 3 files changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e788c8b8/ambari-web/app/controllers/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js
index 58372cb..e7a118f 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -205,7 +205,7 @@ App.MainServiceItemController = Em.Controller.extend({
   },
 
   rollingRestart: function(hostComponentName) {
-    batchUtils.launchHostComponentRollingRestart(hostComponentName, false);
+    batchUtils.launchHostComponentRollingRestart(hostComponentName, false, this.get('content.passiveState') === "ON");
   },
 
   turnOnOffPassiveRequest: function(state,message) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e788c8b8/ambari-web/app/utils/batch_scheduled_requests.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/batch_scheduled_requests.js b/ambari-web/app/utils/batch_scheduled_requests.js
index 43345de..7162595 100644
--- a/ambari-web/app/utils/batch_scheduled_requests.js
+++ b/ambari-web/app/utils/batch_scheduled_requests.js
@@ -215,9 +215,9 @@ module.exports = {
    *           Pre-select host-components which have stale
    *          configurations
    */
-  launchHostComponentRollingRestart: function(hostComponentName, staleConfigsOnly) {
+  launchHostComponentRollingRestart: function(hostComponentName, staleConfigsOnly, skipMaintenance) {
     if (App.get('components.rollinRestartAllowed').contains(hostComponentName)) {
-      this.showRollingRestartPopup(hostComponentName, staleConfigsOnly);
+      this.showRollingRestartPopup(hostComponentName, staleConfigsOnly, null, skipMaintenance);
     }
     else {
       this.showWarningRollingRestartPopup(hostComponentName);
@@ -231,7 +231,7 @@ module.exports = {
    * @param {App.hostComponent[]} hostComponents list of hostComponents that should be restarted (optional).
    * Using this parameter will reset hostComponentName
    */
-  showRollingRestartPopup: function(hostComponentName, staleConfigsOnly, hostComponents) {
+  showRollingRestartPopup: function(hostComponentName, staleConfigsOnly, hostComponents, skipMaintenance) {
     hostComponents = hostComponents || [];
     var componentDisplayName = App.format.role(hostComponentName);
     if (!componentDisplayName) {
@@ -241,6 +241,7 @@ module.exports = {
     var viewExtend = {
       staleConfigsOnly : staleConfigsOnly,
       hostComponentName : hostComponentName,
+      skipMaintenance: skipMaintenance,
       didInsertElement : function() {
         this.set('parentView.innerView', this);
         this.initialize();
@@ -255,6 +256,7 @@ module.exports = {
       header : title,
       hostComponentName : hostComponentName,
       staleConfigsOnly : staleConfigsOnly,
+      skipMaintenance: skipMaintenance,
       innerView : null,
       bodyClass : App.RollingRestartView.extend(viewExtend),
       classNames : [ 'rolling-restart-popup' ],

http://git-wip-us.apache.org/repos/asf/ambari/blob/e788c8b8/ambari-web/app/views/common/rolling_restart_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/rolling_restart_view.js b/ambari-web/app/views/common/rolling_restart_view.js
index eee978c..658ece3 100644
--- a/ambari-web/app/views/common/rolling_restart_view.js
+++ b/ambari-web/app/views/common/rolling_restart_view.js
@@ -39,6 +39,13 @@ App.RollingRestartView = Em.View.extend({
   staleConfigsOnly : false,
 
   /**
+   * We should do rolling restart for components if we run
+   * restart for service and service is in Maintenance mode
+   * @type {bool}
+   */
+  skipMaintenance: false,
+
+  /**
    * Count of host components in one batch
    * @type {Number}
    */
@@ -139,7 +146,7 @@ App.RollingRestartView = Em.View.extend({
    * @type {Array}
    */
   restartHostComponents : function() {
-    var hostComponents = this.get('nonMaintainanceHostComponents');
+    var hostComponents = this.get('skipMaintenance') ? this.get('allHostComponents') : this.get('nonMaintainanceHostComponents');
     if (this.get('staleConfigsOnly')) {
       hostComponents = hostComponents.filterProperty('staleConfigs', true);
     }