You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2016/02/12 19:30:52 UTC

[06/19] ambari git commit: AMBARI-14810 When their are multiple Job History Servers in the cluster, QuickLinks should show the URL for all instances. (atkach)

AMBARI-14810 When their are multiple Job History Servers in the cluster, QuickLinks should show the URL for all instances. (atkach)


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

Branch: refs/heads/2.2.1-maint
Commit: c579388e64aa32ea4b3df1126ebd7beb1759c1cb
Parents: 81c58bb
Author: Andrii Tkach <at...@hortonworks.com>
Authored: Wed Jan 27 17:40:21 2016 +0200
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Thu Feb 4 11:36:39 2016 -0800

----------------------------------------------------------------------
 .../app/views/common/quick_view_link_view.js      | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c579388e/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 7825c09..ece034c 100644
--- a/ambari-web/app/views/common/quick_view_link_view.js
+++ b/ambari-web/app/views/common/quick_view_link_view.js
@@ -228,6 +228,9 @@ App.QuickViewLinks = Em.View.extend({
             }
             if (item.get('service_id')==='OOZIE') {
               newItem.url = item.get('template').fmt(protocol, host.publicHostName, port, App.router.get('loginName'));
+            } else if (item.get('service_id')==='MAPREDUCE2') {
+              var hostPortConfigValue = "%@:%@".fmt(host.publicHostName, port);
+              newItem.url = item.get('template').fmt(protocol, hostPortConfigValue);
             } else {
               newItem.url = item.get('template').fmt(protocol, host.publicHostName, port);
             }
@@ -259,10 +262,11 @@ App.QuickViewLinks = Em.View.extend({
       return [App.get('singleNodeAlias')];
     }
     var hosts = [];
+    var components;
     switch (serviceName) {
       case 'OOZIE':
         // active OOZIE components
-        var components = this.get('content.hostComponents').filterProperty('componentName','OOZIE_SERVER').filterProperty('workStatus', 'STARTED');
+        components = this.get('content.hostComponents').filterProperty('componentName','OOZIE_SERVER').filterProperty('workStatus', 'STARTED');
         if (components && components.length > 1) {
           components.forEach(function (component) {
             hosts.push({
@@ -361,6 +365,18 @@ App.QuickViewLinks = Em.View.extend({
       case "ATLAS":
         hosts[0] = this.findComponentHost(response.items, "ATLAS_SERVER");
         break;
+      case "MAPREDUCE2":
+        components = this.get('content.hostComponents').filterProperty('componentName', 'HISTORYSERVER');
+        if (components && components.length > 1) {
+          components.forEach(function (component) {
+            hosts.push({
+              'publicHostName': response.items.findProperty('Hosts.host_name', component.get('hostName')).Hosts.public_host_name
+            });
+          });
+        } else if (components && components.length === 1) {
+          hosts[0] = this.findComponentHost(response.items, 'HISTORYSERVER');
+        }
+        break;
       default:
         var service = App.StackService.find().findProperty('serviceName', serviceName);
         if (service && service.get('hasMaster')) {