public class TokenCache
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
JOB_TOKEN_HDFS_FILE
file name used on HDFS for generated job token
|
static java.lang.String |
JOB_TOKENS_FILENAME
conf setting for job tokens cache file name
|
Constructor and Description |
---|
TokenCache() |
Modifier and Type | Method and Description |
---|---|
static void |
cleanUpTokenReferral(org.apache.hadoop.conf.Configuration conf)
Remove jobtoken referrals which don't make sense in the context
of the task execution.
|
static org.apache.hadoop.security.token.Token<JobTokenIdentifier> |
getJobToken(org.apache.hadoop.security.Credentials credentials) |
static byte[] |
getSecretKey(org.apache.hadoop.security.Credentials credentials,
org.apache.hadoop.io.Text alias)
auxiliary method to get user's secret keys..
|
static org.apache.hadoop.security.Credentials |
loadTokens(java.lang.String jobTokenFile,
org.apache.hadoop.conf.Configuration conf)
load job token from a file
|
static void |
obtainTokensForNamenodes(org.apache.hadoop.security.Credentials credentials,
org.apache.hadoop.fs.Path[] ps,
org.apache.hadoop.conf.Configuration conf)
Convenience method to obtain delegation tokens from namenodes
corresponding to the paths passed.
|
static void |
setJobToken(org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> t,
org.apache.hadoop.security.Credentials credentials)
store job token
|
public static final java.lang.String JOB_TOKEN_HDFS_FILE
public static final java.lang.String JOB_TOKENS_FILENAME
public static byte[] getSecretKey(org.apache.hadoop.security.Credentials credentials, org.apache.hadoop.io.Text alias)
alias
- public static void obtainTokensForNamenodes(org.apache.hadoop.security.Credentials credentials, org.apache.hadoop.fs.Path[] ps, org.apache.hadoop.conf.Configuration conf) throws java.io.IOException
ps
- array of pathsconf
- configurationjava.io.IOException
public static void cleanUpTokenReferral(org.apache.hadoop.conf.Configuration conf)
conf
- configuration object.public static org.apache.hadoop.security.Credentials loadTokens(java.lang.String jobTokenFile, org.apache.hadoop.conf.Configuration conf) throws java.io.IOException
conf
- java.io.IOException
public static void setJobToken(org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> t, org.apache.hadoop.security.Credentials credentials)
t
- public static org.apache.hadoop.security.token.Token<JobTokenIdentifier> getJobToken(org.apache.hadoop.security.Credentials credentials)
Copyright © 2009 The Apache Software Foundation