aboutsummaryrefslogtreecommitdiff
path: root/yarn
diff options
context:
space:
mode:
authorJeff Zhang <zjffdu@apache.org>2015-09-09 10:26:53 -0700
committerMarcelo Vanzin <vanzin@cloudera.com>2015-09-09 10:26:57 -0700
commitc0052d8d09eebadadb5ed35ac512caaf73919551 (patch)
treeb0b68297a64ad11949b0604954885e2ecc1aa03a /yarn
parent2ddeb63126d26149eda197e85b7b26ef16a6e97c (diff)
downloadspark-c0052d8d09eebadadb5ed35ac512caaf73919551.tar.gz
spark-c0052d8d09eebadadb5ed35ac512caaf73919551.tar.bz2
spark-c0052d8d09eebadadb5ed35ac512caaf73919551.zip
[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.
Diffstat (limited to 'yarn')
-rw-r--r--yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala5
1 files changed, 4 insertions, 1 deletions
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 e9a02baafd..a2c4bc2f54 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."))
}
}