You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2013/09/26 21:12:23 UTC
git commit: AMBARI-3352: Installer wizard: Batch create configuration
calls into single call. (jaimin)
Updated Branches:
refs/heads/branch-1.4.1 483241954 -> fdbbabe8e
AMBARI-3352: Installer wizard: Batch create configuration calls into single call. (jaimin)
Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/fdbbabe8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/fdbbabe8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/fdbbabe8
Branch: refs/heads/branch-1.4.1
Commit: fdbbabe8efae772417e2c4c0babfa1db997b8005
Parents: 4832419
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Thu Sep 26 12:11:53 2013 -0700
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Thu Sep 26 12:11:53 2013 -0700
----------------------------------------------------------------------
.../app/controllers/wizard/step8_controller.js | 63 ++++++++++++--------
1 file changed, 39 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/fdbbabe8/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index 2850375..c21842f 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -37,6 +37,7 @@ App.WizardStep8Controller = Em.Controller.extend({
isBackBtnDisabled: false,
hasErrorOccurred: false,
servicesInstalled: false,
+ serviceConfigTags: [],
securityEnabled: false,
/**
* During page save time, we set the host overrides to the server.
@@ -69,6 +70,7 @@ App.WizardStep8Controller = Em.Controller.extend({
this.get('configs').clear();
this.get('globals').clear();
this.get('clusterInfo').clear();
+ this.get('serviceConfigTags').clear();
this.set('servicesInstalled', false);
},
@@ -1306,57 +1308,70 @@ App.WizardStep8Controller = Em.Controller.extend({
createConfigurations: function () {
var selectedServices = this.get('selectedServices');
if (this.get('content.controllerName') == 'installerController') {
- this.applyConfigurationToSite(this.createGlobalSiteObj());
- this.applyConfigurationToSite(this.createCoreSiteObj());
- this.applyConfigurationToSite(this.createHdfsSiteObj());
+ this.get('serviceConfigTags').pushObject(this.createGlobalSiteObj());
+ this.get('serviceConfigTags').pushObject(this.createCoreSiteObj());
+ this.get('serviceConfigTags').pushObject(this.createHdfsSiteObj());
}
if (selectedServices.someProperty('serviceName', 'MAPREDUCE')) {
- this.applyConfigurationToSite(this.createMrSiteObj());
+ this.get('serviceConfigTags').pushObject(this.createMrSiteObj());
if (App.supports.capacitySchedulerUi) {
- this.applyConfigurationToSite(this.createCapacityScheduler());
- this.applyConfigurationToSite(this.createMapredQueueAcls());
+ this.get('serviceConfigTags').pushObject(this.createCapacityScheduler());
+ this.get('serviceConfigTags').pushObject(this.createMapredQueueAcls());
}
}
if (selectedServices.someProperty('serviceName', 'MAPREDUCE2')) {
- this.applyConfigurationToSite(this.createMrSiteObj());
- this.applyConfigurationToSite(this.createMapredQueueAcls());
+ this.get('serviceConfigTags').pushObject(this.createMrSiteObj());
+ this.get('serviceConfigTags').pushObject(this.createMapredQueueAcls());
}
if (selectedServices.someProperty('serviceName', 'YARN')) {
- this.applyConfigurationToSite(this.createYarnSiteObj());
- this.applyConfigurationToSite(this.createCapacityScheduler());
+ this.get('serviceConfigTags').pushObject(this.createYarnSiteObj());
+ this.get('serviceConfigTags').pushObject(this.createCapacityScheduler());
}
if (selectedServices.someProperty('serviceName', 'HBASE')) {
- this.applyConfigurationToSite(this.createHbaseSiteObj());
+ this.get('serviceConfigTags').pushObject(this.createHbaseSiteObj());
}
if (selectedServices.someProperty('serviceName', 'OOZIE')) {
- this.applyConfigurationToSite(this.createOozieSiteObj('OOZIE'));
+ this.get('serviceConfigTags').pushObject(this.createOozieSiteObj('OOZIE'));
}
if (selectedServices.someProperty('serviceName', 'HIVE')) {
- this.applyConfigurationToSite(this.createHiveSiteObj('HIVE'));
+ this.get('serviceConfigTags').pushObject(this.createHiveSiteObj('HIVE'));
}
if (selectedServices.someProperty('serviceName', 'WEBHCAT')) {
- this.applyConfigurationToSite(this.createWebHCatSiteObj('WEBHCAT'));
+ this.get('serviceConfigTags').pushObject(this.createWebHCatSiteObj('WEBHCAT'));
}
if (selectedServices.someProperty('serviceName', 'HUE')) {
- this.applyConfigurationToSite(this.createHueSiteObj('HUE'));
+ this.get('serviceConfigTags').pushObject(this.createHueSiteObj('HUE'));
}
+ this.applyConfigurationsToCluster();
},
- applyConfigurationToSite: function (data) {
- console.log("Inside applyConfigurationToSite");
+ applyConfigurationsToCluster: function() {
var clusterUrl = App.apiPrefix + '/clusters/' + this.get('clusterName');
- var clusterData = {
- Clusters: {
- desired_configs: data
- }
+ var configData = [];
+ this.get('serviceConfigTags').forEach(function (_serviceConfig) {
+ var Clusters = {
+ Clusters: {
+ desired_config: {
+ type: _serviceConfig.type,
+ tag: _serviceConfig.tag,
+ properties: _serviceConfig.properties
+ }
+ }
+ };
+ configData.pushObject(JSON.stringify(Clusters));
+ }, this);
+
+ var data = {
+ configData: '[' + configData.toString() + ']'
};
- console.debug("applyConfigurationToSite(Step8): Applying to URL", clusterUrl, " Data:", clusterData);
+
+ console.debug("applyConfigurationsToCluster(Step8): Applying to URL", clusterUrl, " Data:", data.configData);
this.ajax({
type: 'PUT',
url: clusterUrl,
- data: JSON.stringify(clusterData),
+ data: data.configData,
beforeSend: function () {
- console.log("BeforeSend: Updating cluster config for " + clusterData.type);
+ console.log("BeforeSend: Updating cluster config");
}
});
},