本文整理汇总了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);
}
}
}
示例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;
}
示例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);
}
}
}