This is an automated email from the ASF dual-hosted git repository.

stack pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
     new 0108e57  HBASE-23175 Yarn unable to acquire delegation token for HBase 
Spark jobs
0108e57 is described below

commit 0108e57309a9ef5bc2131750c1cdf510dbd9b8b6
Author: Ankit Singhal <[email protected]>
AuthorDate: Wed Oct 30 14:49:04 2019 -0700

    HBASE-23175 Yarn unable to acquire delegation token for HBase Spark jobs
---
 .../org/apache/hadoop/hbase/security/token/TokenUtil.java  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/TokenUtil.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/TokenUtil.java
index 159f81e..7cccea4 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/TokenUtil.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/TokenUtil.java
@@ -23,6 +23,7 @@ import java.util.concurrent.CompletableFuture;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.client.AsyncConnection;
 import org.apache.hadoop.hbase.client.Connection;
+import org.apache.hadoop.hbase.client.ConnectionFactory;
 import org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos;
 import org.apache.hadoop.hbase.security.User;
 import org.apache.hadoop.hbase.zookeeper.ZKClusterId;
@@ -58,6 +59,19 @@ public class TokenUtil {
   }
 
   /**
+   * It was removed in HBase-2.0 but added again as spark code relies on this 
method to obtain
+   * delegation token
+   * @deprecated Since 2.0.0.
+   */
+  @Deprecated
+  public static Token<AuthenticationTokenIdentifier> obtainToken(Configuration 
conf)
+      throws IOException {
+    try (Connection connection = ConnectionFactory.createConnection(conf)) {
+      return obtainToken(connection);
+    }
+  }
+
+  /**
    * See {@link 
ClientTokenUtil#obtainToken(org.apache.hadoop.hbase.client.Connection)}.
    * @deprecated External users should not use this method. Please post on
    *   the HBase dev mailing list if you need this method. Internal

Reply via email to