public class JavaCommandLineBuilder extends CommandLineBuilder
define methods are designed to work with Hadoop tool and
Slider launcher applications.argumentList| Constructor and Description |
|---|
JavaCommandLineBuilder() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addConfOption(org.apache.hadoop.conf.Configuration conf,
String key) |
void |
addConfOptions(org.apache.hadoop.conf.Configuration conf,
String... keys)
Add a varargs list of configuration parameters —if they are present
|
String |
addConfOptionToCLI(org.apache.hadoop.conf.Configuration conf,
String key,
String defVal)
Ass a configuration option to the command line of the application
|
void |
addMandatoryConfOption(org.apache.hadoop.conf.Configuration conf,
String key)
Add a mandatory config option
|
int |
addPrefixedConfOptions(org.apache.hadoop.conf.Configuration conf,
String prefix)
Add all configuration options which match the prefix
|
void |
define(String key,
String val)
Add a
-D key=val command to the CLI. |
boolean |
defineIfSet(String key,
String val)
Add a
-D key=val command to the CLI if val
is not null |
void |
enableJavaAssertions()
Turn Java assertions on
|
JavaCommandLineBuilder |
forceIPv4() |
protected String |
getJavaBinary()
Get the java binary.
|
JavaCommandLineBuilder |
headless() |
void |
setJVMHeap(String heap)
Set the size of the heap if a non-empty heap is passed in.
|
void |
sysprop(String property,
String value)
Add a system property definition -must be used before setting the main entry point
|
add, addOutAndErrFiles, build, elt, getArgumentList, size, toStringprotected String getJavaBinary()
public void setJVMHeap(String heap)
heap - empty string or something like "128M" ,"1G" etc. The value is
trimmed.public void enableJavaAssertions()
public void sysprop(String property, String value)
property - value - public JavaCommandLineBuilder forceIPv4()
public JavaCommandLineBuilder headless()
public boolean addConfOption(org.apache.hadoop.conf.Configuration conf,
String key)
public void addConfOptions(org.apache.hadoop.conf.Configuration conf,
String... keys)
conf - configuration sourcekeys - keyspublic int addPrefixedConfOptions(org.apache.hadoop.conf.Configuration conf,
String prefix)
conf - configurationprefix - prefix, e.g "slider."public String addConfOptionToCLI(org.apache.hadoop.conf.Configuration conf, String key, String defVal)
conf - configurationkey - keydefVal - default valueIllegalArgumentException - if key is null or the looked up value
is null (that is: the argument is missing and devVal was null.public void define(String key, String val)
-D key=val command to the CLI. This is very Hadoop APIkey - keyval - valueIllegalArgumentException - if either argument is nullpublic boolean defineIfSet(String key, String val)
-D key=val command to the CLI if val
is not nullkey - keyval - valuepublic void addMandatoryConfOption(org.apache.hadoop.conf.Configuration conf,
String key)
throws BadConfigException
conf - configurationkey - keyBadConfigException - if the key is missingCopyright © 2014–2015 The Apache Software Foundation. All rights reserved.