Package org.apache.drill.yarn.core
Class LaunchSpec
java.lang.Object
org.apache.drill.yarn.core.LaunchSpec
- Direct Known Subclasses:
AppSpec
Abstract description of a remote process launch that describes the many
details needed to launch a process on a remote node.
Based on Simple YARN App.
-
Field Summary
Modifier and TypeFieldDescriptionSet to the application-specific class path for the Java application.Arguments to the remote command.Set to the name of the OS command to run when we wish to run a non-Java command.Defines environment variables to be set on the remote host before launching the remote app.Set to the name of the Java main class (the one with the main method) when we wish to run a Java command.List of (key, file) pairs to be localized to the node before running the command.Optional VM arguments to pass to the JVM when running a Java class; ignored when running an OS command. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.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) Create the command line to run on the remote node.
-
Field Details
-
resources
List of (key, file) pairs to be localized to the node before running the command. The file must exist in a distributed file system (such as HDFS) visible to both the client and remote node. Typically, the path is relative or absolute within the file system defined by the fs.defaultFS parameter in core-site.xml.TODO: Can the value also be a URL such as
hdfs://somehost:1234//path/to/file
The key is used as (what?).
-
env
Defines environment variables to be set on the remote host before launching the remote app. Note: do not set CLASSPATH here; useclassPath
instead. -
command
Set to the name of the OS command to run when we wish to run a non-Java command. -
mainClass
Set to the name of the Java main class (the one with the main method) when we wish to run a Java command. -
classPath
Set to the application-specific class path for the Java application. These values are added to the Hadoop-provided values. These items are relative to (what?), use (what variables) to refer to the localized application directory. -
vmArgs
Optional VM arguments to pass to the JVM when running a Java class; ignored when running an OS command. -
cmdArgs
Arguments to the remote command.
-
-
Constructor Details
-
LaunchSpec
public LaunchSpec()
-
-
Method Details
-
getCommand
Create the command line to run on the remote node. The command can either be a simple OS command (if thecommand
member is set) or can be a Java class (if themainClass
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.
- Returns:
- the complete command string
-
createLaunchContext
public org.apache.hadoop.yarn.api.records.ContainerLaunchContext createLaunchContext(org.apache.hadoop.yarn.conf.YarnConfiguration conf) throws IOException Given this generic description of an application, create the detailed YARN application submission context required to launch the application.- Parameters:
conf
- the YARN configuration obtained by reading the Hadoop configuration files- Returns:
- the completed application launch context for the given application
- Throws:
IOException
- if localized resources are not found in the distributed file system (such as HDFS)
-
dump
-