Skip to content

Commit

Permalink
HBASE-23175 Yarn unable to acquire delegation token for HBase Spark jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitsinghal authored and Apache9 committed Oct 31, 2019
1 parent bff530b commit 29ffcbf
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.lang.reflect.UndeclaredThrowableException;
import org.apache.hadoop.conf.Configuration;
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;
Expand All @@ -43,6 +44,19 @@ public class TokenUtil {
// This class is referenced indirectly by User out in common; instances are created by reflection
private static final Logger LOG = LoggerFactory.getLogger(TokenUtil.class);

/**
* 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
Expand Down

0 comments on commit 29ffcbf

Please sign in to comment.