ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject git commit: AMBARI-6385 stale_configs parameter works incorrectly after refreshing page. (atkach)
Date Fri, 04 Jul 2014 20:57:40 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 72fdaa36b -> ce268b2af


AMBARI-6385 stale_configs parameter works incorrectly after refreshing page. (atkach)


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

Branch: refs/heads/trunk
Commit: ce268b2afafc9af728832b61dcdfa324b5d6e90b
Parents: 72fdaa3
Author: atkach <atkach@hortonworks.com>
Authored: Fri Jul 4 23:57:21 2014 +0300
Committer: atkach <atkach@hortonworks.com>
Committed: Fri Jul 4 23:57:34 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/mappers/hosts_mapper.js | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ce268b2a/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 bd26592..05037f2 100644
--- a/ambari-web/app/mappers/hosts_mapper.js
+++ b/ambari-web/app/mappers/hosts_mapper.js
@@ -71,16 +71,26 @@ App.hostsMapper = App.QuickDataMapper.create({
       var hostIds = {};
       var components = [];
       var componentsIdMap = {};
+      var cacheServices = App.cache['services'];
+      var loadedServiceComponentsMap = App.get('componentConfigMapper').buildServiceComponentMap(cacheServices);
+      var serviceToHostComponentIdMap = {};
+
       json.items.forEach(function (item, index) {
         item.host_components = item.host_components || [];
         item.host_components.forEach(function (host_component) {
           host_component.id = host_component.HostRoles.component_name + "_" + item.Hosts.host_name;
           var component = this.parseIt(host_component, this.hostComponentConfig);
+          var serviceName = host_component.HostRoles.service_name;
+
           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);
           componentsIdMap[component.id] = component;
+          if (!serviceToHostComponentIdMap[serviceName]) {
+            serviceToHostComponentIdMap[serviceName] = [];
+          }
+          serviceToHostComponentIdMap[serviceName].push(component.id);
         }, this);
         item.critical_alerts_count = (item.alerts) ? item.alerts.summary.CRITICAL + item.alerts.summary.WARNING
: 0;
         item.cluster_id = App.get('clusterName');
@@ -116,6 +126,8 @@ App.hostsMapper = App.QuickDataMapper.create({
       if (!isNaN(itemTotal)) {
         App.router.set('mainHostController.filteredCount', itemTotal);
       }
+      //bind host-components with service records
+      App.get('componentConfigMapper').addNewHostComponents(loadedServiceComponentsMap, serviceToHostComponentIdMap,
cacheServices);
     }
     console.timeEnd('App.hostsMapper execution time');
   }


Mime
View raw message