You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by on...@apache.org on 2014/02/07 11:58:47 UTC
git commit: AMBARI-4548. Storm: Add properties on Add Service Wizard
that depend on Ganglia. (Buzhor Denis via onechiporenko)
Updated Branches:
refs/heads/trunk 3f2a76b1e -> c9202e26c
AMBARI-4548. Storm: Add properties on Add Service Wizard that depend on Ganglia. (Buzhor Denis via onechiporenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c9202e26
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c9202e26
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c9202e26
Branch: refs/heads/trunk
Commit: c9202e26c0b1390aa918506e6bb46e7fc1836817
Parents: 3f2a76b
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Fri Feb 7 12:58:24 2014 +0200
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Fri Feb 7 12:58:24 2014 +0200
----------------------------------------------------------------------
ambari-web/app/controllers/wizard.js | 15 ++++++++++++-
.../app/controllers/wizard/step7_controller.js | 15 +++++--------
.../app/controllers/wizard/step8_controller.js | 23 ++++++++++++++++++++
ambari-web/app/data/HDP2/global_properties.js | 12 ++++++----
ambari-web/app/data/HDP2/site_properties.js | 3 +++
5 files changed, 54 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9202e26/ambari-web/app/controllers/wizard.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard.js b/ambari-web/app/controllers/wizard.js
index fce3bbf..312bfc2 100644
--- a/ambari-web/app/controllers/wizard.js
+++ b/ambari-web/app/controllers/wizard.js
@@ -712,6 +712,7 @@ App.WizardController = Em.Controller.extend({
*/
saveServiceConfigProperties: function (stepController) {
var serviceConfigProperties = [];
+ var updateServiceConfigProperties = [];
stepController.get('stepConfigs').forEach(function (_content) {
if (_content.serviceName === 'YARN' && !App.supports.capacitySchedulerUi) {
@@ -733,9 +734,21 @@ App.WizardController = Em.Controller.extend({
};
serviceConfigProperties.push(configProperty);
}, this);
+ // check for configs that need to update for installed services
+ if (stepController.get('installedServiceNames') && stepController.get('installedServiceNames').contains(_content.get('serviceName'))) {
+ // get only modified configs
+ var configs = _content.get('configs').filterProperty('isNotDefaultValue').filter(function(config) {
+ var notAllowed = ['masterHost', 'masterHosts', 'slaveHosts', 'slaveHost'];
+ return !notAllowed.contains(config.get('displayType'));
+ });
+ // if modified configs detected push all service's configs for update
+ if (configs.length)
+ updateServiceConfigProperties = updateServiceConfigProperties.concat(serviceConfigProperties.filterProperty('serviceName',_content.get('serviceName')));
+ }
}, this);
this.setDBProperty('serviceConfigProperties', serviceConfigProperties);
this.set('content.serviceConfigProperties', serviceConfigProperties);
+ this.setDBProperty('configsToUpdate', updateServiceConfigProperties);
},
/**
* save Config groups
@@ -771,6 +784,6 @@ App.WizardController = Em.Controller.extend({
}, this)
}, this);
this.setDBProperty('serviceConfigGroups', serviceConfigGroups);
- this.set('content.serviceConfigProperties', serviceConfigGroups);
+ this.set('content.configGroups', serviceConfigGroups);
}
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9202e26/ambari-web/app/controllers/wizard/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js
index 74eeec7..8132924 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -98,8 +98,6 @@ App.WizardStep7Controller = Em.Controller.extend({
* Load config groups for installed services
*/
loadInstalledServicesConfigGroups: function (servicesNames) {
- if (servicesNames.indexOf('MISC') > -1)
- servicesNames.splice(servicesNames.indexOf('MISC'), 1);
servicesNames.forEach(function(serviceName) {
App.ajax.send({
name: 'config.tags_and_groups',
@@ -255,8 +253,6 @@ App.WizardStep7Controller = Em.Controller.extend({
}
}
}
- serviceConfigProperty.set('isVisible', true);
-
console.log("config result", serviceConfigProperty);
} else {
serviceConfigProperty.set('isVisible', false);
@@ -352,7 +348,7 @@ App.WizardStep7Controller = Em.Controller.extend({
//STEP 2: Load on-site configs by service from local DB
var storedConfigs = this.get('content.serviceConfigProperties');
//STEP 3: Merge pre-defined configs with loaded on-site configs
- var configs = App.config.mergePreDefinedWithStored(storedConfigs, advancedConfigs,this.get('selectedServiceNames'));
+ var configs = App.config.mergePreDefinedWithStored(storedConfigs, advancedConfigs, this.get('selectedServiceNames').concat(this.get('installedServiceNames')));
//STEP 4: Add advanced configs
App.config.addAdvancedConfigs(configs, advancedConfigs);
//STEP 5: Add custom configs
@@ -398,9 +394,8 @@ App.WizardStep7Controller = Em.Controller.extend({
this.set('stepConfigs', serviceConfigs);
if (App.supports.hostOverridesInstaller) {
this.loadConfigGroups(this.get('content.configGroups'));
- var installedServicesConfigs = this.get('stepConfigs').filterProperty('selected', false);
- if (installedServicesConfigs.length > 0 && !storedConfigs)
- this.loadInstalledServicesConfigGroups(installedServicesConfigs.mapProperty('serviceName'));
+ if (this.get('installedServiceNames').length > 0)
+ this.loadInstalledServicesConfigGroups(this.get('installedServiceNames'));
}
this.activateSpecialConfigs();
this.set('selectedService', this.get('stepConfigs').filterProperty('showConfig', true).objectAt(0));
@@ -450,7 +445,9 @@ App.WizardStep7Controller = Em.Controller.extend({
});
configs.forEach(function (_config) {
if (configsMap[_config.name] !== undefined) {
- _config.value = configsMap[_config.name];
+ // prevent overriding already edited properties
+ if (_config.defaultValue != configsMap[_config.name])
+ _config.value = configsMap[_config.name];
_config.defaultValue = configsMap[_config.name];
App.config.handleSpecialProperties(_config);
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9202e26/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 a54de8c..a2e76d8 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -537,6 +537,26 @@ App.WizardStep8Controller = Em.Controller.extend({
this.submitProceed();
}
},
+ /**
+ * Update configurations for installed services.
+ *
+ * @param {Array} configsToUpdate - configs need to update
+ * @return {*}
+ */
+ updateConfigurations: function (configsToUpdate) {
+ var configurationController = App.router.get('mainServiceInfoConfigsController');
+ var serviceNames = configsToUpdate.mapProperty('serviceName').uniq();
+ serviceNames.forEach(function(serviceName) {
+ var configs = configsToUpdate.filterProperty('serviceName', serviceName);
+ configurationController.setNewTagNames(configs);
+ var tagName = configs.objectAt(0).newTagName;
+ var siteConfigs = configs.filterProperty('id', 'site property');
+ siteConfigs.mapProperty('filename').uniq().forEach(function(siteName) {
+ var formattedConfigs = configurationController.createSiteObj(siteName.replace(".xml", ""), tagName, configs.filterProperty('filename', siteName));
+ configurationController.doPUTClusterConfigurationSite(formattedConfigs);
+ });
+ });
+ },
submitProceed: function() {
this.set('isSubmitDisabled', true);
@@ -581,6 +601,9 @@ App.WizardStep8Controller = Em.Controller.extend({
var clusterNames = this.getExistingClusterNames();
this.deleteClusters(clusterNames);
}
+ if (this.get('wizardController').getDBProperty('configsToUpdate')) {
+ this.updateConfigurations(this.get('wizardController').getDBProperty('configsToUpdate'));
+ }
this.setLocalRepositories();
this.createCluster();
this.createSelectedServices();
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9202e26/ambari-web/app/data/HDP2/global_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/global_properties.js b/ambari-web/app/data/HDP2/global_properties.js
index 7ddbe99..2b00b87 100644
--- a/ambari-web/app/data/HDP2/global_properties.js
+++ b/ambari-web/app/data/HDP2/global_properties.js
@@ -1414,7 +1414,8 @@ module.exports =
"isVisible": true,
"isRequiredByAgent": false,
"serviceName": "STORM",
- "category": "StormUIServer"
+ "category": "StormUIServer",
+ "filename": "global.xml"
},
{
"id": "puppet var",
@@ -1427,7 +1428,8 @@ module.exports =
"isVisible": true,
"isRequiredByAgent": false,
"serviceName": "STORM",
- "category": "LogviewerServer"
+ "category": "LogviewerServer",
+ "filename": "global.xml"
},
{
"id": "puppet var",
@@ -1440,7 +1442,8 @@ module.exports =
"isVisible": true,
"isRequiredByAgent": false,
"serviceName": "STORM",
- "category": "DRPCServer"
+ "category": "DRPCServer",
+ "filename": "global.xml"
},
{
"id": "puppet var",
@@ -1454,7 +1457,8 @@ module.exports =
"isRequiredByAgent": false,
"serviceName": "STORM",
"isOverridable": false,
- "category": "Supervisor"
+ "category": "Supervisor",
+ "filename": "global.xml"
},
/**********************************************MISC***************************************/
{
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9202e26/ambari-web/app/data/HDP2/site_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/site_properties.js b/ambari-web/app/data/HDP2/site_properties.js
index 59a0397..8ef5a95 100644
--- a/ambari-web/app/data/HDP2/site_properties.js
+++ b/ambari-web/app/data/HDP2/site_properties.js
@@ -983,6 +983,7 @@ module.exports =
"description": "This parameter is used by the storm-deploy project to configure the jvm options for the nimbus daemon.",
"defaultValue": "-javaagent:/var/lib/storm/jmxetric-1.0.4.jar=host={0},port=8649,wireformat31x=true,mode=multicast,config=/var/lib/storm/jmxetric-conf.xml,process=Nimbus_JVM -Xmx1024m",
"isReconfigurable": true,
+ "isOverridable": false,
"isVisible": false,
"isRequiredByAgent": true,
"serviceName": "STORM",
@@ -1130,6 +1131,7 @@ module.exports =
"description":"This parameter is used by the storm-deploy project to configure the jvm options for the supervisor daemon.",
"isReconfigurable": true,
"isVisible":false,
+ "isOverrideable": false,
"isRequiredByAgent":true,
"serviceName":"STORM",
"category":"Supervisor",
@@ -1357,6 +1359,7 @@ module.exports =
"description": "The jvm opts provided to workers launched by this supervisor. All \"%ID%\" substrings are replaced with an identifier for this worker.",
"isReconfigurable": true,
"isVisible": false,
+ "isOverridable": false,
"isRequiredByAgent": true,
"serviceName": "STORM",
"category": "Advanced",