Repository: ambari
Updated Branches:
  refs/heads/trunk 0be4a567b -> 92b11fc48


AMBARI-15973 FE is auto-populating hive.metastore.uris for 
hive-interactive-site. (ababiichuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/92b11fc4
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/92b11fc4
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/92b11fc4

Branch: refs/heads/trunk
Commit: 92b11fc48ecfe6838512ef7058298b64d248c7c1
Parents: 0be4a56
Author: ababiichuk <[email protected]>
Authored: Tue Apr 19 15:42:00 2016 +0300
Committer: ababiichuk <[email protected]>
Committed: Tue Apr 19 19:52:19 2016 +0300

----------------------------------------------------------------------
 .../app/utils/configs/config_initializer.js       |  8 +++++---
 .../utils/configs/move_hm_config_initializer.js   | 18 ++++++++++--------
 .../test/utils/configs/config_initializer_test.js |  5 ++++-
 3 files changed, 19 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/92b11fc4/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 9806ac7..b4c47f2 100644
--- a/ambari-web/app/utils/configs/config_initializer.js
+++ b/ambari-web/app/utils/configs/config_initializer.js
@@ -303,9 +303,11 @@ App.ConfigInitializer = 
App.ConfigInitializerClass.create(App.MountPointsBasedIn
    * @private
    */
   _initHiveMetastoreUris: function (configProperty, localDB, dependencies) {
-    var hiveMSUris = this.getHiveMetastoreUris(localDB.masterComponentHosts, 
dependencies['hive.metastore.uris']);
-    if (hiveMSUris) {
-      this.setRecommendedValue(configProperty, "(.*)", hiveMSUris);
+    if (App.config.getConfigTagFromFileName(Em.get(configProperty, 
'filename')) === 'hive-site') {
+      var hiveMSUris = this.getHiveMetastoreUris(localDB.masterComponentHosts, 
dependencies['hive.metastore.uris']);
+      if (hiveMSUris) {
+        this.setRecommendedValue(configProperty, "(.*)", hiveMSUris);
+      }
     }
     return configProperty;
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/92b11fc4/ambari-web/app/utils/configs/move_hm_config_initializer.js
----------------------------------------------------------------------
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 e2a2362..cd46682 100644
--- a/ambari-web/app/utils/configs/move_hm_config_initializer.js
+++ b/ambari-web/app/utils/configs/move_hm_config_initializer.js
@@ -48,18 +48,20 @@ App.MoveHmConfigInitializer = 
App.MoveHiveComponentConfigInitializerClass.create
    * @method _initHiveMetastoreUris
    */
   _initHiveMetastoreUris: function (configProperty, localDB, dependencies) {
-    var hiveMSHosts = this.__getHmHostsConsideringMoved(localDB, dependencies);
+    if (App.config.getConfigTagFromFileName(Em.get(configProperty, 
'filename')) === 'hive-site') {
+      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;
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/92b11fc4/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 ed167bf..d2d91e9 100644
--- a/ambari-web/test/utils/configs/config_initializer_test.js
+++ b/ambari-web/test/utils/configs/config_initializer_test.js
@@ -203,6 +203,7 @@ describe('App.ConfigInitializer', function () {
         dependencies: {
           'hive.metastore.uris': 'thrift://localhost:9083'
         },
+        filename: 'hive-site.xml',
         recommendedValue: 'thrift://localhost:9083',
         value: 'thrift://h0:9083,thrift://h1:9083',
         title: 'comma separated list of Metastore hosts with thrift prefix and 
port'
@@ -348,7 +349,8 @@ describe('App.ConfigInitializer', function () {
     it(cases['hive.metastore.uris'].title, function () {
       serviceConfigProperty.setProperties({
         name: 'hive.metastore.uris',
-        recommendedValue: cases['hive.metastore.uris'].recommendedValue
+        recommendedValue: cases['hive.metastore.uris'].recommendedValue,
+        filename: 'hive-site.xml'
       });
       App.ConfigInitializer.initialValue(serviceConfigProperty, 
cases['hive.metastore.uris'].localDB, {'hive.metastore.uris': 
cases['hive.metastore.uris'].recommendedValue});
       
expect(serviceConfigProperty.get('value')).to.equal(cases['hive.metastore.uris'].value);
@@ -727,6 +729,7 @@ describe('App.ConfigInitializer', function () {
       },
       {
         config: 'hive.metastore.uris',
+        filename: 'hive-site.xml',
         localDB: getLocalDBForMultipleComponents('HIVE_METASTORE', 2),
         dependencies: {
           'hive.metastore.uris': 'thrift://localhost:9083'

Reply via email to