You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by on...@apache.org on 2014/01/29 15:27:59 UTC

git commit: AMBARI-4457. Strange behaviour of moving NameNode after enabling HA. (onechiporenko)

Updated Branches:
  refs/heads/branch-1.4.4 c63df3bb9 -> 9b163e089


AMBARI-4457. Strange behaviour of moving NameNode after enabling HA. (onechiporenko)


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

Branch: refs/heads/branch-1.4.4
Commit: 9b163e089b76206f0609f888adaed6465c611488
Parents: c63df3b
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Wed Jan 29 16:18:38 2014 +0200
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Wed Jan 29 16:27:54 2014 +0200

----------------------------------------------------------------------
 .../main/service/reassign/step2_controller.js            | 11 +++++++++--
 ambari-web/app/controllers/wizard/step5_controller.js    | 11 ++---------
 ambari-web/app/templates/wizard/step5.hbs                |  2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9b163e08/ambari-web/app/controllers/main/service/reassign/step2_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/reassign/step2_controller.js b/ambari-web/app/controllers/main/service/reassign/step2_controller.js
index f8225dd..388c52f 100644
--- a/ambari-web/app/controllers/main/service/reassign/step2_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step2_controller.js
@@ -21,10 +21,17 @@ var App = require('app');
 App.ReassignMasterWizardStep2Controller = App.WizardStep5Controller.extend({
 
   currentHostId: null,
+  showCurrentHost: true,
 
   loadStep: function() {
     this._super();
-    this.rebalanceComponentHosts(this.get('content.reassign.component_name'));
+    if(this.get('content.reassign.component_name') == "NAMENODE" && !this.get('content.masterComponentHosts').findProperty('component', "SECONDARY_NAMENODE")){
+      this.set('showCurrentHost', false);
+      this.rebalanceComponentHosts('NAMENODE');
+    }else{
+      this.set('showCurrentHost', true);
+      this.rebalanceSingleComponentHosts(this.get('content.reassign.component_name'));
+    }
   },
 
   loadComponents: function () {
@@ -52,7 +59,7 @@ App.ReassignMasterWizardStep2Controller = App.WizardStep5Controller.extend({
     return result;
   },
 
-  rebalanceComponentHosts:function (componentName) {
+  rebalanceSingleComponentHosts:function (componentName) {
     var currentComponents = this.get("selectedServicesMasters").filterProperty("component_name", componentName),
       componentHosts = currentComponents.mapProperty("selectedHost"),
       availableComponentHosts = [],

http://git-wip-us.apache.org/repos/asf/ambari/blob/9b163e08/ambari-web/app/controllers/wizard/step5_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step5_controller.js b/ambari-web/app/controllers/wizard/step5_controller.js
index e674c18..d98cfb8 100644
--- a/ambari-web/app/controllers/wizard/step5_controller.js
+++ b/ambari-web/app/controllers/wizard/step5_controller.js
@@ -628,15 +628,8 @@ App.WizardStep5Controller = Em.Controller.extend({
 
     currentComponents.forEach(function (item) {
       preparedAvailableHosts = availableComponentHosts.slice(0);
-      if (this.get('content.controllerName') != 'reassignMasterController') {
-        preparedAvailableHosts.pushObject(this.get("hosts").findProperty("host_name", item.get("selectedHost")));
-      } else {
-        if(item.get("host_name") != this.get('content.currentHostId')) {
-          preparedAvailableHosts.pushObject(this.get("hosts").findProperty("host_name", item.get("host_name")));
-        }
-        item.set("selectedHost", preparedAvailableHosts.objectAt(0).host_name);
-      }
-      preparedAvailableHosts.sort(this.sortHostsByName, this);
+      preparedAvailableHosts.pushObject(this.get("hosts").findProperty("host_name", item.get("selectedHost")))
+      preparedAvailableHosts.sort(this.sortHostsByConfig, this);
       item.set("availableHosts", preparedAvailableHosts);
     }, this);
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/9b163e08/ambari-web/app/templates/wizard/step5.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step5.hbs b/ambari-web/app/templates/wizard/step5.hbs
index 54b5090..41e90fa 100644
--- a/ambari-web/app/templates/wizard/step5.hbs
+++ b/ambari-web/app/templates/wizard/step5.hbs
@@ -27,7 +27,7 @@
 <div class="assign-masters row-fluid">
   <div class="select-hosts span7">
     <div class="row-fluid">
-      {{#if currentHostId}}
+      {{#if showCurrentHost}}
         <div class="span12 control-group mlc">
           <div class="row-fluid">
             <div class="span4"><span class="pull-right control-label">{{t services.reassign.step2.currentHost}}</span></div>