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 saintstack committed Oct 30, 2019
1 parent 90017d8 commit 97879d2
Showing 1 changed file with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.Table;
import org.apache.hadoop.hbase.client.ConnectionFactory;
import org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel;
import org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos;
import org.apache.hadoop.hbase.security.User;
Expand Down Expand Up @@ -64,10 +65,25 @@ private static void injectFault() throws ServiceException {

/**
* Obtain and return an authentication token for the current user.
* @param conn The HBase cluster connection
* @throws IOException if a remote error or serialization problem occurs.
* @return the authentication token instance
* 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
* HBase code should use {@link ClientTokenUtil} instead.
*/
@Deprecated
public static Token<AuthenticationTokenIdentifier> obtainToken(
Connection conn) throws IOException {
Table meta = null;
Expand Down

0 comments on commit 97879d2

Please sign in to comment.