public void acquireDelegationToken(final String tokenKind, final FileSystem fs)
    throws IOException {
    Objects.requireNonNull(tokenKind, "tokenKind:null");
    if (userProvider.isHadoopSecurityEnabled()) {
      this.fs = fs;
      userToken = userProvider.getCurrent().getToken(tokenKind, fs.getCanonicalServiceName());
      if (userToken == null) {
        hasForwardedToken = false;
        userToken = fs.getDelegationToken(renewer);
      } else {
        hasForwardedToken = true;
        LOG.info("Use the existing token: " + userToken);
      }
    }
  }
Acquire the delegation token for the specified filesystem and token kind. Before requesting a
new delegation token, tries to find one already available.
@param tokenKind non-null token kind to get delegation token from the {@link UserProvider}
@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