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


Java HadoopKerberosName.getShortName方法代码示例

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


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

示例1: obtainTokensForNamenodesInternal

import org.apache.hadoop.security.HadoopKerberosName; //导入方法依赖的package包/类
/**
 * get delegation tokens for a specific FS
 * @param fs
 * @param credentials
 * @param p
 * @param conf
 * @throws IOException
 */
private static void obtainTokensForNamenodesInternal(FileSystem fs,
    Credentials credentials, Configuration conf) throws IOException {
  HadoopKerberosName jtKrbName = new HadoopKerberosName(conf.get(JobTracker.JT_USER_NAME, ""));
  String delegTokenRenewer = jtKrbName.getShortName();

  mergeBinaryTokens(credentials, conf);

  final Token<?> tokens[] = fs.addDelegationTokens(delegTokenRenewer,
                                                   credentials);
  if (tokens != null) {
    for (Token<?> token : tokens) {
      LOG.info("Got dt for " + fs.getUri() + "; "+token);
    }
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:24,代码来源:TokenCache.java

示例2: AbstractDelegationTokenIdentifier

import org.apache.hadoop.security.HadoopKerberosName; //导入方法依赖的package包/类
public AbstractDelegationTokenIdentifier(Text owner, Text renewer, Text realUser) {
  if (owner == null) {
    this.owner = new Text();
  } else {
    this.owner = owner;
  }
  if (renewer == null) {
    this.renewer = new Text();
  } else {
    HadoopKerberosName renewerKrbName = new HadoopKerberosName(renewer.toString());
    try {
      this.renewer = new Text(renewerKrbName.getShortName());
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
  if (realUser == null) {
    this.realUser = new Text();
  } else {
    this.realUser = realUser;
  }
  issueDate = 0;
  maxDate = 0;
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:25,代码来源:AbstractDelegationTokenIdentifier.java

示例3: setRenewer

import org.apache.hadoop.security.HadoopKerberosName; //导入方法依赖的package包/类
public void setRenewer(Text renewer) {
  if (renewer == null) {
    this.renewer = new Text();
  } else {
    HadoopKerberosName renewerKrbName = new HadoopKerberosName(renewer.toString());
    try {
      this.renewer = new Text(renewerKrbName.getShortName());
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:13,代码来源:AbstractDelegationTokenIdentifier.java


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