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

ababiichuk pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 8453f1d  AMBARI-23937 Reassign Master Wizard issues. (ababiichuk)
8453f1d is described below

commit 8453f1d4078fda328d9e346456018368b62a0511
Author: ababiichuk <ababiic...@hortonworks.com>
AuthorDate: Wed May 23 20:20:06 2018 +0300

    AMBARI-23937 Reassign Master Wizard issues. (ababiichuk)
---
 .../app/mixins/wizard/assign_master_components.js  | 32 +++++++++++++++++++++-
 ambari-web/app/routes/reassign_master_routes.js    |  1 -
 2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/ambari-web/app/mixins/wizard/assign_master_components.js 
b/ambari-web/app/mixins/wizard/assign_master_components.js
index 79ed6f9..2ac2a59 100644
--- a/ambari-web/app/mixins/wizard/assign_master_components.js
+++ b/ambari-web/app/mixins/wizard/assign_master_components.js
@@ -822,7 +822,37 @@ App.AssignMasterComponents = 
Em.Mixin.create(App.HostComponentValidationMixin, A
 
     masterComponents.forEach(function (item) {
       var masterComponent = 
App.StackServiceComponent.find().findProperty('componentName', 
item.component_name);
-      var componentObj = Em.Object.create(item);
+      var componentObj = Em.Object.create(item, item.nameSpace ? {
+        allMasters: result,
+        /**
+         * Namespace of NameNode for enabled HDFS federation.
+         * If a new host is assigned to component, looking for other NameNodes
+         * to find which namespace has a 'free' host after this assignment.
+         * NameNodes with new host assigned are excluded from this process
+         * since moving more than one component at once is not allowed.
+         */
+        nameSpace: function () {
+          const hostComponent = 
App.HostComponent.find(`${this.get('component_name')}_${this.get('selectedHost')}`);
+          if (hostComponent.get('isLoaded')) {
+            return hostComponent.get('haNameSpace');
+          } else {
+            let nameSpacesCounts = {};
+            const allNameSpaces = 
this.get('allMasters').filter(masterComponent => {
+              return masterComponent.get('serviceComponentId') !== 
this.get('serviceComponentId')
+                && 
App.HostComponent.find(`${masterComponent.get('component_name')}_${masterComponent.get('selectedHost')}`).get('isLoaded')
+                && masterComponent.get('nameSpace');
+            }).mapProperty('nameSpace');
+            allNameSpaces.forEach(nameSpace => {
+              const currentCount = nameSpacesCounts[nameSpace];
+              nameSpacesCounts[nameSpace] = currentCount ? currentCount + 1 : 
1;
+            });
+            const nameSpacesWithMissingHost = 
Object.keys(nameSpacesCounts).filter(key => nameSpacesCounts[key] === 1);
+            if (nameSpacesWithMissingHost.length === 1) {
+              return nameSpacesWithMissingHost[0];
+            }
+          }
+        }.property('allMasters.@each.selectedHost')
+      } : {});
       var showRemoveControl;
       if (masterComponent.get('isMasterWithMultipleInstances')) {
         showRemoveControl = 
installedServices.contains(masterComponent.get('stackService.serviceName')) &&
diff --git a/ambari-web/app/routes/reassign_master_routes.js 
b/ambari-web/app/routes/reassign_master_routes.js
index d7f84ff..26eccc0 100644
--- a/ambari-web/app/routes/reassign_master_routes.js
+++ b/ambari-web/app/routes/reassign_master_routes.js
@@ -302,7 +302,6 @@ module.exports = App.WizardRoute.extend({
     next: function (router) {
       var controller = router.get('reassignMasterController');
       controller.finish();
-      controller.get('popup').hide();
       App.clusterStatus.setClusterStatus({
         clusterName: 
router.get('reassignMasterController.content.cluster.name'),
         clusterState: 'DEFAULT',

-- 
To stop receiving notification emails like this one, please contact
ababiic...@apache.org.

Reply via email to