@InterfaceAudience.Private public class TokenUtil extends Object
Constructor and Description |
---|
TokenUtil() |
Modifier and Type | Method and Description |
---|---|
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.
|
public static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> obtainToken(org.apache.hadoop.conf.Configuration conf) throws IOException
conf
- The configuration for connecting to the clusterIOException
public static void obtainAndCacheToken(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.security.UserGroupInformation user) throws IOException, InterruptedException
conf
- The configuration for connecting to the clusteruser
- The user for whom to obtain the tokenIOException
- If making a remote call to the TokenProvider
failsInterruptedException
- If executing as the given user is interruptedpublic static void obtainTokenForJob(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.security.UserGroupInformation user, org.apache.hadoop.mapreduce.Job job) throws IOException, InterruptedException
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 TokenProvider
failsInterruptedException
- If executing as the given user is interruptedpublic static void obtainTokenForJob(org.apache.hadoop.mapred.JobConf job, org.apache.hadoop.security.UserGroupInformation user) throws IOException, InterruptedException
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 TokenProvider
failsInterruptedException
- If executing as the given user is interruptedCopyright © 2014 The Apache Software Foundation. All rights reserved.