ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From onechipore...@apache.org
Subject git commit: AMBARI-6087. Multiple ATS appear on YARN summary page. (onechiporenko)
Date Wed, 11 Jun 2014 18:00:07 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 107bfd168 -> 7ea3b8af4


AMBARI-6087. Multiple ATS appear on YARN summary page. (onechiporenko)


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

Branch: refs/heads/trunk
Commit: 7ea3b8af422398b4b4ffba880737383edc870dec
Parents: 107bfd1
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Wed Jun 11 20:44:59 2014 +0300
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Wed Jun 11 20:59:58 2014 +0300

----------------------------------------------------------------------
 .../app/controllers/global/update_controller.js   | 18 ++++++++++--------
 ambari-web/app/mappers/component_config_mapper.js | 16 ++++++++++++----
 ambari-web/app/mappers/service_metrics_mapper.js  |  3 +++
 3 files changed, 25 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7ea3b8af/ambari-web/app/controllers/global/update_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/update_controller.js b/ambari-web/app/controllers/global/update_controller.js
index 0d0b2d2..0635eb7 100644
--- a/ambari-web/app/controllers/global/update_controller.js
+++ b/ambari-web/app/controllers/global/update_controller.js
@@ -32,7 +32,7 @@ App.UpdateController = Em.Controller.extend({
   }.property('App.router.location.lastSetURL'),
 
   getUrl: function (testUrl, url) {
-    return (App.testMode) ? testUrl : App.apiPrefix + '/clusters/' + this.get('clusterName')
+ url;
+    return (App.get('testMode')) ? testUrl : App.apiPrefix + '/clusters/' + this.get('clusterName')
+ url;
   },
 
   /**
@@ -46,7 +46,7 @@ App.UpdateController = Em.Controller.extend({
     var prefix = App.apiPrefix + '/clusters/' + App.get('clusterName');
     var params = '';
 
-    if (App.testMode) {
+    if (App.get('testMode')) {
       return testUrl;
     } else {
       if (queryParams) {
@@ -193,12 +193,14 @@ App.UpdateController = Em.Controller.extend({
     var self = this;
     self.set('isUpdated', false);
 
-    var conditionalFields = this.getConditionalFields();
-    var conditionalFieldsString = conditionalFields.length > 0 ? ',' + conditionalFields.join(',')
: '';
-    var testUrl = App.get('isHadoop2Stack') ? '/data/dashboard/HDP2/master_components.json'
: '/data/dashboard/services.json';
-    var isFlumeInstalled = App.cache['services'].mapProperty('ServiceInfo.service_name').contains('FLUME');
-    var flumeHandlerParam = isFlumeInstalled ? 'ServiceComponentInfo/component_name=FLUME_HANDLER|'
: '';
-    var realUrl = '/components/?' + flumeHandlerParam +
+    var conditionalFields = this.getConditionalFields(),
+      conditionalFieldsString = conditionalFields.length > 0 ? ',' + conditionalFields.join(',')
: '',
+      testUrl = App.get('isHadoop2Stack') ? '/data/dashboard/HDP2/master_components.json'
: '/data/dashboard/services.json',
+      isFlumeInstalled = App.cache['services'].mapProperty('ServiceInfo.service_name').contains('FLUME'),
+      isYarnInstalled = App.cache['services'].mapProperty('ServiceInfo.service_name').contains('YARN'),
+      flumeHandlerParam = isFlumeInstalled ? 'ServiceComponentInfo/component_name=FLUME_HANDLER|'
: '',
+      atsHandlerParam = isYarnInstalled ? 'ServiceComponentInfo/component_name=APP_TIMELINE_SERVER|'
: '',
+      realUrl = '/components/?' + flumeHandlerParam + atsHandlerParam +
         'ServiceComponentInfo/category=MASTER&fields=' +
         'ServiceComponentInfo/Version,' +
         'ServiceComponentInfo/StartTime,' +

http://git-wip-us.apache.org/repos/asf/ambari/blob/7ea3b8af/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 901333c..1229385 100644
--- a/ambari-web/app/mappers/component_config_mapper.js
+++ b/ambari-web/app/mappers/component_config_mapper.js
@@ -26,7 +26,7 @@ App.componentConfigMapper = App.QuickDataMapper.create({
     component_name: 'component_name',
     host_name: 'host_name',
     $ha_status: 'none',
-    $display_name_advanced: 'none',
+    $display_name_advanced: '',
     stale_configs: 'stale_configs',
     host_id: 'host_name',
     service_id: 'service_name'
@@ -48,9 +48,17 @@ App.componentConfigMapper = App.QuickDataMapper.create({
     }, this);
     App.store.loadMany(this.get('model'), hostComponents);
     for (var serviceName in serviceToHostComponentIdMap) {
-      var service = App.cache['services'].findProperty('ServiceInfo.service_name', serviceName);
-      if (service) {
-        service.host_components.pushObjects(serviceToHostComponentIdMap[serviceName]);
+      if (serviceToHostComponentIdMap.hasOwnProperty(serviceName)) {
+        var service = App.cache['services'].findProperty('ServiceInfo.service_name', serviceName);
+        if (service) {
+          for (var n in serviceToHostComponentIdMap[serviceName]) {
+            if (serviceToHostComponentIdMap[serviceName].hasOwnProperty(n)) {
+              if (!service.host_components.contains(serviceToHostComponentIdMap[serviceName][n]))
{
+                service.host_components.pushObject(serviceToHostComponentIdMap[serviceName][n]);
+              }
+            }
+          }
+        }
       }
     }
     console.timeEnd('App.componentConfigMapper execution time');

http://git-wip-us.apache.org/repos/asf/ambari/blob/7ea3b8af/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 cd76b09..34bb124 100644
--- a/ambari-web/app/mappers/service_metrics_mapper.js
+++ b/ambari-web/app/mappers/service_metrics_mapper.js
@@ -181,6 +181,9 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
       /**
        * services contains constructed service-components structure from components array
        */
+
+      services.setEach('components', []);
+
       json.items.forEach(function (component) {
         var serviceName = component.ServiceComponentInfo.service_name;
         var service = services.findProperty('ServiceInfo.service_name', serviceName);


Mime
View raw message