You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by at...@apache.org on 2014/01/29 11:54:50 UTC
git commit: AMBARI-4453 Change calls on initial load to run in
parallel. (atkach)
Updated Branches:
refs/heads/trunk 2b0ced0d4 -> a2579c320
AMBARI-4453 Change calls on initial load to run in parallel. (atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a2579c32
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a2579c32
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a2579c32
Branch: refs/heads/trunk
Commit: a2579c320a08c0f0eafd5652e5f41952e9a75db5
Parents: 2b0ced0
Author: atkach <at...@hortonworks.com>
Authored: Wed Jan 29 12:51:05 2014 +0200
Committer: atkach <at...@hortonworks.com>
Committed: Wed Jan 29 12:51:05 2014 +0200
----------------------------------------------------------------------
.../app/assets/data/hosts/HDP2/hosts_init.json | 360 +++++++++++++++++++
.../controllers/global/cluster_controller.js | 78 ++--
.../app/controllers/global/update_controller.js | 2 -
.../app/controllers/wizard/step9_controller.js | 3 +-
ambari-web/app/mappers/hosts_mapper.js | 3 +
.../app/mappers/service_metrics_mapper.js | 5 +-
ambari-web/app/mappers/status_mapper.js | 3 +
ambari-web/app/utils/http_client.js | 6 +-
8 files changed, 424 insertions(+), 36 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/a2579c32/ambari-web/app/assets/data/hosts/HDP2/hosts_init.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/hosts/HDP2/hosts_init.json b/ambari-web/app/assets/data/hosts/HDP2/hosts_init.json
new file mode 100644
index 0000000..bf3d10f
--- /dev/null
+++ b/ambari-web/app/assets/data/hosts/HDP2/hosts_init.json
@@ -0,0 +1,360 @@
+{
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts?fields=Hosts/host_name,Hosts/public_host_name,Hosts/disk_info,Hosts/cpu_count,Hosts/total_mem,Hosts/host_status,Hosts/last_heartbeat_time,Hosts/os_arch,Hosts/os_type,Hosts/ip,host_components,metrics/disk,metrics/load/load_one",
+ "items" : [
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com",
+ "Hosts" : {
+ "cluster_name" : "c1",
+ "cpu_count" : 1,
+ "disk_info" : [
+ {
+ "available" : "46389672",
+ "used" : "4692332",
+ "percent" : "10%",
+ "size" : "51606140",
+ "type" : "ext4",
+ "mountpoint" : "/"
+ },
+ {
+ "available" : "1027192",
+ "used" : "272",
+ "percent" : "1%",
+ "size" : "1027464",
+ "type" : "tmpfs",
+ "mountpoint" : "/dev/shm"
+ },
+ {
+ "available" : "409107",
+ "used" : "61137",
+ "percent" : "14%",
+ "size" : "495844",
+ "type" : "ext4",
+ "mountpoint" : "/boot"
+ },
+ {
+ "available" : "44459296",
+ "used" : "184796",
+ "percent" : "1%",
+ "size" : "47033288",
+ "type" : "ext4",
+ "mountpoint" : "/home"
+ },
+ {
+ "available" : "29882200",
+ "used" : "457830724",
+ "percent" : "94%",
+ "size" : "487712924",
+ "type" : "vboxsf",
+ "mountpoint" : "/media/sf_ambari"
+ }
+ ],
+ "host_name" : "dev01.hortonworks.com",
+ "host_status" : "HEALTHY",
+ "ip" : "10.0.2.15",
+ "last_heartbeat_time" : 1375309885919,
+ "os_arch" : "x86_64",
+ "os_type" : "centos6",
+ "public_host_name" : "dev01.hortonworks.com",
+ "total_mem" : 2055208
+ },
+ "metrics" : {
+ "disk" : {
+ "disk_free" : 91.23,
+ "disk_total" : 101.515
+ },
+ "load" : {
+ "load_one" : 1.51880555556
+ }
+ },
+ "host_components" : [
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/DATANODE",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "DATANODE",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/GANGLIA_MONITOR",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "GANGLIA_MONITOR",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/GANGLIA_SERVER",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "GANGLIA_SERVER",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/HBASE_CLIENT",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "HBASE_CLIENT",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/HBASE_MASTER",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "HBASE_MASTER",
+ "ha_status" : "passive",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/HBASE_REGIONSERVER",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "HBASE_REGIONSERVER",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/HCAT",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "HCAT",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/HDFS_CLIENT",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "HDFS_CLIENT",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/HISTORYSERVER",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "HISTORYSERVER",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/HIVE_CLIENT",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "HIVE_CLIENT",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/HIVE_METASTORE",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "HIVE_METASTORE",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/HIVE_SERVER",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "HIVE_SERVER",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/MAPREDUCE2_CLIENT",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "MAPREDUCE2_CLIENT",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/MYSQL_SERVER",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "MYSQL_SERVER",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/NAGIOS_SERVER",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "NAGIOS_SERVER",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/NAMENODE",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "NAMENODE",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/NODEMANAGER",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "NODEMANAGER",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/OOZIE_CLIENT",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "OOZIE_CLIENT",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/OOZIE_SERVER",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "OOZIE_SERVER",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/PIG",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "PIG",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/RESOURCEMANAGER",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "RESOURCEMANAGER",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/SECONDARY_NAMENODE",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "SECONDARY_NAMENODE",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/WEBHCAT_SERVER",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "WEBHCAT_SERVER",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/YARN_CLIENT",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "YARN_CLIENT",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/APP_TIMELINE_SERVER",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "APP_TIMELINE_SERVER",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/TEZ_CLIENT",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "TEZ_CLIENT",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/ZOOKEEPER_CLIENT",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "ZOOKEEPER_CLIENT",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/ZOOKEEPER_SERVER",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "ZOOKEEPER_SERVER",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/NIMBUS",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "NIMBUS",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/SUPERVISOR",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "SUPERVISOR",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ },
+ {
+ "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/FALCON",
+ "HostRoles" : {
+ "cluster_name" : "c1",
+ "component_name" : "FALCON_SERVER",
+ "host_name" : "dev01.hortonworks.com",
+ "state" : "INSTALLED"
+ }
+ }
+ ],
+ "alerts" : {
+ "summary" : {
+ "CRITICAL" : 9,
+ "OK" : 5,
+ "WARNING" : 2
+ }
+ }
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/a2579c32/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 9236d23..46670a1 100644
--- a/ambari-web/app/controllers/global/cluster_controller.js
+++ b/ambari-web/app/controllers/global/cluster_controller.js
@@ -58,7 +58,6 @@ App.ClusterController = Em.Controller.extend({
'clusterStatus':false,
'racks':false,
'users':false,
- 'status': false,
'componentConfigs': false
}),
@@ -193,16 +192,24 @@ App.ClusterController = Em.Controller.extend({
/**
* Send request to server to load components updated statuses
* @param callback Slave function, should be called to fire delayed update.
+ * @param isInitialLoad
* Look at <code>App.updater.run</code> for more information
* @return {Boolean} Whether we have errors
*/
- loadUpdatedStatus: function(callback){
- if(!this.get('clusterName')){
+ loadUpdatedStatus: function (callback, isInitialLoad) {
+ if (!this.get('clusterName')) {
callback();
return false;
}
- var testUrl = App.get('isHadoop2Stack') ? '/data/hosts/HDP2/hc_host_status.json':'/data/dashboard/services.json';
+ var testUrl = App.get('isHadoop2Stack') ? '/data/hosts/HDP2/hc_host_status.json' : '/data/dashboard/services.json';
var statusUrl = '/hosts?fields=Hosts/host_status,host_components/HostRoles/state&minimal_response=true';
+ if (isInitialLoad) {
+ testUrl = '/data/hosts/HDP2/hosts_init.json';
+ statusUrl = '/hosts?fields=Hosts/host_name,Hosts/public_host_name,Hosts/cpu_count,Hosts/ph_cpu_count,Hosts/total_mem,' +
+ 'Hosts/host_status,Hosts/last_heartbeat_time,Hosts/os_arch,Hosts/os_type,Hosts/ip,host_components/HostRoles/state,' +
+ 'Hosts/disk_info,metrics/disk,metrics/load/load_one,metrics/cpu/cpu_system,metrics/cpu/cpu_user,' +
+ 'metrics/memory/mem_total,metrics/memory/mem_free,alerts/summary&minimal_response=true';
+ }
//desired_state property is eliminated since calculateState function is commented out, it become useless
statusUrl = this.getUrl(testUrl, statusUrl);
@@ -247,10 +254,6 @@ App.ClusterController = Em.Controller.extend({
return;
}
var clusterUrl = this.getUrl('/data/clusters/cluster.json', '?fields=Clusters');
- var hostsRealUrl = '/hosts?fields=Hosts/host_name,Hosts/public_host_name,Hosts/cpu_count,Hosts/ph_cpu_count,Hosts/total_mem,' +
- 'Hosts/host_status,Hosts/last_heartbeat_time,Hosts/os_arch,Hosts/os_type,Hosts/ip,host_components,Hosts/disk_info,' +
- 'metrics/disk,metrics/load/load_one,metrics/cpu/cpu_system,metrics/cpu/cpu_user,metrics/memory/mem_total,metrics/memory/mem_free,'+
- 'alerts/summary&minimal_response=true';
var usersUrl = App.testMode ? '/data/users/users.json' : App.apiPrefix + '/users/?fields=*';
var racksUrl = "/data/racks/racks.json";
@@ -288,34 +291,55 @@ App.ClusterController = Em.Controller.extend({
/**
* Order of loading:
- * 1. put services in cache
- * 2. load host-components to model
- * 3. load services from cache with metrics to model
- * 4. update stale_configs of host-components (depends on App.supports.hostOverrides)
- * 5. load hosts to model
+ * 1. request for services
+ * 2. put services in cache
+ * 3. request for hosts and host-components (single call)
+ * 4. request for service metrics
+ * 5. load host-components to model
+ * 6. load hosts to model
+ * 7. load services from cache with metrics to model
+ * 8. update stale_configs of host-components (depends on App.supports.hostOverrides)
*/
-
App.router.get('updateController').updateServices(function () {
self.updateLoadStatus('services');
self.loadUpdatedStatus(function () {
- self.updateLoadStatus('status');
- App.router.get('updateController').updateServiceMetric(function () {
- if (App.supports.hostOverrides) {
- App.router.get('updateController').updateComponentConfig(function () {
- self.updateLoadStatus('componentConfigs');
- });
- } else {
+ self.updateLoadStatus('hosts');
+ if (App.supports.hostOverrides) {
+ App.router.get('updateController').updateComponentConfig(function () {
self.updateLoadStatus('componentConfigs');
- }
- self.updateLoadStatus('serviceMetrics');
- self.requestHosts(hostsRealUrl, function (jqXHR, textStatus) {
- self.updateLoadStatus('hosts');
});
- }, true);
- });
+ } else {
+ self.updateLoadStatus('componentConfigs');
+ }
+ }, true);
+ App.router.get('updateController').updateServiceMetric(function () {}, true);
});
},
+ /**
+ * json from serviceMetricsMapper on initial load
+ */
+ serviceMetricsJson: null,
+ /**
+ * control that services was loaded to model strictly after hosts and host-components
+ * regardless which request was completed first
+ * @param json
+ */
+ deferServiceMetricsLoad: function (json) {
+ if (json) {
+ if (this.get('dataLoadList.hosts')) {
+ App.serviceMetricsMapper.map(json, true);
+ this.updateLoadStatus('serviceMetrics');
+ } else {
+ this.set('serviceMetricsJson', json);
+ }
+ } else if (this.get('serviceMetricsJson')) {
+ json = this.get('serviceMetricsJson');
+ this.set('serviceMetricsJson', null);
+ App.serviceMetricsMapper.map(json, true);
+ this.updateLoadStatus('serviceMetrics');
+ }
+ },
requestHosts: function(realUrl, callback){
var testHostUrl = App.get('isHadoop2Stack') ? '/data/hosts/HDP2/hosts.json':'/data/hosts/hosts.json';
http://git-wip-us.apache.org/repos/asf/ambari/blob/a2579c32/ambari-web/app/controllers/global/update_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/update_controller.js b/ambari-web/app/controllers/global/update_controller.js
index ec190be..db8e7d0 100644
--- a/ambari-web/app/controllers/global/update_controller.js
+++ b/ambari-web/app/controllers/global/update_controller.js
@@ -139,7 +139,6 @@ App.UpdateController = Em.Controller.extend({
});
var conditionalFieldsString = conditionalFields.length > 0 ? ',' + conditionalFields.join(',') : '';
var initialFieldsString = initialFields.length > 0 ? ',' + initialFields.join(',') : '';
- var methodStartTs = new Date().getTime();
var testUrl = App.get('isHadoop2Stack') ? '/data/dashboard/HDP2/master_components.json':'/data/dashboard/services.json';
var realUrl = '/components/?ServiceComponentInfo/category=MASTER&fields=' +
@@ -177,7 +176,6 @@ App.UpdateController = Em.Controller.extend({
};
App.HttpClient.get(servicesUrl, App.serviceMetricsMapper, {
complete: function(){
- console.log("UpdateServiceMetric() Finished in:"+ (new Date().getTime()-methodStartTs) + " ms");
callback();
}
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/a2579c32/ambari-web/app/controllers/wizard/step9_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step9_controller.js b/ambari-web/app/controllers/wizard/step9_controller.js
index f8f32b9..fdec1d9 100644
--- a/ambari-web/app/controllers/wizard/step9_controller.js
+++ b/ambari-web/app/controllers/wizard/step9_controller.js
@@ -682,6 +682,7 @@ App.WizardStep9Controller = Em.Controller.extend({
console.log("Step9: ERROR: NO tasks available to process");
}
var requestId = this.get('content.cluster.requestId');
+ tasksData.setEach('Tasks.request_id', requestId);
if(polledData.Requests && polledData.Requests.id && polledData.Requests.id!=requestId){
// We don't want to use non-current requestId's tasks data to
// determine the current install status.
@@ -737,7 +738,7 @@ App.WizardStep9Controller = Em.Controller.extend({
getUrl: function (requestId) {
var clusterName = this.get('content.cluster.name');
var requestId = requestId || this.get('content.cluster.requestId');
- var url = App.apiPrefix + '/clusters/' + clusterName + '/requests/' + requestId + '?fields=tasks/Tasks/command,tasks/Tasks/exit_code,tasks/Tasks/host_name,tasks/Tasks/id,tasks/Tasks/role,tasks/Tasks/status';
+ var url = App.apiPrefix + '/clusters/' + clusterName + '/requests/' + requestId + '?fields=tasks/Tasks/command,tasks/Tasks/exit_code,tasks/Tasks/host_name,tasks/Tasks/id,tasks/Tasks/role,tasks/Tasks/status&minimal_response=true';
console.log("URL for step9 is: " + url);
return url;
},
http://git-wip-us.apache.org/repos/asf/ambari/blob/a2579c32/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 5180342..ac23b4a 100644
--- a/ambari-web/app/mappers/hosts_mapper.js
+++ b/ambari-web/app/mappers/hosts_mapper.js
@@ -162,6 +162,9 @@ App.hostsMapper = App.QuickDataMapper.create({
}
}
console.timeEnd('App.hostsMapper execution time');
+ if (!App.router.get('clusterController.dataLoadList.serviceMetrics')) {
+ App.router.get('clusterController').deferServiceMetricsLoad();
+ }
},
/**
* check mutable fields whether they have been changed and if positive
http://git-wip-us.apache.org/repos/asf/ambari/blob/a2579c32/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 2737809..541f738 100644
--- a/ambari-web/app/mappers/service_metrics_mapper.js
+++ b/ambari-web/app/mappers/service_metrics_mapper.js
@@ -141,8 +141,9 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
$service_id: 'none' /* will be set outside of parse function */
},
- map: function (json) {
- if (!this.get('model')) {
+ map: function (json, isDefered) {
+ if (!isDefered && !App.router.get('clusterController.isLoaded')) {
+ App.router.get('clusterController').deferServiceMetricsLoad(json);
return;
}
console.time('App.serviceMetricsMapper execution time');
http://git-wip-us.apache.org/repos/asf/ambari/blob/a2579c32/ambari-web/app/mappers/status_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/status_mapper.js b/ambari-web/app/mappers/status_mapper.js
index 721fe38..793c440 100644
--- a/ambari-web/app/mappers/status_mapper.js
+++ b/ambari-web/app/mappers/status_mapper.js
@@ -120,5 +120,8 @@ App.statusMapper = App.QuickDataMapper.create({
}
console.timeEnd('App.statusMapper execution time');
+ if (!App.router.get('clusterController.isLoaded')) {
+ App.hostsMapper.map(json);
+ }
}
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/a2579c32/ambari-web/app/utils/http_client.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/http_client.js b/ambari-web/app/utils/http_client.js
index 0000444..d0d51f3 100644
--- a/ambari-web/app/utils/http_client.js
+++ b/ambari-web/app/utils/http_client.js
@@ -45,9 +45,6 @@ App.HttpClient = Em.Object.create({
}
},
- emptyFunc: function () {
- },
-
/**
* @param {string} url
* @param {Object} ajaxOptions
@@ -82,6 +79,7 @@ App.HttpClient = Em.Object.create({
try {
App.store.commit();
} catch (err) {
+ console.warn('App.store.commit error:', err);
}
mapper.map($.parseJSON(xhr.responseText));
tmp_val.complete.call(self);
@@ -91,7 +89,7 @@ App.HttpClient = Em.Object.create({
}
tmp_val = null;
- xhr = self.emptyFunc();
+ xhr = null;
clearTimeout(timeout);
timeout = null;