|
@@ -54,6 +54,7 @@ import org.apache.hadoop.yarn.api.records.ApplicationId;
|
|
import org.apache.hadoop.yarn.api.records.LocalResource;
|
|
import org.apache.hadoop.yarn.api.records.LocalResource;
|
|
import org.apache.hadoop.yarn.api.records.LocalResourceType;
|
|
import org.apache.hadoop.yarn.api.records.LocalResourceType;
|
|
import org.apache.hadoop.yarn.api.records.LocalResourceVisibility;
|
|
import org.apache.hadoop.yarn.api.records.LocalResourceVisibility;
|
|
|
|
+import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
|
import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
|
|
import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
|
|
import org.apache.hadoop.yarn.util.Apps;
|
|
import org.apache.hadoop.yarn.util.Apps;
|
|
import org.apache.hadoop.yarn.util.BuilderUtils;
|
|
import org.apache.hadoop.yarn.util.BuilderUtils;
|
|
@@ -171,7 +172,7 @@ public class MRApps extends Apps {
|
|
}
|
|
}
|
|
|
|
|
|
private static void setMRFrameworkClasspath(
|
|
private static void setMRFrameworkClasspath(
|
|
- Map<String, String> environment) throws IOException {
|
|
|
|
|
|
+ Map<String, String> environment, Configuration conf) throws IOException {
|
|
InputStream classpathFileStream = null;
|
|
InputStream classpathFileStream = null;
|
|
BufferedReader reader = null;
|
|
BufferedReader reader = null;
|
|
try {
|
|
try {
|
|
@@ -208,8 +209,10 @@ public class MRApps extends Apps {
|
|
}
|
|
}
|
|
|
|
|
|
// Add standard Hadoop classes
|
|
// Add standard Hadoop classes
|
|
- for (String c : ApplicationConstants.APPLICATION_CLASSPATH) {
|
|
|
|
- Apps.addToEnvironment(environment, Environment.CLASSPATH.name(), c);
|
|
|
|
|
|
+ for (String c : conf.get(YarnConfiguration.YARN_APPLICATION_CLASSPATH)
|
|
|
|
+ .split(",")) {
|
|
|
|
+ Apps.addToEnvironment(environment, Environment.CLASSPATH.name(), c
|
|
|
|
+ .trim());
|
|
}
|
|
}
|
|
} finally {
|
|
} finally {
|
|
if (classpathFileStream != null) {
|
|
if (classpathFileStream != null) {
|
|
@@ -222,8 +225,8 @@ public class MRApps extends Apps {
|
|
// TODO: Remove duplicates.
|
|
// TODO: Remove duplicates.
|
|
}
|
|
}
|
|
|
|
|
|
- public static void setClasspath(Map<String, String> environment)
|
|
|
|
- throws IOException {
|
|
|
|
|
|
+ public static void setClasspath(Map<String, String> environment,
|
|
|
|
+ Configuration conf) throws IOException {
|
|
Apps.addToEnvironment(
|
|
Apps.addToEnvironment(
|
|
environment,
|
|
environment,
|
|
Environment.CLASSPATH.name(),
|
|
Environment.CLASSPATH.name(),
|
|
@@ -232,7 +235,7 @@ public class MRApps extends Apps {
|
|
environment,
|
|
environment,
|
|
Environment.CLASSPATH.name(),
|
|
Environment.CLASSPATH.name(),
|
|
Environment.PWD.$() + Path.SEPARATOR + "*");
|
|
Environment.PWD.$() + Path.SEPARATOR + "*");
|
|
- MRApps.setMRFrameworkClasspath(environment);
|
|
|
|
|
|
+ MRApps.setMRFrameworkClasspath(environment, conf);
|
|
}
|
|
}
|
|
|
|
|
|
private static final String STAGING_CONSTANT = ".staging";
|
|
private static final String STAGING_CONSTANT = ".staging";
|