spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From van...@apache.org
Subject spark git commit: [SPARK-10481] [YARN] SPARK_PREPEND_CLASSES make spark-yarn related jar could n…
Date Wed, 09 Sep 2015 17:27:27 GMT
Repository: spark
Updated Branches:
  refs/heads/master 2ddeb6312 -> c0052d8d0


[SPARK-10481] [YARN] SPARK_PREPEND_CLASSES make spark-yarn related jar could n…

Throw a more readable exception. Please help review. Thanks

Author: Jeff Zhang <zjffdu@apache.org>

Closes #8649 from zjffdu/SPARK-10481.


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

Branch: refs/heads/master
Commit: c0052d8d09eebadadb5ed35ac512caaf73919551
Parents: 2ddeb63
Author: Jeff Zhang <zjffdu@apache.org>
Authored: Wed Sep 9 10:26:53 2015 -0700
Committer: Marcelo Vanzin <vanzin@cloudera.com>
Committed: Wed Sep 9 10:26:57 2015 -0700

----------------------------------------------------------------------
 yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/c0052d8d/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
----------------------------------------------------------------------
diff --git a/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala b/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
index e9a02ba..a2c4bc2 100644
--- a/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
+++ b/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
@@ -1045,7 +1045,10 @@ object Client extends Logging {
           s"in favor of the $CONF_SPARK_JAR configuration variable.")
       System.getenv(ENV_SPARK_JAR)
     } else {
-      SparkContext.jarOfClass(this.getClass).head
+      SparkContext.jarOfClass(this.getClass).getOrElse(throw new SparkException("Could not
"
+        + "find jar containing Spark classes. The jar can be defined using the "
+        + "spark.yarn.jar configuration option. If testing Spark, either set that option
or "
+        + "make sure SPARK_PREPEND_CLASSES is not set."))
     }
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message