Browse Source

AMBARI-6081 Add host name property to HostComponent model. (atkach)

atkach 11 years ago
parent
commit
7b9ec36ad0
36 changed files with 82 additions and 71 deletions
  1. 1 1
      ambari-web/app/controllers/main/admin/security/add/step2.js
  2. 1 1
      ambari-web/app/controllers/main/admin/security/add/step4.js
  3. 1 1
      ambari-web/app/controllers/main/admin/security/security_progress_controller.js
  4. 1 1
      ambari-web/app/controllers/main/host/details.js
  5. 1 1
      ambari-web/app/controllers/main/jobs_controller.js
  6. 3 3
      ambari-web/app/controllers/main/mirroring_controller.js
  7. 1 1
      ambari-web/app/controllers/main/service/info/configs.js
  8. 1 1
      ambari-web/app/controllers/main/service/info/summary.js
  9. 1 1
      ambari-web/app/controllers/main/service/reassign_controller.js
  10. 2 2
      ambari-web/app/controllers/wizard.js
  11. 1 1
      ambari-web/app/controllers/wizard/step8_controller.js
  12. 1 0
      ambari-web/app/mappers/component_config_mapper.js
  13. 3 1
      ambari-web/app/mappers/hosts_mapper.js
  14. 11 19
      ambari-web/app/mappers/service_metrics_mapper.js
  15. 2 2
      ambari-web/app/mixins/main/host/details/host_components/decommissionable.js
  16. 3 2
      ambari-web/app/models/host_component.js
  17. 1 0
      ambari-web/app/models/service/flume.js
  18. 3 1
      ambari-web/app/models/service/hbase.js
  19. 10 6
      ambari-web/app/models/service/hdfs.js
  20. 9 5
      ambari-web/app/models/service/mapreduce.js
  21. 3 1
      ambari-web/app/models/service/mapreduce2.js
  22. 6 4
      ambari-web/app/models/service/yarn.js
  23. 1 1
      ambari-web/app/routes/reassign_master_routes.js
  24. 1 1
      ambari-web/app/templates/main/service/services/flume.hbs
  25. 1 1
      ambari-web/app/utils/batch_scheduled_requests.js
  26. 3 3
      ambari-web/app/utils/jobs.js
  27. 1 1
      ambari-web/app/views/common/chart/linear_time.js
  28. 1 1
      ambari-web/app/views/main/admin/rollbackHA/step1_view.js
  29. 1 1
      ambari-web/app/views/main/admin/rollbackHA/step2_view.js
  30. 1 1
      ambari-web/app/views/main/host/details/host_component_views/datanode_view.js
  31. 1 1
      ambari-web/app/views/main/host/details/host_component_views/nodemanager_view.js
  32. 1 1
      ambari-web/app/views/main/host/details/host_component_views/regionserver_view.js
  33. 1 1
      ambari-web/app/views/main/host/details/host_component_views/tasktracker_view.js
  34. 1 1
      ambari-web/app/views/main/jobs/hive_job_details_view.js
  35. 1 1
      ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graphs.js
  36. 1 1
      ambari-web/app/views/main/service/services/flume.js

+ 1 - 1
ambari-web/app/controllers/main/admin/security/add/step2.js

