@InterfaceAudience.Public @InterfaceStability.Evolving public class TokenUtil extends Object
Constructor and Description |
---|
TokenUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addTokenForJob(Connection conn,
JobConf job,
User user)
Checks for an authentication token for the given user, obtaining a new token if necessary,
and adds it to the credentials for the given map reduce job.
|
static void |
addTokenForJob(Connection conn,
User user,
Job job)
Checks for an authentication token for the given user, obtaining a new token if necessary,
and adds it to the credentials for the given map reduce job.
|
static boolean |
addTokenIfMissing(Connection conn,
User user)
Checks if an authentication tokens exists for the connected cluster,
obtaining one if needed and adding it to the user's credentials.
|
static void |
obtainAndCacheToken(Configuration conf,
UserGroupInformation user)
Deprecated.
Replaced by
#obtainAndCacheToken(Connection,User) |
static <any> |
obtainToken(Configuration conf)
Deprecated.
Replaced by
obtainToken(Connection) |
static <any> |
obtainToken(Connection conn)
Obtain and return an authentication token for the current user.
|
static <any> |
obtainToken(Connection conn,
User user)
Obtain and return an authentication token for the current user.
|
static void |
obtainTokenForJob(Configuration conf,
UserGroupInformation user,
Job job)
Deprecated.
Replaced by
obtainTokenForJob(Connection,User,Job) |
static void |
obtainTokenForJob(Connection conn,
JobConf job,
User user)
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(Connection conn,
User user,
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(JobConf job,
UserGroupInformation user)
Deprecated.
Replaced by
obtainTokenForJob(Connection,JobConf,User) |
@Deprecated public static <any> obtainToken(Configuration conf) throws IOException
obtainToken(Connection)
conf
- the configuration for connecting to the clusterIOException
public static <any> obtainToken(Connection conn) throws IOException
conn
- The HBase cluster connectionIOException
public static <any> obtainToken(Connection conn, User user) throws IOException, InterruptedException
conn
- The HBase cluster connectionIOException
InterruptedException
@Deprecated public static void obtainAndCacheToken(Configuration conf, UserGroupInformation user) throws IOException, InterruptedException
#obtainAndCacheToken(Connection,User)
conf
- The configuration for connecting to the clusteruser
- The user for whom to obtain the tokenIOException
- If making a remote call to the authentication service failsInterruptedException
- If executing as the given user is interrupted@Deprecated public static void obtainTokenForJob(Configuration conf, UserGroupInformation user, Job job) throws IOException, InterruptedException
obtainTokenForJob(Connection,User,Job)
conf
- The configuration for connecting to the clusteruser
- The user for whom to obtain the tokenjob
- The job instance in which the token should be storedIOException
- If making a remote call to the authentication service failsInterruptedException
- If executing as the given user is interruptedpublic static void obtainTokenForJob(Connection conn, User user, Job job) throws IOException, InterruptedException
conn
- The HBase cluster connectionuser
- The user for whom to obtain the tokenjob
- The job instance in which the token should be storedIOException
- If making a remote call to the authentication service failsInterruptedException
- If executing as the given user is interrupted@Deprecated public static void obtainTokenForJob(JobConf job, UserGroupInformation user) throws IOException, InterruptedException
obtainTokenForJob(Connection,JobConf,User)
user
- The user for whom to obtain the tokenjob
- The job configuration in which the token should be storedIOException
- If making a remote call to the authentication service failsInterruptedException
- If executing as the given user is interruptedpublic static void obtainTokenForJob(Connection conn, JobConf job, User user) throws IOException, InterruptedException
conn
- The HBase cluster connectionuser
- The user for whom to obtain the tokenjob
- The job configuration in which the token should be storedIOException
- If making a remote call to the authentication service failsInterruptedException
- If executing as the given user is interruptedpublic static void addTokenForJob(Connection conn, JobConf job, User user) throws IOException, InterruptedException
conn
- The HBase cluster connectionuser
- The user for whom to obtain the tokenjob
- The job configuration in which the token should be storedIOException
- If making a remote call to the authentication service failsInterruptedException
- If executing as the given user is interruptedpublic static void addTokenForJob(Connection conn, User user, Job job) throws IOException, InterruptedException
conn
- The HBase cluster connectionuser
- The user for whom to obtain the tokenjob
- The job instance in which the token should be storedIOException
- If making a remote call to the authentication service failsInterruptedException
- If executing as the given user is interruptedpublic static boolean addTokenIfMissing(Connection conn, User user) throws IOException, InterruptedException
conn
- The HBase cluster connectionuser
- The user for whom to obtain the tokenIOException
- If making a remote call to the authentication service failsInterruptedException
- If executing as the given user is interrupted