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-11821. With HBase master HA Ambari sometimes displays incorrect dashboard information. (jaimin)
Date Fri, 12 Jun 2015 20:20:32 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 7d463e79c -> fbb8bc7da


AMBARI-11821. With HBase master HA Ambari sometimes displays incorrect dashboard information.
(jaimin)


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

Branch: refs/heads/trunk
Commit: fbb8bc7da0909f20c5a6696b26acde358f26d564
Parents: 7d463e7
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Fri Jun 12 13:20:04 2015 -0700
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Fri Jun 12 13:20:04 2015 -0700

----------------------------------------------------------------------
 .../HBASE/0.96.0.2.0/metrics.json               |  12 +-
 .../YARN/2.1.0.2.0/YARN_metrics.json            |  10 +-
 .../stacks/HDP/2.3/services/HBASE/metrics.json  |  12 +-
 .../assets/data/metrics/HBASE/definition.json   |  15 --
 .../app/controllers/global/update_controller.js |  23 ++-
 .../app/mappers/service_metrics_mapper.js       | 153 ++++++++++---------
 ambari-web/app/messages.js                      |   1 -
 ambari-web/app/models/service/hbase.js          |   2 -
 ambari-web/app/models/service/mapreduce2.js     |   1 -
 ambari-web/app/models/service/yarn.js           |   1 -
 .../global/update_controller_test.js            |  19 ++-
 ambari-web/test/mappers/service_mapper_test.js  | 104 ++++++++++---
 12 files changed, 214 insertions(+), 139 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fbb8bc7d/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
index ae15651..5e5e775 100644
--- a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
+++ b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
@@ -3711,7 +3711,7 @@
             },
             "metrics/master/AssignmentManger/ritCount": {
               "metric":"master.AssignmentManger.ritCount",
-              "pointInTime": true,
+              "pointInTime": false,
               "temporal": true
             },
             "metrics/master/AssignmentManger/ritCountOverThreshold": {
@@ -5166,6 +5166,11 @@
               "pointInTime": true,
               "temporal": false
             },
+            "metrics/master/AssignmentManger/ritCount": {
+              "metric": "Hadoop:service=HBase,name=Master,sub=AssignmentManger.ritCount",
+              "pointInTime": true,
+              "temporal": false
+            },
             "metrics/rpc/balanceSwitchAvgTime": {
               "metric": "hadoop:service=HBase,name=RPCStatistics.balanceSwitchAvgTime",
               "pointInTime": true,
@@ -7692,6 +7697,11 @@
               "pointInTime": true,
               "temporal": false
             },
+            "metrics/master/AssignmentManger/ritCount": {
+              "metric": "Hadoop:service=HBase,name=Master,sub=AssignmentManger.ritCount",
+              "pointInTime": true,
+              "temporal": false
+            },
             "metrics/rpc/getBlockCacheColumnFamilySummariesNumOps": {
               "metric": "hadoop:service=HBase,name=RPCStatistics.getBlockCacheColumnFamilySummariesNumOps",
               "pointInTime": true,

http://git-wip-us.apache.org/repos/asf/ambari/blob/fbb8bc7d/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/YARN_metrics.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/YARN_metrics.json
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/YARN_metrics.json
index 92c32d8..9ea1483 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/YARN_metrics.json
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/YARN_metrics.json
@@ -1842,11 +1842,6 @@
               "pointInTime": true,
               "temporal": false
             },
-            "metrics/jvm/startTime": {
-              "metric": "java.lang:type=Runtime.StartTime",
-              "pointInTime": true,
-              "temporal": false
-            },
             "metrics/yarn/Queue/$1.replaceAll(\",q(\\d+)=\",\"/\").substring(1)/ActiveApplications":
{
               "metric": "Hadoop:service=ResourceManager,name=QueueMetrics(.+).ActiveApplications",
               "pointInTime": true,
@@ -2533,6 +2528,11 @@
               "pointInTime": true,
               "temporal": false
             },
