You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2015/12/23 16:06:57 UTC

[18/51] [abbrv] ambari git commit: AMBARI-14427 Add Service wizard: Ambari web should select slaves as per the recommendation given by stack advisor. (atkach)

AMBARI-14427 Add Service wizard: Ambari web should select slaves as per the recommendation given by stack advisor. (atkach)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 8a7e563dd7a7f55b784b9758e2bf0199874bbf65
Parents: 7d0da5a
Author: Andrii Tkach <at...@hortonworks.com>
Authored: Mon Dec 21 12:43:55 2015 +0200
Committer: Andrii Tkach <at...@hortonworks.com>
Committed: Mon Dec 21 12:43:55 2015 +0200

----------------------------------------------------------------------
 .../controllers/main/service/add_controller.js  | 82 --------------------
 .../app/controllers/wizard/step6_controller.js  |  3 +-
 2 files changed, 1 insertion(+), 84 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8a7e563d/ambari-web/app/controllers/main/service/add_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/add_controller.js b/ambari-web/app/controllers/main/service/add_controller.js
index 1f8133d..fcfce75 100644
--- a/ambari-web/app/controllers/main/service/add_controller.js
+++ b/ambari-web/app/controllers/main/service/add_controller.js
@@ -337,92 +337,10 @@ App.AddServiceController = App.WizardController.extend(App.AddSecurityConfigs, {
         });
       });
     }
-    if (!slaveComponentHosts) {
-      slaveComponentHosts = this.getSlaveComponentHosts();
-    }
     this.set("content.slaveComponentHosts", slaveComponentHosts);
   },
 
   /**
-   * return slaveComponents bound to hosts
-   * @return {Array}
-   */
-  getSlaveComponentHosts: function () {
-    var components = this.get('slaveComponents');
-    var result = [];
-    var installedServices = App.Service.find().mapProperty('serviceName');
-    var selectedServices = this.get('content.services').filterProperty('isSelected', true).mapProperty('serviceName');
-    var installedComponentsMap = {};
-    var uninstalledComponents = [];
-    var hosts = this.getDBProperty('hosts') || this.get('content.hosts');
-    var masterComponents = App.get('components.masters');
-    var nonMasterComponentHosts = [];
-
-    components.forEach(function (component) {
-      if (installedServices.contains(component.get('serviceName'))) {
-        installedComponentsMap[component.get('componentName')] = [];
-      } else if (selectedServices.contains(component.get('serviceName'))) {
-        uninstalledComponents.push(component);
-      }
-    }, this);
-
-    for (var hostName in hosts) {
-      if (hosts[hostName].isInstalled) {
-        var isMasterComponentHosted = false;
-        hosts[hostName].hostComponents.forEach(function (component) {
-          if (installedComponentsMap[component.HostRoles.component_name]) {
-            installedComponentsMap[component.HostRoles.component_name].push(hostName);
-          }
-          if (masterComponents.contains(component.HostRoles.component_name)) {
-            isMasterComponentHosted = true;
-          }
-        }, this);
-        if (!isMasterComponentHosted) {
-          nonMasterComponentHosts.push(hostName);
-        }
-      }
-    }
-
-    for (var componentName in installedComponentsMap) {
-      var component = {
-        componentName: componentName,
-        displayName: App.format.role(componentName),
-        hosts: [],
-        isInstalled: true
-      };
-      installedComponentsMap[componentName].forEach(function (hostName) {
-        component.hosts.push({
-          group: "Default",
-          hostName: hostName,
-          isInstalled: true
-        });
-      }, this);
-      result.push(component);
-    }
-
-    if (!nonMasterComponentHosts.length) {
-      nonMasterComponentHosts.push(Object.keys(hosts)[0]);
-    }
-    var uninstalledComponentHosts =  nonMasterComponentHosts.map(function(_hostName){
-      return {
-        group: "Default",
-        hostName: _hostName,
-        isInstalled: false
-      }
-    });
-    uninstalledComponents.forEach(function (component) {
-      result.push({
-        componentName: component.get('componentName'),
-        displayName: App.format.role(component.get('componentName')),
-        hosts: component.get('minToInstall') != 0 ? uninstalledComponentHosts : [],
-        isInstalled: false
-      })
-    });
-
-    return result;
-  },
-
-  /**
    * Generate clients list for selected services and save it to model
    */
   saveClients: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/8a7e563d/ambari-web/app/controllers/wizard/step6_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step6_controller.js b/ambari-web/app/controllers/wizard/step6_controller.js
index 04930f4..280bdd7 100644
--- a/ambari-web/app/controllers/wizard/step6_controller.js
+++ b/ambari-web/app/controllers/wizard/step6_controller.js
@@ -408,9 +408,8 @@ App.WizardStep6Controller = Em.Controller.extend(App.BlueprintMixin, {
    * @method renderSlaves
    */
   renderSlaves: function (hostsObj) {
-    var headers = this.get('headers');
-    var clientHeaders = headers.findProperty('name', 'CLIENT');
     var slaveComponents = this.get('content.slaveComponentHosts');
+
     if (!slaveComponents) { // we are at this page for the first time
       var recommendations = this.get('content.recommendations');
       // Get all host-component pairs from recommendations