ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject git commit: AMBARI-6305 "Quick Links" are unusably slow (takes more than 30 seconds for the links to appear). (atkach)
Date Fri, 27 Jun 2014 13:04:49 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-1.6.1 1110b5714 -> e67f8a4a9


AMBARI-6305 "Quick Links" are unusably slow (takes more than 30 seconds for the links to appear).
(atkach)


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

Branch: refs/heads/branch-1.6.1
Commit: e67f8a4a9982de223550af07ae2c9cfa878f375f
Parents: 1110b57
Author: atkach <atkach@hortonworks.com>
Authored: Fri Jun 27 16:02:20 2014 +0300
Committer: atkach <atkach@hortonworks.com>
Committed: Fri Jun 27 16:04:43 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/global/cluster_controller.js | 8 +++++---
 ambari-web/app/utils/ajax/ajax.js                       | 2 +-
 ambari-web/app/views/common/quick_view_link_view.js     | 4 +++-
 3 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e67f8a4a/ambari-web/app/controllers/global/cluster_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js
index 723a998..d148173 100644
--- a/ambari-web/app/controllers/global/cluster_controller.js
+++ b/ambari-web/app/controllers/global/cluster_controller.js
@@ -151,14 +151,15 @@ App.ClusterController = Em.Controller.extend({
       return 'http://gangliaserver/ganglia/?t=yes';
     } else {
       // We want live data here
-      if (this.get('isLoaded')) {
+      var gangliaServer = App.HostComponent.find().findProperty('componentName', 'GANGLIA_SERVER');
+      if (this.get('isLoaded') && gangliaServer) {
         this.set('isGangliaUrlLoaded', true);
         App.ajax.send({
           name: 'hosts.for_quick_links',
           sender: this,
           data: {
             clusterName: App.get('clusterName'),
-            masterComponents: 'GANGLIA_SERVER',
+            masterHosts: gangliaServer.get('hostName'),
             urlParams: ''
           },
           success: 'setGangliaUrlSuccessCallback'
@@ -181,6 +182,7 @@ App.ClusterController = Em.Controller.extend({
       return 'http://nagiosserver/nagios';
     } else {
       // We want live data here
+      var nagiosServer = App.HostComponent.find().findProperty('componentName', 'NAGIOS_SERVER');
       if (this.get('isLoaded')) {
         this.set('isNagiosUrlLoaded', false);
         App.ajax.send({
@@ -188,7 +190,7 @@ App.ClusterController = Em.Controller.extend({
           sender: this,
           data: {
             clusterName: App.get('clusterName'),
-            masterComponents: 'NAGIOS_SERVER',
+            masterHosts: nagiosServer.get('hostName'),
             urlParams: ''
           },
           success: 'setNagiosUrlSuccessCallback'

http://git-wip-us.apache.org/repos/asf/ambari/blob/e67f8a4a/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index 521f29d..1bd4700 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -2067,7 +2067,7 @@ var urls = {
     'mock': ''
   },
   'hosts.for_quick_links': {
-    'real': '/clusters/{clusterName}/hosts?host_components/HostRoles/component_name.in({masterComponents})&fields=Hosts/public_host_name,host_components/HostRoles/component_name{urlParams}&minimal_response=true',
+    'real': '/clusters/{clusterName}/hosts?Hosts/host_name.in({masterHosts})&fields=Hosts/public_host_name,host_components/HostRoles/component_name{urlParams}&minimal_response=true',
     'mock': ''
   },
   'hosts.confirmed.install': {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e67f8a4a/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 5f931ff..fb76c5b 100644
--- a/ambari-web/app/views/common/quick_view_link_view.js
+++ b/ambari-web/app/views/common/quick_view_link_view.js
@@ -50,12 +50,14 @@ App.QuickViewLinks = Em.View.extend({
   },
 
   getQuickLinksHosts: function () {
+    var masterHosts = App.HostComponent.find().filterProperty('isMaster').mapProperty('hostName').uniq();
+
     App.ajax.send({
       name: 'hosts.for_quick_links',
       sender: this,
       data: {
         clusterName: App.get('clusterName'),
-        masterComponents: App.StackServiceComponent.find().filterProperty('isMaster', true).mapProperty('componentName').join(','),
+        masterHosts: masterHosts.join(','),
         urlParams: ',host_components/metrics/hbase/master/IsActiveMaster'
       },
       success: 'setQuickLinksSuccessCallback'


Mime
View raw message