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 2015/07/07 01:38:25 UTC

ambari git commit: AMBARI-12300. Hosts page becomes increasingly unresponsive and laggy (keeps freezing for a long time, especially on a big cluster). (yusaku)

Repository: ambari
Updated Branches:
  refs/heads/trunk cc9e4599a -> 9b991a4a6


AMBARI-12300. Hosts page becomes increasingly unresponsive and laggy (keeps freezing for a long time, especially on a big cluster). (yusaku)


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

Branch: refs/heads/trunk
Commit: 9b991a4a6682dba47b5d0b58aa34485e7c472ad6
Parents: cc9e459
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Mon Jul 6 16:15:45 2015 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Mon Jul 6 16:15:45 2015 -0700

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host.js | 12 +++++++++---
 ambari-web/app/mappers/hosts_mapper.js  | 19 +++++++++++--------
 2 files changed, 20 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9b991a4a/ambari-web/app/controllers/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host.js b/ambari-web/app/controllers/main/host.js
index e5f08b3..81711ef 100644
--- a/ambari-web/app/controllers/main/host.js
+++ b/ambari-web/app/controllers/main/host.js
@@ -54,9 +54,15 @@ App.MainHostController = Em.ArrayController.extend(App.TableServerMixin, {
     return installedComponents;
   }.property('App.router.clusterController.isLoaded'),
 
-  content: function () {
-    return this.get('dataSource').filterProperty('isRequested');
-  }.property('dataSource.@each.isRequested'),
+  content: [],
+
+  requestedObserver: function() {
+    Em.run.once(this, 'setContentOnce');
+  }.observes('dataSource.@each.isRequested'),
+
+  setContentOnce: function() {
+    this.set('content', this.get('dataSource').filterProperty('isRequested'));
+  },
 
   allHostStackVersions: App.HostStackVersion.find(),
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/9b991a4a/ambari-web/app/mappers/hosts_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/hosts_mapper.js b/ambari-web/app/mappers/hosts_mapper.js
index 6158ee9..5ab249e 100644
--- a/ambari-web/app/mappers/hosts_mapper.js
+++ b/ambari-web/app/mappers/hosts_mapper.js
@@ -156,11 +156,12 @@ App.hostsMapper = App.QuickDataMapper.create({
       }
 
 
-      App.Host.find().forEach(function (host) {
-        if (!hostIds[host.get('hostName')]) {
-          host.set('isRequested', false);
-        }
-      });
+      App.Host.find().filterProperty('isRequested', true)
+        .filter(function(item) {
+          return !hostIds[item.get('hostName')];
+        })
+        .setEach('isRequested', false);
+
       App.HostComponent.find().filterProperty('isMaster').forEach(function(component) {
         if (componentsIdMap[component.get('id')]) componentsIdMap[component.get('id')].display_name_advanced = component.get('displayNameAdvanced');
       });
@@ -188,9 +189,11 @@ App.hostsMapper = App.QuickDataMapper.create({
     this.get('model').find().forEach(function (host) {
       if (host.get('isRequested')) {
         var hostMetrics = data.items.findProperty('Hosts.host_name', host.get('hostName'));
-        host.set('diskTotal', Em.get(hostMetrics, 'metrics.disk.disk_total'));
-        host.set('diskFree', Em.get(hostMetrics, 'metrics.disk.disk_free'));
-        host.set('loadOne', Em.get(hostMetrics, 'metrics.load.load_one'));
+        host.setProperties({
+          diskTotal: Em.get(hostMetrics, 'metrics.disk.disk_total'),
+          diskFree: Em.get(hostMetrics, 'metrics.disk.disk_free'),
+          loadOne: Em.get(hostMetrics, 'metrics.load.load_one')
+        });
       }
     }, this);
   }