org.apache.tez.common.security
Class TokenCache

java.lang.Object
  extended by org.apache.tez.common.security.TokenCache

@InterfaceAudience.Private
@InterfaceStability.Unstable
public class TokenCache
extends Object

This class provides user facing APIs for transferring secrets from the job client to the tasks. The secrets can be stored just before submission of jobs and read during the task execution.


Constructor Summary
TokenCache()
           
 
Method Summary
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.token.Token<JobTokenIdentifier> getSessionToken(org.apache.hadoop.security.Credentials credentials)
           
static void mergeBinaryTokens(org.apache.hadoop.security.Credentials creds, org.apache.hadoop.conf.Configuration conf, String tokenFilePath)
          Merge tokens from a configured binary file into provided Credentials object
static void obtainTokensForFileSystems(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 setSessionToken(org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> t, org.apache.hadoop.security.Credentials credentials)
          store session specific token
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenCache

public TokenCache()
Method Detail

getSecretKey

public static byte[] getSecretKey(org.apache.hadoop.security.Credentials credentials,
                                  org.apache.hadoop.io.Text alias)
auxiliary method to get user's secret keys..

Parameters:
alias -
Returns:
secret key from the storage

obtainTokensForFileSystems

public static void obtainTokensForFileSystems(org.apache.hadoop.security.Credentials credentials,
                                              org.apache.hadoop.fs.Path[] ps,
                                              org.apache.hadoop.conf.Configuration conf)
                                       throws IOException
Convenience method to obtain delegation tokens from namenodes corresponding to the paths passed.

Parameters:
credentials -
ps - array of paths
conf - configuration
Throws:
IOException

setSessionToken

@InterfaceAudience.Private
public static void setSessionToken(org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> t,
                                                             org.apache.hadoop.security.Credentials credentials)
store session specific token

Parameters:
t -

getSessionToken

@InterfaceAudience.Private
public static org.apache.hadoop.security.token.Token<JobTokenIdentifier> getSessionToken(org.apache.hadoop.security.Credentials credentials)
Returns:
session token

mergeBinaryTokens

@InterfaceAudience.Private
public static void mergeBinaryTokens(org.apache.hadoop.security.Credentials creds,
                                                               org.apache.hadoop.conf.Configuration conf,
                                                               String tokenFilePath)
                              throws IOException
Merge tokens from a configured binary file into provided Credentials object

Parameters:
creds - Credentials object to add new tokens to
tokenFilePath - Location of tokens' binary file
Throws:
IOException


Copyright © 2014 Apache Software Foundation. All rights reserved.