Java 类org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSelector 实例源码

项目:hadoop-on-lustre    文件:WebHdfsFileSystem.java   
protected void initDelegationToken() throws IOException {
  // look for webhdfs token, then try hdfs
  final Text serviceName = SecurityUtil.buildTokenService(nnAddr);
  Token<?> token = DT_SELECTOR.selectToken(serviceName, ugi.getTokens());      
  if (token == null) {
    token = DelegationTokenSelector.selectHdfsDelegationToken(
        nnAddr, ugi, getConf());
  }

  //since we don't already have a token, go get one
  boolean createdToken = false;
  if (token == null) {
    token = getDelegationToken(null);
    createdToken = (token != null);
  }

  // security might be disabled
  if (token != null) {
    setDelegationToken(token);
    if (createdToken) {
      addRenewAction(this);
      LOG.debug("Created new DT for " + token.getService());
    } else {
      LOG.debug("Found existing DT for " + token.getService());        
    }
  }
}
项目:hortonworks-extension    文件:WebHdfsFileSystem.java   
protected void initDelegationToken() throws IOException {
  // look for webhdfs token, then try hdfs
  final Text serviceName = SecurityUtil.buildTokenService(nnAddr);
  Token<?> token = DT_SELECTOR.selectToken(serviceName, ugi.getTokens());      
  if (token == null) {
    token = DelegationTokenSelector.selectHdfsDelegationToken(
        nnAddr, ugi, getConf());
  }

  //since we don't already have a token, go get one
  boolean createdToken = false;
  if (token == null) {
    token = getDelegationToken(null);
    createdToken = (token != null);
  }

  // security might be disabled
  if (token != null) {
    setDelegationToken(token);
    if (createdToken) {
      addRenewAction(this);
      LOG.debug("Created new DT for " + token.getService());
    } else {
      LOG.debug("Found existing DT for " + token.getService());        
    }
  }
}
项目:hortonworks-extension    文件:WebHdfsFileSystem.java   
protected void initDelegationToken() throws IOException {
  // look for webhdfs token, then try hdfs
  final Text serviceName = SecurityUtil.buildTokenService(nnAddr);
  Token<?> token = DT_SELECTOR.selectToken(serviceName, ugi.getTokens());      
  if (token == null) {
    token = DelegationTokenSelector.selectHdfsDelegationToken(
        nnAddr, ugi, getConf());
  }

  //since we don't already have a token, go get one
  boolean createdToken = false;
  if (token == null) {
    token = getDelegationToken(null);
    createdToken = (token != null);
  }

  // security might be disabled
  if (token != null) {
    setDelegationToken(token);
    if (createdToken) {
      addRenewAction(this);
      LOG.debug("Created new DT for " + token.getService());
    } else {
      LOG.debug("Found existing DT for " + token.getService());        
    }
  }
}
项目:hadoop-on-lustre    文件:HftpFileSystem.java   
protected Token<DelegationTokenIdentifier> selectHdfsDelegationToken() {
  return  DelegationTokenSelector.selectHdfsDelegationToken(
      nnAddr, ugi, getConf());
}
项目:hortonworks-extension    文件:HftpFileSystem.java   
protected Token<DelegationTokenIdentifier> selectHdfsDelegationToken() {
  return  DelegationTokenSelector.selectHdfsDelegationToken(
      nnAddr, ugi, getConf());
}
项目:hortonworks-extension    文件:HftpFileSystem.java   
protected Token<DelegationTokenIdentifier> selectHdfsDelegationToken() {
  return  DelegationTokenSelector.selectHdfsDelegationToken(
      nnAddr, ugi, getConf());
}