Class ClasspathConstructor

java.lang.Object
org.apache.hadoop.yarn.service.containerlaunch.ClasspathConstructor

public class ClasspathConstructor extends Object
build a classpath -allows for entries to be injected in front of YARN classpath as well as behind, adds appropriate separators, extraction of local classpath, etc.
  • Field Details

  • Constructor Details

    • ClasspathConstructor

      public ClasspathConstructor()
  • Method Details

    • yarnApplicationClasspath

      public List<String> yarnApplicationClasspath(org.apache.hadoop.conf.Configuration config)
      Get the list of JARs from the YARN settings
      Parameters:
      config - configuration
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • buildClasspath

      public String buildClasspath()
    • getPathElements

      public List<String> getPathElements()
      Get a copy of the path list
      Returns:
      the JARs
    • append

      public void append(String path)
      Append an entry
      Parameters:
      path - path
    • insert

      public void insert(String path)
      Insert a path at the front of the list. This places it ahead of the standard YARN artifacts
      Parameters:
      path - path to the JAR. Absolute or relative -on the target system
    • appendAll

      public void appendAll(Collection<String> paths)
    • insertAll

      public void insertAll(Collection<String> paths)
    • addLibDir

      public void addLibDir(String pathToLibDir)
    • insertLibDir

      public void insertLibDir(String pathToLibDir)
    • addClassDirectory

      public void addClassDirectory(String pathToDir)
    • insertClassDirectory

      public void insertClassDirectory(String pathToDir)
    • addRemoteClasspathEnvVar

      public void addRemoteClasspathEnvVar()
    • insertRemoteClasspathEnvVar

      public void insertRemoteClasspathEnvVar()
    • buildLibDir

      public String buildLibDir(String pathToLibDir)
      Build a lib dir path
      Parameters:
      pathToLibDir - path to the directory; may or may not end with a trailing space
      Returns:
      a path to a lib dir that is compatible with the java classpath
    • splitClasspath

      public Collection<String> splitClasspath(String localpath)
      Split a classpath. This uses the local path separator so MUST NOT be used to work with remote classpaths
      Parameters:
      localpath - local path
      Returns:
      a splite
    • localJVMClasspath

      public Collection<String> localJVMClasspath()
      Get the local JVM classpath split up
      Returns:
      the list of entries on the JVM classpath env var