Browse Source

AMBARI-1145. Cluster Management refactoring. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1431859 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 years ago
parent
commit
a219509ebc
33 changed files with 248 additions and 518 deletions
  1. 2 2
      ambari-web/app/controllers/global/cluster_controller.js
  2. 26 130
      ambari-web/app/controllers/main/host.js
  3. 1 1
      ambari-web/app/controllers/main/host/add_controller.js
  4. 5 5
      ambari-web/app/controllers/main/host/details.js
  5. 2 2
      ambari-web/app/controllers/main/service/add_controller.js
  6. 5 5
      ambari-web/app/controllers/main/service/info/configs.js
  7. 11 6
      ambari-web/app/controllers/main/service/item.js
  8. 1 2
      ambari-web/app/controllers/wizard/step10_controller.js
  9. 1 1
      ambari-web/app/controllers/wizard/step5_controller.js
  10. 2 5
      ambari-web/app/mappers/hosts_mapper.js
  11. 7 47
      ambari-web/app/mappers/service_mapper.js
  12. 0 16
      ambari-web/app/mappers/status_mapper.js
  13. 7 8
      ambari-web/app/messages.js
  14. 0 1
      ambari-web/app/models.js
  15. 0 103
      ambari-web/app/models/component.js
  16. 1 2
      ambari-web/app/models/host.js
  17. 7 4
      ambari-web/app/models/host_component.js
  18. 9 10
      ambari-web/app/models/service.js
  19. 9 0
      ambari-web/app/styles/application.less
  20. 1 1
      ambari-web/app/templates/main/service/info/summary.hbs
  21. 1 1
      ambari-web/app/templates/main/service/info/summary/ganglia.hbs
  22. 1 1
      ambari-web/app/templates/main/service/info/summary/oozie.hbs
  23. 1 1
      ambari-web/app/templates/main/service/item.hbs
  24. 23 29
      ambari-web/app/templates/wizard/step2.hbs
  25. 55 0
      ambari-web/app/utils/component.js
  26. 4 4
      ambari-web/app/views/common/quick_view_link_view.js
  27. 1 1
      ambari-web/app/views/main/dashboard/service/hbase.js
  28. 1 1
      ambari-web/app/views/main/dashboard/service/hdfs.js
  29. 1 1
      ambari-web/app/views/main/dashboard/service/mapreduce.js
  30. 16 40
      ambari-web/app/views/main/host.js
  31. 8 8
      ambari-web/app/views/main/host/summary.js
  32. 7 7
      ambari-web/app/views/main/service/info/summary.js
  33. 32 73
      ambari-web/app/views/wizard/step2_view.js

+ 2 - 2
ambari-web/app/controllers/global/cluster_controller.js