+            "metrics/runtime/StartTime": {
+              "metric": "java.lang:type=Runtime.StartTime",
+              "pointInTime": true,
+              "temporal": false
+            },
             "metrics/jvm/memHeapCommittedM": {
               "metric": "Hadoop:service=ResourceManager,name=JvmMetrics.MemHeapCommittedM",
               "pointInTime": true,

http://git-wip-us.apache.org/repos/asf/ambari/blob/fbb8bc7d/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/metrics.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/metrics.json b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/metrics.json
index a309ec7..7f9cc16 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/metrics.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/metrics.json
@@ -3711,7 +3711,7 @@
             },
             "metrics/master/AssignmentManger/ritCount": {
               "metric":"master.AssignmentManger.ritCount",
-              "pointInTime": true,
+              "pointInTime": false,
               "temporal": true
             },
             "metrics/master/AssignmentManger/ritCountOverThreshold": {
@@ -5166,6 +5166,11 @@
               "pointInTime": true,
               "temporal": false
             },
+            "metrics/master/AssignmentManger/ritCount": {
+              "metric": "Hadoop:service=HBase,name=Master,sub=AssignmentManger.ritCount",
+              "pointInTime": true,
+              "temporal": false
+            },
             "metrics/rpc/balanceSwitchAvgTime": {
               "metric": "hadoop:service=HBase,name=RPCStatistics.balanceSwitchAvgTime",
               "pointInTime": true,
@@ -7692,6 +7697,11 @@
               "pointInTime": true,
               "temporal": false
             },
+            "metrics/master/AssignmentManger/ritCount": {
+              "metric": "Hadoop:service=HBase,name=Master,sub=AssignmentManger.ritCount",
+              "pointInTime": true,
+              "temporal": false
+            },
             "metrics/rpc/getBlockCacheColumnFamilySummariesNumOps": {
               "metric": "hadoop:service=HBase,name=RPCStatistics.getBlockCacheColumnFamilySummariesNumOps",
               "pointInTime": true,

http://git-wip-us.apache.org/repos/asf/ambari/blob/fbb8bc7d/ambari-web/app/assets/data/metrics/HBASE/definition.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/metrics/HBASE/definition.json b/ambari-web/app/assets/data/metrics/HBASE/definition.json
index 3374f2d..6837f7a 100644
--- a/ambari-web/app/assets/data/metrics/HBASE/definition.json
+++ b/ambari-web/app/assets/data/metrics/HBASE/definition.json
@@ -3916,11 +3916,6 @@
                           "temporal" : false,
                           "name" : "hadoop:service=HBase,name=RPCStatistics.deleteTableNumOps"
                         },
-                        "ServiceComponentInfo/Revision" : {
-                          "pointInTime" : true,
-                          "temporal" : false,
-                          "name" : "hadoop:service=HBase,name=Info.revision"
-                        },
                         "metrics/rpc/splitRegionAvgTime" : {
                           "pointInTime" : true,
                           "temporal" : false,
@@ -4131,11 +4126,6 @@
                           "temporal" : false,
                           "name" : "hadoop:service=HBase,name=RPCStatistics.multiMinTime"
                         },
-                        "metrics/hbase/master/revision" : {
-                          "pointInTime" : true,
-                          "temporal" : false,
-                          "name" : "hadoop:service=HBase,name=Info.revision"
-                        },
                         "metrics/rpc/modifyColumnMaxTime" : {
                           "pointInTime" : true,
                           "temporal" : false,
@@ -7279,11 +7269,6 @@
                           "temporal" : false,
                           "name" : "hadoop:service=HBase,name=RPCStatistics.multiMinTime"
                         },