@@ -280,7 +280,7 @@ App.MainAdminSecurityAddStep2Controller = Em.Controller.extend({
           .filter(function (component) {
             return componentNames.contains(component.get('componentName'));
           })
-          .mapProperty('host.hostName')
+          .mapProperty('hostName')
           .uniq();
         return true;
       }

+ 1 - 1
ambari-web/app/controllers/main/admin/security/add/step4.js

@@ -360,7 +360,7 @@ App.MainAdminSecurityAddStep4Controller = App.MainAdminSecurityProgressControlle
     if (service.get('isLoaded') && isServiceSecure) {
       var hostComponent = service.get('hostComponents').findProperty('componentName', componentName);
       if (hostComponent) {
-        var hostName = hostComponent.get('host.hostName');
+        var hostName = hostComponent.get('hostName');
         this.get('globalProperties').push({
           id: 'puppet var',
           name: configName,

+ 1 - 1
ambari-web/app/controllers/main/admin/security/security_progress_controller.js

@@ -172,7 +172,7 @@ App.MainAdminSecurityProgressController = Em.Controller.extend({
             command.set('isSuccess', true);
           } else {
             var timeLineServer = App.HostComponent.find().findProperty('componentName', 'APP_TIMELINE_SERVER');
-            this.deleteComponents('APP_TIMELINE_SERVER', timeLineServer.get('host.hostName'));
+            this.deleteComponents('APP_TIMELINE_SERVER', timeLineServer.get('hostName'));
           }
         }
         return true;

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

@@ -827,7 +827,7 @@ App.MainHostDetailsController = Em.Controller.extend({
    * @method getZkServerHosts
    */
   getZkServerHosts: function () {
-    var zks = App.HostComponent.find().filterProperty('componentName', 'ZOOKEEPER_SERVER').mapProperty('host.hostName');
+    var zks = App.HostComponent.find().filterProperty('componentName', 'ZOOKEEPER_SERVER').mapProperty('hostName');
     if (this.get('fromDeleteHost')) {
       this.set('fromDeleteHost', false);
       return zks.without(this.get('content.hostName'));

+ 1 - 1
ambari-web/app/controllers/main/jobs_controller.js

@@ -407,7 +407,7 @@ App.MainJobsController = Em.Controller.extend({
     var retryLoad = this.checkDataLoadingError();
     if (yarnService != null) {
       this.set('loading', true);
-      var historyServerHostName = yarnService.get('appTimelineServerNode.hostName');
+      var historyServerHostName = yarnService.get('appTimelineServer.hostName');
       var filtersLink = this.get('filterObject').createJobsFiltersLink();
       var hiveQueriesUrl = App.testMode ? "/data/jobs/hive-queries.json" : "/proxy?url=http://" + historyServerHostName
         + ":" + yarnService.get('ahsWebPort') + "/ws/v1/timeline/HIVE_QUERY_ID" + filtersLink;

+ 3 - 3
ambari-web/app/controllers/main/mirroring_controller.js

@@ -246,9 +246,9 @@ App.MainMirroringController = Em.ArrayController.extend({
       var clusterName = App.get('clusterName');
       var sourceCluster = Ember.Object.create({
         name: clusterName,
-        execute: App.HostComponent.find().findProperty('componentName', 'RESOURCEMANAGER').get('host.hostName') + ':8050',
-        readonly: 'hftp://' + App.HostComponent.find().findProperty('componentName', 'NAMENODE').get('host.hostName') + ':50070',
-        workflow: 'http://' + App.HostComponent.find().findProperty('componentName', 'OOZIE_SERVER').get('host.hostName') + ':11000/oozie',
+        execute: App.HostComponent.find().findProperty('componentName', 'RESOURCEMANAGER').get('hostName') + ':8050',
+        readonly: 'hftp://' + App.HostComponent.find().findProperty('componentName', 'NAMENODE').get('hostName') + ':50070',
+        workflow: 'http://' + App.HostComponent.find().findProperty('componentName', 'OOZIE_SERVER').get('hostName') + ':11000/oozie',
         write: defaultFS,
         staging: '/apps/falcon/' + clusterName + '/staging',
         working: '/apps/falcon/' + clusterName + '/working',

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

@@ -1963,7 +1963,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
   getMasterComponentHostValue: function(componentName, multiple) {
     var components = this.get('content.hostComponents').filterProperty('componentName', componentName);
     if (components.length > 0) {
-      return multiple ? components.mapProperty('host.hostName') : components[0].get('host.hostName');
+      return multiple ? components.mapProperty('hostName') : components[0].get('hostName');
     }
     return false;
   },

+ 1 - 1
ambari-web/app/controllers/main/service/info/summary.js

@@ -69,7 +69,7 @@ App.MainServiceInfoSummaryController = Em.Controller.extend({
         state: state,
         context: context,
         agentName: agent.get('name'),
-        host: agent.get('host.hostName')
+        host: agent.get('hostName')
       },
       success: 'commandSuccessCallback'
     });

+ 1 - 1
ambari-web/app/controllers/main/service/reassign_controller.js

@@ -205,7 +205,7 @@ App.ReassignMasterController = App.WizardController.extend({
       component_name: masterComponent.get('componentName'),
       display_name: masterComponent.get('displayName'),
       service_id: masterComponent.get('service.serviceName'),
-      host_id: masterComponent.get('host.hostName')
+      host_id: masterComponent.get('hostName')
     };
     App.db.setMasterToReassign(component);
   },

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

@@ -894,7 +894,7 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, {
 
     App.HostComponent.find().forEach(function (hostComponent) {
       if (installedComponentsMap[hostComponent.get('componentName')]) {
-        installedComponentsMap[hostComponent.get('componentName')].push(hostComponent.get('host.id'));
+        installedComponentsMap[hostComponent.get('componentName')].push(hostComponent.get('hostName'));
       }
     }, this);
 
@@ -939,7 +939,7 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, {
       App.HostComponent.find().filterProperty('isMaster', true).forEach(function (item) {
         masterComponentHosts.push({
           component: item.get('componentName'),
-          hostName: item.get('host.hostName'),
+          hostName: item.get('hostName'),
           isInstalled: true,
           serviceId: item.get('service.id'),
           display_name: item.get('displayName')

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

@@ -1228,7 +1228,7 @@ App.WizardStep8Controller = Em.Controller.extend({
              */
             var clientHosts = App.HostComponent.find().filterProperty("componentName",_client.component_name).filterProperty("workStatus", "INSTALLED");
             if (clientHosts.length>0) {
-              clientHosts.mapProperty('host.hostName').forEach(function (host) {
+              clientHosts.mapProperty('hostName').forEach(function (host) {
                 if (hostNames.contains(host)) {
                   hostNames.splice(hostNames.indexOf(host), 1);
                 }

+ 1 - 0
ambari-web/app/mappers/component_config_mapper.js

@@ -24,6 +24,7 @@ App.componentConfigMapper = App.QuickDataMapper.create({
     work_status: 'state',
     passive_state: 'maintenance_state',
     component_name: 'component_name',
+    host_name: 'host_name',
     $ha_status: 'none',
     $display_name_advanced: 'none',
     stale_configs: 'stale_configs',

+ 3 - 1
ambari-web/app/mappers/hosts_mapper.js

@@ -59,7 +59,8 @@ App.hostsMapper = App.QuickDataMapper.create({
     service_id: 'HostRoles.service_name',
     passive_state: 'HostRoles.maintenance_state',
     work_status: 'HostRoles.state',
-    stale_configs: 'HostRoles.stale_configs'
+    stale_configs: 'HostRoles.stale_configs',
+    host_name: 'host_name'
   },
   map: function (json, isAll) {
     console.time('App.hostsMapper execution time');
@@ -75,6 +76,7 @@ App.hostsMapper = App.QuickDataMapper.create({
           var component = this.parseIt(host_component, this.hostComponentConfig);
           component.id = host_component.HostRoles.component_name + "_" + item.Hosts.host_name;
           component.host_id = item.Hosts.host_name;
+          component.host_name = item.Hosts.host_name;
           components.push(component);
         }, this);
         item.critical_alerts_count = (item.alerts) ? item.alerts.summary.CRITICAL + item.alerts.summary.WARNING : 0;

+ 11 - 19
ambari-web/app/mappers/service_metrics_mapper.js

@@ -37,8 +37,6 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
   },
   hdfsConfig: {
     version: 'nameNodeComponent.host_components[0].metrics.dfs.namenode.Version',
-    name_node_id: 'nameNodeComponent.host_components[0].HostRoles.host_name',
-    sname_node_id: 'snameNodeComponent.host_components[0].HostRoles.host_name',
     active_name_node_id: 'active_name_node_id',
     standby_name_node_id: 'standby_name_node_id',
     standby_name_node2_id: 'standby_name_node2_id',
@@ -65,7 +63,6 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
   },
   yarnConfig: {
     version: 'resourceManagerComponent.ServiceComponentInfo.Version',
-    resource_manager_node_id: 'resourceManagerComponent.host_components[0].HostRoles.host_name',
     resource_manager_start_time: 'resourceManagerComponent.ServiceComponentInfo.StartTime',
     jvm_memory_heap_used: 'resourceManagerComponent.host_components[0].metrics.jvm.HeapMemoryUsed',
     jvm_memory_heap_max: 'resourceManagerComponent.host_components[0].metrics.jvm.HeapMemoryMax',
@@ -93,13 +90,10 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
   },
   mapReduce2Config: {
     version: 'jobHistoryServerComponent.ServiceComponentInfo.Version',
-    job_history_server_id: 'jobHistoryServerComponent.host_components[0].HostRoles.host_name',
     map_reduce2_clients: 'map_reduce2_clients'
   },
   mapReduceConfig: {
     version: 'jobTrackerComponent.ServiceComponentInfo.Version',
-    job_history_server_id: 'jobHistoryServerComponent.host_components[0].HostRoles.host_name',
-    job_tracker_id: 'jobTrackerComponent.host_components[0].HostRoles.host_name',
     job_tracker_start_time: 'jobTrackerComponent.ServiceComponentInfo.StartTime',
     job_tracker_heap_used: 'jobTrackerComponent.ServiceComponentInfo.HeapMemoryUsed',
     job_tracker_heap_max: 'jobTrackerComponent.ServiceComponentInfo.HeapMemoryMax',
@@ -128,7 +122,6 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
   },
   hbaseConfig: {
     version: 'masterComponent.ServiceComponentInfo.Version',
-    master_id: 'masterComponent.host_components[0].HostRoles.host_name',
     master_start_time: 'masterComponent.ServiceComponentInfo.MasterStartTime',
     master_active_time: 'masterComponent.ServiceComponentInfo.MasterActiveTime',
     average_load: 'masterComponent.ServiceComponentInfo.AverageLoad',
@@ -156,6 +149,7 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     name: 'HostComponentProcess.name',
     status: 'HostComponentProcess.status',
     host_id: 'HostComponentProcess.host_name',
+    host_name: 'HostComponentProcess.host_name',
     channels_count: 'HostComponentProcess.channels_count',
     sources_count: 'HostComponentProcess.sources_count',
     sinks_count: 'HostComponentProcess.sinks_count'
@@ -169,6 +163,7 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     desired_status: 'HostRoles.desired_state',
     component_name: 'HostRoles.component_name',
     host_id: 'HostRoles.host_name',
+    host_name: 'HostRoles.host_name',
     stale_configs: 'HostRoles.stale_configs',
     display_name_advanced: 'display_name_advanced',
     $service_id: 'none' /* will be set outside of parse function */
@@ -401,16 +396,16 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
           item.standby_name_node2_id = null;
           switch (active_name_node.length) {
             case 1:
-              item.active_name_node_id = active_name_node[0];
+              item.active_name_node_id = 'NAMENODE' + '_' + active_name_node[0];
               break;
           }
           switch (standby_name_nodes.length) {
             case 1:
-              item.standby_name_node_id = standby_name_nodes[0];
+              item.standby_name_node_id = 'NAMENODE' + '_' + standby_name_nodes[0];
               break;
             case 2:
-              item.standby_name_node_id = standby_name_nodes[0];
-              item.standby_name_node2_id = standby_name_nodes[1];
+              item.standby_name_node_id = 'NAMENODE' + '_' + standby_name_nodes[0];
+              item.standby_name_node2_id = 'NAMENODE' + '_' + standby_name_nodes[1];
               break;
           }
           // important: active nameNode always at host_components[0]; if no active, then any nameNode could work.
@@ -427,13 +422,10 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
           var decommissionNodesJson = App.parseJSON(component.host_components[0].metrics.dfs.namenode.DecomNodes);
         }
         item.decommission_data_nodes = [];
-        for (var dcn in decommissionNodesJson) {
-          item.decommission_data_nodes.push(dcn);
+        for (var host in decommissionNodesJson) {
+          item.decommission_data_nodes.push('DATANODE'+ '_' + host);
         }
       }
-      if (component.ServiceComponentInfo && component.ServiceComponentInfo.component_name == "SECONDARY_NAMENODE") {
-        item.snameNodeComponent = component;
-      }
       if (component.ServiceComponentInfo && component.ServiceComponentInfo.component_name == "JOURNALNODE") {
         if (!item.journal_nodes) {
           item.journal_nodes = [];
@@ -526,7 +518,7 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
         item.black_list_trackers = [];
         if (liveNodesJson != null) {
           liveNodesJson.forEach(function (nj) {
-            item.alive_trackers.push(nj.hostname);
+            item.alive_trackers.push('TASKTRACKER' + '_' + nj.hostname);
             if (nj.slots && nj.slots.map_slots)
               item.map_slots += nj.slots.map_slots;
             if (nj.slots && nj.slots.map_slots_used)
@@ -539,12 +531,12 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
         }
         if (grayNodesJson != null) {
           grayNodesJson.forEach(function (nj) {
-            item.gray_list_trackers.push(nj.hostname);
+            item.gray_list_trackers.push('TASKTRACKER' + '_' + nj.hostname);
           });
         }
         if (blackNodesJson != null) {
           blackNodesJson.forEach(function (nj) {
-            item.black_list_trackers.push(nj.hostname);
+            item.black_list_trackers.push('TASKTRACKER' + '_' + nj.hostname);
           });
         }
       } else if (component.ServiceComponentInfo && component.ServiceComponentInfo.component_name == "HISTORYSERVER") {

+ 2 - 2
ambari-web/app/mixins/main/host/details/host_components/decommissionable.js

@@ -150,7 +150,7 @@ App.Decommissionable = Em.Mixin.create({
       name: 'host.host_component.slave_desired_admin_state',
       sender: this,
       data: {
-        hostName: this.get('content.host.hostName'),
+        hostName: this.get('content.hostName'),
         componentName: this.get('content.componentName')
       },
       success: 'getDesiredAdminStateSuccessCallback',
@@ -190,7 +190,7 @@ App.Decommissionable = Em.Mixin.create({
       name: 'host.host_component.decommission_status',
       sender: this,
       data: {
-        hostName: this.get('content.host.hostName'),
+        hostName: this.get('content.hostName'),
         componentName: this.get('componentForCheckDecommission'),
         serviceName: this.get('content.service.serviceName')
       },

+ 3 - 2
ambari-web/app/models/host_component.js

@@ -26,6 +26,7 @@ App.HostComponent = DS.Model.extend({
   displayNameAdvanced: DS.attr('string'),
   staleConfigs: DS.attr('boolean'),
   host: DS.belongsTo('App.Host'),
+  hostName: DS.attr('string'),
   service: DS.belongsTo('App.Service'),
   /**
    * Determine if component is client
@@ -142,7 +143,7 @@ App.HostComponent = DS.Model.extend({
    */
   isDecommissioning: function () {
     var decommissioning = false;
-    var hostName = this.get('host.hostName');
+    var hostName = this.get('hostName');
     var componentName = this.get('componentName');
     var hdfsSvc = App.HDFSService.find().objectAt(0);
     if (componentName === 'DATANODE' && hdfsSvc) {
@@ -151,7 +152,7 @@ App.HostComponent = DS.Model.extend({
       decommissioning = decomNode != null;
     }
     return decommissioning;
-  }.property('componentName', 'host.hostName', 'App.router.clusterController.isLoaded', 'App.router.updateController.isUpdated'),
+  }.property('componentName', 'hostName', 'App.router.clusterController.isLoaded', 'App.router.updateController.isUpdated'),
   /**
    * User friendly host component status
    * @returns {String}

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

@@ -35,6 +35,7 @@ App.FlumeAgent = DS.Model.extend({
    */
   status: DS.attr('string'),
   host: DS.belongsTo('App.Host'),
+  hostName: DS.attr('string'),
 
   channelsCount: DS.attr('number'),
   sourcesCount: DS.attr('number'),

+ 3 - 1
ambari-web/app/models/service/hbase.js

@@ -19,7 +19,9 @@ var App = require('app');
 
 App.HBaseService = App.Service.extend({
   version: DS.attr('string'),
-  master: DS.belongsTo('App.Host'),
+  master: function () {
+    return this.get('hostComponents').findProperty('componentName', 'HBASE_MASTER');
+  }.property('hostComponents'),
   regionServersStarted: DS.attr('number'),
   regionServersInstalled: DS.attr('number'),
   regionServersTotal: DS.attr('number'),

+ 10 - 6
ambari-web/app/models/service/hdfs.js

@@ -19,11 +19,15 @@ var App = require('app');
 
 App.HDFSService = App.Service.extend({
   version: DS.attr('string'),
-  nameNode: DS.belongsTo('App.Host'),
-  snameNode: DS.belongsTo('App.Host'),
-  activeNameNode: DS.belongsTo('App.Host'),
-  standbyNameNode: DS.belongsTo('App.Host'),
-  standbyNameNode2: DS.belongsTo('App.Host'),
+  nameNode: function () {
+    return this.get('hostComponents').findProperty('componentName', 'NAMENODE');
+  }.property('hostComponents'),
+  snameNode: function () {
+    return this.get('hostComponents').findProperty('componentName', 'SECONDARY_NAMENODE');
+  }.property('hostComponents'),
+  activeNameNode: DS.belongsTo('App.HostComponent'),
+  standbyNameNode: DS.belongsTo('App.HostComponent'),
+  standbyNameNode2: DS.belongsTo('App.HostComponent'),
   dataNodesStarted: DS.attr('number'),
   dataNodesInstalled: DS.attr('number'),
   dataNodesTotal: DS.attr('number'),
@@ -33,7 +37,7 @@ App.HDFSService = App.Service.extend({
   nameNodeStartTime: DS.attr('number'),
   jvmMemoryHeapUsed: DS.attr('number'),
   jvmMemoryHeapMax: DS.attr('number'),
-  decommissionDataNodes: DS.hasMany('App.Host'),
+  decommissionDataNodes: DS.hasMany('App.HostComponent'),
   capacityUsed: DS.attr('number'),
   capacityTotal: DS.attr('number'),
   capacityRemaining: DS.attr('number'),

+ 9 - 5
ambari-web/app/models/service/mapreduce.js

@@ -19,17 +19,21 @@ var App = require('app');
 
 App.MapReduceService = App.Service.extend({
   version: DS.attr('string'),
-  jobHistoryServer: DS.belongsTo('App.Host'),
-  jobTracker: DS.belongsTo('App.Host'),
+  jobHistoryServer: function () {
+    return this.get('hostComponents').findProperty('componentName', 'HISTORYSERVER');
+  }.property('hostComponents'),
+  jobTracker: function () {
+    return this.get('hostComponents').findProperty('componentName', 'JOBTRACKER');
+  }.property('hostComponents'),
   taskTrackersStarted: DS.attr('number'),
   taskTrackersInstalled: DS.attr('number'),
   taskTrackersTotal: DS.attr('number'),
   jobTrackerStartTime: DS.attr('number'),
   jobTrackerHeapUsed: DS.attr('number'),
   jobTrackerHeapMax: DS.attr('number'),
-  aliveTrackers: DS.hasMany('App.Host'),
-  blackListTrackers: DS.hasMany('App.Host'),
-  grayListTrackers: DS.hasMany('App.Host'),
+  aliveTrackers: DS.hasMany('App.HostComponent'),
+  blackListTrackers: DS.hasMany('App.HostComponent'),
+  grayListTrackers: DS.hasMany('App.HostComponent'),
   mapSlots: DS.attr('number'),
   reduceSlots: DS.attr('number'),
   jobsSubmitted: DS.attr('number'),

+ 3 - 1
ambari-web/app/models/service/mapreduce2.js

@@ -19,7 +19,9 @@ var App = require('app');
 
 App.MapReduce2Service = App.Service.extend({
   version: DS.attr('string'),
-  jobHistoryServer: DS.belongsTo('App.Host'),
+  jobHistoryServer: function () {
+    return this.get('hostComponents').findProperty('componentName', 'HISTORYSERVER');
+  }.property('hostComponents'),
   mapReduce2Clients: DS.attr('number')
 });
 

+ 6 - 4
ambari-web/app/models/service/yarn.js

@@ -20,10 +20,12 @@ var objectUtils = require('utils/object_utils');
 
 App.YARNService = App.Service.extend({
   version: DS.attr('string'),
-  resourceManagerNode: DS.belongsTo('App.Host'),
-  appTimelineServerNode: function() {
-    return this.get('hostComponents').filterProperty('componentName', 'APP_TIMELINE_SERVER').mapProperty('host').objectAt(0);
-  }.property(),
+  resourceManager: function() {
+    return this.get('hostComponents').findProperty('componentName', 'RESOURCEMANAGER');
+  }.property('hostComponents'),
+  appTimelineServer: function() {
+    return this.get('hostComponents').findProperty('componentName', 'APP_TIMELINE_SERVER');
+  }.property('hostComponents'),
   nodeManagersStarted: DS.attr('number'),
   nodeManagersInstalled: DS.attr('number'),
   nodeManagersTotal: DS.attr('number'),

+ 1 - 1
ambari-web/app/routes/reassign_master_routes.js

@@ -127,7 +127,7 @@ module.exports = App.WizardRoute.extend({
       var reassignHosts = {};
       var componentName = reassignMasterWizardStep2.get('content.reassign.component_name');
       var masterAssignmentsHosts = reassignMasterWizardStep2.get('selectedServicesMasters').filterProperty('component_name', componentName).mapProperty('selectedHost');
-      var currentMasterHosts = App.HostComponent.find().filterProperty('componentName', componentName).mapProperty('host.hostName');
+      var currentMasterHosts = App.HostComponent.find().filterProperty('componentName', componentName).mapProperty('hostName');
       masterAssignmentsHosts.forEach(function (host) {
         if (!currentMasterHosts.contains(host)) {
           reassignHosts.target = host;

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

@@ -62,7 +62,7 @@
                 </td>
                 <td class="agent-host-name">
                   <a href="javascript:void(null)" {{action showDetails agent.host}}>
-                    {{agent.host.hostName}}
+                    {{agent.hostName}}
                   </a>
                 </td>
                 <td>

+ 1 - 1
ambari-web/app/utils/batch_scheduled_requests.js

@@ -196,7 +196,7 @@ module.exports = {
     var hosts = [];
     var componentServiceMap = App.QuickDataMapper.componentServiceMap();
     hostComponentsList.forEach(function(hc) {
-      var hostName = hc.get('hostName') || hc.get('host.hostName');
+      var hostName = hc.get('hostName');
       var componentName = hc.get('componentName');
       if (!componentToHostsMap[componentName]) {
         componentToHostsMap[componentName] = [];

+ 3 - 3
ambari-web/app/utils/jobs.js

@@ -54,7 +54,7 @@ module.exports = {
     var self = this;
     // TODO - to be changed to history server when implemented in stack.
     var yarnService = App.YARNService.find().objectAt(0);
-    var historyServerHostName = yarnService.get('appTimelineServerNode.hostName');
+    var historyServerHostName = yarnService.get('appTimelineServer.hostName');
     var ahsWebPort = yarnService.get('ahsWebPort');
     var hiveJobId = hiveJob.get('id');
     // First refresh query
@@ -119,7 +119,7 @@ module.exports = {
     var self = this;
     var yarnService = App.YARNService.find().objectAt(0);
     var ahsWebPort = yarnService.get('ahsWebPort');
-    var historyServerHostName = yarnService.get('appTimelineServerNode.hostName');
+    var historyServerHostName = yarnService.get('appTimelineServer.hostName');
     var tezDag = App.TezDag.find(tezDagId);
     if (tezDag) {
       var tezDagInstanceId = tezDag.get('instanceId');
@@ -178,7 +178,7 @@ module.exports = {
   refreshTezDagVertex : function(tezDagId, tezVertexInstanceId, successCallback) {
     var yarnService = App.YARNService.find().objectAt(0);
     var ahsWebPort = yarnService.get('ahsWebPort');
-    var historyServerHostName = yarnService.get('appTimelineServerNode.hostName');
+    var historyServerHostName = yarnService.get('appTimelineServer.hostName');
     var tezDag = App.TezDag.find(tezDagId);
     var hiveJob = App.HiveJob.find().findProperty('tezDag', tezDag);
     var hiveJobFailed = hiveJob.get('failed');

+ 1 - 1
ambari-web/app/views/common/chart/linear_time.js

@@ -170,7 +170,7 @@ App.ChartLinearTimeView = Ember.View.extend({
     var MapReduceService = App.MapReduceService.find().objectAt(0);
     var jobTrackerNode = MapReduceService ? MapReduceService.get('jobTracker.hostName') : "";
     var YARNService = App.YARNService.find().objectAt(0);
-    var resourceManager = YARNService ? YARNService.get('resourceManagerNode.hostName') : "";
+    var resourceManager = YARNService ? YARNService.get('resourceManager.hostName') : "";
     var timeUnit = this.get('timeUnitSeconds');
     return {
       toSeconds: toSeconds,

+ 1 - 1
ambari-web/app/views/main/admin/rollbackHA/step1_view.js

@@ -48,7 +48,7 @@ App.RollbackHighAvailabilityWizardStep1View = Em.View.extend({
     this.set('selectedAddNNHost', this.get('controller.content.addNNHost'));
 
     if (addNNHosts.length == 2) {
-      this.set('addNNHosts', addNNHosts.mapProperty('host.hostName'));
+      this.set('addNNHosts', addNNHosts.mapProperty('hostName'));
     }
     data.items.forEach(function (host) {
       this.secondaryNNHosts.push(host.Hosts.host_name);

+ 1 - 1
ambari-web/app/views/main/admin/rollbackHA/step2_view.js

@@ -28,7 +28,7 @@ App.RollbackHighAvailabilityWizardStep2View = App.HighAvailabilityWizardStep4Vie
     if(!activeNN){
       activeNN = App.HostComponent.find().findProperty('componentName','NAMENODE');
     }
-    activeNN = activeNN.get('host.hostName');
+    activeNN = activeNN.get('hostName');
     this.get('controller.content').set('activeNNHost', activeNN);
     return Em.I18n.t('admin.highAvailability.rollback.step2.body').format(this.get('controller.content.hdfsUser'), activeNN);
   }.property()

+ 1 - 1
ambari-web/app/views/main/host/details/host_component_views/datanode_view.js

@@ -69,7 +69,7 @@ App.DataNodeComponentView = App.HostComponentView.extend(App.Decommissionable, {
    * load Recommission/Decommission status from adminState of each live node
    */
   loadComponentDecommissionStatus: function () {
-    var hostName = this.get('content.host.hostName');
+    var hostName = this.get('content.hostName');
     var dfd = $.Deferred();
     var self = this;
     this.getDNDecommissionStatus().done(function () {

+ 1 - 1
ambari-web/app/views/main/host/details/host_component_views/nodemanager_view.js

@@ -26,7 +26,7 @@ App.NodeManagerComponentView = App.HostComponentView.extend(App.Decommissionable
    * load Recommission/Decommission status for nodeManager from nodeManagers list
    */
   loadComponentDecommissionStatus: function () {
-    var hostName = this.get('content.host.hostName');
+    var hostName = this.get('content.hostName');
     var dfd = $.Deferred();
     var self = this;
     this.getDesiredAdminState().done( function () {

+ 1 - 1
ambari-web/app/views/main/host/details/host_component_views/regionserver_view.js

@@ -25,7 +25,7 @@ App.RegionServerComponentView = App.HostComponentView.extend(App.Decommissionabl
    * load Recommission/Decommission status of RegionServer
    */
   loadComponentDecommissionStatus: function () {
-    var hostName = this.get('content.host.hostName');
+    var hostName = this.get('content.hostName');
     var slaveType = 'HBASE_REGIONSERVER';
     var self = this;
     var deferred = $.Deferred();

+ 1 - 1
ambari-web/app/views/main/host/details/host_component_views/tasktracker_view.js

@@ -26,7 +26,7 @@ App.TaskTrackerComponentView = App.HostComponentView.extend(App.Decommissionable
    * load Recommission/Decommission status for TaskTracker from JobTracker/AliveNodes list
    */
   loadComponentDecommissionStatus: function () {
-    var hostName = this.get('content.host.hostName');
+    var hostName = this.get('content.hostName');
     var dfd = $.Deferred();
     var self = this;
     this.getDesiredAdminState().done( function () {

+ 1 - 1
ambari-web/app/views/main/jobs/hive_job_details_view.js

@@ -114,7 +114,7 @@ App.MainHiveJobDetailsView = Em.View.extend({
       }
     }
     return null;
-  }.property('content.tezDag.yarnApplicationId', 'App.YARNService.resourceManagerNode.hostName'),
+  }.property('content.tezDag.yarnApplicationId', 'App.YARNService.resourceManager.hostName'),
 
   jobObserver : function() {
     var content = this.get('content');

+ 1 - 1
ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graphs.js

@@ -25,7 +25,7 @@ App.MainServiceInfoFlumeGraphsView = App.MainServiceInfoSummaryMetricGraphsView.
     var viewData = this.get('viewData');
     if (viewData != null) {
       var metricType = viewData.metricType;
-      var hostName = viewData.agent.get('host.hostName');
+      var hostName = viewData.agent.get('hostName');
       var metricNamesGatherer = {
         success: function(data) {
           var metricNames = {};

+ 1 - 1
ambari-web/app/views/main/service/services/flume.js

@@ -144,7 +144,7 @@ App.MainDashboardServiceFlumeView = App.TableView.extend({
       return  metricType + ' - ' + hostName;
     };
     var gangliaUrlTpl = App.router.get('clusterController.gangliaUrl') + '/?r=hour&cs=&ce=&m=load_one&s=by+name&c=HDPFlumeServer&h={0}&host_regex=&max_graphs=0&tab=m&vn=&sh=1&z=small&hc=4';
-    var agentHostMock = agent.get('host.hostName');
+    var agentHostMock = agent.get('hostName');
     var mockMetricData = [
       {
         header: 'channelName',