ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject git commit: AMBARI-6793. Need ResourceManager UI Quicklinks for active / standby. (akovalenko)
Date Mon, 11 Aug 2014 09:43:39 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk da2ac5777 -> 7826a3ff4


AMBARI-6793. Need ResourceManager UI Quicklinks for active / standby. (akovalenko)


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

Branch: refs/heads/trunk
Commit: 7826a3ff41d7a23dec54a636dbd088666a9fd6d9
Parents: da2ac57
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Fri Aug 8 17:40:02 2014 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Mon Aug 11 12:42:41 2014 +0300

----------------------------------------------------------------------
 .../app/mappers/service_metrics_mapper.js       |  4 +-
 .../app/views/common/quick_view_link_view.js    | 39 ++++++++++++++------
 2 files changed, 29 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7826a3ff/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 bc2211e..1ee93bc 100644
--- a/ambari-web/app/mappers/service_metrics_mapper.js
+++ b/ambari-web/app/mappers/service_metrics_mapper.js
@@ -170,7 +170,7 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     host_id: 'HostRoles.host_name',
     host_name: 'HostRoles.host_name',
     stale_configs: 'HostRoles.stale_configs',
-    ha_state: 'HostRoles.ha_state',
+    ha_status: 'HostRoles.ha_state',
     display_name_advanced: 'display_name_advanced',
     $service_id: 'none' /* will be set outside of parse function */
   },
@@ -352,7 +352,7 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
             hostComponent.display_name_advanced = null;
           }
         } else if (hostComponent.component_name === 'RESOURCEMANAGER' && isRMHAEnabled
&& hostComponent.work_status === 'STARTED') {
-          switch (hostComponent.ha_state) {
+          switch (hostComponent.ha_status) {
             case 'ACTIVE':
               hostComponent.display_name_advanced = Em.I18n.t('dashboard.services.yarn.resourceManager.active');
               break;

http://git-wip-us.apache.org/repos/asf/ambari/blob/7826a3ff/ambari-web/app/views/common/quick_view_link_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/quick_view_link_view.js b/ambari-web/app/views/common/quick_view_link_view.js
index 4eaf8a8..37611a7 100644
--- a/ambari-web/app/views/common/quick_view_link_view.js
+++ b/ambari-web/app/views/common/quick_view_link_view.js
@@ -111,7 +111,7 @@ App.QuickViewLinks = Em.View.extend({
 
   findComponentHost: function (components, componentName) {
     return App.singleNodeInstall ? App.singleNodeAlias : components.find(function (item)
{
-      return item.host_components.mapProperty('HostRoles.component_name').contains(componentName);
+      return item.host_components.someProperty('HostRoles.component_name', componentName);
     }).Hosts.public_host_name
   },
 
@@ -127,17 +127,13 @@ App.QuickViewLinks = Em.View.extend({
     var quickLinks = [];
     switch (serviceName) {
       case "HDFS":
-        var otherHost;
         if (this.get('content.snameNode')) {
           // not HA
           hosts[0] = this.findComponentHost(response.items, 'NAMENODE');
         } else {
           // HA enabled, need both two namenodes hosts
-          var nameNodes = response.items.filter(function (item) {
-            return item.host_components.mapProperty('HostRoles.component_name').contains('NAMENODE');
-          });
-          nameNodes.forEach(function(item) {
-            hosts.push({'publicHostName': item.Hosts.public_host_name});
+          this.get('content.hostComponents').filterProperty('componentName', 'NAMENODE').forEach(function
(component) {
+            hosts.push({'publicHostName': response.items.findProperty('Hosts.host_name',
component.get('hostName')).Hosts.public_host_name});
           });
           // assign each namenode status label
           if (this.get('content.activeNameNode')) {
@@ -160,18 +156,18 @@ App.QuickViewLinks = Em.View.extend({
         break;
       case "HBASE":
         var masterComponents = response.items.filter(function (item) {
-            return item.host_components.mapProperty('HostRoles.component_name').contains('HBASE_MASTER');
+            return item.host_components.someProperty('HostRoles.component_name', 'HBASE_MASTER');
         });
         var activeMaster, standbyMasters, otherMasters;
         if (App.supports.multipleHBaseMasters) {
           activeMaster = masterComponents.filter(function (item) {
-            return item.host_components.mapProperty('metrics.hbase.master.IsActiveMaster').contains('true');
+            return item.host_components.someProperty('metrics.hbase.master.IsActiveMaster',
'true');
           });
           standbyMasters = masterComponents.filter(function (item) {
-            return item.host_components.mapProperty('metrics.hbase.master.IsActiveMaster').contains('false');
+            return item.host_components.someProperty('metrics.hbase.master.IsActiveMaster',
'false');
           });
           otherMasters = masterComponents.filter(function (item) {
-            return !(item.host_components.mapProperty('metrics.hbase.master.IsActiveMaster').contains('true')
|| item.host_components.mapProperty('metrics.hbase.master.IsActiveMaster').contains('false'))
;
+            return !(item.host_components.someProperty('metrics.hbase.master.IsActiveMaster',
'true') || item.host_components.someProperty('metrics.hbase.master.IsActiveMaster', 'false'))
;
           });
         }
         if (masterComponents) {
@@ -200,7 +196,26 @@ App.QuickViewLinks = Em.View.extend({
         }
         break;
       case "YARN":
-        hosts[0] = this.findComponentHost(response.items, 'RESOURCEMANAGER');
+        if (App.get('isRMHaEnabled')) {
+          this.get('content.hostComponents').filterProperty('componentName', 'RESOURCEMANAGER').forEach(function
(component) {
+            var newHost = {'publicHostName': response.items.findProperty('Hosts.host_name',
component.get('hostName')).Hosts.public_host_name};
+            var status = '';
+            switch (component.get('haStatus')) {
+              case 'ACTIVE':
+                status = Em.I18n.t('quick.links.label.active');
+                break;
+              case 'STANDBY':
+                status = Em.I18n.t('quick.links.label.standby');
+                break;
+            }
+            if (status) {
+              newHost.status = status;
+            }
+            hosts.push(newHost);
+          }, this);
+        } else {
+          hosts[0] = this.findComponentHost(response.items, 'RESOURCEMANAGER');
+        }
         break;
       case "MAPREDUCE2":
         hosts[0] = this.findComponentHost(response.items, 'HISTORYSERVER');


Mime
View raw message