gpt4 book ai didi

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

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

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

YarnConfiguration.getStrings介绍

暂无

代码示例

代码示例来源:origin: apache/drill

/**
 * Return standard class path entries from the YARN application class path.
 */
public String[] getYarnAppClassPath() {
 return conf.getStrings(YarnConfiguration.YARN_APPLICATION_CLASSPATH,
   YarnConfiguration.DEFAULT_YARN_APPLICATION_CLASSPATH);
}

代码示例来源:origin: apache/ignite

/**
   * @param envs Environment variables.
   * @param conf Yarn configuration.
   */
  private static void setupAppMasterEnv(Map<String, String> envs, YarnConfiguration conf) {
    for (String c : conf.getStrings(YarnConfiguration.YARN_APPLICATION_CLASSPATH,
      YarnConfiguration.DEFAULT_YARN_APPLICATION_CLASSPATH))
      Apps.addToEnvironment(envs, Environment.CLASSPATH.name(),
          c.trim(), File.pathSeparator);

    Apps.addToEnvironment(envs,
        Environment.CLASSPATH.name(),
        Environment.PWD.$() + File.separator + "*",
        File.pathSeparator);
  }
}

代码示例来源:origin: apache/flink

return new String[] {(String) invocationOnMock.getArguments()[1]};
}).when(yarnConf).getStrings(anyString(), Mockito.<String> anyVararg());

代码示例来源:origin: linkedin/TonY

private void setAMEnvironment(Map<String, LocalResource> localResources,
                       FileSystem fs) throws IOException {
 LocalResource tonyConfResource = localResources.get(Constants.TONY_FINAL_XML);
 Utils.addEnvironmentForResource(tonyConfResource, fs, Constants.TONY_CONF_PREFIX, containerEnv);
 // Add AppMaster.jar location to classpath
 // At some point we should not be required to add
 // the hadoop specific classpaths to the env.
 // It should be provided out of the box.
 // For now setting all required classpaths including
 // the classpath to "." for the application jar
 StringBuilder classPathEnv = new StringBuilder(ApplicationConstants.Environment.CLASSPATH.$$())
   .append(ApplicationConstants.CLASS_PATH_SEPARATOR).append("./*");
 for (String c : yarnConf.getStrings(
   YarnConfiguration.YARN_APPLICATION_CLASSPATH,
   YarnConfiguration.DEFAULT_YARN_CROSS_PLATFORM_APPLICATION_CLASSPATH)) {
  classPathEnv.append(ApplicationConstants.CLASS_PATH_SEPARATOR);
  classPathEnv.append(c.trim());
 }
 containerEnv.put("CLASSPATH", classPathEnv.toString());
}

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

String[] rmIds = yarnConf.getStrings(YarnConfiguration.RM_HA_IDS);

代码示例来源:origin: org.apache.slider/slider-core

String[] rmIds = yarnConf.getStrings(RM_HA_IDS);
Preconditions.checkState((rmIds != null) && (rmIds.length > 0),
  "Not set " + RM_HA_IDS);

代码示例来源:origin: io.hops/hadoop-mapreduce-client-core

public static InetSocketAddress getMasterAddress(Configuration conf) {
 String masterAddress;
 String framework = conf.get(MRConfig.FRAMEWORK_NAME, MRConfig.YARN_FRAMEWORK_NAME);
 if (framework.equals(MRConfig.CLASSIC_FRAMEWORK_NAME)) {
  masterAddress = conf.get(MRConfig.MASTER_ADDRESS, "localhost:8012");
  return NetUtils.createSocketAddr(masterAddress, 8012, MRConfig.MASTER_ADDRESS);
 } else if (framework.equals(MRConfig.YARN_FRAMEWORK_NAME) &&
   HAUtil.isHAEnabled(conf)) {
  YarnConfiguration yarnConf = new YarnConfiguration(conf);
  if (yarnConf.get(YarnConfiguration.RM_HA_ID) == null) {
   String[] rmIds = yarnConf.getStrings(YarnConfiguration.RM_HA_IDS);
   if (rmIds != null && rmIds.length > 0) {
    // If RM_HA_ID is not configured, use the first one.
    // Because any valid RM HA ID should work.
    yarnConf.set(YarnConfiguration.RM_HA_ID, rmIds[0]);
   } else {
    LOG.warn("RM_HA_IDS is not configured when RM HA is enabled");
   }
  }
  return yarnConf.getSocketAddr(
    YarnConfiguration.RM_ADDRESS,
    YarnConfiguration.DEFAULT_RM_ADDRESS,
    YarnConfiguration.DEFAULT_RM_PORT);
 } else {
  return conf.getSocketAddr(
    YarnConfiguration.RM_ADDRESS,
    YarnConfiguration.DEFAULT_RM_ADDRESS,
    YarnConfiguration.DEFAULT_RM_PORT);
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-mapreduce-client-core

public static InetSocketAddress getMasterAddress(Configuration conf) {
 String masterAddress;
 String framework = conf.get(MRConfig.FRAMEWORK_NAME, MRConfig.YARN_FRAMEWORK_NAME);
 if (framework.equals(MRConfig.CLASSIC_FRAMEWORK_NAME)) {
  masterAddress = conf.get(MRConfig.MASTER_ADDRESS, "localhost:8012");
  return NetUtils.createSocketAddr(masterAddress, 8012, MRConfig.MASTER_ADDRESS);
 } else if (framework.equals(MRConfig.YARN_FRAMEWORK_NAME) &&
   HAUtil.isHAEnabled(conf)) {
  YarnConfiguration yarnConf = new YarnConfiguration(conf);
  if (yarnConf.get(YarnConfiguration.RM_HA_ID) == null) {
   String[] rmIds = yarnConf.getStrings(YarnConfiguration.RM_HA_IDS);
   if (rmIds != null && rmIds.length > 0) {
    // If RM_HA_ID is not configured, use the first one.
    // Because any valid RM HA ID should work.
    yarnConf.set(YarnConfiguration.RM_HA_ID, rmIds[0]);
   } else {
    LOG.warn("RM_HA_IDS is not configured when RM HA is enabled");
   }
  }
  return yarnConf.getSocketAddr(
    YarnConfiguration.RM_ADDRESS,
    YarnConfiguration.DEFAULT_RM_ADDRESS,
    YarnConfiguration.DEFAULT_RM_PORT);
 } else {
  return conf.getSocketAddr(
    YarnConfiguration.RM_ADDRESS,
    YarnConfiguration.DEFAULT_RM_ADDRESS,
    YarnConfiguration.DEFAULT_RM_PORT);
 }
}

代码示例来源:origin: apache/incubator-slider

String[] rmIds = yarnConf.getStrings(RM_HA_IDS);
Preconditions.checkState((rmIds != null) && (rmIds.length > 0),
  "Not set " + RM_HA_IDS);

代码示例来源:origin: apache/hama

ApplicationConstants.Environment.CLASSPATH.$()).append(File.pathSeparatorChar)
  .append("./*");
for (String c : yarnConf.getStrings(
  YarnConfiguration.YARN_APPLICATION_CLASSPATH,
  YarnConfiguration.DEFAULT_YARN_APPLICATION_CLASSPATH)) {

代码示例来源:origin: dremio/dremio-oss

String[] yarnClasspath = yarnConfiguration.getStrings(YarnConfiguration.YARN_APPLICATION_CLASSPATH,
 YarnConfiguration.DEFAULT_YARN_APPLICATION_CLASSPATH);
final TwillPreparer preparer = twillRunner.prepare(dacDaemonApp)

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