本文整理匯總了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;
}
示例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;
}
示例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;
}