Class FsDelegationToken
java.lang.Object
org.apache.hadoop.hbase.security.token.FsDelegationToken
Helper class to obtain a filesystem delegation token. Mainly used by Map-Reduce jobs that
requires to read/write data to a remote file-system (e.g. BulkLoad, ExportSnapshot).
-
Field Summary
Modifier and TypeFieldDescriptionprivate org.apache.hadoop.fs.FileSystem
private boolean
private static final org.slf4j.Logger
private final String
private final UserProvider
private org.apache.hadoop.security.token.Token<?>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
acquireDelegationToken
(String tokenKind, org.apache.hadoop.fs.FileSystem fs) Acquire the delegation token for the specified filesystem and token kind.void
acquireDelegationToken
(org.apache.hadoop.fs.FileSystem fs) Acquire the delegation token for the specified filesystem.org.apache.hadoop.fs.FileSystem
Returns the account name that is allowed to renew the token.org.apache.hadoop.security.token.Token<?>
Returns the delegation token acquired, or null in case it was not acquiredvoid
Releases a previously acquired delegation token.
-
Field Details
-
LOG
-
userProvider
-
renewer
-
hasForwardedToken
-
userToken
-
fs
-
-
Constructor Details
-
FsDelegationToken
-
-
Method Details
-
acquireDelegationToken
Acquire the delegation token for the specified filesystem. Before requesting a new delegation token, tries to find one already available. Currently supports checking existing delegation tokens for swebhdfs, webhdfs and hdfs.- Parameters:
fs
- the filesystem that requires the delegation token- Throws:
IOException
- on fs.getDelegationToken() failure
-
acquireDelegationToken
public void acquireDelegationToken(String tokenKind, org.apache.hadoop.fs.FileSystem fs) throws IOException Acquire the delegation token for the specified filesystem and token kind. Before requesting a new delegation token, tries to find one already available.- Parameters:
tokenKind
- non-null token kind to get delegation token from theUserProvider
fs
- the filesystem that requires the delegation token- Throws:
IOException
- on fs.getDelegationToken() failure
-
releaseDelegationToken
Releases a previously acquired delegation token. -
getUserProvider
-
getRenewer
Returns the account name that is allowed to renew the token. -
getUserToken
Returns the delegation token acquired, or null in case it was not acquired -
getFileSystem
-