ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject ambari git commit: AMBARI-11363. widget polls standby hostcomponent for metrics when failover happens. (jaimin)
Date Mon, 25 May 2015 02:06:31 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk e6f975a64 -> 75a806cc6


AMBARI-11363. widget polls standby hostcomponent for metrics when failover happens. (jaimin)


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

Branch: refs/heads/trunk
Commit: 75a806cc675915f74641d35349faa17f9492e7a6
Parents: e6f975a
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Sun May 24 19:06:16 2015 -0700
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Sun May 24 19:06:16 2015 -0700

----------------------------------------------------------------------
 .../service/widgets/create/step3_controller.js  |  1 +
 .../app/mixins/common/widgets/widget_mixin.js   | 20 +++++++++++---------
 2 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/75a806cc/ambari-web/app/controllers/main/service/widgets/create/step3_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/widgets/create/step3_controller.js b/ambari-web/app/controllers/main/service/widgets/create/step3_controller.js
index 4c9dc81..8a0eaa3 100644
--- a/ambari-web/app/controllers/main/service/widgets/create/step3_controller.js
+++ b/ambari-web/app/controllers/main/service/widgets/create/step3_controller.js
@@ -129,6 +129,7 @@ App.WidgetWizardStep3Controller = Em.Controller.extend({
         author: this.get('widgetAuthor'),
         metrics: this.get('widgetMetrics').map(function (metric) {
           delete metric.data;
+          delete metric.actual_host_component_criteria;
           return metric;
         }),
         values: this.get('widgetValues').map(function (value) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/75a806cc/ambari-web/app/mixins/common/widgets/widget_mixin.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/widgets/widget_mixin.js b/ambari-web/app/mixins/common/widgets/widget_mixin.js
index 5f91be5..0220a7e 100644
--- a/ambari-web/app/mixins/common/widgets/widget_mixin.js
+++ b/ambari-web/app/mixins/common/widgets/widget_mixin.js
@@ -133,7 +133,7 @@ App.WidgetMixin = Ember.Mixin.create({
       metrics.forEach(function (metric, index) {
         var key;
         if (metric.host_component_criteria) {
-          this.tweakHostComponentCriteria(metric);
+          this.createActualHostComponentCriteria(metric);
           key = metric.service_name + '_' + metric.component_name + '_' + metric.host_component_criteria;
         } else {
           key = metric.service_name + '_' + metric.component_name;
@@ -153,27 +153,29 @@ App.WidgetMixin = Ember.Mixin.create({
   },
 
   /**
-   * Tweak necessary host component criteria
-   * NameNode HA host component criteria is applicable only in HA mode
+   * Create actual host component criteria  from persisted host component criteria
+   * NameNode HA and ReourceManager HA host component criteria is applicable only in HA mode
    */
-  tweakHostComponentCriteria: function (metric) {
+  createActualHostComponentCriteria: function (metric) {
     switch (metric.component_name) {
       case 'NAMENODE':
         if (metric.host_component_criteria === 'host_components/metrics/dfs/FSNamesystem/HAState=active')
{
-          //if (metric.host_component_criteria)
           var hdfs = App.HDFSService.find().objectAt(0);
           var activeNNHostName = !hdfs.get('snameNode') && hdfs.get('activeNameNode');
           if (!activeNNHostName) {
-            metric.host_component_criteria = 'host_components/HostRoles/component_name=NAMENODE';
+            metric.actual_host_component_criteria = 'host_components/HostRoles/component_name=NAMENODE';
+          } else {
+            metric.actual_host_component_criteria = metric.host_component_criteria;
           }
         }
         break;
       case 'RESOURCEMANAGER':
         if (metric.host_component_criteria === 'host_components/HostRoles/ha_state=ACTIVE')
{
-          //if (metric.host_component_criteria)
           var yarn = App.YARNService.find().objectAt(0);
           if (!yarn.get('isRMHaEnabled')) {
-            metric.host_component_criteria = 'host_components/HostRoles/component_name=RESOURCEMANAGER';
+            metric.actual_host_component_criteria = 'host_components/HostRoles/component_name=RESOURCEMANAGER';
+          } else {
+            metric.actual_host_component_criteria = metric.host_component_criteria;
           }
         }
         break;
@@ -245,7 +247,7 @@ App.WidgetMixin = Ember.Mixin.create({
         serviceName: request.service_name,
         componentName: request.component_name,
         metricPaths: request.metric_paths.join(','),
-        hostComponentCriteria: request.host_component_criteria
+        hostComponentCriteria: request.actual_host_component_criteria || request.host_component_criteria
       }
     });
   },


Mime
View raw message