public class LaunchSpec extends Object
Based on Simple YARN App.
Modifier and Type | Field and Description |
---|---|
List<String> |
classPath
Set to the application-specific class path for the Java application.
|
List<String> |
cmdArgs
Arguments to the remote command.
|
String |
command
Set to the name of the OS command to run when we wish to run a non-Java
command.
|
Map<String,String> |
env
Defines environment variables to be set on the remote host before launching
the remote app.
|
String |
mainClass
Set to the name of the Java main class (the one with the main method) when
we wish to run a Java command.
|
Map<String,org.apache.hadoop.yarn.api.records.LocalResource> |
resources
List of (key, file) pairs to be localized to the node before running the
command.
|
List<String> |
vmArgs
Optional VM arguments to pass to the JVM when running a Java class; ignored
when running an OS command.
|
Constructor and Description |
---|
LaunchSpec() |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.yarn.api.records.ContainerLaunchContext |
createLaunchContext(org.apache.hadoop.yarn.conf.YarnConfiguration conf)
Given this generic description of an application, create the detailed YARN
application submission context required to launch the application.
|
void |
dump(PrintStream out) |
String |
getCommand()
Create the command line to run on the remote node.
|
public Map<String,org.apache.hadoop.yarn.api.records.LocalResource> resources
TODO: Can the value also be a URL such as
The key is used as (what?).hdfs://somehost:1234//path/to/file
public Map<String,String> env
classPath
instead.public String command
public String mainClass
public List<String> classPath
public List<String> vmArgs
public String getCommand()
command
member is set) or can be a
Java class (if the mainClass
member is set. If the command is
Java, then we pass along optional Java VM arguments.
In all cases we append arguments to the command itself, and redirect stdout and stderr to log files.
public org.apache.hadoop.yarn.api.records.ContainerLaunchContext createLaunchContext(org.apache.hadoop.yarn.conf.YarnConfiguration conf) throws IOException
conf
- the YARN configuration obtained by reading the Hadoop
configuration filesIOException
- if localized resources are not found in the distributed file
system (such as HDFS)public void dump(PrintStream out)
Copyright © 1970 The Apache Software Foundation. All rights reserved.