hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgumas...@apache.org
Subject hive git commit: HIVE-13020: Hive Metastore and HiveServer2 to Zookeeper fails with IBM JDK (Greg Senia reviewed by Thejas Nair)
Date Fri, 17 Mar 2017 20:13:13 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-1.2 1be6f1514 -> 66fd257c6


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


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

Branch: refs/heads/branch-1.2
Commit: 66fd257c6b1b2f1ecdf243045329197eeba7858a
Parents: 1be6f15
Author: Vaibhav Gumashta <vgumashta@hortonworks.com>
Authored: Fri Mar 17 13:13:07 2017 -0700
Committer: Vaibhav Gumashta <vgumashta@hortonworks.com>
Committed: Fri Mar 17 13:13:07 2017 -0700

----------------------------------------------------------------------
 .../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/66fd257c/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..ca2bcf1 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