You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by wu...@apache.org on 2022/11/04 03:23:07 UTC
[ambari] branch trunk updated: AMBARI-25248: Hive service check is failing after moving Hive Metastore from node to another using system tests (#3447)
This is an automated email from the ASF dual-hosted git repository.
wuzhiguo pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push:
new 0c98622399 AMBARI-25248: Hive service check is failing after moving Hive Metastore from node to another using system tests (#3447)
0c98622399 is described below
commit 0c98622399467079522e5b8a0858ded879a8a4c5
Author: Zhiguo Wu <wu...@apache.org>
AuthorDate: Fri Nov 4 11:23:01 2022 +0800
AMBARI-25248: Hive service check is failing after moving Hive Metastore from node to another using system tests (#3447)
---
.../main/service/reassign/step3_controller.js | 20 +++++++++++++++++++-
.../controllers/main/service/reassign_controller.js | 2 +-
.../app/utils/configs/move_hm_config_initializer.js | 18 ++++++++----------
.../utils/configs/move_hm_config_initializer_test.js | 7 -------
4 files changed, 28 insertions(+), 19 deletions(-)
diff --git a/ambari-web/app/controllers/main/service/reassign/step3_controller.js b/ambari-web/app/controllers/main/service/reassign/step3_controller.js
index 8d09745512..58f799e2d4 100644
--- a/ambari-web/app/controllers/main/service/reassign/step3_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step3_controller.js
@@ -371,13 +371,14 @@ App.ReassignMasterWizardStep3Controller = Em.Controller.extend({
this.get('propertiesToChange')[type].forEach(function (property) {
var propertyName = property.name,
stackProperty = App.configsCollection.getConfigByName(propertyName, type) || {},
+ displayName = self.getDisplayName(stackProperty.displayName, propertyName, type, serviceName),
displayedProperty = App.ServiceConfigProperty.create({
name: propertyName,
- displayName: propertyName,
fileName: type
}, stackProperty, {
value: configs[type][propertyName],
category: serviceName,
+ displayName,
isEditable: Boolean(stackProperty.isEditable !== false && !property.isSecure)
});
displayedConfigs.push(displayedProperty);
@@ -392,6 +393,23 @@ App.ReassignMasterWizardStep3Controller = Em.Controller.extend({
});
},
+ getDisplayName: function (stackDisplayName, propertyName, type, serviceName) {
+ let displayName = stackDisplayName || propertyName;
+ const keys = Em.keys(this.get('propertiesToChange'));
+ for (let i = 0; i < keys.length; i++) {
+ const fileName = keys[i],
+ service = App.config.get('serviceByConfigTypeMap')[fileName];
+ if (fileName !== type && service && service.get('serviceName') === serviceName) {
+ const configs = this.get('propertiesToChange')[fileName];
+ if (configs.someProperty('name', propertyName)) {
+ displayName = `${type}/${propertyName}`;
+ break;
+ }
+ }
+ }
+ return displayName;
+ },
+
onLoadConfigs: function (data) {
// Find hawq-site.xml location
var hawqSiteIndex = -1;
diff --git a/ambari-web/app/controllers/main/service/reassign_controller.js b/ambari-web/app/controllers/main/service/reassign_controller.js
index 3bb1c05040..04ade8a28d 100644
--- a/ambari-web/app/controllers/main/service/reassign_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign_controller.js
@@ -159,7 +159,7 @@ App.ReassignMasterController = App.WizardController.extend({
'APP_TIMELINE_SERVER': ['yarn-site', 'yarn-env'],
'OOZIE_SERVER': ['oozie-site', 'core-site', 'oozie-env'],
'HIVE_SERVER': ['hive-site', 'webhcat-site', 'hive-env', 'core-site'],
- 'HIVE_METASTORE': ['hive-site', 'webhcat-site', 'hive-env', 'core-site'],
+ 'HIVE_METASTORE': ['hive-site', 'webhcat-site', 'hive-env', 'core-site', 'hive-interactive-site'],
'MYSQL_SERVER': ['hive-site'],
'HISTORYSERVER': ['mapred-site'],
'TIMELINE_READER' : ['yarn-site']
diff --git a/ambari-web/app/utils/configs/move_hm_config_initializer.js b/ambari-web/app/utils/configs/move_hm_config_initializer.js
index 527ba7072e..e6529f2352 100644
--- a/ambari-web/app/utils/configs/move_hm_config_initializer.js
+++ b/ambari-web/app/utils/configs/move_hm_config_initializer.js
@@ -47,20 +47,18 @@ App.MoveHmConfigInitializer = App.MoveHiveComponentConfigInitializerClass.create
* @method _initHiveMetastoreUris
*/
_initHiveMetastoreUris: function (configProperty, localDB, dependencies) {
- if (App.config.getConfigTagFromFileName(Em.get(configProperty, 'filename')) === 'hive-site') {
- var hiveMSHosts = this.__getHmHostsConsideringMoved(localDB, dependencies);
+ var hiveMSHosts = this.__getHmHostsConsideringMoved(localDB, dependencies);
- var value = Em.get(configProperty, 'value');
+ var value = Em.get(configProperty, 'value');
- var port = value.match(/:[0-9]{2,4}/);
- port = port ? port[0].slice(1) : '9083';
+ var port = value.match(/:[0-9]{2,4}/);
+ port = port ? port[0].slice(1) : '9083';
- value = hiveMSHosts.uniq().map(function (hiveMSHost) {
- return 'thrift://' + hiveMSHost + ':' + port;
- }).join(',');
+ value = hiveMSHosts.uniq().map(function (hiveMSHost) {
+ return 'thrift://' + hiveMSHost + ':' + port;
+ }).join(',');
- Em.set(configProperty, 'value', value);
- }
+ Em.set(configProperty, 'value', value);
return configProperty;
},
diff --git a/ambari-web/test/utils/configs/move_hm_config_initializer_test.js b/ambari-web/test/utils/configs/move_hm_config_initializer_test.js
index c1972f9f95..7505e0e15e 100644
--- a/ambari-web/test/utils/configs/move_hm_config_initializer_test.js
+++ b/ambari-web/test/utils/configs/move_hm_config_initializer_test.js
@@ -89,13 +89,6 @@ describe('App.MoveHmConfigInitializer', function () {
});
describe('#_initHiveMetastoreUris', function () {
- it('should not change property value if config tag is not equal hive-site', function () {
- sinon.stub(App.config, 'getConfigTagFromFileName').returns('test');
- var result = initializer._initHiveMetastoreUris(Em.Object.create({value: 'test'}), {}, {});
- expect(result.get('value')).to.be.equal('test');
- App.config.getConfigTagFromFileName.restore();
- });
-
it('should set correct value if config tag is equal to hive-site and set 9083 port by default', function () {
sinon.stub(App.config, 'getConfigTagFromFileName').returns('hive-site');
var result = initializer._initHiveMetastoreUris(
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ambari.apache.org
For additional commands, e-mail: commits-help@ambari.apache.org