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 String getDelegationToken(String renewerKerberosPrincipalName) throws @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 long renewDelegationToken(String tokenStrForm) throws MetaException, TExc @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); } 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 @@ boolean revoke_privileges(PrivilegeBag privileges, boolean grantOption) 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