You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by th...@apache.org on 2015/04/27 22:03:19 UTC

hive git commit: HIVE-4625 : HS2 should not attempt to get delegation token from metastore if using embedded metastore (Hari Sankar Sivarama Subramaniyan via Thejas Nair)

Repository: hive
Updated Branches:
  refs/heads/master daf85805e -> cb42b090e


HIVE-4625 : HS2 should not attempt to get delegation token from metastore if using embedded metastore (Hari Sankar Sivarama Subramaniyan 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/cb42b090
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/cb42b090
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/cb42b090

Branch: refs/heads/master
Commit: cb42b090e4f632770742941e41f210c2136cc721
Parents: daf8580
Author: Thejas Nair <th...@hortonworks.com>
Authored: Mon Apr 27 13:02:58 2015 -0700
Committer: Thejas Nair <th...@hortonworks.com>
Committed: Mon Apr 27 13:03:15 2015 -0700

----------------------------------------------------------------------
 .../hadoop/hive/metastore/HiveMetaStoreClient.java  | 16 +++++++---------
 .../hadoop/hive/metastore/IMetaStoreClient.java     |  2 ++
 2 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/cb42b090/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
index fdc9e91..afc584a 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
@@ -1787,18 +1787,17 @@ public class HiveMetaStoreClient implements IMetaStoreClient {
   @Override
   public String getDelegationToken(String owner, String renewerKerberosPrincipalName) throws
   MetaException, TException {
-    if(localMetaStore) {
-      throw new UnsupportedOperationException("getDelegationToken() can be " +
-          "called only in thrift (non local) mode");
+    // This is expected to be a no-op, so we will return null when we use local metastore.
+    if (localMetaStore) {
+      return null;
     }
     return client.get_delegation_token(owner, renewerKerberosPrincipalName);
   }
 
   @Override
   public long renewDelegationToken(String tokenStrForm) throws MetaException, TException {
-    if(localMetaStore) {
-      throw new UnsupportedOperationException("renewDelegationToken() can be " +
-          "called only in thrift (non local) mode");
+    if (localMetaStore) {
+      return 0;
     }
     return client.renew_delegation_token(tokenStrForm);
 
@@ -1806,9 +1805,8 @@ public class HiveMetaStoreClient implements IMetaStoreClient {
 
   @Override
   public void cancelDelegationToken(String tokenStrForm) throws MetaException, TException {
-    if(localMetaStore) {
-      throw new UnsupportedOperationException("renewDelegationToken() can be " +
-          "called only in thrift (non local) mode");
+    if (localMetaStore) {
+      return;
     }
     client.cancel_delegation_token(tokenStrForm);
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/cb42b090/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java b/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java
index 18c7675..92adad0 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java
@@ -1088,6 +1088,8 @@ public interface IMetaStoreClient {
       throws MetaException, TException;
 
   /**
+   * This is expected to be a no-op when in local mode,
+   * which means that the implementation will return null.
    * @param owner the intended owner for the token
    * @param renewerKerberosPrincipalName
    * @return the string of the token