- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.hadoop.yarn.conf.YarnConfiguration.getStringCollection()
方法的一些代码示例,展示了YarnConfiguration.getStringCollection()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnConfiguration.getStringCollection()
方法的具体详情如下:
包路径:org.apache.hadoop.yarn.conf.YarnConfiguration
类名称:YarnConfiguration
方法名:getStringCollection
暂无
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-common
public static List<String> getRMHAWebappAddresses(
final YarnConfiguration conf) {
Collection<String> rmIds =
conf.getStringCollection(YarnConfiguration.RM_HA_IDS);
List<String> addrs = new ArrayList<String>();
if (YarnConfiguration.useHttps(conf)) {
for (String id : rmIds) {
String addr = conf.get(
YarnConfiguration.RM_WEBAPP_HTTPS_ADDRESS + "." + id);
if (addr != null) {
addrs.add(addr);
}
}
} else {
for (String id : rmIds) {
String addr = conf.get(YarnConfiguration.RM_WEBAPP_ADDRESS + "." + id);
if (addr != null) {
addrs.add(addr);
}
}
}
return addrs;
}
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-common
public static List<String> getRMHAWebappAddresses(
final YarnConfiguration conf) {
Collection<String> rmIds =
conf.getStringCollection(YarnConfiguration.RM_HA_IDS);
List<String> addrs = new ArrayList<String>();
if (YarnConfiguration.useHttps(conf)) {
for (String id : rmIds) {
String addr = conf.get(
YarnConfiguration.RM_WEBAPP_HTTPS_ADDRESS + "." + id);
if (addr != null) {
addrs.add(addr);
}
}
} else {
for (String id : rmIds) {
String addr = conf.get(YarnConfiguration.RM_WEBAPP_ADDRESS + "." + id);
if (addr != null) {
addrs.add(addr);
}
}
}
return addrs;
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common
public static List<String> getRMHAWebappAddresses(
final YarnConfiguration conf) {
String prefix;
String defaultPort;
if (YarnConfiguration.useHttps(conf)) {
prefix = YarnConfiguration.RM_WEBAPP_HTTPS_ADDRESS;
defaultPort = ":" + YarnConfiguration.DEFAULT_RM_WEBAPP_HTTPS_PORT;
} else {
prefix =YarnConfiguration.RM_WEBAPP_ADDRESS;
defaultPort = ":" + YarnConfiguration.DEFAULT_RM_WEBAPP_PORT;
}
Collection<String> rmIds =
conf.getStringCollection(YarnConfiguration.RM_HA_IDS);
List<String> addrs = new ArrayList<String>();
for (String id : rmIds) {
String addr = conf.get(HAUtil.addSuffix(prefix, id));
if (addr == null) {
String hostname =
conf.get(HAUtil.addSuffix(YarnConfiguration.RM_HOSTNAME, id));
if (hostname != null) {
addr = hostname + defaultPort;
}
}
if (addr != null) {
addrs.add(addr);
}
}
return addrs;
}
}
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-common
public static String findActiveRMHAId(YarnConfiguration conf) {
YarnConfiguration yarnConf = new YarnConfiguration(conf);
Collection<String> rmIds =
yarnConf.getStringCollection(YarnConfiguration.RM_HA_IDS);
for (String currentId : rmIds) {
yarnConf.set(YarnConfiguration.RM_HA_ID, currentId);
try {
HAServiceState haState = getHAState(yarnConf);
if (haState.equals(HAServiceState.ACTIVE)) {
return currentId;
}
} catch (Exception e) {
// Couldn't check if this RM is active. Do nothing. Worst case,
// we wouldn't find an Active RM and return null.
}
}
return null; // Couldn't find an Active RM
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-common
public static String findActiveRMHAId(YarnConfiguration conf) {
YarnConfiguration yarnConf = new YarnConfiguration(conf);
Collection<String> rmIds =
yarnConf.getStringCollection(YarnConfiguration.RM_HA_IDS);
for (String currentId : rmIds) {
yarnConf.set(YarnConfiguration.RM_HA_ID, currentId);
try {
HAServiceState haState = getHAState(yarnConf);
if (haState.equals(HAServiceState.ACTIVE)) {
return currentId;
}
} catch (Exception e) {
// Couldn't check if this RM is active. Do nothing. Worst case,
// we wouldn't find an Active RM and return null.
}
}
return null; // Couldn't find an Active RM
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common
public static String findActiveRMHAId(YarnConfiguration conf) {
YarnConfiguration yarnConf = new YarnConfiguration(conf);
Collection<String> rmIds =
yarnConf.getStringCollection(YarnConfiguration.RM_HA_IDS);
for (String currentId : rmIds) {
yarnConf.set(YarnConfiguration.RM_HA_ID, currentId);
try {
HAServiceState haState = getHAState(yarnConf);
if (haState.equals(HAServiceState.ACTIVE)) {
return currentId;
}
} catch (Exception e) {
// Couldn't check if this RM is active. Do nothing. Worst case,
// we wouldn't find an Active RM and return null.
}
}
return null; // Couldn't find an Active RM
}
本文整理了Java中org.apache.hadoop.yarn.conf.YarnConfiguration.getStringCollection()方法的一些代码示例,展示了YarnConfig
我是一名优秀的程序员,十分优秀!