org.apache.hadoop.hbase.security.token
Class TokenUtil

java.lang.Object
  extended by org.apache.hadoop.hbase.security.token.TokenUtil

public class TokenUtil
extends Object

Utility methods for obtaining authentication tokens.


Constructor Summary
TokenUtil()
           
 
Method Summary
static void obtainAndCacheToken(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.security.UserGroupInformation user)
          Obtain an authentication token for the given user and add it to the user's credentials.
static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> obtainToken(org.apache.hadoop.conf.Configuration conf)
          Obtain and return an authentication token for the current user.
static void obtainTokenForJob(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.security.UserGroupInformation user, org.apache.hadoop.mapreduce.Job job)
          Obtain an authentication token on behalf of the given user and add it to the credentials for the given map reduce job.
static void obtainTokenForJob(org.apache.hadoop.mapred.JobConf job, org.apache.hadoop.security.UserGroupInformation user)
          Obtain an authentication token on behalf of the given user and add it to the credentials for the given map reduce job.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenUtil

public TokenUtil()
Method Detail

obtainToken

public static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> obtainToken(org.apache.hadoop.conf.Configuration conf)
                                                                                         throws IOException
Obtain and return an authentication token for the current user.

Parameters:
conf - The configuration for connecting to the cluster
Returns:
the authentication token instance
Throws:
IOException

obtainAndCacheToken

public static void obtainAndCacheToken(org.apache.hadoop.conf.Configuration conf,
                                       org.apache.hadoop.security.UserGroupInformation user)
                                throws IOException,
                                       InterruptedException
Obtain an authentication token for the given user and add it to the user's credentials.

Parameters:
conf - The configuration for connecting to the cluster
user - The user for whom to obtain the token
Throws:
IOException - If making a remote call to the TokenProvider fails
InterruptedException - If executing as the given user is interrupted

obtainTokenForJob

public static void obtainTokenForJob(org.apache.hadoop.conf.Configuration conf,
                                     org.apache.hadoop.security.UserGroupInformation user,
                                     org.apache.hadoop.mapreduce.Job job)
                              throws IOException,
                                     InterruptedException
Obtain an authentication token on behalf of the given user and add it to the credentials for the given map reduce job.

Parameters:
conf - The configuration for connecting to the cluster
user - The user for whom to obtain the token
job - The job instance in which the token should be stored
Throws:
IOException - If making a remote call to the TokenProvider fails
InterruptedException - If executing as the given user is interrupted

obtainTokenForJob

public static void obtainTokenForJob(org.apache.hadoop.mapred.JobConf job,
                                     org.apache.hadoop.security.UserGroupInformation user)
                              throws IOException,
                                     InterruptedException
Obtain an authentication token on behalf of the given user and add it to the credentials for the given map reduce job.

Parameters:
user - The user for whom to obtain the token
job - The job configuration in which the token should be stored
Throws:
IOException - If making a remote call to the TokenProvider fails
InterruptedException - If executing as the given user is interrupted


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.