-                        "metrics/hbase/master/revision" : {
-                          "pointInTime" : true,
-                          "temporal" : false,
-                          "name" : "hadoop:service=HBase,name=Info.revision"
-                        },
                         "metrics/rpc/modifyColumnMaxTime" : {
                           "pointInTime" : true,
                           "temporal" : false,

http://git-wip-us.apache.org/repos/asf/ambari/blob/fbb8bc7d/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 7246c37..e265c3f 100644
--- a/ambari-web/app/controllers/global/update_controller.js
+++ b/ambari-web/app/controllers/global/update_controller.js
@@ -380,10 +380,6 @@ App.UpdateController = Em.Controller.extend({
       haComponents = App.get('isHaEnabled') ? 'ServiceComponentInfo/component_name=JOURNALNODE|ServiceComponentInfo/component_name=ZKFC|'
: '',
       realUrl = '/components/?' + flumeHandlerParam + atsHandlerParam + haComponents +
         'ServiceComponentInfo/category=MASTER&fields=' +
-        'ServiceComponentInfo/Version,' +
-        'ServiceComponentInfo/StartTime,' +
-        'ServiceComponentInfo/HeapMemoryUsed,' +
-        'ServiceComponentInfo/HeapMemoryMax,' +
         'ServiceComponentInfo/service_name,' +
         'host_components/HostRoles/host_name,' +
         'host_components/HostRoles/state,' +
@@ -435,17 +431,16 @@ App.UpdateController = Em.Controller.extend({
     var serviceSpecificParams = {
       'FLUME': "host_components/processes/HostComponentProcess",
       'YARN': "host_components/metrics/yarn/Queue," +
-        "ServiceComponentInfo/rm_metrics/cluster/activeNMcount," +
-        "ServiceComponentInfo/rm_metrics/cluster/lostNMcount," +
-        "ServiceComponentInfo/rm_metrics/cluster/unhealthyNMcount," +
-        "ServiceComponentInfo/rm_metrics/cluster/rebootedNMcount," +
-        "ServiceComponentInfo/rm_metrics/cluster/decommissionedNMcount",
+        "host_components/metrics/yarn/ClusterMetrics/NumActiveNMs," +
+        "host_components/metrics/yarn/ClusterMetrics/NumLostNMs," +
+        "host_components/metrics/yarn/ClusterMetrics/NumUnhealthyNMs," +
+        "host_components/metrics/yarn/ClusterMetrics/NumRebootedNMs," +
+        "host_components/metrics/yarn/ClusterMetrics/NumDecommissionedNMs",
       'HBASE': "host_components/metrics/hbase/master/IsActiveMaster," +
-        "ServiceComponentInfo/MasterStartTime," +
-        "ServiceComponentInfo/MasterActiveTime," +
-        "ServiceComponentInfo/AverageLoad," +
-        "ServiceComponentInfo/Revision," +
-        "ServiceComponentInfo/RegionsInTransition",
+        "host_components/metrics/hbase/master/MasterStartTime," +
+        "host_components/metrics/hbase/master/MasterActiveTime," +
+        "host_components/metrics/hbase/master/AverageLoad," +
+        "host_components/metrics/master/AssignmentManger/ritCount",
       'STORM': /^2.1/.test(App.get('currentStackVersionNumber')) ? 'metrics/api/cluster/summary'
: 'metrics/api/v1/cluster/summary,metrics/api/v1/topology/summary'
     };
     var services = App.cache['services'];

http://git-wip-us.apache.org/repos/asf/ambari/blob/fbb8bc7d/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 9c39fc6..b97ec42 100644
--- a/ambari-web/app/mappers/service_metrics_mapper.js
+++ b/ambari-web/app/mappers/service_metrics_mapper.js
@@ -31,7 +31,7 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     passive_state: 'ServiceInfo.passive_state',
     critical_alerts_count: 'ServiceInfo.critical_alerts_count',
     $rand: Math.random(),
-    $alerts: [ 1, 2, 3 ],
+    $alerts: [1, 2, 3],
     host_components: 'host_components',
     tool_tip_content: 'tool_tip_content',
     installed_clients: 'installed_clients',
@@ -72,8 +72,7 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     nfs_gateways_total: 'nfs_gateways_total'
   },
   yarnConfig: {
-    version: 'resourceManagerComponent.ServiceComponentInfo.Version',
-    resource_manager_start_time: 'resourceManagerComponent.ServiceComponentInfo.StartTime',
+    resource_manager_start_time: 'resourceManagerComponent.host_components[0].metrics.runtime.StartTime',
     jvm_memory_heap_used: 'resourceManagerComponent.host_components[0].metrics.jvm.HeapMemoryUsed',
     jvm_memory_heap_max: 'resourceManagerComponent.host_components[0].metrics.jvm.HeapMemoryMax',
     containers_allocated: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.AllocatedContainers',
@@ -85,11 +84,11 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     apps_completed: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.AppsCompleted',
     apps_killed: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.AppsKilled',
     apps_failed: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.AppsFailed',
-    node_managers_count_active: 'resourceManagerComponent.ServiceComponentInfo.rm_metrics.cluster.activeNMcount',
-    node_managers_count_lost: 'resourceManagerComponent.ServiceComponentInfo.rm_metrics.cluster.lostNMcount',
-    node_managers_count_unhealthy: 'resourceManagerComponent.ServiceComponentInfo.rm_metrics.cluster.unhealthyNMcount',
-    node_managers_count_rebooted: 'resourceManagerComponent.ServiceComponentInfo.rm_metrics.cluster.rebootedNMcount',
-    node_managers_count_decommissioned: 'resourceManagerComponent.ServiceComponentInfo.rm_metrics.cluster.decommissionedNMcount',
+    node_managers_count_active: 'resourceManagerComponent.host_components[0].metrics.yarn.ClusterMetrics.NumActiveNMs',
+    node_managers_count_lost: 'resourceManagerComponent.host_components[0].metrics.yarn.ClusterMetrics.NumLostNMs',
+    node_managers_count_unhealthy: 'resourceManagerComponent.host_components[0].metrics.yarn.ClusterMetrics.NumUnhealthyNMs',
+    node_managers_count_rebooted: 'resourceManagerComponent.host_components[0].metrics.yarn.ClusterMetrics.NumRebootedNMs',
+    node_managers_count_decommissioned: 'resourceManagerComponent.host_components[0].metrics.yarn.ClusterMetrics.NumDecommissionedNMs',
     allocated_memory: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.AllocatedMB',
     available_memory: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.AvailableMB',
     reserved_memory: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.ReservedMB',
@@ -99,18 +98,15 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     node_managers_total: 'node_managers_total'
   },
   mapReduce2Config: {
-    version: 'jobHistoryServerComponent.ServiceComponentInfo.Version',
     map_reduce2_clients: 'map_reduce2_clients'
   },
   hbaseConfig: {
-    version: 'masterComponent.ServiceComponentInfo.Version',
-    master_start_time: 'masterComponent.ServiceComponentInfo.MasterStartTime',
-    master_active_time: 'masterComponent.ServiceComponentInfo.MasterActiveTime',
-    average_load: 'masterComponent.ServiceComponentInfo.AverageLoad',
+    master_start_time: 'masterComponent.host_components[0].metrics.hbase.master.MasterStartTime',
+    master_active_time: 'masterComponent.host_components[0].metrics.hbase.master.MasterActiveTime',
+    average_load: 'masterComponent.host_components[0].metrics.hbase.master.AverageLoad',
+    heap_memory_used: 'masterComponent.host_components[0].metrics.jvm.HeapMemoryUsed',
+    heap_memory_max: 'masterComponent.host_components[0].metrics.jvm.HeapMemoryMax',
     regions_in_transition: 'regions_in_transition',
-    revision: 'masterComponent.ServiceComponentInfo.Revision',
-    heap_memory_used: 'masterComponent.ServiceComponentInfo.HeapMemoryUsed',
-    heap_memory_max: 'masterComponent.ServiceComponentInfo.HeapMemoryMax',
     region_servers_started: 'region_servers_started',
     region_servers_installed: 'region_servers_installed',
     region_servers_total: 'region_servers_total',
@@ -147,7 +143,7 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
   config3: {
     id: 'id',
     work_status: 'HostRoles.state',
-    passive_state:'HostRoles.maintenance_state',
+    passive_state: 'HostRoles.maintenance_state',
     desired_status: 'HostRoles.desired_state',
     component_name: 'HostRoles.component_name',
     host_id: 'HostRoles.host_name',
@@ -173,11 +169,11 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
        * services contains constructed service-components structure from components array
        */
 
-      services.forEach(function(service) {
+      services.forEach(function (service) {
         service.host_components = [];
         service.components = [];
       });
-      
+
       json.items.forEach(function (component) {
         var serviceName = component.ServiceComponentInfo.service_name;
         var service = services.findProperty('ServiceInfo.service_name', serviceName);
@@ -266,23 +262,23 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
       //load services to model
       App.store.loadMany(this.get('model'), result);
       /*if (previousResponse.length !== result.length) {
-        App.store.loadMany(this.get('model'), result);
-      } else {
-        result.forEach(function (serviceJson) {
-          var fields = ['passive_state','work_status', 'rand', 'alerts', 'quick_links', 'host_components',
'tool_tip_content', 'critical_alerts_count'];
-          var service = this.get('model').find(serviceJson.id);
-          var modifiedData = this.getDiscrepancies(serviceJson, previousResponse.findProperty('id',
serviceJson.id), fields);
-          if (modifiedData.isLoadNeeded) {
-            App.store.load(this.get('model'), serviceJson);
-          } else {
-            for (var property in modifiedData) {
-              service.set(stringUtils.underScoreToCamelCase(property), modifiedData[property]);
-            }
-          }
-        }, this)
-      }
+       App.store.loadMany(this.get('model'), result);
+       } else {
+       result.forEach(function (serviceJson) {
+       var fields = ['passive_state','work_status', 'rand', 'alerts', 'quick_links', 'host_components',
'tool_tip_content', 'critical_alerts_count'];
+       var service = this.get('model').find(serviceJson.id);
+       var modifiedData = this.getDiscrepancies(serviceJson, previousResponse.findProperty('id',
serviceJson.id), fields);
+       if (modifiedData.isLoadNeeded) {
+       App.store.load(this.get('model'), serviceJson);
+       } else {
+       for (var property in modifiedData) {
+       service.set(stringUtils.underScoreToCamelCase(property), modifiedData[property]);
+       }
+       }
+       }, this)
+       }
 
-      previousResponse = result;*/
+       previousResponse = result;*/
     }
     console.timeEnd('App.serviceMetricsMapper execution time');
   },
@@ -298,7 +294,7 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     services.setEach('tool_tip_content', '');
     // set tooltip for client-only services
     var clientOnlyServiceNames = App.get('services.clientOnly');
-    clientOnlyServiceNames.forEach(function(serviceName) {
+    clientOnlyServiceNames.forEach(function (serviceName) {
       var service = services.findProperty('ServiceInfo.service_name', serviceName);
       if (service) {
         service.tool_tip_content = Em.I18n.t('services.service.summary.clientOnlyService.ToolTip');
@@ -357,8 +353,8 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
    * @param finalJson
    * @param item
    */
-  mapQuickLinks: function (finalJson, item){
-    if(!(item && item.ServiceInfo)) return;
+  mapQuickLinks: function (finalJson, item) {
+    if (!(item && item.ServiceInfo)) return;
     var quickLinks = {
       OOZIE: [19],
       GANGLIA: [20],
@@ -377,10 +373,11 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     var finalConfig = jQuery.extend({}, this.config);
     // Change the JSON so that it is easy to map
     var hdfsConfig = this.hdfsConfig;
+    var self = this;
     item.components.forEach(function (component) {
       if (component.ServiceComponentInfo && component.ServiceComponentInfo.component_name
== "NAMENODE") {
         //enabled HA
-        if ( component.host_components.length == 2) {
+        if (component.host_components.length == 2) {
           var haState1;
           var haState2;
           if (component.host_components[1].metrics && component.host_components[1].metrics.dfs)
{
@@ -424,12 +421,8 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
               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.
-          if (haState2 == "active") { // change places for all model bind with host_component[0]
-            var tmp = component.host_components[1];
-            component.host_components[1] = component.host_components[0];
-            component.host_components[0] = tmp;
-          }
+          var activeHostComponentIndex = haState2 == "active" ? 1 : 0;
+          self.setActiveAsFirstHostComponent(component, activeHostComponentIndex);
         }
         item.nameNodeComponent = component;
         finalConfig = jQuery.extend(finalConfig, hdfsConfig);
@@ -446,13 +439,13 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
         item.dead_data_nodes = [];
         item.live_data_nodes = [];
         for (var host in decommissionNodesJson) {
-          item.decommission_data_nodes.push('DATANODE'+ '_' + host);
+          item.decommission_data_nodes.push('DATANODE' + '_' + host);
         }
         for (var host in deadNodesJson) {
-          item.dead_data_nodes.push('DATANODE'+ '_' + host);
+          item.dead_data_nodes.push('DATANODE' + '_' + host);
         }
         for (var host in liveNodesJson) {
-          item.live_data_nodes.push('DATANODE'+ '_' + host);
+          item.live_data_nodes.push('DATANODE' + '_' + host);
         }
       }
       if (component.ServiceComponentInfo && component.ServiceComponentInfo.component_name
== "JOURNALNODE") {
@@ -472,6 +465,7 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
 
     return finalJson;
   },
+
   yarnMapper: function (item) {
     var result = [];
     var self = this;
@@ -485,11 +479,8 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
         // if YARN has two host components, ACTIVE one should be first in component.host_components
array for proper metrics mapping
         if (component.host_components.length === 2) {
           var activeRM = component.host_components.findProperty('HostRoles.ha_state', 'ACTIVE');
-          // if "second" RM isn't STARTED his ha_status is null (not STANDBY)
-          var standbyRM = component.host_components.filter(function(host_component) {return
host_component.HostRoles.ha_state !== 'ACTIVE';})[0];
-          if (activeRM && standbyRM) {
-            component.host_components = [activeRM, standbyRM];
-          }
+          var activeHostComponentIndex = component.host_components.indexOf(activeRM);
+          self.setActiveAsFirstHostComponent(component, activeHostComponentIndex);
         }
 
         if (component.host_components[0].metrics && component.host_components[0].metrics.yarn)
{
@@ -504,11 +495,11 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     });
     // Map
     var finalJson = this.parseIt(item, finalConfig);
-    finalJson.quick_links = [ 23, 24, 25, 26 ];
+    finalJson.quick_links = [23, 24, 25, 26];
     return finalJson;
   },
 
-  parseObject: function(obj) {
+  parseObject: function (obj) {
     var res = {};
     for (var p in obj) {
       if (obj.hasOwnProperty(p)) {
@@ -538,6 +529,7 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     return finalJson;
   },
   hbaseMapper: function (item) {
+    var self = this;
     // Change the JSON so that it is easy to map
     var finalConfig = jQuery.extend({}, this.config);
     var hbaseConfig = this.hbaseConfig;
@@ -545,12 +537,20 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
       if (component.ServiceComponentInfo && component.ServiceComponentInfo.component_name
== "HBASE_MASTER") {
         item.masterComponent = component;
         finalConfig = jQuery.extend(finalConfig, hbaseConfig);
-        var regionsArray = App.parseJSON(component.ServiceComponentInfo.RegionsInTransition);
-        //regions_in_transition can have various type of value: null, array or int
-        if (Array.isArray(regionsArray)) {
-          item.regions_in_transition = regionsArray.length;
-        } else {
-          item.regions_in_transition = regionsArray == null ? 0 : regionsArray;
+        if (component.host_components.length) {
+          var activeMaster = component.host_components.findProperty('metrics.hbase.master.IsActiveMaster',
'true');
+          var activeHostComponentIndex = component.host_components.indexOf(activeMaster);
+          self.setActiveAsFirstHostComponent(component, activeHostComponentIndex);
+          var regionsArray = null;
+          if (!Em.none(Em.get(component.host_components[0], 'metrics.master.AssignmentManger.ritCount')))
{
+            regionsArray = App.parseJSON(component.host_components[0].metrics.master.AssignmentManger.ritCount);
+          }
+          //regions_in_transition can have various type of value: null, array or int
+          if (Array.isArray(regionsArray)) {
+            item.regions_in_transition = regionsArray.length;
+          } else {
+            item.regions_in_transition = regionsArray == null ? 0 : regionsArray;
+          }
         }
       }
     });
@@ -560,7 +560,22 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     finalJson.quick_links = [13, 14, 15, 16, 17, 18];
     return finalJson;
   },
-  
+
+  /**
+   * Sets the active host component as the first host component
+   * @param component {Object}
+   * @param activeHostComponentIndex {Number}
+   */
+  setActiveAsFirstHostComponent: function (component, activeHostComponentIndex) {
+    // important: active component always at host_components[0];
+    if (activeHostComponentIndex && activeHostComponentIndex !== -1) {
+      var tmp = component.host_components[activeHostComponentIndex];
+      component.host_components[activeHostComponentIndex] = component.host_components[0];
+      component.host_components[0] = tmp;
+    }
+  }
+  ,
+
   /**
    * Flume is different from other services, in that the important
    * data is in customizable channels. Hence we directly transfer
@@ -576,9 +591,9 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     flumeHandlers = flumeHandlers ? flumeHandlers.host_components : [];
     finalJson.agents = [];
     finalJson.agentJsons = [];
-    flumeHandlers.forEach(function(flumeHandler){
+    flumeHandlers.forEach(function (flumeHandler) {
       var hostName = flumeHandler.HostRoles.host_name;
-      flumeHandler.processes.forEach(function(process){
+      flumeHandler.processes.forEach(function (process) {
         var agentJson = self.parseIt(process, self.flumeAgentConfig);
         var agentId = agentJson.name + "-" + hostName;
         finalJson.agents.push(agentId);
@@ -587,12 +602,13 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
       });
     });
     return finalJson;
-  },
+  }
+  ,
 
   /**
    * Storm mapper
    */
-  stormMapper: function(item) {
+  stormMapper: function (item) {
     var finalConfig = jQuery.extend({}, this.config);
     var stormConfig = this.stormConfig;
     var metricsInfoComponent = /^2.1/.test(App.get('currentStackVersionNumber')) ? 'STORM_REST_API'
: 'STORM_UI_SERVER';
@@ -601,7 +617,7 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
       STORM_UI_SERVER: 'metrics.api.v1.cluster.summary'
     }[metricsInfoComponent];
 
-    item.components.forEach(function(component) {
+    item.components.forEach(function (component) {
       if (component.ServiceComponentInfo && component.ServiceComponentInfo.component_name
== metricsInfoComponent) {
         if (Em.get(component, metricsPath)) {
           item.restApiComponent = App.keysDottedToCamelCase(Em.get(component, metricsPath));
@@ -616,4 +632,5 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     });
     return this.parseIt(item, finalConfig);
   }
-});
+})
+;

http://git-wip-us.apache.org/repos/asf/ambari/blob/fbb8bc7d/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 665ce8b..7c2e3d1 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2474,7 +2474,6 @@ Em.I18n.translations = {
   'dashboard.services.hbase.phoenixServers':'Phoenix Query Servers',
   'dashboard.services.hbase.phoenixServersSummary':'{0} live / {1} total',
   'dashboard.services.hbase.chart.label':'Request Count',
-  'dashboard.services.hbase.version':'Version',
   'dashboard.services.hbase.masterWebUI':'Master Web UI',
   'dashboard.services.hbase.regions.transition':'Regions In Transition',
   'dashboard.services.hbase.masterStarted':'Master Started',

http://git-wip-us.apache.org/repos/asf/ambari/blob/fbb8bc7d/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 662577f..5b39771 100644
--- a/ambari-web/app/models/service/hbase.js
+++ b/ambari-web/app/models/service/hbase.js
@@ -18,7 +18,6 @@
 var App = require('app');
 
 App.HBaseService = App.Service.extend({
-  version: DS.attr('string'),
   master: function () {
     return this.get('hostComponents').findProperty('componentName', 'HBASE_MASTER');
   }.property('hostComponents'),
@@ -32,7 +31,6 @@ App.HBaseService = App.Service.extend({
   masterActiveTime: DS.attr('number'),
   averageLoad: DS.attr('number'),
   regionsInTransition: DS.attr('number'),
-  revision: DS.attr('string'),
   heapMemoryUsed: DS.attr('number'),
   heapMemoryMax: DS.attr('number')
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/fbb8bc7d/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 388b236..ad343e1 100644
--- a/ambari-web/app/models/service/mapreduce2.js
+++ b/ambari-web/app/models/service/mapreduce2.js
@@ -18,7 +18,6 @@
 var App = require('app');
 
 App.MapReduce2Service = App.Service.extend({
-  version: DS.attr('string'),
   jobHistoryServer: function () {
     return this.get('hostComponents').findProperty('componentName', 'HISTORYSERVER');
   }.property('hostComponents'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/fbb8bc7d/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 eb33886..3534b4e 100644
--- a/ambari-web/app/models/service/yarn.js
+++ b/ambari-web/app/models/service/yarn.js
@@ -19,7 +19,6 @@ var App = require('app');
 var objectUtils = require('utils/object_utils');
 
 App.YARNService = App.Service.extend({
-  version: DS.attr('string'),
   resourceManager: function() {
     return this.get('hostComponents').findProperty('componentName', 'RESOURCEMANAGER');
   }.property('hostComponents'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/fbb8bc7d/ambari-web/test/controllers/global/update_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/global/update_controller_test.js b/ambari-web/test/controllers/global/update_controller_test.js
index f55136b..87be07b 100644
--- a/ambari-web/test/controllers/global/update_controller_test.js
+++ b/ambari-web/test/controllers/global/update_controller_test.js
@@ -147,11 +147,11 @@ describe('App.UpdateController', function () {
           }
         ],
         result: ["host_components/metrics/yarn/Queue," +
-          "ServiceComponentInfo/rm_metrics/cluster/activeNMcount," +
-          "ServiceComponentInfo/rm_metrics/cluster/lostNMcount," +
-          "ServiceComponentInfo/rm_metrics/cluster/unhealthyNMcount," +
-          "ServiceComponentInfo/rm_metrics/cluster/rebootedNMcount," +
-          "ServiceComponentInfo/rm_metrics/cluster/decommissionedNMcount"]
+        "host_components/metrics/yarn/ClusterMetrics/NumActiveNMs," +
+        "host_components/metrics/yarn/ClusterMetrics/NumLostNMs," +
+        "host_components/metrics/yarn/ClusterMetrics/NumUnhealthyNMs," +
+        "host_components/metrics/yarn/ClusterMetrics/NumRebootedNMs," +
+        "host_components/metrics/yarn/ClusterMetrics/NumDecommissionedNMs"]
       },
       {
         title: 'HBASE service',
@@ -163,11 +163,10 @@ describe('App.UpdateController', function () {
           }
         ],
         result: ["host_components/metrics/hbase/master/IsActiveMaster," +
-          "ServiceComponentInfo/MasterStartTime," +
-          "ServiceComponentInfo/MasterActiveTime," +
-          "ServiceComponentInfo/AverageLoad," +
-          "ServiceComponentInfo/Revision," +
-          "ServiceComponentInfo/RegionsInTransition"]
+        "host_components/metrics/hbase/master/MasterStartTime," +
+        "host_components/metrics/hbase/master/MasterActiveTime," +
+        "host_components/metrics/hbase/master/AverageLoad," +
+        "host_components/metrics/master/AssignmentManger/ritCount"]
       },
       {
         title: 'STORM service',

http://git-wip-us.apache.org/repos/asf/ambari/blob/fbb8bc7d/ambari-web/test/mappers/service_mapper_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mappers/service_mapper_test.js b/ambari-web/test/mappers/service_mapper_test.js
index 1ab4cf9..3545c03 100644
--- a/ambari-web/test/mappers/service_mapper_test.js
+++ b/ambari-web/test/mappers/service_mapper_test.js
@@ -32,48 +32,112 @@ describe('App.serviceMetricsMapper', function () {
         {
           components: [
             {
-                ServiceComponentInfo: {
-                  AverageLoad: 1.23456789,
-                  component_name: "HBASE_MASTER",
-                  RegionsInTransition : [ ]
+              ServiceComponentInfo: {
+                component_name: "HBASE_MASTER",
+                RegionsInTransition : [ ]
+              },
+              host_components: [
+                {
+                  metrics:{
+                    hbase: {
+                      master: {
+                        IsActiveMaster: 'true',
+                        AverageLoad: 1.23456789
+                      }
+                    },
+                    master: {
+                      AssignmentManger: {
+                        ritCount: 0
+                      }
+                    }
+                  }
                 }
-              }
+              ]
+            }
           ],
           e: '1.23'
         },
         {
           components: [
             {
-                ServiceComponentInfo: {
-                  AverageLoad: 1.00,
-                  component_name: "HBASE_MASTER",
-                  RegionsInTransition : [ ]
+              ServiceComponentInfo: {
+                component_name: "HBASE_MASTER",
+                RegionsInTransition : [ ]
+              },
+              host_components: [
+                {
+                  metrics:{
+                    hbase: {
+                      master: {
+                        IsActiveMaster: 'true',
+                        AverageLoad: 1.00
+                      }
+                    },
+                    master: {
+                      AssignmentManger: {
+                        ritCount: 0
+                      }
+                    }
+                  }
                 }
-              }
+              ]
+            }
           ],
           e: '1.00'
         },
         {
           components: [
             {
-                ServiceComponentInfo: {
-                  AverageLoad: 1,
-                  component_name: "HBASE_MASTER",
-                  RegionsInTransition : [ ]
+              ServiceComponentInfo: {
+                component_name: "HBASE_MASTER",
+                RegionsInTransition : [ ]
+              },
+              host_components: [
+                {
+                  metrics:{
+                    hbase: {
+                      master: {
+                        IsActiveMaster: 'true',
+                        AverageLoad: 1
+                      }
+                    },
+                    master: {
+                      AssignmentManger: {
+                        ritCount: 0
+                      }
+                    }
+                  }
                 }
-              }
+              ]
+            }
           ],
           e: '1.00'
         },
         {
           components: [
             {
-                ServiceComponentInfo: {
-                  AverageLoad: 1.2,
-                  component_name: "HBASE_MASTER",
-                  RegionsInTransition : [ ]
+              ServiceComponentInfo: {
+                component_name: "HBASE_MASTER",
+                RegionsInTransition : [ ]
+              },
+              host_components: [
+                {
+                  metrics:{
+                    hbase: {
+                      master: {
+                        IsActiveMaster: 'true',
+                        AverageLoad: 1.2
+                      }
+                    },
+                    master: {
+                      AssignmentManger: {
+                        ritCount: 0
+                      }
+                    }
+                  }
                 }
-              }
+              ]
+            }
           ],
           e: '1.20'
         }


Mime
View raw message