当前位置: 首页>>代码示例>>Java>>正文


Java YarnConfiguration.DEFAULT_CONTAINER_TEMP_DIR属性代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.conf.YarnConfiguration.DEFAULT_CONTAINER_TEMP_DIR属性的典型用法代码示例。如果您正苦于以下问题:Java YarnConfiguration.DEFAULT_CONTAINER_TEMP_DIR属性的具体用法?Java YarnConfiguration.DEFAULT_CONTAINER_TEMP_DIR怎么用?Java YarnConfiguration.DEFAULT_CONTAINER_TEMP_DIR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.hadoop.yarn.conf.YarnConfiguration的用法示例。


在下文中一共展示了YarnConfiguration.DEFAULT_CONTAINER_TEMP_DIR属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getVMCommand

/**
 * Create worker attempt jvm command
 * @param conf application configuration
 * @param appid application id
 * @param workerAttemptId worker attempt id
 * @return
 */
public static List<String> getVMCommand(Configuration conf, ApplicationId appid, WorkerAttemptId workerAttemptId) {
  Vector<String> vargs = new Vector<String>(8);

  vargs.add(Environment.JAVA_HOME.$() + "/bin/java");

  String javaOpts = getChildJavaOpts(conf, appid, workerAttemptId);
  LOG.debug("javaOpts=" + javaOpts);

  String[] javaOptsSplit = javaOpts.split(" ");
  for (int i = 0; i < javaOptsSplit.length; i++) {
    vargs.add(javaOptsSplit[i]);
  }

  Path childTmpDir = new Path(Environment.PWD.$(), YarnConfiguration.DEFAULT_CONTAINER_TEMP_DIR);
  vargs.add("-Djava.io.tmpdir=" + childTmpDir);

  // Setup the log4j prop
  long logSize = 0;
  setupLog4jProperties(conf, vargs, logSize);

  // Add main class and its arguments
  String workerClassName =
      conf.get(AngelConf.ANGEL_WORKER_CLASS,
          AngelConf.DEFAULT_ANGEL_WORKER_CLASS);
  vargs.add(workerClassName);

  vargs.add("1>" + getTaskLogFile(TaskLog.LogName.STDOUT));
  vargs.add("2>" + getTaskLogFile(TaskLog.LogName.STDERR));

  // Final commmand
  StringBuilder mergedCommand = new StringBuilder();
  for (CharSequence str : vargs) {
    mergedCommand.append(str).append(" ");
  }
  Vector<String> vargsFinal = new Vector<String>(1);
  vargsFinal.add(mergedCommand.toString());
  return vargsFinal;
}
 
开发者ID:Tencent,项目名称:angel,代码行数:45,代码来源:WorkerJVM.java

示例2: getVMCommand

public static List<String> getVMCommand(Configuration conf, ApplicationId appid,
    PSAgentAttemptId attemptId) {

  Vector<String> vargs = new Vector<String>(8);
  vargs.add(Environment.JAVA_HOME.$() + "/bin/java");

  String javaOpts = getChildJavaOpts(conf, appid, attemptId);

  String[] javaOptsSplit = javaOpts.split(" ");
  for (int i = 0; i < javaOptsSplit.length; i++) {
    vargs.add(javaOptsSplit[i]);
  }

  Path childTmpDir = new Path(Environment.PWD.$(), YarnConfiguration.DEFAULT_CONTAINER_TEMP_DIR);
  vargs.add("-Djava.io.tmpdir=" + childTmpDir);

  Path sizeOfJarPath = new Path(Environment.PWD.$(), "sizeof-0.3.0.jar");
  vargs.add("-javaagent:" + sizeOfJarPath);

  // Setup the log4j prop
  long logSize = 0;// TaskLog.getTaskLogLength(conf);
  setupLog4jProperties(conf, vargs, logSize);

  // Add main class and its arguments
  String className =
      conf.get(AngelConf.ANGEL_PSAGENT_CLASS,
          AngelConf.DEFAULT_ANGEL_PSAGENT_CLASS);
  vargs.add(className); // main of Child

  // Finally add the jvmID
  // vargs.add(String.valueOf(jvmID.getId()));
  vargs.add("1>" + getTaskLogFile(TaskLog.LogName.STDOUT));
  vargs.add("2>" + getTaskLogFile(TaskLog.LogName.STDERR));

  // Final commmand
  StringBuilder mergedCommand = new StringBuilder();
  for (CharSequence str : vargs) {
    mergedCommand.append(str).append(" ");
  }
  Vector<String> vargsFinal = new Vector<String>(1);
  vargsFinal.add(mergedCommand.toString());
  return vargsFinal;
}
 
开发者ID:Tencent,项目名称:angel,代码行数:43,代码来源:PSAgentAttemptJVM.java

示例3: getVMCommand

/**
 * Generate ps attempt jvm command
 * @param conf application configuration
 * @param appid application id
 * @param psAttemptId ps attempt id
 * @return ps attempt jvm command
 */
public static List<String> getVMCommand(Configuration conf, ApplicationId appid,
    PSAttemptId psAttemptId) {

  Vector<String> vargs = new Vector<String>(8);
  vargs.add(Environment.JAVA_HOME.$() + "/bin/java");

  String javaOpts = getChildJavaOpts(conf, appid, psAttemptId);
  String[] javaOptsSplit = javaOpts.split(" ");
  for (int i = 0; i < javaOptsSplit.length; i++) {
    vargs.add(javaOptsSplit[i]);
  }

  Path childTmpDir = new Path(Environment.PWD.$(), YarnConfiguration.DEFAULT_CONTAINER_TEMP_DIR);
  vargs.add("-Djava.io.tmpdir=" + childTmpDir);

  // Setup the log4j prop
  long logSize = 0;// TaskLog.getTaskLogLength(conf);
  setupLog4jProperties(conf, vargs, logSize);

  // Add main class and its arguments
  String psClassName =
      conf.get(AngelConf.ANGEL_PS_CLASS, AngelConf.DEFAULT_ANGEL_PS_CLASS);
  vargs.add(psClassName); // main of Child

  // Finally add the jvmID
  // vargs.add(String.valueOf(jvmID.getId()));
  vargs.add("1>" + getTaskLogFile(TaskLog.LogName.STDOUT));
  vargs.add("2>" + getTaskLogFile(TaskLog.LogName.STDERR));

  // Final commmand
  StringBuilder mergedCommand = new StringBuilder();
  for (CharSequence str : vargs) {
    mergedCommand.append(str).append(" ");
  }
  Vector<String> vargsFinal = new Vector<String>(1);
  vargsFinal.add(mergedCommand.toString());

  LOG.info("Command to launch container for PS is : " + mergedCommand);

  return vargsFinal;
}
 
开发者ID:Tencent,项目名称:angel,代码行数:48,代码来源:ParameterServerJVM.java


注:本文中的org.apache.hadoop.yarn.conf.YarnConfiguration.DEFAULT_CONTAINER_TEMP_DIR属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。