You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2015/03/16 19:02:59 UTC

ambari git commit: AMBARI-10068. Add Host incorrectly changes webhcat properties. (jaimin)

Repository: ambari
Updated Branches:
  refs/heads/trunk 34c3951c2 -> c61c920bc


AMBARI-10068. Add Host incorrectly changes webhcat properties. (jaimin)


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

Branch: refs/heads/trunk
Commit: c61c920bcac93d7b0fa012c2e93a73d43d319700
Parents: 34c3951
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Mon Mar 16 11:02:12 2015 -0700
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Mon Mar 16 11:02:23 2015 -0700

----------------------------------------------------------------------
 .../HIVE/0.12.0.2.0/kerberos.json               |  2 +-
 .../main/admin/kerberos/step4_controller.js     | 24 +++++++++++++++++++-
 2 files changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c61c920b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/kerberos.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/kerberos.json b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/kerberos.json
index ad5ee3e..932b71b 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/kerberos.json
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/kerberos.json
@@ -21,7 +21,7 @@
         {
           "webhcat-site": {
             "templeton.kerberos.secret": "secret",
-            "templeton.hive.properties": "hive.metastore.local=false,hive.metastore.uris=thrift://${host}:9083,hive.metastore.sasl.enabled=true,hive.metastore.execute.setugi=true,hive.metastore.warehouse.dir=/apps/hive/warehouse,hive.exec.mode.local.auto=false,hive.metastore.kerberos.principal=hive/_HOST@${realm}"
+            "templeton.hive.properties": "hive.metastore.local=false,hive.metastore.uris=thrift://${clusterHostInfo/hive_metastore_host}:9083,hive.metastore.sasl.enabled=true,hive.metastore.execute.setugi=true,hive.metastore.warehouse.dir=/apps/hive/warehouse,hive.exec.mode.local.auto=false,hive.metastore.kerberos.principal=hive/_HOST@${realm}"
           }
         },
         {

http://git-wip-us.apache.org/repos/asf/ambari/blob/c61c920b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
index 064eafc..47a4107 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
@@ -189,12 +189,34 @@ App.KerberosWizardStep4Controller = App.WizardStep7Controller.extend(App.AddSecu
           property.set('displayType', siteProperty.displayType);
         }
       }
-    });
+      this.tweakConfigProperty(property);
+    },this);
 
     return configProperties;
   },
 
   /**
+   * Function to override kerberos descriptor's property values
+   */
+  tweakConfigProperty: function(config) {
+    if (config.name === 'templeton.hive.properties') {
+      var defaultHiveMsPort = "9083";
+      var hiveMSHosts = App.HostComponent.find().filterProperty('componentName', 'HIVE_METASTORE');
+      if (hiveMSHosts.length > 1) {
+        var hiveMSHostNames = hiveMSHosts.mapProperty('hostName');
+        var port = config.value.match(/:[0-9]{2,4}/);
+        port = port ? port[0].slice(1) : defaultHiveMsPort;
+        for (var i = 0; i < hiveMSHostNames.length; i++) {
+          hiveMSHostNames[i] = "thrift://" + hiveMSHostNames[i] + ":" + port;
+        }
+        var configValue =  config.value.replace(/thrift.+[0-9]{2,},/i, hiveMSHostNames.join('\\,') + ",");
+        config.set('value', configValue);
+        config.set('defaultValue', configValue);
+      }
+    }
+  },
+
+  /**
    * Sync up values between inherited property and its reference.
    * 
    * @param {App.ServiceConfigProperty} configProperty