You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by mr...@apache.org on 2018/04/19 22:41:14 UTC
[ambari] branch branch-feature-AMBARI-14714-configs updated
(caea977 -> 228236c)
This is an automated email from the ASF dual-hosted git repository.
mradhakrishnan pushed a change to branch branch-feature-AMBARI-14714-configs
in repository https://gitbox.apache.org/repos/asf/ambari.git.
from caea977 [AMBARI-23191] Service config API updates (#1028)
add 4e7f7eb AMBARI-23508: Update execution_command module to handle data type conversion issue
add b4cacd8 AMBARI-23508: Update execution_command module to handle data type conversion issue
add c1fdcea Merge branch 'AMBARI-23508-branch-feature-AMBARI-14714' of https://github.com/scottduan/ambari into AMBARI-23508-branch-feature-AMBARI-14714
add 3737c41 Merge branch 'AMBARI-23508-branch-feature-AMBARI-14714' of https://github.com/scottduan/ambari into AMBARI-23508-branch-feature-AMBARI-14714
add 5cd0361 Merge branch 'AMBARI-23508-branch-feature-AMBARI-14714' of https://github.com/scottduan/ambari into AMBARI-23508-branch-feature-AMBARI-14714
add a847d26 AMBARI-23508-2: Misuse one execution_command package api
add e6c7963 Merge remote-tracking branch 'upstream/branch-feature-AMBARI-14714' into AMBARI-23508-branch-feature-AMBARI-14714
add 788dee3 [AMBARI-23508] Misuse get_all_attributes in execution_command.py, it is actually in module_configs.py
add 0bbc27a [AMBARI-23573] HDFS install fails at before-ANY hook due to no created instances (dsen) (#999)
add 9aaed52 [AMBARI-23569] Provide Mpack Package Name to Install in mpack.json
add 26f1e62 [AMBARI-23569] Provide Mpack Package Name to Install in mpack.json
add 4adcb38 AMBARI-23552. Switch to using Surrogate PK in Ambari DB tables, wherever applicable.
add d99514d AMBARI-23552. Switch to using Surrogate PK in Ambari DB tables, wherever applicable.
add 703b2b0 Merge branch-feature-AMBARI-14714-configs to branch-feature-AMBARI-14714
add f1e7472 [AMBARI-23590] Return mpack info even when attempting to register duplicate mpack
add 53c2377 Return mpack info even when attempting to register duplicate mpack
new 228236c Revert "Merge branch-feature-AMBARI-14714-configs to branch-feature-AMBARI-14714"
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../internal/UpgradePlanResourceProvider.java | 3 +-
.../VersionDefinitionResourceProvider.java | 174 ++++++++++-----------
.../apache/ambari/server/mpack/MpackManager.java | 104 ++++++------
.../ambari/server/orm/dao/ClusterServiceDAO.java | 24 +--
.../server/orm/dao/ServiceDesiredStateDAO.java | 10 +-
.../ambari/server/orm/dao/ServiceGroupDAO.java | 23 +--
.../server/orm/entities/ClusterServiceEntity.java | 37 ++---
.../orm/entities/ClusterServiceEntityPK.java | 85 ----------
.../server/orm/entities/ConfigGroupEntity.java | 8 +-
.../orm/entities/HostConfigMappingEntity.java | 8 +-
.../ServiceComponentDesiredStateEntity.java | 12 +-
.../server/orm/entities/ServiceConfigEntity.java | 8 +-
.../orm/entities/ServiceDependencyEntity.java | 27 ++--
.../orm/entities/ServiceDesiredStateEntity.java | 24 +--
.../orm/entities/ServiceDesiredStateEntityPK.java | 85 ----------
.../orm/entities/ServiceGroupDependencyEntity.java | 29 ++--
.../server/orm/entities/ServiceGroupEntity.java | 16 +-
.../server/orm/entities/ServiceGroupEntityPK.java | 71 ---------
.../org/apache/ambari/server/state/Module.java | 1 +
.../java/org/apache/ambari/server/state/Mpack.java | 12 ++
.../ambari/server/state/MpackOsSpecific.java | 52 +++---
.../ambari/server/state/ServiceComponentImpl.java | 7 +-
.../ambari/server/state/ServiceGroupImpl.java | 47 ++----
.../apache/ambari/server/state/ServiceImpl.java | 54 ++-----
.../ambari/server/state/cluster/ClusterImpl.java | 2 +-
.../server/state/configgroup/ConfigGroupImpl.java | 4 +-
.../src/main/resources/Ambari-DDL-Derby-CREATE.sql | 32 ++--
.../src/main/resources/Ambari-DDL-MySQL-CREATE.sql | 32 ++--
.../main/resources/Ambari-DDL-Oracle-CREATE.sql | 32 ++--
.../main/resources/Ambari-DDL-Postgres-CREATE.sql | 33 ++--
.../resources/Ambari-DDL-SQLAnywhere-CREATE.sql | 32 ++--
.../main/resources/Ambari-DDL-SQLServer-CREATE.sql | 32 ++--
.../stack-hooks/after-INSTALL/scripts/hook.py | 6 +-
.../after-INSTALL/scripts/shared_initialization.py | 2 +-
.../stack-hooks/before-ANY/scripts/hook.py | 4 +-
.../stack-hooks/before-ANY/scripts/params.py | 14 +-
.../stack-hooks/before-START/scripts/hook.py | 10 +-
.../internal/ServiceResourceProviderTest.java | 52 ++++--
.../internal/UpgradePlanResourceProviderTest.java | 3 +-
ambari-web/app/controllers/wizard.js | 2 +-
.../app/controllers/wizard/step8_controller.js | 102 ++++++------
.../app/controllers/wizard/step9_controller.js | 4 +-
.../app/mixins/common/configs/configs_saver.js | 3 +-
ambari-web/app/utils/ajax/ajax.js | 9 +-
ambari-web/test/controllers/wizard/step8_test.js | 35 +++--
.../mixins/common/configs/configs_saver_test.js | 124 +++++++--------
46 files changed, 599 insertions(+), 891 deletions(-)
delete mode 100644 ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterServiceEntityPK.java
delete mode 100644 ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntityPK.java
delete mode 100644 ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceGroupEntityPK.java
copy contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/dto/TableInfo.java => ambari-server/src/main/java/org/apache/ambari/server/state/MpackOsSpecific.java (53%)
--
To stop receiving notification emails like this one, please contact
mradhakrishnan@apache.org.
[ambari] 01/01: Revert "Merge branch-feature-AMBARI-14714-configs
to branch-feature-AMBARI-14714"
Posted by mr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mradhakrishnan pushed a commit to branch branch-feature-AMBARI-14714-configs
in repository https://gitbox.apache.org/repos/asf/ambari.git
commit 228236c4a71b151fe157afdfa0c5b3ccf0c6a602
Author: Madhuvanthi Radhakrishnan <mr...@hortonworks.com>
AuthorDate: Thu Apr 19 15:39:30 2018 -0700
Revert "Merge branch-feature-AMBARI-14714-configs to branch-feature-AMBARI-14714"
This reverts commit 703b2b04aaf31e70a532e0ec5f17316661c4b0bc, reversing
changes made to d99514d3cde9a7e672862ac3aa950d345a4a5a57.
---
ambari-web/app/controllers/wizard.js | 2 +-
.../app/controllers/wizard/step8_controller.js | 102 +++++++++--------
.../app/controllers/wizard/step9_controller.js | 4 +-
.../app/mixins/common/configs/configs_saver.js | 3 +-
ambari-web/app/utils/ajax/ajax.js | 9 +-
ambari-web/test/controllers/wizard/step8_test.js | 35 ++++--
.../mixins/common/configs/configs_saver_test.js | 124 ++++++++++-----------
7 files changed, 143 insertions(+), 136 deletions(-)
diff --git a/ambari-web/app/controllers/wizard.js b/ambari-web/app/controllers/wizard.js
index 84ee966..f8f37d4 100644
--- a/ambari-web/app/controllers/wizard.js
+++ b/ambari-web/app/controllers/wizard.js
@@ -529,7 +529,7 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, App.ThemesMappingM
const serviceGroups = this.get('content.serviceGroups');
const installPromises = serviceGroups.map(sg => {
- data.serviceGroupName = sg;
+ data.serviceGroup = sg;
return App.ajax.send({
name: isRetry ? 'common.host_components.update' : 'common.services.update',
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index 9a894eb..2ca005e 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -1051,7 +1051,7 @@ App.WizardStep8Controller = App.WizardStepController.extend(App.AddSecurityConfi
this.addRequestToAjaxQueue({
name: 'wizard.step8.create_selected_services',
data: {
- serviceGroupName: service.ServiceInfo.service_group_name,
+ serviceGroup: service.ServiceInfo.service_group_name,
data: JSON.stringify(service)
}
});
@@ -1131,13 +1131,13 @@ App.WizardStep8Controller = App.WizardStepController.extend(App.AddSecurityConfi
* @param componentsData
* @param serviceName
*/
- addRequestToCreateComponent: function (componentsData, serviceName, serviceGroupName) {
+ addRequestToCreateComponent: function (componentsData, serviceName, serviceGroup) {
this.addRequestToAjaxQueue({
name: 'wizard.step8.create_components',
data: {
data: JSON.stringify(componentsData),
serviceName: serviceName,
- serviceGroupName: serviceGroupName
+ serviceGroup: serviceGroup
}
});
},
@@ -1529,66 +1529,72 @@ App.WizardStep8Controller = App.WizardStepController.extend(App.AddSecurityConfi
*/
createServiceConfigurations: function () {
this.get('selectedServices').forEach(function (service) {
- let serviceConfigs = {
- serviceName: service.get('serviceName'),
- serviceGroupName: service.get('stackName'), //TODO - mpacks: for now
- data: {
- "ServiceConfigVersion": {
- "service_config_version_note": this.getServiceConfigNote('', service.get('displayName')),
- "stack_id": `${service.get('stackName')}-${service.get('stackVersion')}`
- },
- "configurations": []
+ Object.keys(service.get('configTypes')).forEach(function (type) {
+ if (!this.get('serviceConfigTags').someProperty('type', type)) {
+ var configs = this.get('configs').filterProperty('filename', App.config.getOriginalFileName(type));
+ var serviceConfigNote = this.getServiceConfigNote(type, service.get('displayName'));
+ this.get('serviceConfigTags').pushObject(this.createDesiredConfig(type, configs, serviceConfigNote));
}
- };
-
- Object.keys(service.get('configTypesRendered')).forEach(function (typeName) {
- const type = service.get('configTypes')[typeName]; //just ensure that the type is in both lists; they contain the same data if so
- if (type) {
- const configs = this.get('configs').filterProperty('filename', App.config.getOriginalFileName(typeName));
- serviceConfigs.data.configurations.push(this.createDesiredConfig(typeName, configs, null, true));
- }
}, this);
-
- if (serviceConfigs.data.configurations.length > 0) {
- this.get('serviceConfigTags').pushObject(Em.Object.create(serviceConfigs));
- }
}, this);
-
this.createNotification();
},
/**
- * Send <code>serviceConfigTags</code> to server
- * Queued request
- * One request for each service config data item,
- * each of which corresponds to a single service instance
- * @param serviceConfigData
- * @method applyConfigurationsToCluster
- */
- applyConfigurationsToCluster: function (serviceConfigData) {
- serviceConfigData.forEach(function (serviceConfig) {
- this.addRequestToAjaxQueue({
- name: 'common.service.create.configs',
- data: {
- serviceName: serviceConfig.get('serviceName'),
- serviceGroupName: serviceConfig.get('serviceGroupName'),
- data: serviceConfig.get('data')
- }
- });
- }, this);
- },
-
- /**
* Get config version message
*
* @param type
* @param serviceDisplayName
* @returns {*}
- */
+ */
getServiceConfigNote: function(type, serviceDisplayName) {
return this.get('isAddService') && type === 'core-site' ?
Em.I18n.t('dashboard.configHistory.table.notes.addService') : Em.I18n.t('dashboard.configHistory.table.notes.default').format(serviceDisplayName);
- },
+ },
+
+ /**
+ * Send <code>serviceConfigTags</code> to server
+ * Queued request
+ * One request for each service config tag
+ * @param serviceConfigTags
+ * @method applyConfigurationsToCluster
+ */
+ applyConfigurationsToCluster: function (serviceConfigTags) {
+ var allServices = this.get('installedServices').concat(this.get('selectedServices'));
+ var allConfigData = [];
+ allServices.forEach(function (service) {
+ var serviceConfigData = [];
+ Object.keys(service.get('configTypesRendered')).forEach(function (type) {
+ var serviceConfigTag = serviceConfigTags.findProperty('type', type);
+ if (serviceConfigTag) {
+ serviceConfigData.pushObject(serviceConfigTag);
+ }
+ }, this);
+ if (serviceConfigData.length) {
+ allConfigData.pushObject(JSON.stringify({
+ Clusters: {
+ desired_config: serviceConfigData.map(function(item) {
+ var props = {};
+ Em.keys(item.properties).forEach(function(propName) {
+ if (item.properties[propName] !== null) {
+ props[propName] = item.properties[propName];
+ }
+ });
+ item.properties = props;
+ return item;
+ })
+ }
+ }));
+ }
+ }, this);
+
+ this.addRequestToAjaxQueue({
+ name: 'common.across.services.configurations',
+ data: {
+ data: '[' + allConfigData.toString() + ']'
+ }
+ });
+ },
/**
* Create and update config groups
diff --git a/ambari-web/app/controllers/wizard/step9_controller.js b/ambari-web/app/controllers/wizard/step9_controller.js
index 1785a94..b918a75 100644
--- a/ambari-web/app/controllers/wizard/step9_controller.js
+++ b/ambari-web/app/controllers/wizard/step9_controller.js
@@ -522,7 +522,7 @@ App.WizardStep9Controller = App.WizardStepController.extend(App.ReloadPopupMixin
serviceGroups = this.get('content.serviceGroups');
promises = serviceGroups.map(sg => {
- data.serviceGroupName = sg;
+ data.serviceGroup = sg;
return App.ajax.send({
name: 'common.services.update',
@@ -544,7 +544,7 @@ App.WizardStep9Controller = App.WizardStepController.extend(App.ReloadPopupMixin
serviceGroups = this.get('content.serviceGroups');
promises = serviceGroups.map(sg => {
- data.serviceGroupName = sg;
+ data.serviceGroup = sg;
return App.ajax.send({
name: 'common.services.update',
diff --git a/ambari-web/app/mixins/common/configs/configs_saver.js b/ambari-web/app/mixins/common/configs/configs_saver.js
index c700c16..c2245fb 100644
--- a/ambari-web/app/mixins/common/configs/configs_saver.js
+++ b/ambari-web/app/mixins/common/configs/configs_saver.js
@@ -458,7 +458,6 @@ App.ConfigsSaverMixin = Em.Mixin.create({
Em.assert('type should be defined', type);
var desired_config = {
"type": type,
- "tag": "v1", //REMOVE
"properties": {}
};
if (!ignoreVersionNote) {
@@ -488,7 +487,7 @@ App.ConfigsSaverMixin = Em.Mixin.create({
if (Object.keys(attributes.final).length || Object.keys(attributes.password).length) {
desired_config.properties_attributes = attributes;
}
- return { "Config": desired_config };
+ return desired_config;
},
/**
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index fb54510..8b1522b 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -57,7 +57,7 @@ var urls = {
},
'common.services.update' : {
- 'real': '/clusters/{clusterName}/servicegroups/{serviceGroupName}/services?{urlParams}',
+ 'real': '/clusters/{clusterName}/servicegroups/{serviceGroup}/services?{urlParams}',
'mock': '/data/wizard/deploy/poll_1.json',
'format': function (data) {
return {
@@ -247,9 +247,10 @@ var urls = {
'common.service.create.configs': {
'type': 'POST',
- 'real': '/clusters/{clusterName}/servicegroups/{serviceGroupName}/services/{serviceName}/configurations/service_config_versions',
+ 'real':'/clusters/{clusterName}/servicegroups/{serviceGroup}/services/{serviceName}/configurations',
'format': function(data) {
return {
+ apiPrefix: 'api/v2',
data: JSON.stringify(data.data)
}
}
@@ -2095,7 +2096,7 @@ var urls = {
'wizard.step8.create_selected_services': {
'type': 'POST',
- 'real': '/clusters/{cluster}/servicegroups/{serviceGroupName}/services',
+ 'real': '/clusters/{cluster}/servicegroups/{serviceGroup}/services',
'mock': '/data/stacks/HDP-2.1/recommendations.json',
'format': function (data) {
return {
@@ -2106,7 +2107,7 @@ var urls = {
},
'wizard.step8.create_components': {
- 'real': '/clusters/{cluster}/servicegroups/{serviceGroupName}/services/{serviceName}/components',
+ 'real': '/clusters/{cluster}/servicegroups/{serviceGroup}/services/{serviceName}/components',
'mock': '',
'format': function (data) {
return {
diff --git a/ambari-web/test/controllers/wizard/step8_test.js b/ambari-web/test/controllers/wizard/step8_test.js
index 6d3832d..089746c 100644
--- a/ambari-web/test/controllers/wizard/step8_test.js
+++ b/ambari-web/test/controllers/wizard/step8_test.js
@@ -1302,20 +1302,31 @@ describe('App.WizardStep8Controller', function () {
describe('#applyConfigurationsToCluster', function() {
it('should call addRequestToAjaxQueue', function() {
- var serviceConfig = {
- serviceName: "service",
- serviceGroupName: "serviceGroup",
- data: {
- properties: {
- prop1: "val1"
+ var serviceConfigTags = [
+ {
+ type: 'hdfs',
+ tag: 'tag1',
+ properties: {
+ 'prop1': 'value1'
+ }
}
- }
- }
-
- var serviceConfigTags = [Em.Object.create(serviceConfig)];
-
+ ],
+ data = '['+JSON.stringify({
+ Clusters: {
+ desired_config: [serviceConfigTags[0]]
+ }
+ })+']';
+ installerStep8Controller.reopen({
+ installedServices: [
+ Em.Object.create({
+ isSelected: true,
+ isInstalled: false,
+ configTypesRendered: {hdfs:'tag1'}
+ })
+ ], selectedServices: []
+ });
installerStep8Controller.applyConfigurationsToCluster(serviceConfigTags);
- expect(JSON.stringify(installerStep8Controller.addRequestToAjaxQueue.args[0][0].data)).to.deep.equal(JSON.stringify(serviceConfig));
+ expect(installerStep8Controller.addRequestToAjaxQueue.args[0][0].data.data).to.equal(data);
});
});
diff --git a/ambari-web/test/mixins/common/configs/configs_saver_test.js b/ambari-web/test/mixins/common/configs/configs_saver_test.js
index 1d8f9d7..ff238c1 100644
--- a/ambari-web/test/mixins/common/configs/configs_saver_test.js
+++ b/ambari-web/test/mixins/common/configs/configs_saver_test.js
@@ -137,46 +137,38 @@ describe('App.ConfigsSaverMixin', function() {
it('generates config without properties', function() {
expect(mixin.createDesiredConfig('type1')).to.eql({
- "Config": {
- "type": 'type1',
- "properties": {},
- "service_config_version_note": ""
- }
+ "type": 'type1',
+ "properties": {},
+ "service_config_version_note": ""
})
});
it('generates config with properties', function() {
expect(mixin.createDesiredConfig('type1', [Em.Object.create({name: 'p1', value: 'v1', isRequiredByAgent: true}), Em.Object.create({name: 'p2', value: 'v2', isRequiredByAgent: true})], "note")).to.eql({
- "Config": {
- "type": 'type1',
- "properties": {
- "p1": 'v1',
- "p2": 'v2'
- },
- "service_config_version_note": 'note'
- }
+ "type": 'type1',
+ "properties": {
+ "p1": 'v1',
+ "p2": 'v2'
+ },
+ "service_config_version_note": 'note'
})
});
it('generates config with properties and skip isRequiredByAgent', function() {
expect(mixin.createDesiredConfig('type1', [Em.Object.create({name: 'p1', value: 'v1', isRequiredByAgent: true}), Em.Object.create({name: 'p2', value: 'v2', isRequiredByAgent: false})], "note")).to.eql({
- "Config": {
- "type": 'type1',
- "properties": {
- p1: 'v1'
- },
- "service_config_version_note": 'note'
- }
+ "type": 'type1',
+ "properties": {
+ p1: 'v1'
+ },
+ "service_config_version_note": 'note'
})
});
it('generates config with properties and skip service_config_version_note', function() {
expect(mixin.createDesiredConfig('type1', [Em.Object.create({name: 'p1', value: 'v1', isRequiredByAgent: true})], "note", true)).to.eql({
- "Config": {
- "type": 'type1',
- "properties": {
- p1: 'v1'
- }
+ "type": 'type1',
+ "properties": {
+ p1: 'v1'
}
})
});
@@ -191,49 +183,47 @@ describe('App.ConfigsSaverMixin', function() {
Em.Object.create({name: 'p6', value: 'v6', isRequiredByAgent: true, propertyType: ["TEXT", "VALUE_FROM_PROPERTY_FILE"]}),
Em.Object.create({name: 'p7', value: 'v7', isRequiredByAgent: true, propertyType: ["PASSWORD"]})
], "note")).to.eql({
- "Config": {
- "type": 'type1',
- "properties": {
- p1: 'v1',
- p2: 'v2',
- p3: 'v3',
- p4: 'v4',
- p5: 'v5',
- p6: 'v6',
- p7: 'v7'
- },
- "properties_attributes": {
- final: {
- 'p1': "true"
- },
- password: {
- "p3": "true",
- "p4": "true",
- "p7": "true"
- },
- user: {
- "p3": "true"
- },
- group: {
- "p3": "true"
- },
- text: {
- "p4": "true",
- "p6": "true"
- },
- additional_user_property: {
- "p4": "true"
- },
- not_managed_hdfs_path: {
- "p5": "true"
- },
- value_from_property_file: {
- "p6": "true"
- }
- },
- "service_config_version_note": 'note'
+ "type": 'type1',
+ "properties": {
+ p1: 'v1',
+ p2: 'v2',
+ p3: 'v3',
+ p4: 'v4',
+ p5: 'v5',
+ p6: 'v6',
+ p7: 'v7'
+ },
+ "properties_attributes": {
+ final: {
+ 'p1': "true"
+ },
+ password: {
+ "p3": "true",
+ "p4": "true",
+ "p7": "true"
+ },
+ user: {
+ "p3": "true"
+ },
+ group: {
+ "p3": "true"
+ },
+ text: {
+ "p4": "true",
+ "p6": "true"
+ },
+ additional_user_property: {
+ "p4": "true"
+ },
+ not_managed_hdfs_path: {
+ "p5": "true"
+ },
+ value_from_property_file: {
+ "p6": "true"
}
- })
+ },
+ "service_config_version_note": 'note'
+ })
})
});
--
To stop receiving notification emails like this one, please contact
mradhakrishnan@apache.org.