You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by vi...@apache.org on 2012/12/27 01:31:05 UTC

svn commit: r1426094 - in /oozie/trunk: core/src/main/java/org/apache/oozie/action/hadoop/HCatCredentialHelper.java release-log.txt

Author: virag
Date: Thu Dec 27 00:31:04 2012
New Revision: 1426094

URL: http://svn.apache.org/viewvc?rev=1426094&view=rev
Log:
OOZIE-1147 HCatCredentialHelper uses the wrong API for getDelegationToken (rohini via virag)

Modified:
    oozie/trunk/core/src/main/java/org/apache/oozie/action/hadoop/HCatCredentialHelper.java
    oozie/trunk/release-log.txt

Modified: oozie/trunk/core/src/main/java/org/apache/oozie/action/hadoop/HCatCredentialHelper.java
URL: http://svn.apache.org/viewvc/oozie/trunk/core/src/main/java/org/apache/oozie/action/hadoop/HCatCredentialHelper.java?rev=1426094&r1=1426093&r2=1426094&view=diff
==============================================================================
--- oozie/trunk/core/src/main/java/org/apache/oozie/action/hadoop/HCatCredentialHelper.java (original)
+++ oozie/trunk/core/src/main/java/org/apache/oozie/action/hadoop/HCatCredentialHelper.java Thu Dec 27 00:31:04 2012
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,6 +23,7 @@ import org.apache.hadoop.hive.metastore.
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapred.JobConf;
 import org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier;
+import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.security.token.Token;
 import org.apache.oozie.util.XLog;
 
@@ -52,7 +53,8 @@ public class HCatCredentialHelper {
             XLog.getLog(getClass()).debug(
                     "HCatCredentialHelper: set: User name for which token will be asked from HCat: "
                             + launcherJobConf.get(USER_NAME));
-            String tokenStrForm = client.getDelegationToken(launcherJobConf.get(USER_NAME));
+            String tokenStrForm = client.getDelegationToken(launcherJobConf.get(USER_NAME), UserGroupInformation
+                    .getLoginUser().getShortUserName());
             Token<DelegationTokenIdentifier> hcatToken = new Token<DelegationTokenIdentifier>();
             hcatToken.decodeFromUrlString(tokenStrForm);
             launcherJobConf.getCredentials().addToken(new Text("HCat Token"), hcatToken);
@@ -77,7 +79,7 @@ public class HCatCredentialHelper {
         hiveConf = new HiveConf();
         XLog.getLog(getClass()).debug("getHCatClient: Principal: " + principal + " Server: " + server);
         // specified a thrift url
-       
+
         hiveConf.set(HIVE_METASTORE_SASL_ENABLED, "true");
         hiveConf.set(HIVE_METASTORE_KERBEROS_PRINCIPAL, principal);
         hiveConf.set(HIVE_METASTORE_LOCAL, "false");

Modified: oozie/trunk/release-log.txt
URL: http://svn.apache.org/viewvc/oozie/trunk/release-log.txt?rev=1426094&r1=1426093&r2=1426094&view=diff
==============================================================================
--- oozie/trunk/release-log.txt (original)
+++ oozie/trunk/release-log.txt Thu Dec 27 00:31:04 2012
@@ -68,6 +68,7 @@ OOZIE-944 Implement Workflow Generator U
 
 -- Oozie 3.3.1 (unreleased)
 
+OOZIE-1147 HCatCredentialHelper uses the wrong API for getDelegationToken (rohini via virag)
 OOZIE-1139 bump up Tomcat version to 6.0.36 (tucu via rkanter)
 OOZIE-1110 log Error that happens in XCommand to make debug easy (rohini via virag)
 OOZIE-1133 Remove hadoop-auth dependency from oozie-core (virag)