hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From the...@apache.org
Subject hive git commit: HIVE-13020 : Hive Metastore and HiveServer2 to Zookeeper fails with IBM JDK (Greg Senia via Thejas Nair)
Date Thu, 11 Feb 2016 23:52:51 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-1 ad7c129e9 -> 826086946


HIVE-13020 : Hive Metastore and HiveServer2 to Zookeeper fails with IBM JDK (Greg Senia  via
Thejas Nair)


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

Branch: refs/heads/branch-1
Commit: 826086946119f9ba2096d3c0444019e8eb0b3159
Parents: ad7c129
Author: Greg Senia <>
Authored: Thu Feb 11 14:23:35 2016 -0800
Committer: Thejas Nair <thejas@hortonworks.com>
Committed: Thu Feb 11 14:23:35 2016 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/shims/Utils.java     | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/82608694/shims/common/src/main/java/org/apache/hadoop/hive/shims/Utils.java
----------------------------------------------------------------------
diff --git a/shims/common/src/main/java/org/apache/hadoop/hive/shims/Utils.java b/shims/common/src/main/java/org/apache/hadoop/hive/shims/Utils.java
index b898343..4bcb8c3 100644
--- a/shims/common/src/main/java/org/apache/hadoop/hive/shims/Utils.java
+++ b/shims/common/src/main/java/org/apache/hadoop/hive/shims/Utils.java
@@ -39,6 +39,9 @@ import org.apache.zookeeper.client.ZooKeeperSaslClient;
 
 public class Utils {
 
+  private static final boolean IBM_JAVA = System.getProperty("java.vendor")
+      .contains("IBM");
+
   public static UserGroupInformation getUGI() throws LoginException, IOException {
     String doAs = System.getenv("HADOOP_USER_NAME");
     if(doAs != null && doAs.length() > 0) {
@@ -143,6 +146,8 @@ public class Utils {
    */
   private static class JaasConfiguration extends javax.security.auth.login.Configuration
{
     // Current installed Configuration
+    private static final boolean IBM_JAVA = System.getProperty("java.vendor")
+      .contains("IBM");
     private final javax.security.auth.login.Configuration baseConfig = javax.security.auth.login.Configuration
         .getConfiguration();
     private final String loginContextName;
@@ -159,11 +164,16 @@ public class Utils {
     public AppConfigurationEntry[] getAppConfigurationEntry(String appName) {
       if (loginContextName.equals(appName)) {
         Map<String, String> krbOptions = new HashMap<String, String>();
-        krbOptions.put("doNotPrompt", "true");
-        krbOptions.put("storeKey", "true");
-        krbOptions.put("useKeyTab", "true");
-        krbOptions.put("principal", principal);
-        krbOptions.put("keyTab", keyTabFile);
+        if (IBM_JAVA) {
+          krbOptions.put("credsType", "both");
+          krbOptions.put("useKeytab", keyTabFile);
+        } else {
+          krbOptions.put("doNotPrompt", "true");
+          krbOptions.put("storeKey", "true");
+          krbOptions.put("useKeyTab", "true");
+          krbOptions.put("keyTab", keyTabFile);
+        }
+	krbOptions.put("principal", principal);
         krbOptions.put("refreshKrb5Config", "true");
         AppConfigurationEntry hiveZooKeeperClientEntry = new AppConfigurationEntry(
             KerberosUtil.getKrb5LoginModuleName(), LoginModuleControlFlag.REQUIRED, krbOptions);


Mime
View raw message