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
FieldsModifier and TypeFieldDescriptionprivate org.apache.hadoop.fs.FileSystemprivate booleanprivate static final org.slf4j.Loggerprivate final Stringprivate final UserProviderprivate org.apache.hadoop.security.token.Token<?> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidacquireDelegationToken(String tokenKind, org.apache.hadoop.fs.FileSystem fs) Acquire the delegation token for the specified filesystem and token kind.voidacquireDelegationToken(org.apache.hadoop.fs.FileSystem fs) Acquire the delegation token for the specified filesystem.org.apache.hadoop.fs.FileSystemReturns 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 acquiredvoidReleases 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 theUserProviderfs- 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
-