From b768fc652e74e402c480b35efacb36c71c7e2f7c Mon Sep 17 00:00:00 2001 From: zeodtr Date: Wed, 28 May 2014 13:30:04 +0900 Subject: [PATCH] fixes https://issues.apache.org/jira/browse/SPARK-1825 --- .../apache/spark/deploy/yarn/ClientBase.scala | 17 +++++++++-------- .../deploy/yarn/ExecutorRunnableUtil.scala | 4 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala b/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala index aeb3f0062df3b..9832ee623701b 100644 --- a/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala +++ b/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala @@ -32,6 +32,7 @@ import org.apache.hadoop.mapreduce.MRJobConfig import org.apache.hadoop.security.UserGroupInformation import org.apache.hadoop.util.StringUtils import org.apache.hadoop.yarn.api._ +import org.apache.hadoop.yarn.api.ApplicationConstants import org.apache.hadoop.yarn.api.ApplicationConstants.Environment import org.apache.hadoop.yarn.api.protocolrecords._ import org.apache.hadoop.yarn.api.records._ @@ -309,7 +310,7 @@ trait ClientBase extends Logging { // Add Xmx for AM memory JAVA_OPTS += "-Xmx" + amMemory + "m" - val tmpDir = new Path(Environment.PWD.$(), YarnConfiguration.DEFAULT_CONTAINER_TEMP_DIR) + val tmpDir = new Path(Environment.PWD.$$(), YarnConfiguration.DEFAULT_CONTAINER_TEMP_DIR) JAVA_OPTS += "-Djava.io.tmpdir=" + tmpDir // TODO: Remove once cpuset version is pushed out. @@ -357,7 +358,7 @@ trait ClientBase extends Logging { JAVA_OPTS += ClientBase.getLog4jConfiguration(localResources) // Command for the ApplicationMaster - val commands = Seq(Environment.JAVA_HOME.$() + "/bin/java", "-server") ++ + val commands = Seq(Environment.JAVA_HOME.$$() + "/bin/java", "-server") ++ JAVA_OPTS ++ Seq(args.amClass, "--class", args.userClass, "--jar ", args.userJar, userArgsToString(args), @@ -396,7 +397,7 @@ object ClientBase { if (classpathEntries != null) { for (c <- classpathEntries) { YarnSparkHadoopUtil.addToEnvironment(env, Environment.CLASSPATH.name, c.trim, - File.pathSeparator) + ApplicationConstants.CLASS_PATH_SEPARATOR) } } @@ -406,7 +407,7 @@ object ClientBase { if (mrClasspathEntries != null) { for (c <- mrClasspathEntries) { YarnSparkHadoopUtil.addToEnvironment(env, Environment.CLASSPATH.name, c.trim, - File.pathSeparator) + ApplicationConstants.CLASS_PATH_SEPARATOR) } } } @@ -473,15 +474,15 @@ object ClientBase { if (localPath != null) { val parentPath = new File(localPath).getParent() YarnSparkHadoopUtil.addToEnvironment(env, Environment.CLASSPATH.name, parentPath, - File.pathSeparator) + ApplicationConstants.CLASS_PATH_SEPARATOR) } } /** Add entry to the classpath. */ def addClasspathEntry(path: String) = YarnSparkHadoopUtil.addToEnvironment(env, - Environment.CLASSPATH.name, path, File.pathSeparator) + Environment.CLASSPATH.name, path, ApplicationConstants.CLASS_PATH_SEPARATOR) /** Add entry to the classpath. Interpreted as a path relative to the working directory. */ - def addPwdClasspathEntry(entry: String) = addClasspathEntry(Environment.PWD.$() + Path.SEPARATOR + entry) + def addPwdClasspathEntry(entry: String) = addClasspathEntry(Environment.PWD.$$() + Path.SEPARATOR + entry) extraClassPath.foreach(addClasspathEntry) @@ -500,7 +501,7 @@ object ClientBase { cachedSecondaryJarLinks.foreach(addPwdClasspathEntry) } // Append all class files and jar files under the working directory to the classpath. - addClasspathEntry(Environment.PWD.$()) + addClasspathEntry(Environment.PWD.$$()) addPwdClasspathEntry("*") } diff --git a/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ExecutorRunnableUtil.scala b/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ExecutorRunnableUtil.scala index 32f8861dc9503..6aebf079fe923 100644 --- a/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ExecutorRunnableUtil.scala +++ b/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ExecutorRunnableUtil.scala @@ -57,7 +57,7 @@ trait ExecutorRunnableUtil extends Logging { } JAVA_OPTS += "-Djava.io.tmpdir=" + - new Path(Environment.PWD.$(), YarnConfiguration.DEFAULT_CONTAINER_TEMP_DIR) + new Path(Environment.PWD.$$(), YarnConfiguration.DEFAULT_CONTAINER_TEMP_DIR) JAVA_OPTS += ClientBase.getLog4jConfiguration(localResources) // Certain configs need to be passed here because they are needed before the Executor @@ -96,7 +96,7 @@ trait ExecutorRunnableUtil extends Logging { } */ - val commands = Seq(Environment.JAVA_HOME.$() + "/bin/java", + val commands = Seq(Environment.JAVA_HOME.$$() + "/bin/java", "-server", // Kill if OOM is raised - leverage yarn's failure handling to cause rescheduling. // Not killing the task leaves various aspects of the executor and (to some extent) the jvm in