You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by me...@apache.org on 2014/06/10 07:19:01 UTC

git commit: Make sure that empty string is filtered out when we get the secondary jars from conf

Repository: spark
Updated Branches:
  refs/heads/master a9ec033c8 -> 6f2db8c2f


Make sure that empty string is filtered out when we get the secondary jars from conf

Author: DB Tsai <db...@dbtsai.com>

Closes #1027 from dbtsai/dbtsai-classloader and squashes the following commits:

9ac6be3 [DB Tsai] Fixed line too long
c9c7ad7 [DB Tsai] Make sure that empty string is filtered out when we get the secondary jars from conf.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/6f2db8c2
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/6f2db8c2
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/6f2db8c2

Branch: refs/heads/master
Commit: 6f2db8c2f51911f88a601ec5bf1509ea0e8173ed
Parents: a9ec033
Author: DB Tsai <db...@dbtsai.com>
Authored: Mon Jun 9 22:18:50 2014 -0700
Committer: Xiangrui Meng <me...@databricks.com>
Committed: Mon Jun 9 22:18:50 2014 -0700

----------------------------------------------------------------------
 .../main/scala/org/apache/spark/deploy/yarn/ClientBase.scala   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/6f2db8c2/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala
----------------------------------------------------------------------
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 4b5e0ef..801e8b3 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
@@ -221,7 +221,7 @@ trait ClientBase extends Logging {
       }
     }
 
-    var cachedSecondaryJarLinks = ListBuffer.empty[String]
+    val cachedSecondaryJarLinks = ListBuffer.empty[String]
     val fileLists = List( (args.addJars, LocalResourceType.FILE, true),
       (args.files, LocalResourceType.FILE, false),
       (args.archives, LocalResourceType.ARCHIVE, false) )
@@ -502,12 +502,14 @@ object ClientBase extends Logging {
     def addClasspathEntry(path: String) = YarnSparkHadoopUtil.addToEnvironment(env,
       Environment.CLASSPATH.name, path, File.pathSeparator)
     /** 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)
 
     val cachedSecondaryJarLinks =
       sparkConf.getOption(CONF_SPARK_YARN_SECONDARY_JARS).getOrElse("").split(",")
+        .filter(_.nonEmpty)
     // Normally the users app.jar is last in case conflicts with spark jars
     if (sparkConf.get("spark.yarn.user.classpath.first", "false").toBoolean) {
       addPwdClasspathEntry(APP_JAR)