You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ol...@apache.org on 2016/08/18 10:30:03 UTC
[27/50] [abbrv] ambari git commit: AMBARI-18131. UI -
atlas.rest.address needs to be recalculated by StackAdvisor whenever
AtlasServer is added/moved/deleted (onechiporenko)
AMBARI-18131. UI - atlas.rest.address needs to be recalculated by StackAdvisor whenever AtlasServer is added/moved/deleted (onechiporenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/42fd20de
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/42fd20de
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/42fd20de
Branch: refs/heads/branch-dev-logsearch
Commit: 42fd20de03c0c665b5659f47b758eabc7681e3bd
Parents: 9911267
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Wed Aug 17 16:10:04 2016 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Wed Aug 17 16:10:04 2016 +0300
----------------------------------------------------------------------
.../app/controllers/wizard/step7_controller.js | 11 ++++
.../app/utils/configs/config_initializer.js | 28 +++++++++-
.../utils/configs/config_initializer_test.js | 58 +++++++++++++++++++-
3 files changed, 95 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/42fd20de/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 a35ea00..7c213fd 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -221,9 +221,15 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
var dependencies = {};
var hiveMetastore = App.configsCollection.getConfigByName('hive.metastore.uris', 'hive-site.xml');
var clientPort = App.configsCollection.getConfigByName('clientPort', 'zoo.cfg.xml');
+ var atlasTls = App.configsCollection.getConfigByName('atlas.enableTLS', 'application-properties.xml');
+ var atlasHttpPort = App.configsCollection.getConfigByName('atlas.server.http.port', 'application-properties.xml');
+ var atlasHttpsPort = App.configsCollection.getConfigByName('atlas.server.https.port', 'application-properties.xml');
if (hiveMetastore) dependencies['hive.metastore.uris'] = hiveMetastore.recommendedValue;
if (clientPort) dependencies.clientPort = clientPort.recommendedValue;
+ if (atlasTls) dependencies['atlas.enableTLS'] = atlasTls.recommendedValue;
+ if (atlasHttpPort) dependencies['atlas.server.http.port'] = atlasHttpPort.recommendedValue;
+ if (atlasHttpsPort) dependencies['atlas.server.https.port'] = atlasHttpsPort.recommendedValue;
return dependencies;
}.property(),
@@ -1041,6 +1047,11 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
this.get('configDependencies').clientPort = config.savedValue;
}
}
+ if (config.filename === 'application-properties.xml') {
+ if (this.get('configDependencies').hasOwnProperty(config.name)) {
+ this.get('configDependencies')[config.name] = config.savedValue;
+ }
+ }
},
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/42fd20de/ambari-web/app/utils/configs/config_initializer.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/configs/config_initializer.js b/ambari-web/app/utils/configs/config_initializer.js
index 3446c86..cb5b41f 100644
--- a/ambari-web/app/utils/configs/config_initializer.js
+++ b/ambari-web/app/utils/configs/config_initializer.js
@@ -141,7 +141,8 @@ App.ConfigInitializer = App.ConfigInitializerClass.create(App.MountPointsBasedIn
'hbase.zookeeper.quorum': '_initHBaseZookeeperQuorum',
'yarn.resourcemanager.zk-address': '_initYarnRMzkAddress',
'RANGER_HOST': '_initRangerHost',
- 'hive.metastore.uris': '_initHiveMetastoreUris'
+ 'hive.metastore.uris': '_initHiveMetastoreUris',
+ 'atlas.rest.address': '_initAtlasRestAddress'
},
initializerTypes: [
@@ -313,6 +314,31 @@ App.ConfigInitializer = App.ConfigInitializerClass.create(App.MountPointsBasedIn
},
/**
+ * Unique initializer for <code>atlas.rest.address</code>
+ *
+ * @param {configProperty} configProperty
+ * @param {topologyLocalDB} localDB
+ * @param {object} dependencies
+ * @return {Object}
+ * @private
+ */
+ _initAtlasRestAddress: function (configProperty, localDB, dependencies) {
+ var atlasTls = dependencies['atlas.enableTLS'];
+ var httpPort = dependencies['atlas.server.http.port'];
+ var httpsPort = dependencies['atlas.server.https.port'];
+ var protocol = atlasTls ? 'https': 'http';
+ var port = atlasTls ? httpsPort : httpPort;
+ var value = localDB.masterComponentHosts.filterProperty('component', 'ZOOKEEPER_SERVER').map(function (component) {
+ return protocol + '://' + component.hostName + ':' + port;
+ }).join(',');
+ Em.setProperties(configProperty, {
+ value: value,
+ recommendedValue: value
+ });
+ return configProperty;
+ },
+
+ /**
* Get hive.metastore.uris initial value
*
* @param {object[]} hosts
http://git-wip-us.apache.org/repos/asf/ambari/blob/42fd20de/ambari-web/test/utils/configs/config_initializer_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/configs/config_initializer_test.js b/ambari-web/test/utils/configs/config_initializer_test.js
index a5031b1..e951b34 100644
--- a/ambari-web/test/utils/configs/config_initializer_test.js
+++ b/ambari-web/test/utils/configs/config_initializer_test.js
@@ -263,9 +263,65 @@ describe('App.ConfigInitializer', function () {
},
value: ['h0', 'h1'],
title: 'array that contains names of hosts with Knox Gateway'
- }
+ },
+ 'atlas.rest.address': [
+ {
+ localDB: {
+ masterComponentHosts: [
+ {
+ component: 'ZOOKEEPER_SERVER',
+ hostName: 'h0'
+ },
+ {
+ component: 'ZOOKEEPER_SERVER',
+ hostName: 'h1'
+ }
+ ]
+ },
+ dependencies: {
+ 'atlas.enableTLS': false,
+ 'atlas.server.http.port': 21000,
+ 'atlas.server.https.port': 21443
+ },
+ value: 'http://h0:21000,http://h1:21000',
+ title: 'TLS is not enabled'
+ },
+ {
+ localDB: {
+ masterComponentHosts: [
+ {
+ component: 'ZOOKEEPER_SERVER',
+ hostName: 'h0'
+ },
+ {
+ component: 'ZOOKEEPER_SERVER',
+ hostName: 'h1'
+ }
+ ]
+ },
+ dependencies: {
+ 'atlas.enableTLS': true,
+ 'atlas.server.http.port': 21000,
+ 'atlas.server.https.port': 21443
+ },
+ value: 'https://h0:21443,https://h1:21443',
+ title: 'TLS is enabled'
+ }
+ ]
};
+ cases['atlas.rest.address'].forEach(function (test) {
+ it(test.title, function () {
+ serviceConfigProperty.setProperties({
+ name: 'atlas.rest.address',
+ value: ''
+ });
+ App.ConfigInitializer.initialValue(serviceConfigProperty, test.localDB, test.dependencies);
+ expect(serviceConfigProperty.get('value')).to.equal(test.value);
+ expect(serviceConfigProperty.get('recommendedValue')).to.equal(test.value);
+ });
+ });
+
cases['kafka.ganglia.metrics.host'].forEach(function (item) {
it(item.message, function () {
serviceConfigProperty.setProperties({