Repository: ambari Updated Branches: refs/heads/trunk cbf926a42 -> 7b9ec36ad
AMBARI-6081 Add host name property to HostComponent model. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7b9ec36a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7b9ec36a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7b9ec36a Branch: refs/heads/trunk Commit: 7b9ec36ad0ef8ae5b803adb7cb3a35393329502e Parents: cbf926a Author: atkach <atk...@hortonworks.com> Authored: Wed Jun 11 15:54:59 2014 +0300 Committer: atkach <atk...@hortonworks.com> Committed: Wed Jun 11 15:57:55 2014 +0300 ---------------------------------------------------------------------- .../main/admin/security/add/step2.js | 2 +- .../main/admin/security/add/step4.js | 2 +- .../security/security_progress_controller.js | 2 +- ambari-web/app/controllers/main/host/details.js | 2 +- .../app/controllers/main/jobs_controller.js | 2 +- .../controllers/main/mirroring_controller.js | 6 ++-- .../controllers/main/service/info/configs.js | 2 +- .../controllers/main/service/info/summary.js | 2 +- .../main/service/reassign_controller.js | 2 +- ambari-web/app/controllers/wizard.js | 4 +-- .../app/controllers/wizard/step8_controller.js | 2 +- .../app/mappers/component_config_mapper.js | 1 + ambari-web/app/mappers/hosts_mapper.js | 4 ++- .../app/mappers/service_metrics_mapper.js | 30 +++++++------------- .../details/host_components/decommissionable.js | 4 +-- ambari-web/app/models/host_component.js | 5 ++-- ambari-web/app/models/service/flume.js | 1 + ambari-web/app/models/service/hbase.js | 4 ++- ambari-web/app/models/service/hdfs.js | 16 +++++++---- ambari-web/app/models/service/mapreduce.js | 14 +++++---- ambari-web/app/models/service/mapreduce2.js | 4 ++- ambari-web/app/models/service/yarn.js | 10 ++++--- ambari-web/app/routes/reassign_master_routes.js | 2 +- .../templates/main/service/services/flume.hbs | 2 +- .../app/utils/batch_scheduled_requests.js | 2 +- ambari-web/app/utils/jobs.js | 6 ++-- .../app/views/common/chart/linear_time.js | 2 +- .../views/main/admin/rollbackHA/step1_view.js | 2 +- .../views/main/admin/rollbackHA/step2_view.js | 2 +- .../host_component_views/datanode_view.js | 2 +- .../host_component_views/nodemanager_view.js | 2 +- .../host_component_views/regionserver_view.js | 2 +- .../host_component_views/tasktracker_view.js | 2 +- .../views/main/jobs/hive_job_details_view.js | 2 +- .../info/metrics/flume/flume_metric_graphs.js | 2 +- .../app/views/main/service/services/flume.js | 2 +- 36 files changed, 82 insertions(+), 71 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/controllers/main/admin/security/add/step2.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/security/add/step2.js b/ambari-web/app/controllers/main/admin/security/add/step2.js index 347b266..37103b2 100644 --- a/ambari-web/app/controllers/main/admin/security/add/step2.js +++ b/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; } http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/controllers/main/admin/security/add/step4.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/security/add/step4.js b/ambari-web/app/controllers/main/admin/security/add/step4.js index 33684b6..5706ac6 100644 --- a/ambari-web/app/controllers/main/admin/security/add/step4.js +++ b/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, http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/controllers/main/admin/security/security_progress_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/security/security_progress_controller.js b/ambari-web/app/controllers/main/admin/security/security_progress_controller.js index cf8a763..1fc290a 100644 --- a/ambari-web/app/controllers/main/admin/security/security_progress_controller.js +++ b/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; http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/controllers/main/host/details.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js index 24cfbb3..762dc0f 100644 --- a/ambari-web/app/controllers/main/host/details.js +++ b/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')); http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/controllers/main/jobs_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/jobs_controller.js b/ambari-web/app/controllers/main/jobs_controller.js index 39a4f53..3071dc5 100644 --- a/ambari-web/app/controllers/main/jobs_controller.js +++ b/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; http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/controllers/main/mirroring_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/mirroring_controller.js b/ambari-web/app/controllers/main/mirroring_controller.js index fc836e1..2cce6d8 100644 --- a/ambari-web/app/controllers/main/mirroring_controller.js +++ b/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', http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/controllers/main/service/info/configs.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js index d616bd3..6052607 100644 --- a/ambari-web/app/controllers/main/service/info/configs.js +++ b/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; }, http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/controllers/main/service/info/summary.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/info/summary.js b/ambari-web/app/controllers/main/service/info/summary.js index ff6a718..ce90ac4 100644 --- a/ambari-web/app/controllers/main/service/info/summary.js +++ b/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' }); http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/controllers/main/service/reassign_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/reassign_controller.js b/ambari-web/app/controllers/main/service/reassign_controller.js index 5d12460..9a7aaf7 100644 --- a/ambari-web/app/controllers/main/service/reassign_controller.js +++ b/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); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/controllers/wizard.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard.js b/ambari-web/app/controllers/wizard.js index f5e9748..21a0f3d 100644 --- a/ambari-web/app/controllers/wizard.js +++ b/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') http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/controllers/wizard/step8_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js index e1d74fa..7d03066 100644 --- a/ambari-web/app/controllers/wizard/step8_controller.js +++ b/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); } http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/mappers/component_config_mapper.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mappers/component_config_mapper.js b/ambari-web/app/mappers/component_config_mapper.js index 4f0b69a..901333c 100644 --- a/ambari-web/app/mappers/component_config_mapper.js +++ b/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', http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/mappers/hosts_mapper.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mappers/hosts_mapper.js b/ambari-web/app/mappers/hosts_mapper.js index 41aaf0e..c5e07cd 100644 --- a/ambari-web/app/mappers/hosts_mapper.js +++ b/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; http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/mappers/service_metrics_mapper.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mappers/service_metrics_mapper.js b/ambari-web/app/mappers/service_metrics_mapper.js index 4b5702d..cd76b09 100644 --- a/ambari-web/app/mappers/service_metrics_mapper.js +++ b/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") { http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/mixins/main/host/details/host_components/decommissionable.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mixins/main/host/details/host_components/decommissionable.js b/ambari-web/app/mixins/main/host/details/host_components/decommissionable.js index 6222a88..dce7044 100644 --- a/ambari-web/app/mixins/main/host/details/host_components/decommissionable.js +++ b/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') }, http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/models/host_component.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/host_component.js b/ambari-web/app/models/host_component.js index ca27fbb..0671552 100644 --- a/ambari-web/app/models/host_component.js +++ b/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} http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/models/service/flume.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/service/flume.js b/ambari-web/app/models/service/flume.js index 61dc7eb..79af5a7 100644 --- a/ambari-web/app/models/service/flume.js +++ b/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'), http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/models/service/hbase.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/service/hbase.js b/ambari-web/app/models/service/hbase.js index 1276a4d..6955f22 100644 --- a/ambari-web/app/models/service/hbase.js +++ b/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'), http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/models/service/hdfs.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/service/hdfs.js b/ambari-web/app/models/service/hdfs.js index bd8d34f..f62e167 100644 --- a/ambari-web/app/models/service/hdfs.js +++ b/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'), http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/models/service/mapreduce.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/service/mapreduce.js b/ambari-web/app/models/service/mapreduce.js index 712543a..9c35f54 100644 --- a/ambari-web/app/models/service/mapreduce.js +++ b/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'), http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/models/service/mapreduce2.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/service/mapreduce2.js b/ambari-web/app/models/service/mapreduce2.js index 8a3a968..388b236 100644 --- a/ambari-web/app/models/service/mapreduce2.js +++ b/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') }); http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/models/service/yarn.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/service/yarn.js b/ambari-web/app/models/service/yarn.js index ff7e5af..e9266b1 100644 --- a/ambari-web/app/models/service/yarn.js +++ b/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'), http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/routes/reassign_master_routes.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/reassign_master_routes.js b/ambari-web/app/routes/reassign_master_routes.js index e041fee..f9f8d85 100644 --- a/ambari-web/app/routes/reassign_master_routes.js +++ b/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; http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/templates/main/service/services/flume.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/service/services/flume.hbs b/ambari-web/app/templates/main/service/services/flume.hbs index f9526ef..7bea002 100644 --- a/ambari-web/app/templates/main/service/services/flume.hbs +++ b/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> http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/utils/batch_scheduled_requests.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/batch_scheduled_requests.js b/ambari-web/app/utils/batch_scheduled_requests.js index 918b116..75eb33a 100644 --- a/ambari-web/app/utils/batch_scheduled_requests.js +++ b/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] = []; http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/utils/jobs.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/jobs.js b/ambari-web/app/utils/jobs.js index c0b5054..aa21d43 100644 --- a/ambari-web/app/utils/jobs.js +++ b/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'); http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/views/common/chart/linear_time.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/chart/linear_time.js b/ambari-web/app/views/common/chart/linear_time.js index e81e5c5..a37133d 100644 --- a/ambari-web/app/views/common/chart/linear_time.js +++ b/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, http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/views/main/admin/rollbackHA/step1_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/rollbackHA/step1_view.js b/ambari-web/app/views/main/admin/rollbackHA/step1_view.js index 7021085..4a2d689 100644 --- a/ambari-web/app/views/main/admin/rollbackHA/step1_view.js +++ b/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); http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/views/main/admin/rollbackHA/step2_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/rollbackHA/step2_view.js b/ambari-web/app/views/main/admin/rollbackHA/step2_view.js index c7e5574..1ef2e03 100644 --- a/ambari-web/app/views/main/admin/rollbackHA/step2_view.js +++ b/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() http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/views/main/host/details/host_component_views/datanode_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host/details/host_component_views/datanode_view.js b/ambari-web/app/views/main/host/details/host_component_views/datanode_view.js index a0cb1c7..985be4f 100644 --- a/ambari-web/app/views/main/host/details/host_component_views/datanode_view.js +++ b/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 () { http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/views/main/host/details/host_component_views/nodemanager_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host/details/host_component_views/nodemanager_view.js b/ambari-web/app/views/main/host/details/host_component_views/nodemanager_view.js index 37e360b..c4ad2a1 100644 --- a/ambari-web/app/views/main/host/details/host_component_views/nodemanager_view.js +++ b/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 () { http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/views/main/host/details/host_component_views/regionserver_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host/details/host_component_views/regionserver_view.js b/ambari-web/app/views/main/host/details/host_component_views/regionserver_view.js index beab003..512b24e 100644 --- a/ambari-web/app/views/main/host/details/host_component_views/regionserver_view.js +++ b/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(); http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/views/main/host/details/host_component_views/tasktracker_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host/details/host_component_views/tasktracker_view.js b/ambari-web/app/views/main/host/details/host_component_views/tasktracker_view.js index 991ed6f..6aaabee 100644 --- a/ambari-web/app/views/main/host/details/host_component_views/tasktracker_view.js +++ b/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 () { http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/views/main/jobs/hive_job_details_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/jobs/hive_job_details_view.js b/ambari-web/app/views/main/jobs/hive_job_details_view.js index 8c42d61..efa17a8 100644 --- a/ambari-web/app/views/main/jobs/hive_job_details_view.js +++ b/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'); http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graphs.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graphs.js b/ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graphs.js index 1ebfb60..bb38638 100644 --- a/ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graphs.js +++ b/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 = {}; http://git-wip-us.apache.org/repos/asf/ambari/blob/7b9ec36a/ambari-web/app/views/main/service/services/flume.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/services/flume.js b/ambari-web/app/views/main/service/services/flume.js index 12dc89b..7965faf 100644 --- a/ambari-web/app/views/main/service/services/flume.js +++ b/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',