You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2014/06/24 16:16:26 UTC
git commit: AMBARI-6252 Service Configs page loads too slow on 2k
node cluster [patch 2]. (Buzhor Denys via ababiichuk)
Repository: ambari
Updated Branches:
refs/heads/trunk 7030788e3 -> 8d4c6b86a
AMBARI-6252 Service Configs page loads too slow on 2k node cluster [patch 2]. (Buzhor Denys via ababiichuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8d4c6b86
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8d4c6b86
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8d4c6b86
Branch: refs/heads/trunk
Commit: 8d4c6b86ab02af530c3ba0e5c13b05e456042e2d
Parents: 7030788
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Tue Jun 24 16:59:25 2014 +0300
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Tue Jun 24 16:59:56 2014 +0300
----------------------------------------------------------------------
.../controllers/global/cluster_controller.js | 20 --------------------
.../controllers/main/service/info/configs.js | 10 +++++-----
ambari-web/app/utils/config.js | 13 +++++++++++--
3 files changed, 16 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/8d4c6b86/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 b52cbe4..723a998 100644
--- a/ambari-web/app/controllers/global/cluster_controller.js
+++ b/ambari-web/app/controllers/global/cluster_controller.js
@@ -233,32 +233,12 @@ App.ClusterController = Em.Controller.extend({
}.property('App.router.updateController.isUpdated', 'dataLoadList.serviceMetrics'),
/**
- * Get all host names. We have many places where we need it.
- **/
- loadAllHostNames: function () {
- App.ajax.send({
- sender: this,
- name: 'cluster.fields',
- data: {
- fields: ['hosts'],
- clusterName: App.get('clusterName')
- },
- success: 'loadAllHostNamesSuccess'
- });
- },
-
- loadAllHostNamesSuccess: function(response) {
- App.cache['HostsList'] = response.hosts.mapProperty('Hosts.host_name');
- },
- /**
- *
* load all data and update load status
*/
loadClusterData: function () {
var self = this;
this.loadAmbariProperties();
this.loadAmbariViews();
- this.loadAllHostNames();
if (!this.get('clusterName')) {
return;
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/8d4c6b86/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index f7d4fbd..b494af4 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -224,9 +224,9 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
var serviceName = this.get('content.serviceName');
console.debug("loadServiceConfigs(): data=", data);
// Create default configuration group
- var defaultConfigGroupHosts = App.cache['HostsList'];
var selectedConfigGroup;
var siteToTagMap = {};
+ var hostsLength = App.router.get('mainHostController.hostsCountMap.TOTAL');
serviceConfigsDef.sites.forEach(function(siteName){
if(data.Clusters.desired_configs[siteName]){
siteToTagMap[siteName] = data.Clusters.desired_configs[siteName].tag;
@@ -253,9 +253,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
hosts: groupHosts,
configSiteTags: []
});
- groupHosts.forEach(function (host) {
- defaultConfigGroupHosts = defaultConfigGroupHosts.without(host);
- }, this);
+ hostsLength -= groupHosts.length;
item.desired_configs.forEach(function (config) {
newConfigGroup.configSiteTags.push(App.ConfigSiteTag.create({
site: config.type,
@@ -276,7 +274,9 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
name: App.Service.DisplayNames[serviceName] + " Default",
description: "Default cluster level " + serviceName + " configuration",
isDefault: true,
- hosts: defaultConfigGroupHosts,
+ hosts: {
+ length: hostsLength
+ },
parentConfigGroup: null,
service: this.get('content'),
serviceName: serviceName,
http://git-wip-us.apache.org/repos/asf/ambari/blob/8d4c6b86/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index 2238b72..9037061 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -1292,12 +1292,21 @@ App.config = Em.Object.create({
}.property('selectedConfigGroup'),
onPrimary: function () {
var newGroup = this.get('selectedConfigGroup');
- selectedGroup.get('hosts').removeObject(hostName);
+ if (selectedGroup.get('isDefault')) {
+ selectedGroup.set('hosts.length', selectedGroup.get('hosts.length') - 1)
+ } else {
+ selectedGroup.get('hosts').removeObject(hostName);
+ }
if (!selectedGroup.get('isDefault')) {
self.updateConfigurationGroup(selectedGroup, function () {
}, Em.K);
}
- newGroup.get('hosts').pushObject(hostName);
+
+ if (newGroup.get('isDefault')) {
+ newGroup.set('hosts.length', newGroup.get('hosts.length') + 1)
+ } else {
+ newGroup.get('hosts').pushObject(hostName);
+ }
callback(newGroup);
if (!newGroup.get('isDefault')) {
self.updateConfigurationGroup(newGroup, function () {