Class FsDelegationToken

java.lang.Object
org.apache.hadoop.hbase.security.token.FsDelegationToken

@Private @Evolving public class FsDelegationToken extends Object
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 Details

  • Constructor Details

  • Method Details

    • acquireDelegationToken

      public void acquireDelegationToken(org.apache.hadoop.fs.FileSystem fs) throws IOException
      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 the UserProvider
      fs - the filesystem that requires the delegation token
      Throws:
      IOException - on fs.getDelegationToken() failure
    • releaseDelegationToken

      public void releaseDelegationToken()
      Releases a previously acquired delegation token.
    • getUserProvider

    • getRenewer

      public String getRenewer()
      Returns the account name that is allowed to renew the token.
    • getUserToken

      public org.apache.hadoop.security.token.Token<?> getUserToken()
      Returns the delegation token acquired, or null in case it was not acquired
    • getFileSystem

      public org.apache.hadoop.fs.FileSystem getFileSystem()