OOZIE-2153 modify HCatCredentialHelper to use HCatClient (ryota)

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

Branch: refs/heads/master
Commit: b916754694d10da1bfcf34df9249cd832694f856
Parents: ced1271
Author: egashira <[email protected]>
Authored: Thu Mar 5 10:46:14 2015 -0800
Committer: egashira <[email protected]>
Committed: Thu Mar 5 10:46:14 2015 -0800

----------------------------------------------------------------------
 .../oozie/action/hadoop/HCatCredentialHelper.java | 18 +++++++++---------
 release-log.txt                                   |  1 +
 2 files changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oozie/blob/b9167546/core/src/main/java/org/apache/oozie/action/hadoop/HCatCredentialHelper.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/oozie/action/hadoop/HCatCredentialHelper.java 
b/core/src/main/java/org/apache/oozie/action/hadoop/HCatCredentialHelper.java
index 9ba0245..ca12b60 100644
--- 
a/core/src/main/java/org/apache/oozie/action/hadoop/HCatCredentialHelper.java
+++ 
b/core/src/main/java/org/apache/oozie/action/hadoop/HCatCredentialHelper.java
@@ -19,7 +19,6 @@
 package org.apache.oozie.action.hadoop;
 
 import org.apache.hadoop.hive.conf.HiveConf;
-import org.apache.hadoop.hive.metastore.HiveMetaStoreClient;
 import org.apache.hadoop.hive.metastore.api.MetaException;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapred.JobConf;
@@ -27,6 +26,8 @@ import 
org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIden
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.security.token.Token;
 import org.apache.hadoop.security.SaslRpcServer;
+import org.apache.hive.hcatalog.api.HCatClient;
+import org.apache.hive.hcatalog.common.HCatException;
 import org.apache.oozie.util.XLog;
 
 /**
@@ -52,8 +53,7 @@ public class HCatCredentialHelper {
      */
     public void set(JobConf launcherJobConf, String principal, String server) 
throws Exception {
         try {
-            HiveMetaStoreClient client = getHCatClient
-                (launcherJobConf, principal, server);
+            HCatClient client = getHCatClient(launcherJobConf, principal, 
server);
             XLog.getLog(getClass()).debug(
                     "HCatCredentialHelper: set: User name for which token will 
be asked from HCat: "
                             + launcherJobConf.get(USER_NAME));
@@ -75,13 +75,13 @@ public class HCatCredentialHelper {
      * @param jobConf
      * @param principal
      * @param server
-     * @return HiveMetaStoreClient
-     * @throws MetaException
+     * @return HCatClient
+     * @throws HCatException
      */
-    public HiveMetaStoreClient getHCatClient(JobConf launcherJobConf,
-        String principal, String server) throws MetaException {
+    public HCatClient getHCatClient(JobConf launcherJobConf,
+        String principal, String server) throws HCatException {
         HiveConf hiveConf = null;
-        HiveMetaStoreClient hiveclient = null;
+        HCatClient hiveclient = null;
         hiveConf = new HiveConf();
         XLog.getLog(getClass()).debug("getHCatClient: Principal: " + principal 
+ " Server: " + server);
         // specified a thrift url
@@ -96,7 +96,7 @@ public class HCatCredentialHelper {
         XLog.getLog(getClass()).debug("getHCatClient, setting rpc protection 
to " + protection);
         hiveConf.set(HADOOP_RPC_PROTECTION, protection);
 
-        hiveclient = new HiveMetaStoreClient(hiveConf);
+        hiveclient = HCatClient.create(hiveConf);
         return hiveclient;
     }
 }

http://git-wip-us.apache.org/repos/asf/oozie/blob/b9167546/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 3f10813..bd81afb 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -1,5 +1,6 @@
 -- Oozie 4.2.0 release (trunk - unreleased)
 
+OOZIE-2153 modify HCatCredentialHelper to use HCatClient (ryota)
 OOZIE-2132 FS actions are not retried (ryota)
 OOZIE-2147 Oozie upgrade from 4.0.0 to 4.1.0 fails with CLOBs of zero length 
with Oracle DB (venkatnrangan via bzhang)
 OOZIE-2158 Overrides in action conf in streaming action do not work (rohini)

Reply via email to