本文整理了Java中org.apache.hadoop.yarn.client.util.YarnClientUtils.getRmPrincipal()
方法的一些代码示例,展示了YarnClientUtils.getRmPrincipal()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnClientUtils.getRmPrincipal()
方法的具体详情如下:
包路径:org.apache.hadoop.yarn.client.util.YarnClientUtils
类名称:YarnClientUtils
方法名:getRmPrincipal
[英]Perform the _HOST
replacement in the principal, Returning the result. Correctly handles HA resource manager configurations.
[中]在主体中执行_HOST
替换,并返回结果。正确处理HA资源管理器配置。
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-client
/**
* Look up and return the resource manager's principal. This method
* automatically does the <code>_HOST</code> replacement in the principal and
* correctly handles HA resource manager configurations.
*
* @param conf the {@link Configuration} file from which to read the
* principal
* @return the resource manager's principal string or null if the
* {@link YarnConfiguration#RM_PRINCIPAL} property is not set in the
* {@code conf} parameter
* @throws IOException thrown if there's an error replacing the host name
*/
public static String getRmPrincipal(Configuration conf) throws IOException {
String principal = conf.get(YarnConfiguration.RM_PRINCIPAL);
String prepared = null;
if (principal != null) {
prepared = getRmPrincipal(principal, conf);
}
return prepared;
}
代码示例来源:origin: linkedin/TonY
String tokenRenewer = YarnClientUtils.getRmPrincipal(yarnConf);
if (tokenRenewer == null) {
throw new RuntimeException("Failed to get RM principal.");
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-applications-distributedshell
String tokenRenewer = YarnClientUtils.getRmPrincipal(conf);
if (tokenRenewer == null || tokenRenewer.length() == 0) {
throw new IOException(
内容来源于网络,如有侵权,请联系作者删除!