public void acquireDelegationToken(final FileSystem fs) throws IOException {
    String tokenKind;
    String scheme = fs.getUri().getScheme();
    if (SWEBHDFS_SCHEME.equalsIgnoreCase(scheme)) {
      tokenKind = SWEBHDFS_TOKEN_KIND.toString();
    } else if (WEBHDFS_SCHEME.equalsIgnoreCase(scheme)) {
      tokenKind = WEBHDFS_TOKEN_KIND.toString();
    } else if (HDFS_URI_SCHEME.equalsIgnoreCase(scheme)) {
      tokenKind = HDFS_DELEGATION_KIND.toString();
    } else {
      LOG.warn("Unknown FS URI scheme: " + scheme);
      // Preserve default behavior
      tokenKind = HDFS_DELEGATION_KIND.toString();
    }

    acquireDelegationToken(tokenKind, fs);
  }
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.
@param fs the filesystem that requires the delegation token
@throws IOException on fs.getDelegationToken() failure
hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/FsDelegationToken.java