@@ -94,7 +94,7 @@ App.ClusterController = Em.Controller.extend({
       var svcs = App.Service.find();
       var svcs = App.Service.find();
       var gangliaSvc = svcs.findProperty("serviceName", "GANGLIA");
       var gangliaSvc = svcs.findProperty("serviceName", "GANGLIA");
       if (gangliaSvc) {
       if (gangliaSvc) {
-        var svcComponents = gangliaSvc.get('components');
+        var svcComponents = gangliaSvc.get('hostComponents');
         if (svcComponents) {
         if (svcComponents) {
           var gangliaSvcComponent = svcComponents.findProperty("componentName", "GANGLIA_SERVER");
           var gangliaSvcComponent = svcComponents.findProperty("componentName", "GANGLIA_SERVER");
           if (gangliaSvcComponent) {
           if (gangliaSvcComponent) {
@@ -128,7 +128,7 @@ App.ClusterController = Em.Controller.extend({
       var svcs = App.Service.find();
       var svcs = App.Service.find();
       var nagiosSvc = svcs.findProperty("serviceName", "NAGIOS");
       var nagiosSvc = svcs.findProperty("serviceName", "NAGIOS");
       if (nagiosSvc) {
       if (nagiosSvc) {
-        var svcComponents = nagiosSvc.get('components');
+        var svcComponents = nagiosSvc.get('hostComponents');
         if (svcComponents) {
         if (svcComponents) {
           var nagiosSvcComponent = svcComponents.findProperty("componentName", "NAGIOS_SERVER");
           var nagiosSvcComponent = svcComponents.findProperty("componentName", "NAGIOS_SERVER");
           if (nagiosSvcComponent) {
           if (nagiosSvcComponent) {

+ 26 - 130
ambari-web/app/controllers/main/host.js

@@ -18,161 +18,51 @@
 
 
 var App = require('app');
 var App = require('app');
 var validator = require('utils/validator');
 var validator = require('utils/validator');
+var componentHelper = require('utils/component');
 
 
 App.MainHostController = Em.ArrayController.extend({
 App.MainHostController = Em.ArrayController.extend({
   name:'mainHostController',
   name:'mainHostController',
-  content:[],
+  content: App.Host.find(),
   comeWithFilter: false,
   comeWithFilter: false,
-  fullContent:App.Host.find(),
-  clusters:App.Cluster.find(),
 
 
   isAdmin: function(){
   isAdmin: function(){
-    return App.db.getUser().admin;
+    return App.router.getUser().admin;
   }.property('App.router.loginController.loginName'),
   }.property('App.router.loginController.loginName'),
+
+  /**
+   * Components which will be shown in component filter
+   */
   componentsForFilter:function() {
   componentsForFilter:function() {
-    var components = App.Component.find();
-    var ret = new Array();
-    if (!components) {
-      return ret;
-    }
-    components.forEach(function(item) {
-      var o = Ember.Object.create({
-        id: item.get('id'),
-        isMaster: item.get('isMaster'),
-        isSlave: item.get('isSlave'),
-        displayName: item.get('displayName'),
-        componentName: item.get('componentName'),
-        checkedForHostFilter: item.get('checkedForHostFilter')
-      });
-      ret.push(o);
-    });
-    return ret;
+    var installedComponents = componentHelper.getInstalledComponents();
+    installedComponents.setEach('checkedForHostFilter', false);
+    return installedComponents;
   }.property(),
   }.property(),
 
 
-  totalBinding:'fullContent.length',
-  filters:{components:[]},
-  isDisabled:true,
-
-  checkRemoved:function (host_id) {
-    var hosts = this.get('content');
-    var selectedHosts = hosts.filterProperty('id', host_id);
-    this.get('fullContent').removeObjects(selectedHosts);
-  },
-
   masterComponents:function () {
   masterComponents:function () {
-    var components = [];
-    this.get('componentsForFilter').forEach(function (component) {
-      if (component.get('isMaster')) {
-        components.push(component);
-      }
-    });
-    return components;
+    return this.get('componentsForFilter').filterProperty('isMaster', true);
   }.property('componentsForFilter'),
   }.property('componentsForFilter'),
 
 
   slaveComponents:function () {
   slaveComponents:function () {
-    var components = [];
-    this.get('componentsForFilter').forEach(function (component) {
-      if (component.get('isSlave')) {
-        components.push(component);
-      }
-    });
-    return components;
+    return this.get('componentsForFilter').filterProperty('isSlave', true);
   }.property('componentsForFilter'),
   }.property('componentsForFilter'),
 
 
   clientComponents: function() {
   clientComponents: function() {
-    var components = [];
-    this.get('componentsForFilter').forEach(function(component) {
-      if (!component.get('isMaster') && !component.get('isSlave')) {
-        components.push(component);
-      }
-    });
-    return components;
+    return this.get('componentsForFilter').filterProperty('isClient', true);
   }.property('componentsForFilter'),
   }.property('componentsForFilter'),
 
 
-  backgroundOperationsCount:function () {
-    return 5;
-  }.property(),
-
-  checkedComponentsIds:function () {
-    var checked = [];
-    this.get('componentsForFilter').forEach(function (comp) {
-      if (comp.get('checkedForHostFilter'))
-        checked.push(comp.get('id'));
-    });
-
-    return checked;
-  },
-
+  /**
+   * Filter hosts by componentName of <code>component</code>
+   * @param component App.HostComponent
+   */
   filterByComponent:function (component) {
   filterByComponent:function (component) {
-    var id = component.get('id');
-    /*this.get('componentsForFilter').setEach('isChecked', false);
-    component.set('isChecked', true);*/
+    var id = component.get('componentName');
+
     this.get('componentsForFilter').setEach('checkedForHostFilter', false);
     this.get('componentsForFilter').setEach('checkedForHostFilter', false);
     this.get('componentsForFilter').filterProperty('id', id).setEach('checkedForHostFilter', true);
     this.get('componentsForFilter').filterProperty('id', id).setEach('checkedForHostFilter', true);
-    //component.set('checkedForHostFilter', true);
-    this.set('filters.components', [component.get('id')]);
-    console.log(this.get('filters.components').objectAt(0));
-    this.set('comeWithFilter', true);
-  },
-
-
-  applyHostFilters:function (items) {
-
-    var field = 'hostName'; // make this function universal
-    var value = this.get('hostFilter' + field);
-
-    var itemsToDelete = [];
-    if (value) {
-      items.forEach(function (host, index) {
-        if (host) {
-          var fieldValue = host.get(field);
-          if (fieldValue) {
-            if (fieldValue.indexOf(value) == -1) {
-              itemsToDelete.push(host);
-            }
-          }
-        }
-      });
-    }
 
 
-    if (itemsToDelete.length) {
-      itemsToDelete.forEach(function (hostToDelete) {
-        var index = items.indexOf(hostToDelete);
-        items.removeAt(index);
-      })
-    }
-
-    return items;
+    this.set('comeWithFilter', true);
   },
   },
 
 
-  changeContent:function () {
-    var items = [];
-    var filters = this.get('filters.components');
-    this.get('fullContent').forEach(function (item) {
-      if (filters.length) {
-        var inFilters = false;
-        item.get('components').forEach(function (component) {
-          if (filters.indexOf(component.get('id')) != -1) {
-            inFilters = true;
-          }
-        });
-
-
-        if (inFilters) {
-          items.push(item);
-        }
-      }
-      else {
-        items.push(item);
-      }
-    });
-
-    items = this.applyHostFilters(items);
-    this.set('total', items.length);
-
-    this.replace(0, this.get('length'), items);
-  }.observes('total'),
-
   decommissionButtonPopup:function () {
   decommissionButtonPopup:function () {
     var self = this;
     var self = this;
     App.ModalPopup.show({
     App.ModalPopup.show({
@@ -212,6 +102,12 @@ App.MainHostController = Em.ArrayController.extend({
       console.log('Removing:  ' + _hostInfo.hostName);
       console.log('Removing:  ' + _hostInfo.hostName);
     });
     });
     this.get('fullContent').removeObjects(selectedHosts);
     this.get('fullContent').removeObjects(selectedHosts);
+  },
+
+  checkRemoved:function (host_id) {
+    var hosts = this.get('content');
+    var selectedHosts = hosts.filterProperty('id', host_id);
+    this.get('fullContent').removeObjects(selectedHosts);
   }
   }
 
 
 });
 });

+ 1 - 1
ambari-web/app/controllers/main/host/add_controller.js

@@ -156,7 +156,7 @@ App.AddHostController = App.WizardController.extend({
     var masterComponentHosts = App.db.getMasterComponentHosts();
     var masterComponentHosts = App.db.getMasterComponentHosts();
     if (!masterComponentHosts) {
     if (!masterComponentHosts) {
       masterComponentHosts = [];
       masterComponentHosts = [];
-      App.Component.find().filterProperty('isMaster', true).forEach(function (item) {
+      App.HostComponent.find().filterProperty('isMaster', true).forEach(function (item) {
         masterComponentHosts.push({
         masterComponentHosts.push({
           component: item.get('componentName'),
           component: item.get('componentName'),
           hostName: item.get('host.hostName'),
           hostName: item.get('host.hostName'),

+ 5 - 5
ambari-web/app/controllers/main/host/details.js

@@ -97,9 +97,9 @@ App.MainHostDetailsController = Em.Controller.extend({
           console.log('Send request for STARTING successfully');
           console.log('Send request for STARTING successfully');
 
 
           if (App.testMode) {
           if (App.testMode) {
-            component.set('workStatus', App.Component.Status.starting);
+            component.set('workStatus', App.HostComponentStatus.starting);
             setTimeout(function(){
             setTimeout(function(){
-              component.set('workStatus', App.Component.Status.started);
+              component.set('workStatus', App.HostComponentStatus.started);
             },10000);
             },10000);
           } else {
           } else {
             App.router.get('clusterController').loadUpdatedStatusDelayed(500);
             App.router.get('clusterController').loadUpdatedStatusDelayed(500);
@@ -148,9 +148,9 @@ App.MainHostDetailsController = Em.Controller.extend({
           console.log('Send request for STOPPING successfully');
           console.log('Send request for STOPPING successfully');
 
 
           if (App.testMode) {
           if (App.testMode) {
-            component.set('workStatus', App.Component.Status.stopping);
+            component.set('workStatus', App.HostComponentStatus.stopping);
             setTimeout(function(){
             setTimeout(function(){
-              component.set('workStatus', App.Component.Status.stopped);
+              component.set('workStatus', App.HostComponentStatus.stopped);
             },10000);
             },10000);
           } else {
           } else {
             App.router.get('clusterController').loadUpdatedStatus();
             App.router.get('clusterController').loadUpdatedStatus();
@@ -322,7 +322,7 @@ App.MainHostDetailsController = Em.Controller.extend({
    * var components = this.get('content.components');
    * var components = this.get('content.components');
    * components.forEach(function (cInstance) { var cName =
    * components.forEach(function (cInstance) { var cName =
    * cInstance.get('componentName'); if (slaveComponents.contains(cName)) { if
    * cInstance.get('componentName'); if (slaveComponents.contains(cName)) { if
-   * (cInstance.get('workStatus') === App.Component.Status.stopped &&
+   * (cInstance.get('workStatus') === App.HostComponentStatus.stopped &&
    * !cInstance.get('decommissioned')) { workingComponents.push(cName); } } else {
    * !cInstance.get('decommissioned')) { workingComponents.push(cName); } } else {
    * masterComponents.push(cName); } }); // debugger; if
    * masterComponents.push(cName); } }); // debugger; if
    * (workingComponents.length || masterComponents.length) {
    * (workingComponents.length || masterComponents.length) {

+ 2 - 2
ambari-web/app/controllers/main/service/add_controller.js

@@ -161,7 +161,7 @@ App.AddServiceController = App.WizardController.extend({
   saveMasterComponentHosts: function (stepController) {
   saveMasterComponentHosts: function (stepController) {
     var obj = stepController.get('selectedServicesMasters');
     var obj = stepController.get('selectedServicesMasters');
     var masterComponentHosts = [];
     var masterComponentHosts = [];
-    var installedComponents = App.Component.find();
+    var installedComponents = App.HostComponent.find();
 
 
     obj.forEach(function (_component) {
     obj.forEach(function (_component) {
         masterComponentHosts.push({
         masterComponentHosts.push({
@@ -187,7 +187,7 @@ App.AddServiceController = App.WizardController.extend({
     var masterComponentHosts = App.db.getMasterComponentHosts();
     var masterComponentHosts = App.db.getMasterComponentHosts();
     if(!masterComponentHosts){
     if(!masterComponentHosts){
       masterComponentHosts = [];
       masterComponentHosts = [];
-      App.Component.find().filterProperty('isMaster', true).forEach(function(item){
+      App.HostComponent.find().filterProperty('isMaster', true).forEach(function(item){
         masterComponentHosts.push({
         masterComponentHosts.push({
           component: item.get('componentName'),
           component: item.get('componentName'),
           hostName: item.get('host.hostName'),
           hostName: item.get('host.hostName'),

+ 5 - 5
ambari-web/app/controllers/main/service/info/configs.js

@@ -987,27 +987,27 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
     switch (serviceName) {
     switch (serviceName) {
       case 'HDFS':
       case 'HDFS':
         var sNameNodeHost = serviceConfigs.findProperty('name', 'snamenode_host');
         var sNameNodeHost = serviceConfigs.findProperty('name', 'snamenode_host');
-        sNameNodeHost.defaultValue = this.get('content.components').findProperty('componentName', 'SECONDARY_NAMENODE').get('host.hostName');
+        sNameNodeHost.defaultValue = this.get('content.hostComponents').findProperty('componentName', 'SECONDARY_NAMENODE').get('host.hostName');
         globalConfigs.push(sNameNodeHost);
         globalConfigs.push(sNameNodeHost);
         break;
         break;
       case 'MAPREDUCE':
       case 'MAPREDUCE':
         var jobTrackerHost = serviceConfigs.findProperty('name', 'jobtracker_host');
         var jobTrackerHost = serviceConfigs.findProperty('name', 'jobtracker_host');
-        jobTrackerHost.defaultValue = this.get('content.components').findProperty('componentName', 'JOBTRACKER').get('host.hostName');
+        jobTrackerHost.defaultValue = this.get('content.hostComponents').findProperty('componentName', 'JOBTRACKER').get('host.hostName');
         globalConfigs.push(jobTrackerHost);
         globalConfigs.push(jobTrackerHost);
         break;
         break;
       case 'HIVE':
       case 'HIVE':
         var hiveMetastoreHost = serviceConfigs.findProperty('name', 'hivemetastore_host');
         var hiveMetastoreHost = serviceConfigs.findProperty('name', 'hivemetastore_host');
-        hiveMetastoreHost.defaultValue = this.get('content.components').findProperty('componentName', 'HIVE_SERVER').get('host.hostName');
+        hiveMetastoreHost.defaultValue = this.get('content.hostComponents').findProperty('componentName', 'HIVE_SERVER').get('host.hostName');
         globalConfigs.push(hiveMetastoreHost);
         globalConfigs.push(hiveMetastoreHost);
         break;
         break;
       case 'OOZIE':
       case 'OOZIE':
         var oozieServerHost = serviceConfigs.findProperty('name', 'oozieserver_host');
         var oozieServerHost = serviceConfigs.findProperty('name', 'oozieserver_host');
-        oozieServerHost.defaultValue = this.get('content.components').findProperty('componentName', 'OOZIE_SERVER').get('host.hostName');
+        oozieServerHost.defaultValue = this.get('content.hostComponents').findProperty('componentName', 'OOZIE_SERVER').get('host.hostName');
         globalConfigs.push(oozieServerHost);
         globalConfigs.push(oozieServerHost);
         break;
         break;
       case 'HBASE':
       case 'HBASE':
         var hbaseMasterHost = serviceConfigs.findProperty('name', 'hbasemaster_host');
         var hbaseMasterHost = serviceConfigs.findProperty('name', 'hbasemaster_host');
-        hbaseMasterHost.defaultValue = this.get('content.components').findProperty('componentName', 'HBASE_MASTER').get('host.hostName');
+        hbaseMasterHost.defaultValue = this.get('content.hostComponents').findProperty('componentName', 'HBASE_MASTER').get('host.hostName');
         globalConfigs.push(hbaseMasterHost);
         globalConfigs.push(hbaseMasterHost);
         break;
         break;
     }
     }

+ 11 - 6
ambari-web/app/controllers/main/service/item.js

@@ -76,7 +76,6 @@ App.MainServiceItemController = Em.Controller.extend({
       primary: 'Yes',
       primary: 'Yes',
       secondary: 'No',
       secondary: 'No',
       onPrimary: function () {
       onPrimary: function () {
-        self.get('content.components').setEach('workStatus', App.Component.Status.starting);
         self.sendCommandToServer('/services/' + self.get('content.serviceName').toUpperCase(), "PUT", {
         self.sendCommandToServer('/services/' + self.get('content.serviceName').toUpperCase(), "PUT", {
           ServiceInfo: {
           ServiceInfo: {
             state: 'STARTED'
             state: 'STARTED'
@@ -89,9 +88,11 @@ App.MainServiceItemController = Em.Controller.extend({
           console.log('Send request for STARTING successfully');
           console.log('Send request for STARTING successfully');
 
 
           if (App.testMode) {
           if (App.testMode) {
-            self.content.set('workStatus', App.Service.Health.starting);
+            self.set('content.workStatus', App.Service.Health.starting);
+            self.get('content.hostComponents').setEach('workStatus', App.HostComponentStatus.starting);
             setTimeout(function () {
             setTimeout(function () {
-              self.content.set('workStatus', App.Service.Health.live);
+              self.set('content.workStatus', App.Service.Health.live);
+              self.get('content.hostComponents').setEach('workStatus', App.HostComponentStatus.started);
             }, 10000);
             }, 10000);
           } else {
           } else {
             App.router.get('clusterController').loadUpdatedStatusDelayed(500);
             App.router.get('clusterController').loadUpdatedStatusDelayed(500);
@@ -134,7 +135,6 @@ App.MainServiceItemController = Em.Controller.extend({
       primary: 'Yes',
       primary: 'Yes',
       secondary: 'No',
       secondary: 'No',
       onPrimary: function() {
       onPrimary: function() {
-        self.get('content.components').setEach('workStatus', App.Component.Status.stopping);
         self.sendCommandToServer('/services/' + self.get('content.serviceName').toUpperCase(), "PUT",{
         self.sendCommandToServer('/services/' + self.get('content.serviceName').toUpperCase(), "PUT",{
           ServiceInfo:{
           ServiceInfo:{
             state: 'INSTALLED'
             state: 'INSTALLED'
@@ -145,9 +145,11 @@ App.MainServiceItemController = Em.Controller.extend({
           }
           }
           console.log('Send request for STOPPING successfully');
           console.log('Send request for STOPPING successfully');
           if (App.testMode) {
           if (App.testMode) {
-            self.content.set('workStatus', App.Service.Health.stopping);
+            self.set('content.workStatus', App.Service.Health.stopping);
+            self.get('content.hostComponents').setEach('workStatus', App.HostComponentStatus.stopping);
             setTimeout(function () {
             setTimeout(function () {
-              self.content.set('workStatus', App.Service.Health.dead);
+              self.set('content.workStatus', App.Service.Health.dead);
+              self.get('content.hostComponents').setEach('workStatus', App.HostComponentStatus.stopped);
             }, 10000);
             }, 10000);
           } else {
           } else {
             App.router.get('clusterController').loadUpdatedStatusDelayed(500);
             App.router.get('clusterController').loadUpdatedStatusDelayed(500);
@@ -237,6 +239,9 @@ App.MainServiceItemController = Em.Controller.extend({
     });
     });
   },
   },
   doAction: function (event) {
   doAction: function (event) {
+    if ($(event.target).hasClass('disabled') || $(event.target.parentElement).hasClass('disabled')) {
+      return;
+    }
     var methodName = event.context;
     var methodName = event.context;
     switch (methodName) {
     switch (methodName) {
       case 'runRebalancer':
       case 'runRebalancer':

+ 1 - 2
ambari-web/app/controllers/wizard/step10_controller.js

@@ -19,11 +19,10 @@
 var App = require('app');
 var App = require('app');
 
 
 App.WizardStep10Controller = Em.Controller.extend({
 App.WizardStep10Controller = Em.Controller.extend({
-  name: 'wizardStep10Controller',
   clusterInfo: [],
   clusterInfo: [],
 
 
   isNagiosRestartRequired: function() {
   isNagiosRestartRequired: function() {
-    return App.db.getSelectedServiceNames().contains('NAGIOS') && this.get('content.controllerName') !== 'installerController';
+    return this.get('content.controllerName') !== 'installerController' && App.db.getSlaveComponentHosts().findProperty('componentName', 'HBASE_REGIONSERVER').hosts.length;
   }.property(),
   }.property(),
 
 
   clearStep: function () {
   clearStep: function () {

+ 1 - 1
ambari-web/app/controllers/wizard/step5_controller.js

@@ -161,7 +161,7 @@ App.WizardStep5Controller = Em.Controller.extend({
           componentObj.component_name = _componentInfo.component_name;
           componentObj.component_name = _componentInfo.component_name;
           componentObj.display_name = _componentInfo.display_name;
           componentObj.display_name = _componentInfo.display_name;
           componentObj.selectedHost = savedComponent ? savedComponent.hostName : this.selectHost(_componentInfo.component_name);   // call the method that plays selectNode algorithm or fetches from server
           componentObj.selectedHost = savedComponent ? savedComponent.hostName : this.selectHost(_componentInfo.component_name);   // call the method that plays selectNode algorithm or fetches from server
-          componentObj.isInstalled = savedComponent ? savedComponent.isInstalled : App.Component.find().someProperty('componentName', _componentInfo.component_name);
+          componentObj.isInstalled = savedComponent ? savedComponent.isInstalled : App.HostComponent.find().someProperty('componentName', _componentInfo.component_name);
           componentObj.serviceId = services[index];
           componentObj.serviceId = services[index];
           componentObj.availableHosts = [];
           componentObj.availableHosts = [];
           componentObj.isHiveCoHost = ['HIVE_METASTORE', 'WEBHCAT_SERVER'].contains(_componentInfo.component_name);
           componentObj.isHiveCoHost = ['HIVE_METASTORE', 'WEBHCAT_SERVER'].contains(_componentInfo.component_name);

+ 2 - 5
ambari-web/app/mappers/hosts_mapper.js

@@ -15,6 +15,8 @@
  * the License.
  * the License.
  */
  */
 
 
+var App = require('app');
+
 App.hostsMapper = App.QuickDataMapper.create({
 App.hostsMapper = App.QuickDataMapper.create({
   model: App.Host,
   model: App.Host,
   tmp_result:[],
   tmp_result:[],
@@ -23,11 +25,6 @@ App.hostsMapper = App.QuickDataMapper.create({
     host_name: 'Hosts.host_name',
     host_name: 'Hosts.host_name',
     public_host_name: 'Hosts.public_host_name',
     public_host_name: 'Hosts.public_host_name',
     cluster_id: 'Hosts.cluster_name',// 1
     cluster_id: 'Hosts.cluster_name',// 1
-    components_key: 'host_components',
-    components_type: 'array',
-    components: {
-      item: 'HostRoles.component_name'
-    },
     rack: 'Hosts.rack_info',
     rack: 'Hosts.rack_info',
     host_components_key: 'host_components',
     host_components_key: 'host_components',
     host_components_type: 'array',
     host_components_type: 'array',

+ 7 - 47
ambari-web/app/mappers/service_mapper.js

@@ -14,6 +14,8 @@
  * License for the specific language governing permissions and limitations under
  * License for the specific language governing permissions and limitations under
  * the License.
  * the License.
  */
  */
+
+var App = require('app');
 var stringUtils = require('utils/string_utils');
 var stringUtils = require('utils/string_utils');
 
 
 App.servicesMapper = App.QuickDataMapper.create({
 App.servicesMapper = App.QuickDataMapper.create({
@@ -49,11 +51,6 @@ App.servicesMapper = App.QuickDataMapper.create({
     work_status: 'ServiceInfo.state',
     work_status: 'ServiceInfo.state',
     $service_audit: [ 1, 2, 3 ],
     $service_audit: [ 1, 2, 3 ],
     $alerts: [ 1, 2, 3 ],
     $alerts: [ 1, 2, 3 ],
-    components_key: 'components',
-    components_type: 'array',
-    components: {
-      item: 'ServiceComponentInfo.component_name'
-    },
     host_components: 'host_components'
     host_components: 'host_components'
   },
   },
   hdfsConfig: {
   hdfsConfig: {
@@ -115,21 +112,6 @@ App.servicesMapper = App.QuickDataMapper.create({
     heap_memory_max: 'masterComponent.ServiceComponentInfo.HeapMemoryMax'
     heap_memory_max: 'masterComponent.ServiceComponentInfo.HeapMemoryMax'
   },
   },
 
 
-  model2: App.Component,
-  config2: {
-    id: 'ServiceComponentInfo.component_name',
-    component_name: 'ServiceComponentInfo.component_name',
-    service_id: 'ServiceComponentInfo.service_name',
-    // TODO - PROBLEM:
-    // below statements are a problem for multiple 
-    // host_component components. Because it randomly
-    // picks one of the hosts. Especially the host details
-    // page must be careful because, it will randomly
-    // pick a host.
-    work_status: 'host_components[0].HostRoles.state',
-    host_id: 'host_components[0].HostRoles.host_name'
-  },
-
   model3: App.HostComponent,
   model3: App.HostComponent,
   config3: {
   config3: {
     id: 'id',
     id: 'id',
@@ -137,7 +119,7 @@ App.servicesMapper = App.QuickDataMapper.create({
     desired_status: 'HostRoles.desired_state',
     desired_status: 'HostRoles.desired_state',
     component_name: 'HostRoles.component_name',
     component_name: 'HostRoles.component_name',
     host_id: 'HostRoles.host_name',
     host_id: 'HostRoles.host_name',
-    service_id: 'component[0].ServiceComponentInfo.service_name'
+    $service_id: 'none' /* will be set outside of parse function */
   },
   },
 
 
   map: function (json) {
   map: function (json) {
@@ -195,37 +177,15 @@ App.servicesMapper = App.QuickDataMapper.create({
       result = this.sortByOrder(this.get('servicesSortOrder'), result);
       result = this.sortByOrder(this.get('servicesSortOrder'), result);
       App.store.loadMany(this.get('model'), result);
       App.store.loadMany(this.get('model'), result);
 
 
-      // Service components
-      result = [];
-      json.items.forEach(function(item){
-        item.components.forEach(function(component){
-          result.push(this.parseIt(component, this.config2));
-        }, this)
-      }, this);
-      var newComponents = [];
-      result.forEach(function(componentJson){
-        var component = App.Component.find(componentJson.id);
-        if (component && component.get('isLoaded')) { // UPDATE
-          if (componentJson.work_status) {
-            component.set('workStatus', componentJson.work_status);
-          }
-          if (componentJson.host_id) {
-            component.set('host', App.Host.find(componentJson.host_id));
-          }
-        } else {
-          newComponents.push(componentJson);
-        }
-      });
-      if (newComponents.length > 0) {
-        App.store.loadMany(this.get('model2'), newComponents);
-      }
-
       // Host components
       // Host components
       result = [];
       result = [];
       json.items.forEach(function(item){
       json.items.forEach(function(item){
         item.components.forEach(function(component){
         item.components.forEach(function(component){
+          var service = component.ServiceComponentInfo.service_name;
           component.host_components.forEach(function(host_component){
           component.host_components.forEach(function(host_component){
-            result.push(this.parseIt(host_component, this.config3));
+            var comp = this.parseIt(host_component, this.config3);
+            comp.service_id = service;
+            result.push(comp);
           }, this)
           }, this)
         }, this)
         }, this)
       }, this);
       }, this);

+ 0 - 16
ambari-web/app/mappers/status_mapper.js

@@ -59,22 +59,6 @@ App.statusMapper = App.QuickDataMapper.create({
         }
         }
       })
       })
 
 
-      result = [];
-      json.items.forEach(function (item) {
-        item.components.forEach(function (component) {
-          result.push(this.parseIt(component, this.config2));
-        }, this)
-      }, this);
-
-      //console.log(result)
-      var components = App.Component.find();
-      result.forEach(function(item){
-        var component = components.findProperty('id', item.id);
-        if(component){
-          component.set('workStatus', item.work_status);
-        }
-      })
-
       result = [];
       result = [];
       json.items.forEach(function (item) {
       json.items.forEach(function (item) {
         item.components.forEach(function (component) {
         item.components.forEach(function (component) {

+ 7 - 8
ambari-web/app/messages.js

@@ -79,11 +79,11 @@ Em.I18n.translations = {
   'installer.step2.hostName.error.notRequired':'Host Names will be ignored if not using SSH to automatically configure hosts',
   'installer.step2.hostName.error.notRequired':'Host Names will be ignored if not using SSH to automatically configure hosts',
   'installer.step2.hostName.error.invalid':'Invalid Host Name(s)',
   'installer.step2.hostName.error.invalid':'Invalid Host Name(s)',
   'installer.step2.hostName.pattern.header':'Host name pattern expressions',
   'installer.step2.hostName.pattern.header':'Host name pattern expressions',
-  'installer.step2.sshKey':'Host Connectivity Information',
+  'installer.step2.sshKey':'Host Registration Information',
   'installer.step2.sshKey.error.required':'SSH Private Key is required',
   'installer.step2.sshKey.error.required':'SSH Private Key is required',
   'installer.step2.passphrase.error.match':'Passphrases do not match',
   'installer.step2.passphrase.error.match':'Passphrases do not match',
   'installer.step2.manualInstall.label':'Do not use SSH to automatically configure hosts ',
   'installer.step2.manualInstall.label':'Do not use SSH to automatically configure hosts ',
-  'installer.step2.manualInstall.info':'By not using SSH to connect to the target hosts, you must manually install and start the ' +
+  'installer.step2.manualInstall.info':'By not using SSH to connect to the target hosts, you must manually install the ' +
     'Ambari Agent on each host in order for the wizard to perform the necessary configurations and software installs.',
     'Ambari Agent on each host in order for the wizard to perform the necessary configurations and software installs.',
   'installer.step2.advancedOption':'Advanced Options',
   'installer.step2.advancedOption':'Advanced Options',
   'installer.step2.repoConf':'Software Repository Configuration File Path',
   'installer.step2.repoConf':'Software Repository Configuration File Path',
@@ -92,22 +92,22 @@ Em.I18n.translations = {
   'installer.step2.localRepo.label_instead':'instead of downloading software packages from the Internet',
   'installer.step2.localRepo.label_instead':'instead of downloading software packages from the Internet',
   'installer.step2.localRepo.error.required':'Local repository file path is required',
   'installer.step2.localRepo.error.required':'Local repository file path is required',
   'installer.step2.localRepo.tooltip.title':'Local Software Repository',
   'installer.step2.localRepo.tooltip.title':'Local Software Repository',
-  'installer.step2.localRepo.tooltip.content': 'The install process requires access to the Internet to fetch software ' +
+  'installer.step2.localRepo.tooltip.content': 'The cluster install requires access to the Internet to fetch software ' +
     'from a remote repository. In some cases, adequate bandwidth is not available and you want to prevent downloading ' +
     'from a remote repository. In some cases, adequate bandwidth is not available and you want to prevent downloading ' +
     'packages from the remote repository over and over again. Other times, Internet access is not available from the ' +
     'packages from the remote repository over and over again. Other times, Internet access is not available from the ' +
     'hosts in your cluster. In these situations, you must set up a version of the repository that your machines can ' +
     'hosts in your cluster. In these situations, you must set up a version of the repository that your machines can ' +
     'access locally and this is called a <b>Local Software Repository</b>',
     'access locally and this is called a <b>Local Software Repository</b>',
   'installer.step2.javaHome.label' : 'Path to 64-bit JDK',
   'installer.step2.javaHome.label' : 'Path to 64-bit JDK',
-  'installer.step2.javaHome.label2' : 'on all hosts',
   'installer.step2.javaHome.tooltip.title' : 'JAVA_HOME',
   'installer.step2.javaHome.tooltip.title' : 'JAVA_HOME',
   'installer.step2.javaHome.tooltip.content' : 'Path to 64-bit JAVA_HOME. /usr/jdk/jdk1.6.0_31 is the default used by Ambari. You can override this to a specific path that contains the JDK. <br/> Note: the path must be valid on <b>ALL</b> hosts in your cluster.',
   'installer.step2.javaHome.tooltip.content' : 'Path to 64-bit JAVA_HOME. /usr/jdk/jdk1.6.0_31 is the default used by Ambari. You can override this to a specific path that contains the JDK. <br/> Note: the path must be valid on <b>ALL</b> hosts in your cluster.',
   'installer.step2.useSsh.provide' : 'Provide your',
   'installer.step2.useSsh.provide' : 'Provide your',
   'installer.step2.useSsh.provide_id_rsa' : '(id_rsa for root) and use SSH to automatically register hosts',
   'installer.step2.useSsh.provide_id_rsa' : '(id_rsa for root) and use SSH to automatically register hosts',
   'installer.step2.useSsh.tooltip.title':'SSH Private Key',
   'installer.step2.useSsh.tooltip.title':'SSH Private Key',
   'installer.step2.useSsh.tooltip.content':'The <b>SSH Private Key File</b> is used for the root access to the target hosts in your cluster.',
   'installer.step2.useSsh.tooltip.content':'The <b>SSH Private Key File</b> is used for the root access to the target hosts in your cluster.',
-  'installer.step2.manualInstall.tooltip.title':'Not Using SSH (Manual Install)',
-  'installer.step2.manualInstall.tooltip.content':'If you do not wish Ambari to automatically configure the target hosts via SSH,' +
-    ' you have the option of configuring them yourself.  This involves installing and starting Ambari Agent on each of your target hosts.',
+  'installer.step2.manualInstall.perform':'Perform',
+  'installer.step2.manualInstall.perform_on_hosts':'on hosts and do not use SSH',
+  'installer.step2.manualInstall.tooltip.title':'manual registration',
+  'installer.step2.manualInstall.tooltip.content':'Manually registering the Ambari Agent on each host eliminates the need for SSH and should be performed prior to continuing cluster installation.',
   'installer.step2.manualInstall.popup.header':'Before You Proceed',
   'installer.step2.manualInstall.popup.header':'Before You Proceed',
   'installer.step2.manualInstall.popup.body':'You must install Ambari Agents on each host you want to manage before you proceed.',
   'installer.step2.manualInstall.popup.body':'You must install Ambari Agents on each host you want to manage before you proceed.',
 
 
@@ -289,7 +289,6 @@ Em.I18n.translations = {
   'hosts.cant.do.popup.masterList.body':'You cannot delete this host because it is hosting following master services: {0}.',
   'hosts.cant.do.popup.masterList.body':'You cannot delete this host because it is hosting following master services: {0}.',
   'hosts.cant.do.popup.workingList.body':'You cannot delete this host because following slave services are not fully stopped or decommissioned: {0}.',
   'hosts.cant.do.popup.workingList.body':'You cannot delete this host because following slave services are not fully stopped or decommissioned: {0}.',
   'hosts.add.header':'Add Host Wizard',
   'hosts.add.header':'Add Host Wizard',
-  'hosts.add.step2.warning':'Hosts are already part of the cluster and will be ignored',
   'hosts.assignRack':'Assign Rack',
   'hosts.assignRack':'Assign Rack',
 
 
   'charts.horizon.chart.showText':'show',
   'charts.horizon.chart.showText':'show',

+ 0 - 1
ambari-web/app/models.js

@@ -26,7 +26,6 @@ require('models/cluster_states');
 require('models/hosts');
 require('models/hosts');
 require('models/quick_links');
 require('models/quick_links');
 require('models/service');
 require('models/service');
-require('models/component');
 require('models/service_config');
 require('models/service_config');
 require('models/service_audit');
 require('models/service_audit');
 require('models/service/hdfs');
 require('models/service/hdfs');

+ 0 - 103
ambari-web/app/models/component.js

@@ -1,103 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-
-App.Component = DS.Model.extend({
-
-  componentName: DS.attr('string'),
-
-  displayName: function () {
-    return App.format.role(this.get('componentName'));
-  }.property('componentName'),
-
-  service: DS.belongsTo('App.Service'),
-  //service_id: DS.attr('string'),
-
-  host: DS.belongsTo('App.Host'),
-  //host_id: DS.attr('string'),
-
-  workStatus: DS.attr('string'),
-
-  isMaster: function () {
-    switch (this.get('componentName')) {
-      case 'NAMENODE':
-      case 'SECONDARY_NAMENODE':
-      case 'SNAMENODE':
-      case 'JOBTRACKER':
-      case 'ZOOKEEPER_SERVER':
-      case 'HIVE_SERVER':
-      case 'HIVE_METASTORE':
-      case 'MYSQL_SERVER':
-      case 'HBASE_MASTER':
-      case 'NAGIOS_SERVER':
-      case 'GANGLIA_SERVER':
-      case 'OOZIE_SERVER':
-      case 'WEBHCAT_SERVER':
-        return true;
-      default:
-        return false;
-    }
-    return this.get('componentName');
-  }.property('componentName'),
-  isSlave: function(){
-    switch (this.get('componentName')) {
-      case 'DATANODE':
-      case 'TASKTRACKER':
-      case 'HBASE_REGIONSERVER':
-      case 'GANGLIA_MONITOR':
-        return true;
-      default:
-        return false;
-    }
-    return this.get('componentName');
-  }.property('componentName')
-});
-
-App.Component.Status = {
-  started: "STARTED",
-  starting: "STARTING",
-  stopped: "INSTALLED",
-  stopping: "STOPPING",
-  stop_failed: "STOP_FAILED",
-  start_failed: "START_FAILED",
-  install_failed: "INSTALL_FAILED",
-
-  getKeyName:function(value){
-    switch(value){
-      case this.started:
-        return 'started';
-      case this.starting:
-        return 'starting';
-      case this.stopped:
-        return 'installed';
-      case this.stopping:
-        return 'stopping';
-      case this.stop_failed:
-        return 'stop_failed';
-      case this.start_failed:
-        return 'start_failed';
-      case this.install_failed:
-         return 'install_failed';
-    }
-    return 'none';
-  }
-}
-
-App.Component.FIXTURES = [];
-

+ 1 - 2
ambari-web/app/models/host.js

@@ -34,7 +34,6 @@ App.Host = DS.Model.extend({
   hostName: DS.attr('string'),
   hostName: DS.attr('string'),
   publicHostName: DS.attr('string'),
   publicHostName: DS.attr('string'),
   cluster: DS.belongsTo('App.Cluster'),
   cluster: DS.belongsTo('App.Cluster'),
-  components: DS.hasMany('App.Component'),
   hostComponents: DS.hasMany('App.HostComponent'),
   hostComponents: DS.hasMany('App.HostComponent'),
   cpu: DS.attr('string'),
   cpu: DS.attr('string'),
   memory: DS.attr('string'),
   memory: DS.attr('string'),
@@ -130,7 +129,7 @@ App.Host = DS.Model.extend({
     } else {
     } else {
       var status;
       var status;
       var masterComponents = this.get('hostComponents').filterProperty('isMaster', true);
       var masterComponents = this.get('hostComponents').filterProperty('isMaster', true);
-      var masterComponentsRunning = masterComponents.everyProperty('workStatus', App.HostComponent.Status.started);
+      var masterComponentsRunning = masterComponents.everyProperty('workStatus', App.HostComponentStatus.started);
       if (this.get('isNotHeartBeating')) {
       if (this.get('isNotHeartBeating')) {
         status = 'DEAD-YELLOW';
         status = 'DEAD-YELLOW';
       } else if (masterComponentsRunning) {
       } else if (masterComponentsRunning) {

+ 7 - 4
ambari-web/app/models/host_component.js

@@ -83,15 +83,18 @@ App.HostComponent = DS.Model.extend({
     }
     }
     return decommissioning;
     return decommissioning;
   }.property('componentName', 'host.hostName', 'App.router.mainServiceController.hdfsService.decommissionDataNodes.@each.hostName')
   }.property('componentName', 'host.hostName', 'App.router.mainServiceController.hdfsService.decommissionDataNodes.@each.hostName')
-})
+});
 
 
-App.HostComponent.Status = {
+App.HostComponent.FIXTURES = [];
+
+App.HostComponentStatus = {
   started: "STARTED",
   started: "STARTED",
   starting: "STARTING",
   starting: "STARTING",
   stopped: "INSTALLED",
   stopped: "INSTALLED",
   stopping: "STOPPING",
   stopping: "STOPPING",
   stop_failed: "STOP_FAILED",
   stop_failed: "STOP_FAILED",
   start_failed: "START_FAILED",
   start_failed: "START_FAILED",
+  install_failed: "INSTALL_FAILED",
 
 
   getKeyName:function(value){
   getKeyName:function(value){
     switch(value){
     switch(value){
@@ -107,10 +110,10 @@ App.HostComponent.Status = {
         return 'stop_failed';
         return 'stop_failed';
       case this.start_failed:
       case this.start_failed:
         return 'start_failed';
         return 'start_failed';
+      case this.install_failed:
+        return 'install_failed';
     }
     }
     return 'none';
     return 'none';
   }
   }
 }
 }
 
 
-App.HostComponent.FIXTURES = [];
-

+ 9 - 10
ambari-web/app/models/service.js

@@ -27,7 +27,6 @@ App.Service = DS.Model.extend({
   workStatus: DS.attr('string'),
   workStatus: DS.attr('string'),
   alerts: DS.hasMany('App.Alert'),
   alerts: DS.hasMany('App.Alert'),
   quickLinks: DS.hasMany('App.QuickLinks'),
   quickLinks: DS.hasMany('App.QuickLinks'),
-  components: DS.hasMany('App.Component'),
   hostComponents: DS.hasMany('App.HostComponent'),
   hostComponents: DS.hasMany('App.HostComponent'),
   isStartDisabled: function () {
   isStartDisabled: function () {
     return !(this.get('healthStatus') == 'red');
     return !(this.get('healthStatus') == 'red');
@@ -39,11 +38,11 @@ App.Service = DS.Model.extend({
 
 
   healthStatus: function () {
   healthStatus: function () {
     var components = this.get('hostComponents').filterProperty('isMaster', true);
     var components = this.get('hostComponents').filterProperty('isMaster', true);
-    if (components.everyProperty('workStatus', App.HostComponent.Status.started)) {
+    if (components.everyProperty('workStatus', App.HostComponentStatus.started)) {
       return 'green';
       return 'green';
-    } else if (components.someProperty('workStatus', App.HostComponent.Status.starting)) {
+    } else if (components.someProperty('workStatus', App.HostComponentStatus.starting)) {
       return 'green-blinking';
       return 'green-blinking';
-    } else if (components.someProperty('workStatus', App.HostComponent.Status.stopped)) {
+    } else if (components.someProperty('workStatus', App.HostComponentStatus.stopped)) {
       return 'red';
       return 'red';
     } else {
     } else {
       return 'red-blinking';
       return 'red-blinking';
@@ -51,20 +50,20 @@ App.Service = DS.Model.extend({
   }.property('hostComponents.@each.workStatus'),
   }.property('hostComponents.@each.workStatus'),
 
 
   isStopped: function () {
   isStopped: function () {
-    var components = this.get('components');
+    var components = this.get('hostComponents');
     var flag = true;
     var flag = true;
     components.forEach(function (_component) {
     components.forEach(function (_component) {
-      if (_component.get('workStatus') !== App.Component.Status.stopped && _component.get('workStatus') !== App.Component.Status.install_failed) {
+      if (_component.get('workStatus') !== App.HostComponentStatus.stopped && _component.get('workStatus') !== App.HostComponentStatus.install_failed) {
         flag = false;
         flag = false;
       }
       }
     }, this);
     }, this);
     return flag;
     return flag;
-  }.property('components.@each.workStatus'),
+  }.property('hostComponents.@each.workStatus'),
 
 
   isStarted: function () {
   isStarted: function () {
-    var components = this.get('components').filterProperty('isMaster', true);
-    return components.everyProperty('workStatus', App.Component.Status.started);
-  }.property('components.@each.workStatus'),
+    var components = this.get('hostComponents').filterProperty('isMaster', true);
+    return components.everyProperty('workStatus', App.HostComponentStatus.started);
+  }.property('hostComponents.@each.workStatus'),
   isMaintained: function () {
   isMaintained: function () {
     var maintainedServices = [
     var maintainedServices = [
       "HDFS",
       "HDFS",

+ 9 - 0
ambari-web/app/styles/application.less

@@ -286,6 +286,15 @@ h1 {
     .java-home {
     .java-home {
       margin-bottom: 10px
       margin-bottom: 10px
     }
     }
+    .ssh-key-input {
+      padding-left: 18px;
+    }
+    .ssh-key-input-indentation {
+      margin-bottom: 5px;
+    }
+    input[type="radio"]:focus {
+      outline: none;
+    }
   }
   }
   #confirm-hosts {
   #confirm-hosts {
     #host-filter {
     #host-filter {

+ 1 - 1
ambari-web/app/templates/main/service/info/summary.hbs

@@ -47,7 +47,7 @@
       {{#unless view.serviceStatus.mapreduce}}
       {{#unless view.serviceStatus.mapreduce}}
       {{#unless view.serviceStatus.hbase}}
       {{#unless view.serviceStatus.hbase}}
       {{#unless view.serviceStatus.ganglia}}
       {{#unless view.serviceStatus.ganglia}}
-      {{#each component in controller.content.components}}
+      {{#each component in controller.content.hostComponents}}
         <tr>
         <tr>
           {{#if component.isMaster}}
           {{#if component.isMaster}}
             <td class="summary-label">{{component.displayName}}</td>
             <td class="summary-label">{{component.displayName}}</td>

+ 1 - 1
ambari-web/app/templates/main/service/info/summary/ganglia.hbs

@@ -15,7 +15,7 @@
 * See the License for the specific language governing permissions and
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * limitations under the License.
 }}
 }}
-{{#each component in controller.content.components}}
+{{#each component in controller.content.hostComponents}}
   {{#if component.isMaster}}
   {{#if component.isMaster}}
     <tr>
     <tr>
         <td class="summary-label">{{component.displayName}}</td>
         <td class="summary-label">{{component.displayName}}</td>

+ 1 - 1
ambari-web/app/templates/main/service/info/summary/oozie.hbs

@@ -16,7 +16,7 @@
 * limitations under the License.
 * limitations under the License.
 }}
 }}
 
 
-{{#each component in controller.content.components}}
+{{#each component in controller.content.hostComponents}}
   {{#if component.isMaster}}
   {{#if component.isMaster}}
     <tr>
     <tr>
         <td class="summary-label">Server</td>
         <td class="summary-label">Server</td>

+ 1 - 1
ambari-web/app/templates/main/service/item.hbs

@@ -28,7 +28,7 @@
     <ul class="dropdown-menu">
     <ul class="dropdown-menu">
       <!-- dropdown menu links -->
       <!-- dropdown menu links -->
       {{#each option in view.maintenance}}
       {{#each option in view.maintenance}}
-      <li>
+      <li {{bindAttr class="controller.content.isStopDisabled:disabled"}}>
         <a {{action "doAction" option.action target="controller" href=true}}>{{option.label}}</a>
         <a {{action "doAction" option.action target="controller" href=true}}>{{option.label}}</a>
       </li>
       </li>
       {{/each}}
       {{/each}}

+ 23 - 29
ambari-web/app/templates/wizard/step2.hbs

@@ -33,19 +33,6 @@
         </a>
         </a>
       </p>
       </p>
 
 
-      {{#if view.parentView.controller.hideBackButton}}
-        {{#if view.hostsInfo.oldHostNames }}
-          <p class="alert alert-info">
-            {{t hosts.add.step2.warning}}
-            <br/>
-            {{{view.hostsInfo.oldHostNames}}}
-              {{#if view.hostsInfo.showMoreHostsText}}
-                <a href="" {{action "showMoreHosts" target="view"}}>{{view.hostsInfo.showMoreHostsText}}</a>
-              {{/if}}
-          </p>
-        {{/if}}
-      {{/if}}
-
       <div class="controls">
       <div class="controls">
         {{view Ember.TextArea class="span6" valueBinding="content.installOptions.hostNames" rows="5" placeholder="host names"}}
         {{view Ember.TextArea class="span6" valueBinding="content.installOptions.hostNames" rows="5" placeholder="host names"}}
         {{#if hostsError}}
         {{#if hostsError}}
@@ -59,30 +46,38 @@
     <div class="ambari-agents">
     <div class="ambari-agents">
       <h5>{{t installer.step2.sshKey}}</h5>
       <h5>{{t installer.step2.sshKey}}</h5>
 
 
-      <label class="checkbox">
-        {{view Ember.Checkbox checkedBinding="content.installOptions.useSsh"}}
+      <label class="radio">
+        {{view view.providingSSHKeyRadioButton}}
         {{t installer.step2.useSsh.provide}}
         {{t installer.step2.useSsh.provide}}
           <a href="javascript:void(null)"
           <a href="javascript:void(null)"
              rel="popover"
              rel="popover"
             {{translateAttr title="installer.step2.useSsh.tooltip.title" data-content="installer.step2.useSsh.tooltip.content"}}>
             {{translateAttr title="installer.step2.useSsh.tooltip.title" data-content="installer.step2.useSsh.tooltip.content"}}>
-              {{t installer.step2.useSsh.tooltip.title}}</a>
-          {{t installer.step2.useSsh.provide_id_rsa}}
+            {{t installer.step2.useSsh.tooltip.title}}</a>
+        {{t installer.step2.useSsh.provide_id_rsa}}
       </label>
       </label>
-
-      <div {{bindAttr class="sshKeyError:error :control-group"}}>
+      <div {{bindAttr class="sshKeyError:error :control-group :ssh-key-input"}}>
         {{#if view.isFileApi}}
         {{#if view.isFileApi}}
-          {{view App.SshKeyFileUploader}}
-          <pre {{bindAttr class="view.sshKeyPreviewClass"}}>{{content.installOptions.sshKey}}</pre>
+          {{view App.SshKeyFileUploader disabledBinding="view.sshKeyState"}}
         {{/if}}
         {{/if}}
-        <div class="controls">
-          {{view Ember.TextArea class="span6" rows="4" classBinding="view.sshKeyClass"  id="sshKey"
-          placeholder="ssh private key" disabledBinding="view.sshKeyState" valueBinding="content.installOptions.sshKey"}}
-          {{#if sshKeyError}}
-          <span class="help-inline">{{sshKeyError}}</span>
-          {{/if}}
-        </div>
+          <div class="controls">
+            {{view Ember.TextArea class="span6" rows="3" id="sshKey"
+            placeholder="ssh private key" disabledBinding="view.sshKeyState" valueBinding="content.installOptions.sshKey"}}
+            {{#if sshKeyError}}
+                <span class="help-inline">{{sshKeyError}}</span>
+            {{/if}}
+          </div>
       </div>
       </div>
 
 
+      <label class="radio">
+        {{view view.manualRegistrationRadioButton}}
+        {{t installer.step2.manualInstall.perform}}
+          <a href="javascript:void(null)"
+             rel="popover"
+            {{translateAttr title="installer.step2.manualInstall.tooltip.title" data-content="installer.step2.manualInstall.tooltip.content"}}>
+            {{t installer.step2.manualInstall.tooltip.title}}</a>
+        {{t installer.step2.manualInstall.perform_on_hosts}}
+      </label>
+
     </div>
     </div>
   </div>
   </div>
 
 
@@ -109,7 +104,6 @@
            rel="popover"
            rel="popover"
           {{translateAttr title="installer.step2.javaHome.tooltip.title" data-content="installer.step2.javaHome.tooltip.content"}}>
           {{translateAttr title="installer.step2.javaHome.tooltip.title" data-content="installer.step2.javaHome.tooltip.content"}}>
             {{t installer.step2.javaHome.tooltip.title}}</a>
             {{t installer.step2.javaHome.tooltip.title}}</a>
-        {{t installer.step2.javaHome.label2}}
       </div>
       </div>
       {{view App.WizardTextField valueBinding="content.installOptions.javaHome" placeholder="/usr/jdk/jdk1.6.0_31"}}
       {{view App.WizardTextField valueBinding="content.installOptions.javaHome" placeholder="/usr/jdk/jdk1.6.0_31"}}
     </label>
     </label>

+ 55 - 0
ambari-web/app/utils/component.js

@@ -0,0 +1,55 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Here will be stored slave functions related to components
+ * @type {Object}
+ */
+module.exports = {
+
+  /**
+   * Return list of installed components. Syntax is:
+   *
+   * [{
+   *    id : 'DATANODE',
+   *    displayName : 'DataNode',
+   *    isMaster : true,
+   *    isSlave : false,
+   *    isClient : false
+   * }]
+   *
+   */
+  getInstalledComponents : function(){
+    var components = App.HostComponent.find();
+    var names = components.mapProperty('componentName').uniq();
+    var result = [];
+
+    names.forEach(function(componentName){
+      var component = components.findProperty('componentName', componentName);
+      result.push(Ember.Object.create({
+        id: componentName,
+        isMaster: component.get('isMaster'),
+        isSlave: component.get('isSlave'),
+        isClient: !component.get('isMaster') && !component.get('isSlave'),
+        displayName: component.get('displayName')
+      }));
+    });
+
+    return result;
+  }
+};

+ 4 - 4
ambari-web/app/views/common/quick_view_link_view.js

@@ -25,15 +25,15 @@ App.QuickViewLinks = Em.View.extend({
    */
    */
   quickLinks:function () {
   quickLinks:function () {
     var serviceName = this.get('content.serviceName');
     var serviceName = this.get('content.serviceName');
-    var components = this.get('content.components');
+    var components = this.get('content.hostComponents');
     var host;
     var host;
 
 
     if (serviceName === 'HDFS') {
     if (serviceName === 'HDFS') {
-      host = components.filterProperty('id', 'NAMENODE').objectAt(0).get('host.publicHostName');
+      host = components.findProperty('componentName', 'NAMENODE').get('host.publicHostName');
     } else if (serviceName === 'MAPREDUCE') {
     } else if (serviceName === 'MAPREDUCE') {
-      host = components.filterProperty('id', 'JOBTRACKER').objectAt(0).get('host.publicHostName');
+      host = components.findProperty('componentName', 'JOBTRACKER').get('host.publicHostName');
     } else if (serviceName === 'HBASE') {
     } else if (serviceName === 'HBASE') {
-      host = components.filterProperty('id', 'HBASE_MASTER').objectAt(0).get('host.publicHostName');
+      host = components.findProperty('componentName', 'HBASE_MASTER').get('host.publicHostName');
     }
     }
     if (!host) {
     if (!host) {
       return [];
       return [];

+ 1 - 1
ambari-web/app/views/main/dashboard/service/hbase.js

@@ -82,7 +82,7 @@ App.MainDashboardServiceHbaseView = App.MainDashboardServiceView.extend({
   }.property("service.masterActiveTime"),
   }.property("service.masterActiveTime"),
 
 
   regionServerComponent: function () {
   regionServerComponent: function () {
-    return App.Component.find().findProperty('componentName', 'HBASE_REGIONSERVER');
+    return App.HostComponent.find().findProperty('componentName', 'HBASE_REGIONSERVER');
   }.property('components'),
   }.property('components'),
 
 
   isCollapsed: false,
   isCollapsed: false,

+ 1 - 1
ambari-web/app/views/main/dashboard/service/hdfs.js

@@ -109,7 +109,7 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
   }.property('service.capacityUsed', 'service.capacityTotal'),
   }.property('service.capacityUsed', 'service.capacityTotal'),
 
 
   dataNodeComponent: function () {
   dataNodeComponent: function () {
-    return App.Component.find().findProperty('componentName', 'DATANODE');
+    return App.HostComponent.find().findProperty('componentName', 'DATANODE');
   }.property('+'),
   }.property('+'),
 
 
   isCollapsed: false,
   isCollapsed: false,

+ 1 - 1
ambari-web/app/views/main/dashboard/service/mapreduce.js

@@ -117,7 +117,7 @@ App.MainDashboardServiceMapreduceView = App.MainDashboardServiceView.extend({
   }.property('service.mapSlots', 'service.reduceSlots', 'service.aliveTrackers'),
   }.property('service.mapSlots', 'service.reduceSlots', 'service.aliveTrackers'),
 
 
   taskTrackerComponent: function () {
   taskTrackerComponent: function () {
-    return App.Component.find().findProperty('componentName', 'TASKTRACKER');
+    return App.HostComponent.find().findProperty('componentName', 'TASKTRACKER');
   }.property('components'),
   }.property('components'),
 
 
   isCollapsed: false,
   isCollapsed: false,

+ 16 - 40
ambari-web/app/views/main/host.js

@@ -68,8 +68,7 @@ App.MainHostView = Em.View.extend({
     content:null,
     content:null,
 
 
     shortLabels: function() {
     shortLabels: function() {
-      var components = this.get('labels');
-      var labels = this.get('content.components').getEach('displayName');
+      var labels = this.get('content.hostComponents').getEach('displayName');
       var shortLabels = '';
       var shortLabels = '';
       var c = 0;
       var c = 0;
       labels.forEach(function(label) {
       labels.forEach(function(label) {
@@ -88,8 +87,8 @@ App.MainHostView = Em.View.extend({
     }.property('labels'),
     }.property('labels'),
 
 
     labels: function(){
     labels: function(){
-      return this.get('content.components').getEach('displayName').join('\n');
-    }.property('content.components.@each'),
+      return this.get('content.hostComponents').getEach('displayName').join('\n');
+    }.property('content.hostComponents.@each'),
 
 
     usageStyle:function () {
     usageStyle:function () {
       return "width:" + this.get('content.diskUsage') + "%";
       return "width:" + this.get('content.diskUsage') + "%";
@@ -198,57 +197,37 @@ App.MainHostView = Em.View.extend({
 
 
     allComponentsChecked:false,
     allComponentsChecked:false,
     toggleAllComponents:function () {
     toggleAllComponents:function () {
-      this.set('masterComponentsChecked', this.get('allComponentsChecked'));
-      this.set('slaveComponentsChecked', this.get('allComponentsChecked'));
-      this.set('clientComponentsChecked', this.get('allComponentsChecked'));
+      var checked = this.get('allComponentsChecked');
+      this.set('masterComponentsChecked', checked);
+      this.set('slaveComponentsChecked', checked);
+      this.set('clientComponentsChecked', checked);
     }.observes('allComponentsChecked'),
     }.observes('allComponentsChecked'),
 
 
     masterComponentsChecked:false,
     masterComponentsChecked:false,
     toggleMasterComponents:function () {
     toggleMasterComponents:function () {
-      var checked = this.get('masterComponentsChecked');
-      this.get('masterComponents').forEach(function (comp) {
-        comp.set('checkedForHostFilter', checked);
-      });
+      this.get('masterComponents').setEach('checkedForHostFilter', this.get('masterComponentsChecked'));
     }.observes('masterComponentsChecked'),
     }.observes('masterComponentsChecked'),
 
 
     slaveComponentsChecked:false,
     slaveComponentsChecked:false,
     toggleSlaveComponents:function () {
     toggleSlaveComponents:function () {
-      var checked = this.get('slaveComponentsChecked');
-      this.get('slaveComponents').forEach(function (comp) {
-        comp.set('checkedForHostFilter', checked);
-      });
+      this.get('slaveComponents').setEach('checkedForHostFilter', this.get('slaveComponentsChecked'));
     }.observes('slaveComponentsChecked'),
     }.observes('slaveComponentsChecked'),
 
 
     clientComponentsChecked: false,
     clientComponentsChecked: false,
     toggleClientComponents: function() {
     toggleClientComponents: function() {
-      var checked = this.get('clientComponentsChecked');
-      this.get('clientComponents').forEach(function(comp) {
-        comp.set('checkedForHostFilter', checked);
-      });
+      this.get('clientComponents').setEach('checkedForHostFilter', this.get('clientComponentsChecked'));
     }.observes('clientComponentsChecked'),
     }.observes('clientComponentsChecked'),
 
 
     masterComponents:function(){
     masterComponents:function(){
-      var masterComponents = [];
-      for(var i = 0; i < this.get('parentView').get('controller.masterComponents').length; i++) {
-        masterComponents.push(this.get('parentView').get('controller.masterComponents')[i]);
-      }
-      return masterComponents;
+      return this.get('parentView.controller.masterComponents');
     }.property('parentView.controller.masterComponents'),
     }.property('parentView.controller.masterComponents'),
 
 
     slaveComponents:function(){
     slaveComponents:function(){
-      var slaveComponents = [];
-      for(var i = 0; i < this.get('parentView').get('controller.slaveComponents').length; i++) {
-        slaveComponents.push(this.get('parentView').get('controller.slaveComponents')[i]);
-      }
-      return slaveComponents;
+      return this.get('parentView.controller.slaveComponents');
     }.property('parentView.controller.slaveComponents'),
     }.property('parentView.controller.slaveComponents'),
 
 
     clientComponents: function() {
     clientComponents: function() {
-      var clientComponents = [];
-      for (var i = 0; i < this.get('parentView').get('controller.clientComponents').length; i++) {
-        clientComponents.push(this.get('parentView').get('controller.clientComponents')[i]);
-      }
-      return clientComponents;
+      return this.get('parentView.controller.clientComponents');
     }.property('parentView.controller.clientComponents'),
     }.property('parentView.controller.clientComponents'),
 
 
     template: Ember.Handlebars.compile('<div {{bindAttr class="view.btnGroupClass"}} >'+
     template: Ember.Handlebars.compile('<div {{bindAttr class="view.btnGroupClass"}} >'+
@@ -335,12 +314,6 @@ App.MainHostView = Em.View.extend({
       var self = this;
       var self = this;
       this.set('isFilterOpen', !this.get('isFilterOpen'));
       this.set('isFilterOpen', !this.get('isFilterOpen'));
       if (this.get('isFilterOpen')) {
       if (this.get('isFilterOpen')) {
-        var filters = App.router.get('mainHostController.filters.components');
-        $('.filter-component').each(function() {
-          var componentId = parseInt($(this).attr('id').replace('component-', ''));
-          var index = filters.indexOf(componentId);
-          $(this).attr('checked', index == -1);
-        });
 
 
         var dropDown = $('#filter-dropdown');
         var dropDown = $('#filter-dropdown');
         var firstClick = true;
         var firstClick = true;
@@ -358,6 +331,9 @@ App.MainHostView = Em.View.extend({
       if (this.get('controller.comeWithFilter')) {
       if (this.get('controller.comeWithFilter')) {
         this.applyFilter();
         this.applyFilter();
         this.closeFilters();
         this.closeFilters();
+        this.set('controller.comeWithFilter', false);
+      } else {
+        this.clearFilter(this);
       }
       }
     },
     },
 
 

+ 8 - 8
ambari-web/app/views/main/host/summary.js

@@ -93,7 +93,7 @@ App.MainHostSummaryView = Em.View.extend({
   sortedComponents: function() {
   sortedComponents: function() {
     var slaveComponents = [];
     var slaveComponents = [];
     var masterComponents = [];
     var masterComponents = [];
-    this.get('content.components').forEach(function(component){
+    this.get('content.hostComponents').forEach(function(component){
       if(component.get('isMaster')){
       if(component.get('isMaster')){
         masterComponents.push(component);
         masterComponents.push(component);
       } else if(component.get('isSlave')) {
       } else if(component.get('isSlave')) {
@@ -104,7 +104,7 @@ App.MainHostSummaryView = Em.View.extend({
   }.property('content'),
   }.property('content'),
   clients: function(){
   clients: function(){
     var clients = [];
     var clients = [];
-    this.get('content.components').forEach(function(component){
+    this.get('content.hostComponents').forEach(function(component){
       if(!component.get('componentName')){
       if(!component.get('componentName')){
         //temporary fix because of different data in hostComponents and serviceComponents
         //temporary fix because of different data in hostComponents and serviceComponents
         return;
         return;
@@ -152,14 +152,14 @@ App.MainHostSummaryView = Em.View.extend({
           return 'health-status-DEAD-ORANGE';
           return 'health-status-DEAD-ORANGE';
         }
         }
       }
       }
-      return 'health-status-' + App.Component.Status.getKeyName(this.get('workStatus'));
-    }.property('workStatus'),
+      return 'health-status-' + App.HostComponentStatus.getKeyName(this.get('workStatus'));
+    }.property('workStatus', 'isDataNodeRecommissionAvailable'),
     /**
     /**
      * Disable element while component is starting/stopping
      * Disable element while component is starting/stopping
      */
      */
     disabledClass:function(){
     disabledClass:function(){
       var workStatus = this.get('workStatus');
       var workStatus = this.get('workStatus');
-      if([App.Component.Status.starting, App.Component.Status.stopping].contains(workStatus) ){
+      if([App.HostComponentStatus.starting, App.HostComponentStatus.stopping].contains(workStatus) ){
         return 'disabled';
         return 'disabled';
       } else {
       } else {
         return '';
         return '';
@@ -171,7 +171,7 @@ App.MainHostSummaryView = Em.View.extend({
     doBlinking : function(){
     doBlinking : function(){
       var workStatus = this.get('workStatus');
       var workStatus = this.get('workStatus');
       var self = this;
       var self = this;
-      var pulsate = [ App.Component.Status.starting, App.Component.Status.stopping ].contains(workStatus);
+      var pulsate = [ App.HostComponentStatus.starting, App.HostComponentStatus.stopping ].contains(workStatus);
       if (!pulsate && this.get('isDataNode')) {
       if (!pulsate && this.get('isDataNode')) {
         var dataNodeComponent = this.get('content');
         var dataNodeComponent = this.get('content');
         if (dataNodeComponent)
         if (dataNodeComponent)
@@ -193,11 +193,11 @@ App.MainHostSummaryView = Em.View.extend({
     }.observes('workStatus'),
     }.observes('workStatus'),
 
 
     isStart : function() {
     isStart : function() {
-      return (this.get('workStatus') === App.Component.Status.started || this.get('workStatus') === App.Component.Status.starting);
+      return (this.get('workStatus') === App.HostComponentStatus.started || this.get('workStatus') === App.HostComponentStatus.starting);
     }.property('workStatus'),
     }.property('workStatus'),
 
 
     isInProgress : function() {
     isInProgress : function() {
-      return (this.get('workStatus') === App.Component.Status.stopping || this.get('workStatus') === App.Component.Status.starting);
+      return (this.get('workStatus') === App.HostComponentStatus.stopping || this.get('workStatus') === App.HostComponentStatus.starting);
     }.property('workStatus'),
     }.property('workStatus'),
     /**
     /**
      * Shows whether we need to show Decommision/Recomission buttons
      * Shows whether we need to show Decommision/Recomission buttons

+ 7 - 7
ambari-web/app/views/main/service/info/summary.js

@@ -142,7 +142,7 @@ App.MainServiceInfoSummaryView = Em.View.extend({
   monitorsObj: function(){
   monitorsObj: function(){
     var service = this.get('controller.content');
     var service = this.get('controller.content');
     if (service.get("id") == "GANGLIA") {
     if (service.get("id") == "GANGLIA") {
-      var monitors = service.get('components').filterProperty('isMaster', false);
+      var monitors = service.get('hostComponents').filterProperty('isMaster', false);
       if (monitors.length) {
       if (monitors.length) {
         return monitors[0];
         return monitors[0];
       }
       }
@@ -157,7 +157,7 @@ App.MainServiceInfoSummaryView = Em.View.extend({
   serversHost: function() {
   serversHost: function() {
     var service = this.get('controller.content');
     var service = this.get('controller.content');
     if (service.get("id") == "ZOOKEEPER") {
     if (service.get("id") == "ZOOKEEPER") {
-      var servers = service.get('components').filterProperty('isMaster');
+      var servers = service.get('hostComponents').filterProperty('isMaster');
       if (servers.length > 0) {
       if (servers.length > 0) {
         return servers[0];
         return servers[0];
       }
       }
@@ -172,7 +172,7 @@ App.MainServiceInfoSummaryView = Em.View.extend({
   clientObj: function() {
   clientObj: function() {
     var service = this.get('controller.content');
     var service = this.get('controller.content');
     if (service.get("id") == "OOZIE" || service.get("id") == "ZOOKEEPER") {
     if (service.get("id") == "OOZIE" || service.get("id") == "ZOOKEEPER") {
-      var clients = service.get('components').filterProperty('isMaster', false);
+      var clients = service.get('hostComponents').filterProperty('isMaster', false);
       if (clients.length > 0) {
       if (clients.length > 0) {
         return clients[0];
         return clients[0];
       }
       }
@@ -190,7 +190,7 @@ App.MainServiceInfoSummaryView = Em.View.extend({
   gangliaServer:function(){
   gangliaServer:function(){
     var service=this.get('controller.content');
     var service=this.get('controller.content');
     if(service.get("id") == "GANGLIA"){
     if(service.get("id") == "GANGLIA"){
-      return service.get("components").findProperty('isMaster', true).get("host").get("publicHostName");
+      return service.get("hostComponents").findProperty('isMaster', true).get("host").get("publicHostName");
     }else{
     }else{
       return "";
       return "";
     }
     }
@@ -198,7 +198,7 @@ App.MainServiceInfoSummaryView = Em.View.extend({
   nagiosServer:function(){
   nagiosServer:function(){
     var service=this.get('controller.content');
     var service=this.get('controller.content');
     if(service.get("id") == "NAGIOS"){
     if(service.get("id") == "NAGIOS"){
-      return service.get("components").findProperty('isMaster', true).get("host").get("publicHostName");
+      return service.get("hostComponents").findProperty('isMaster', true).get("host").get("publicHostName");
     }else{
     }else{
       return "";
       return "";
     }
     }
@@ -206,7 +206,7 @@ App.MainServiceInfoSummaryView = Em.View.extend({
   oozieServer:function(){
   oozieServer:function(){
     var service=this.get('controller.content');
     var service=this.get('controller.content');
     if(service.get("id") == "OOZIE"){
     if(service.get("id") == "OOZIE"){
-      return service.get("components").findProperty('isMaster', true).get("host").get("publicHostName");
+      return service.get("hostComponents").findProperty('isMaster', true).get("host").get("publicHostName");
     }else{
     }else{
       return "";
       return "";
     }
     }
@@ -224,7 +224,7 @@ App.MainServiceInfoSummaryView = Em.View.extend({
     var service=this.get('controller.content');
     var service=this.get('controller.content');
     if(service.get("id") == "HIVE"){
     if(service.get("id") == "HIVE"){
       var self = this;
       var self = this;
-      var components = service.get("components");
+      var components = service.get("hostComponents");
       if(components){
       if(components){
         components.forEach(function(component){
         components.forEach(function(component){
           var ci = {
           var ci = {

+ 32 - 73
ambari-web/app/views/wizard/step2_view.js

@@ -20,7 +20,8 @@
 var App = require('app');
 var App = require('app');
 
 
 App.SshKeyFileUploader = Ember.View.extend({
 App.SshKeyFileUploader = Ember.View.extend({
-  template:Ember.Handlebars.compile('<input type="file" />'),
+  template:Ember.Handlebars.compile('<input type="file" {{bindAttr disabled="view.disabled"}} />'),
+  classNames: ['ssh-key-input-indentation'],
 
 
   change: function (e) {
   change: function (e) {
     var self=this;
     var self=this;
@@ -61,62 +62,9 @@ App.WizardStep2View = Em.View.extend({
     this.set('controller.sshKeyError',null);
     this.set('controller.sshKeyError',null);
     this.loadHostsInfo();
     this.loadHostsInfo();
   },
   },
-  /**
-   * Config for displaying more hosts
-   * if oldHosts.length more than config.count that configuration will be applied
-   */
-  hostDisplayConfig: [
-    {
-      count: 0,
-      delimitery: '<br/>',
-      popupDelimitery: '<br />'
-    },
-    {
-      count: 10,
-      delimitery: ', ',
-      popupDelimitery: '<br />'
-    },
-    {
-      count: 50,
-      delimitery: ', ',
-      popupDelimitery: ', '
-    }
-  ],
-  showMoreHosts: function () {
-    var self = this;
-    App.ModalPopup.show({
-      header: "Hosts are already part of the cluster and will be ignored",
-      body: self.get('hostsInfo.oldHostNamesMore'),
-      encodeBody: false,
-      onPrimary: function () {
-        this.hide();
-      },
-      secondary: null
-    });
-  },
-  loadHostsInfo: function(){
 
 
+  loadHostsInfo: function(){
     var hostsInfo = Em.Object.create();
     var hostsInfo = Em.Object.create();
-
-    var oldHostNames = App.Host.find().getEach('id');
-    var k = 10;
-
-    var usedConfig = false;
-    this.get('hostDisplayConfig').forEach(function (config) {
-      if (oldHostNames.length > config.count) {
-        usedConfig = config;
-      }
-    });
-
-    k = usedConfig.count ? usedConfig.count : oldHostNames.length;
-    var displayedHostNames = oldHostNames.slice(0, k);
-    hostsInfo.set('oldHostNames', displayedHostNames.join(usedConfig.delimitery));
-    if (usedConfig.count) {
-      var moreHostNames = oldHostNames.slice(k + 1);
-      hostsInfo.set('oldHostNamesMore', moreHostNames.join(usedConfig.popupDelimitery));
-      hostsInfo.set('showMoreHostsText', "...and %@ more".fmt(moreHostNames.length));
-    }
-
     this.set('hostsInfo', hostsInfo);
     this.set('hostsInfo', hostsInfo);
   },
   },
 
 
@@ -132,26 +80,10 @@ App.WizardStep2View = Em.View.extend({
     return this.get("controller.content.installOptions.manualInstall");
     return this.get("controller.content.installOptions.manualInstall");
   }.property("controller.content.installOptions.manualInstall"),
   }.property("controller.content.installOptions.manualInstall"),
 
 
-  sshKeyClass:function() {
-    return (this.get("isFileApi")) ? "hide" : "" ;
-  }.property("isFileApi"),
-
   isFileApi: function () {
   isFileApi: function () {
     return (window.File && window.FileReader && window.FileList) ? true : false ;
     return (window.File && window.FileReader && window.FileList) ? true : false ;
   }.property(),
   }.property(),
 
 
-  sshKeyPreviewClass: function() {
-    if (this.get('controller.content.installOptions.sshKey').trim() != '') {
-      if (this.get('controller.content.installOptions.manualInstall')) {
-        return 'sshKey-file-view disabled';
-      } else {
-        return 'sshKey-file-view';
-      }
-    } else {
-      return 'hidden';
-    }
-  }.property('controller.content.installOptions.sshKey', 'controller.content.installOptions.manualInstall'),
-
   manualInstallPopup: function(){
   manualInstallPopup: function(){
     if(!this.get('controller.content.installOptions.useSsh')){
     if(!this.get('controller.content.installOptions.useSsh')){
       App.ModalPopup.show({
       App.ModalPopup.show({
@@ -165,8 +97,35 @@ App.WizardStep2View = Em.View.extend({
       });
       });
     }
     }
     this.set('controller.content.installOptions.manualInstall', !this.get('controller.content.installOptions.useSsh'));
     this.set('controller.content.installOptions.manualInstall', !this.get('controller.content.installOptions.useSsh'));
-  }.observes('controller.content.installOptions.useSsh')
-
+  }.observes('controller.content.installOptions.useSsh'),
+
+  providingSSHKeyRadioButton: Ember.Checkbox.extend({
+    tagName: 'input',
+    attributeBindings: ['type', 'checked'],
+    checked: function () {
+      return this.get('controller.content.installOptions.useSsh');
+    }.property('controller.content.installOptions.useSsh'),
+    type: 'radio',
+
+    click: function () {
+      this.set('controller.content.installOptions.useSsh', true);
+      this.set('controller.content.installOptions.manualInstall', false);
+    }
+  }),
+
+  manualRegistrationRadioButton: Ember.Checkbox.extend({
+    tagName: 'input',
+    attributeBindings: ['type', 'checked'],
+    checked: function () {
+      return this.get('controller.content.installOptions.manualInstall');
+    }.property('controller.content.installOptions.manualInstall'),
+    type: 'radio',
+
+    click: function () {
+      this.set('controller.content.installOptions.manualInstall', true);
+      this.set('controller.content.installOptions.useSsh', false);
+    }
+  })
 });
 });