Example usage for org.apache.hadoop.yarn.conf YarnConfiguration DEFAULT_YARN_APPLICATION_CLASSPATH

List of usage examples for org.apache.hadoop.yarn.conf YarnConfiguration DEFAULT_YARN_APPLICATION_CLASSPATH

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.conf YarnConfiguration DEFAULT_YARN_APPLICATION_CLASSPATH.

Prototype

String[] DEFAULT_YARN_APPLICATION_CLASSPATH

To view the source code for org.apache.hadoop.yarn.conf YarnConfiguration DEFAULT_YARN_APPLICATION_CLASSPATH.

Click Source Link

Document

Default platform-specific CLASSPATH for YARN applications.

Usage

From source file:org.springframework.yarn.config.EnvironmentNamespaceTest.java

License:Apache License

@Test
public void testEnvironmentWithClasspathCustomDefaultFromYarn() throws Exception {
    assertNotNull(defClasspathEnvironmentCustomDefaultClasspathFromYarn);

    String classpath = defClasspathEnvironmentCustomDefaultClasspathFromYarn.get("CLASSPATH");
    assertNotNull(classpath);//from   w  w  w. j  a  v  a 2  s.  c  o  m
    for (String entry : YarnConfiguration.DEFAULT_YARN_APPLICATION_CLASSPATH) {
        assertThat(classpath, containsString(entry));
    }

    String[] entries = classpath.split(":");
    assertNotNull(entries);
    assertThat(entries.length, greaterThan(0));
    assertThat(entries, hasItemInArray("./*"));

    // check that there's no extra or empty elements
    assertThat(false, is(classpath.contains("::")));
    assertThat(true, is(classpath.charAt(0) != ':'));
    assertThat(true, is(classpath.charAt(classpath.length() - 1) != ':'));
}

From source file:runtime.starter.MPJAppMaster.java

License:Open Source License

private void setupEnv(Map<String, String> containerEnv) {
    for (String c : conf.getStrings(YarnConfiguration.YARN_APPLICATION_CLASSPATH,
            YarnConfiguration.DEFAULT_YARN_APPLICATION_CLASSPATH)) {

        Apps.addToEnvironment(containerEnv, Environment.CLASSPATH.name(), c.trim());

    }/*  www .j  a  v  a 2 s.  com*/

    Apps.addToEnvironment(containerEnv, Environment.CLASSPATH.name(),
            Environment.PWD.$() + File.separator + "*");
}

From source file:runtime.starter.MPJYarnClient.java

License:Open Source License

private void setupAppMasterEnv(Map<String, String> appMasterEnv) {

    for (String c : conf.getStrings(YarnConfiguration.YARN_APPLICATION_CLASSPATH,
            YarnConfiguration.DEFAULT_YARN_APPLICATION_CLASSPATH)) {
        Apps.addToEnvironment(appMasterEnv, Environment.CLASSPATH.name(), c.trim());
    }//from w w w . j a  va  2  s  . c  om

    Apps.addToEnvironment(appMasterEnv, Environment.CLASSPATH.name(),
            Environment.PWD.$() + File.separator + "*");
}

From source file:tachyon.yarn.Client.java

License:Apache License

private void setupAppMasterEnv(Map<String, String> appMasterEnv) {
    String classpath = ApplicationConstants.Environment.CLASSPATH.name();
    for (String path : mYarnConf.getStrings(YarnConfiguration.YARN_APPLICATION_CLASSPATH,
            YarnConfiguration.DEFAULT_YARN_APPLICATION_CLASSPATH)) {
        Apps.addToEnvironment(appMasterEnv, classpath, path.trim(), ApplicationConstants.CLASS_PATH_SEPARATOR);
    }//from   w  w  w .jav a2 s.  co  m
    Apps.addToEnvironment(appMasterEnv, classpath, PathUtils.concatPath(Environment.PWD.$(), "*"),
            ApplicationConstants.CLASS_PATH_SEPARATOR);
    Apps.addToEnvironment(appMasterEnv, classpath, PathUtils.concatPath(mTachyonHome, "conf") + File.separator,
            ApplicationConstants.CLASS_PATH_SEPARATOR);
    Apps.addToEnvironment(appMasterEnv, classpath, PathUtils.concatPath(mTachyonHome, "bin") + File.separator,
            ApplicationConstants.CLASS_PATH_SEPARATOR);
}

From source file:yarnkit.utils.YarnUtils.java

License:Apache License

public static void configureClasspath(@Nonnull final Map<String, String> env,
        @Nonnull final Configuration conf) {
    for (String c : conf.getStrings(YarnConfiguration.YARN_APPLICATION_CLASSPATH,
            YarnConfiguration.DEFAULT_YARN_APPLICATION_CLASSPATH)) {
        Apps.addToEnvironment(env, ApplicationConstants.Environment.CLASSPATH.name(), c.trim(), ":");
    }//  w ww . j  ava2 s . c  o  m
    Apps.addToEnvironment(env, ApplicationConstants.Environment.CLASSPATH.name(),
            ApplicationConstants.Environment.PWD.$() + File.separator + "*", ":");
}

From source file:yrun.YarnRunner.java

License:Apache License

private void setupAppMasterEnv(Map<String, String> appMasterEnv, String appJarFile) {
    String dirSep = File.separator;
    String pathSep = File.pathSeparator;
    for (String c : _configuration.getStrings(YarnConfiguration.YARN_APPLICATION_CLASSPATH,
            YarnConfiguration.DEFAULT_YARN_APPLICATION_CLASSPATH)) {
        Apps.addToEnvironment(appMasterEnv, Environment.CLASSPATH.name(), c.trim(), pathSep);
    }/*from w w w . j ava 2s.com*/
    Apps.addToEnvironment(appMasterEnv, Environment.JAVA_HOME.name(),
            "/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home", pathSep);
    Apps.addToEnvironment(appMasterEnv, Environment.CLASSPATH.name(), Environment.PWD.$() + dirSep + appJarFile,
            pathSep);
    Apps.addToEnvironment(appMasterEnv, Environment.CLASSPATH.name(), Environment.PWD.$() + dirSep + "*",
            pathSep);
}