HBASE-23175 Yarn unable to acquire delegation token for HBase Spark jobs

This commit is contained in:
Ankit Singhal 2019-10-30 14:49:04 -07:00 committed by stack
parent e808ea1d04
commit 0108e57309
1 changed files with 14 additions and 0 deletions

View File

@ -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;
@ -57,6 +58,19 @@ public class TokenUtil {
return ClientTokenUtil.obtainToken(conn);
}
/**
* 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