当前位置: 首页>>代码示例>>Java>>正文


Java DelegationTokenSecretManager.createCredentials方法代码示例

本文整理汇总了Java中org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager.createCredentials方法的典型用法代码示例。如果您正苦于以下问题:Java DelegationTokenSecretManager.createCredentials方法的具体用法?Java DelegationTokenSecretManager.createCredentials怎么用?Java DelegationTokenSecretManager.createCredentials使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager的用法示例。


在下文中一共展示了DelegationTokenSecretManager.createCredentials方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generateDelegationToken

import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager; //导入方法依赖的package包/类
private Token<? extends TokenIdentifier> generateDelegationToken(
    final NameNode namenode, final UserGroupInformation ugi,
    final String renewer) throws IOException {
  final Credentials c = DelegationTokenSecretManager.createCredentials(
      namenode, ugi, renewer != null? renewer: ugi.getShortUserName());
  if (c == null) {
    return null;
  }
  final Token<? extends TokenIdentifier> t = c.getAllTokens().iterator().next();
  Text kind = request.getScheme().equals("http") ? WebHdfsFileSystem.TOKEN_KIND
      : SWebHdfsFileSystem.TOKEN_KIND;
  t.setKind(kind);
  return t;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:NamenodeWebHdfsMethods.java

示例2: generateDelegationToken

import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager; //导入方法依赖的package包/类
private Token<? extends TokenIdentifier> generateDelegationToken(
    final NameNode namenode, final UserGroupInformation ugi,
    final String renewer) throws IOException {
  final Credentials c = DelegationTokenSecretManager.createCredentials(
      namenode, ugi, renewer != null? renewer: ugi.getShortUserName());
  if (c == null) {
    return null;
  }
  final Token<? extends TokenIdentifier> t = c.getAllTokens().iterator().next();
  Text kind = request.getScheme().equals("http") ? WebHdfsConstants.WEBHDFS_TOKEN_KIND
      : WebHdfsConstants.SWEBHDFS_TOKEN_KIND;
  t.setKind(kind);
  return t;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:15,代码来源:NamenodeWebHdfsMethods.java

示例3: generateDelegationToken

import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager; //导入方法依赖的package包/类
private Token<? extends TokenIdentifier> generateDelegationToken(
    final NameNode namenode, final UserGroupInformation ugi,
    final String renewer) throws IOException {
  final Credentials c = DelegationTokenSecretManager.createCredentials(
      namenode, ugi, renewer != null? renewer: ugi.getShortUserName());
  final Token<? extends TokenIdentifier> t = c.getAllTokens().iterator().next();
  t.setKind(WebHdfsFileSystem.TOKEN_KIND);
  return t;
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:10,代码来源:NamenodeWebHdfsMethods.java

示例4: generateDelegationToken

import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager; //导入方法依赖的package包/类
private Token<? extends TokenIdentifier> generateDelegationToken(
    final NameNode namenode, final UserGroupInformation ugi,
    final String renewer) throws IOException {
  final Credentials c = DelegationTokenSecretManager
      .createCredentials(namenode, ugi,
          renewer != null ? renewer : ugi.getShortUserName());
  final Token<? extends TokenIdentifier> t =
      c.getAllTokens().iterator().next();
  t.setKind(WebHdfsFileSystem.TOKEN_KIND);
  SecurityUtil.setTokenService(t, namenode.getHttpAddress());
  return t;
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:13,代码来源:NamenodeWebHdfsMethods.java

示例5: generateDelegationToken

import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager; //导入方法依赖的package包/类
private Token<? extends TokenIdentifier> generateDelegationToken(
    final NameNode namenode, final UserGroupInformation ugi,
    final String renewer) throws IOException {
  final Credentials c = DelegationTokenSecretManager.createCredentials(
      namenode, ugi, renewer != null? renewer: ugi.getShortUserName());
  final Token<? extends TokenIdentifier> t = c.getAllTokens().iterator().next();
  t.setKind(WebHdfsFileSystem.TOKEN_KIND);
  SecurityUtil.setTokenService(t, namenode.getHttpAddress());
  return t;
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre,代码行数:11,代码来源:NamenodeWebHdfsMethods.java

示例6: generateDelegationToken

import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager; //导入方法依赖的package包/类
private Token<? extends TokenIdentifier> generateDelegationToken(
    final NameNode namenode, final UserGroupInformation ugi,
    final String renewer) throws IOException {
  final Credentials c = DelegationTokenSecretManager.createCredentials(
      namenode, ugi, renewer != null? renewer: ugi.getShortUserName());
  final Token<? extends TokenIdentifier> t = c.getAllTokens().iterator().next();
  Text kind = request.getScheme().equals("http") ? WebHdfsFileSystem.TOKEN_KIND
      : SWebHdfsFileSystem.TOKEN_KIND;
  t.setKind(kind);
  return t;
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:12,代码来源:NamenodeWebHdfsMethods.java


注:本文中的org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager.createCredentials方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。