Class LaunchSpec

java.lang.Object
org.apache.drill.yarn.core.LaunchSpec
Direct Known Subclasses:
AppSpec

public class LaunchSpec extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    Set 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.
    Map<String,org.apache.hadoop.yarn.api.records.LocalResource>
    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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    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
     
    Create the command line to run on the remote node.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • resources

      public 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. 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

      public Map<String,String> env
      Defines environment variables to be set on the remote host before launching the remote app. Note: do not set CLASSPATH here; use classPath instead.
    • command

      public String command
      Set to the name of the OS command to run when we wish to run a non-Java command.
    • mainClass

      public 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.
    • classPath

      public List<String> 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

      public List<String> vmArgs
      Optional VM arguments to pass to the JVM when running a Java class; ignored when running an OS command.
    • cmdArgs

      public List<String> cmdArgs
      Arguments to the remote command.
  • Constructor Details

    • LaunchSpec

      public LaunchSpec()
  • Method Details

    • getCommand

      public String getCommand()
      Create the command line to run on the remote node. The command can either be a simple OS command (if the 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.

      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

      public void dump(PrintStream out)