/** * Utility method to set up the classpath * @param classpath classpath to use */ public void setClasspath(ClasspathConstructor classpath) { setEnv(CLASSPATH, classpath.buildClasspath()); }
/** * Add a varargs list of configuration parameters —if they are present * @param conf configuration source * @param keys keys */ public void addConfOptions(Configuration conf, String... keys) { for (String key : keys) { addConfOption(conf, key); } }
/** * Set an environment variable if its value is non-null. * @param var variable name * @param value value (may be null) */ public void maybeSetEnv(String var, String value) { if (value != null) { setEnv(var, value); } }
/** * This just returns the command line * @see #build() * @return the command line */ @Override public String toString() { return build(); }
@Override public boolean forceKillApplication(String reason) throws YarnException, IOException { if (applicationId != null) { new LaunchedApplication(applicationId, yarnClient).forceKill(reason); return true; } return false; }
public void addClassDirectory(String pathToDir) { append(appendDirectoryTerminator(pathToDir)); }
public JavaCommandLineBuilder headless() { sysprop("java.awt.headless", "true"); return this; }
/** * Build a lib dir path * @param pathToLibDir path to the directory; may or may not end with a * trailing space * @return a path to a lib dir that is compatible with the java classpath */ public String buildLibDir(String pathToLibDir) { String dir = appendDirectoryTerminator(pathToLibDir); dir += "*"; return dir; }
@Override public String toString() { return buildClasspath(); }
/** * This just returns the command line * @see #build() * @return the command line */ @Override public String toString() { return build(); }
/** * Utility method to set up the classpath * @param classpath classpath to use */ public void setClasspath(ClasspathConstructor classpath) { setEnv(CLASSPATH, classpath.buildClasspath()); }
@Override public boolean forceKillApplication(String reason) throws YarnException, IOException { if (applicationId != null) { new LaunchedApplication(applicationId, yarnClient).forceKill(reason); return true; } return false; }
public JavaCommandLineBuilder forceIPv4() { sysprop("java.net.preferIPv4Stack", "true"); return this; }
/** * Add a varargs list of configuration parameters —if they are present * @param conf configuration source * @param keys keys */ public void addConfOptions(Configuration conf, String... keys) { for (String key : keys) { addConfOption(conf, key); } }
/** * Set an environment variable if its value is non-null. * @param var variable name * @param value value (may be null) */ public void maybeSetEnv(String var, String value) { if (value != null) { setEnv(var, value); } }
/** * Build a lib dir path * @param pathToLibDir path to the directory; may or may not end with a * trailing space * @return a path to a lib dir that is compatible with the java classpath */ public String buildLibDir(String pathToLibDir) { String dir = appendDirectoryTerminator(pathToLibDir); dir += "*"; return dir; }
public JavaCommandLineBuilder forceIPv4() { sysprop("java.net.preferIPv4Stack", "true"); return this; }
public JavaCommandLineBuilder headless() { sysprop("java.awt.headless", "true"); return this; }