gpt4 book ai didi

org.apache.hadoop.yarn.conf.YarnConfiguration.getServiceAddressConfKeys()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 01:52:40 26 4
gpt4 key购买 nike

本文整理了Java中org.apache.hadoop.yarn.conf.YarnConfiguration.getServiceAddressConfKeys()方法的一些代码示例,展示了YarnConfiguration.getServiceAddressConfKeys()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnConfiguration.getServiceAddressConfKeys()方法的具体详情如下:
包路径:org.apache.hadoop.yarn.conf.YarnConfiguration
类名称:YarnConfiguration
方法名:getServiceAddressConfKeys

YarnConfiguration.getServiceAddressConfKeys介绍

暂无

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-api

public static void verifyAndSetAllServiceAddresses(Configuration conf) {
 for (String confKey : YarnConfiguration.getServiceAddressConfKeys(conf)) {
  verifyAndSetConfValue(confKey, conf);
 }
}

代码示例来源:origin: io.hops/hadoop-yarn-api

public static void verifyAndSetAllServiceAddresses(Configuration conf) {
 for (String confKey : YarnConfiguration.getServiceAddressConfKeys(conf)) {
  verifyAndSetConfValue(confKey, conf);
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-api

public static void verifyAndSetAllServiceAddresses(Configuration conf) {
 for (String confKey : YarnConfiguration.getServiceAddressConfKeys(conf)) {
  verifyAndSetConfValue(confKey, conf);
 }
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-api

public static void verifyAndSetAllServiceAddresses(Configuration conf) {
 for (String confKey : YarnConfiguration.getServiceAddressConfKeys(conf)) {
  verifyAndSetConfValue(confKey, conf);
 }
}

代码示例来源:origin: io.hops/hadoop-yarn-api

@InterfaceAudience.Private
@VisibleForTesting
static String getConfKeyForRMInstance(String prefix, Configuration conf, String RMId) {
 if (!YarnConfiguration.getServiceAddressConfKeys(conf).contains(prefix)) {
  return prefix;
 } else {
  checkAndSetRMRPCAddress(prefix, RMId, conf);
  return addSuffix(prefix, RMId);
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-api

@InterfaceAudience.Private
@VisibleForTesting
static String getConfKeyForRMInstance(String prefix, Configuration conf) {
 if (!YarnConfiguration.getServiceAddressConfKeys(conf).contains(prefix)) {
  return prefix;
 } else {
  String RMId = getRMHAId(conf);
  checkAndSetRMRPCAddress(prefix, RMId, conf);
  return addSuffix(prefix, RMId);
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-api

@InterfaceAudience.Private
@VisibleForTesting
static String getConfKeyForRMInstance(String prefix, Configuration conf) {
 if (!YarnConfiguration.getServiceAddressConfKeys(conf).contains(prefix)) {
  return prefix;
 } else {
  String RMId = getRMHAId(conf);
  checkAndSetRMRPCAddress(prefix, RMId, conf);
  return addSuffix(prefix, RMId);
 }
}

代码示例来源:origin: io.hops/hadoop-yarn-api

@InterfaceAudience.Private
@VisibleForTesting
static String getConfKeyForRMInstance(String prefix, Configuration conf) {
 if (!YarnConfiguration.getServiceAddressConfKeys(conf).contains(prefix)) {
  return prefix;
 } else {
  String RMId = getRMHAId(conf);
  checkAndSetRMRPCAddress(prefix, RMId, conf);
  return addSuffix(prefix, RMId);
 }
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-api

@InterfaceAudience.Private
@VisibleForTesting
static String getConfKeyForRMInstance(String prefix, Configuration conf) {
 if (!YarnConfiguration.getServiceAddressConfKeys(conf).contains(prefix)) {
  return prefix;
 } else {
  String RMId = getRMHAId(conf);
  checkAndSetRMRPCAddress(prefix, RMId, conf);
  return addSuffix(prefix, RMId);
 }
}

代码示例来源:origin: io.hops/hadoop-yarn-api

@Override
public InetSocketAddress updateConnectAddr(String name,
                      InetSocketAddress addr) {
 String prefix = name;
 if (HAUtil.isHAEnabled(this) && getServiceAddressConfKeys(this).contains(name)) {
  prefix = HAUtil.addSuffix(prefix, HAUtil.getRMHAId(this));
 }
 return super.updateConnectAddr(prefix, addr);
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-api

@Override
public InetSocketAddress updateConnectAddr(String name,
                      InetSocketAddress addr) {
 String prefix = name;
 if (HAUtil.isHAEnabled(this) && getServiceAddressConfKeys(this).contains(name)) {
  prefix = HAUtil.addSuffix(prefix, HAUtil.getRMHAId(this));
 }
 return super.updateConnectAddr(prefix, addr);
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common

@Before
public void setUp() {
 conf = new Configuration();
 conf.set(YarnConfiguration.RM_HA_IDS, RM_NODE_IDS_UNTRIMMED);
 conf.set(YarnConfiguration.RM_HA_ID, RM1_NODE_ID_UNTRIMMED);
 for (String confKey : YarnConfiguration.getServiceAddressConfKeys(conf)) {
  // configuration key itself cannot contains space/tab/return chars.
  conf.set(HAUtil.addSuffix(confKey, RM1_NODE_ID), RM1_ADDRESS_UNTRIMMED);
  conf.set(HAUtil.addSuffix(confKey, RM2_NODE_ID), RM2_ADDRESS);
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

private void updateConfigurationForRMHA() {
 configuration.set(YarnConfiguration.RM_CONFIGURATION_PROVIDER_CLASS,
   "org.apache.hadoop.yarn.FileSystemBasedConfigurationProvider");
 configuration.setBoolean(YarnConfiguration.RM_HA_ENABLED, true);
 configuration.setBoolean(YarnConfiguration.AUTO_FAILOVER_ENABLED, false);
 configuration.set(YarnConfiguration.RM_HA_IDS, "rm1,rm2");
 int base = 1500;
 for (String confKey : YarnConfiguration
   .getServiceAddressConfKeys(configuration)) {
  configuration.set(HAUtil.addSuffix(confKey, "rm1"),
    "0.0.0.0:" + (base + 20));
  configuration.set(HAUtil.addSuffix(confKey, "rm2"),
    "0.0.0.1:" + (base + 40));
  base = base * 2;
 }
}

代码示例来源:origin: io.hops/hadoop-yarn-common

@Before
public void setUp() {
 conf = new Configuration();
 conf.set(YarnConfiguration.RM_HA_IDS, RM_NODE_IDS_UNTRIMMED);
 conf.set(YarnConfiguration.RM_HA_ID, RM1_NODE_ID_UNTRIMMED);
 for (String confKey : YarnConfiguration.getServiceAddressConfKeys(conf)) {
  // configuration key itself cannot contains space/tab/return chars.
  conf.set(HAUtil.addSuffix(confKey, RM1_NODE_ID), RM1_ADDRESS_UNTRIMMED);
  conf.set(HAUtil.addSuffix(confKey, RM2_NODE_ID), RM2_ADDRESS);
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-common

@Before
public void setUp() {
 conf = new Configuration();
 conf.set(YarnConfiguration.RM_HA_IDS, RM_NODE_IDS_UNTRIMMED);
 conf.set(YarnConfiguration.RM_HA_ID, RM1_NODE_ID_UNTRIMMED);
 for (String confKey : YarnConfiguration.getServiceAddressConfKeys(conf)) {
  // configuration key itself cannot contains space/tab/return chars.
  conf.set(HAUtil.addSuffix(confKey, RM1_NODE_ID), RM1_ADDRESS_UNTRIMMED);
  conf.set(HAUtil.addSuffix(confKey, RM2_NODE_ID), RM2_ADDRESS);
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-tests

private void setHARMConfigurationWithEphemeralPorts(final int index, Configuration conf) {
 String hostname = MiniYARNCluster.getHostname();
 for (String confKey : YarnConfiguration.getServiceAddressConfKeys(conf)) {
  conf.set(HAUtil.addSuffix(confKey, rmIds[index]), hostname + ":0");
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-tests

private void setHARMConfigurationWithEphemeralPorts(final int index, Configuration conf) {
 String hostname = MiniYARNCluster.getHostname();
 for (String confKey : YarnConfiguration.getServiceAddressConfKeys(conf)) {
  conf.set(HAUtil.addSuffix(confKey, rmIds[index]), hostname + ":0");
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Before
public void setUp() throws Exception {
 Logger rootLogger = LogManager.getRootLogger();
 rootLogger.setLevel(Level.INFO);
 conf = new Configuration();
 conf.setBoolean(YarnConfiguration.RM_HA_ENABLED, true);
 conf.setBoolean(YarnConfiguration.CURATOR_LEADER_ELECTOR, true);
 conf.set(YarnConfiguration.RM_CLUSTER_ID, "cluster1");
 conf.set(YarnConfiguration.RM_HA_IDS, RM1_NODE_ID + "," + RM2_NODE_ID);
 for (String confKey : YarnConfiguration.getServiceAddressConfKeys(conf)) {
  conf.set(HAUtil.addSuffix(confKey, RM1_NODE_ID), RM1_ADDRESS);
  conf.set(HAUtil.addSuffix(confKey, RM2_NODE_ID), RM2_ADDRESS);
 }
 zkCluster = new TestingCluster(3);
 conf.set(YarnConfiguration.RM_ZK_ADDRESS, zkCluster.getConnectString());
 zkCluster.start();
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

public static void setRpcAddressForRM(String rmId, int base,
  Configuration conf) throws IOException {
 for (String confKey : YarnConfiguration.getServiceAddressConfKeys(conf)) {
  setConfForRM(rmId, confKey, "0.0.0.0:" + ServerSocketUtil.getPort(base +
    YarnConfiguration.getRMDefaultPortNumber(confKey, conf), 10), conf);
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Before
public void setUp() throws Exception {
 configuration = new Configuration();
 UserGroupInformation.setConfiguration(configuration);
 configuration.setBoolean(YarnConfiguration.RM_HA_ENABLED, true);
 configuration.set(YarnConfiguration.RM_HA_IDS, RM1_NODE_ID + ","
   + RM2_NODE_ID);
 for (String confKey : YarnConfiguration
   .getServiceAddressConfKeys(configuration)) {
  configuration.set(HAUtil.addSuffix(confKey, RM1_NODE_ID), RM1_ADDRESS);
  configuration.set(HAUtil.addSuffix(confKey, RM2_NODE_ID), RM2_ADDRESS);
 }
 ClusterMetrics.destroy();
 QueueMetrics.clearQueueMetrics();
 DefaultMetricsSystem.shutdown();
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com