GitHub user holdenk opened a pull request:
https://github.com/apache/spark/pull/8911
[SPARK-10812][YARN][WIP] Spark hadoop util support switching to yarn
While this is likely not a huge issue for real production systems, for test
systems which may setup a Spark Context and tear it down and stand up a Spark
Context with a different master (e.g. some local mode & some yarn mode) tests
this cane be an issue. Discovered during work on spark-testing-base on Spark
1.4.1, but seems like the logic that triggers it is present in master (see
SparkHadoopUtil object). A valid work around for users encountering this issue
is to fork a different JVM, however this can be heavy weight.
```
[info] SampleMiniClusterTest:
[info] Exception encountered when attempting to run a suite with class
name: com.holdenkarau.spark.testing.SampleMiniClusterTest *** ABORTED ***
[info] java.lang.ClassCastException:
org.apache.spark.deploy.SparkHadoopUtil cannot be cast to
org.apache.spark.deploy.yarn.YarnSparkHadoopUtil
[info] at
org.apache.spark.deploy.yarn.YarnSparkHadoopUtil$.get(YarnSparkHadoopUtil.scala:163)
[info] at
org.apache.spark.deploy.yarn.Client.prepareLocalResources(Client.scala:257)
[info] at
org.apache.spark.deploy.yarn.Client.createContainerLaunchContext(Client.scala:561)
[info] at
org.apache.spark.deploy.yarn.Client.submitApplication(Client.scala:115)
[info] at
org.apache.spark.scheduler.cluster.YarnClientSchedulerBackend.start(YarnClientSchedulerBackend.scala:57)
[info] at
org.apache.spark.scheduler.TaskSchedulerImpl.start(TaskSchedulerImpl.scala:141)
[info] at org.apache.spark.SparkContext.<init>(SparkContext.scala:497)
[info] at
com.holdenkarau.spark.testing.SharedMiniCluster$class.setup(SharedMiniCluster.scala:186)
[info] at
com.holdenkarau.spark.testing.SampleMiniClusterTest.setup(SampleMiniClusterTest.scala:26)
[info] at
com.holdenkarau.spark.testing.SharedMiniCluster$class.beforeAll(SharedMiniCluster.scala:103)
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/holdenk/spark
SPARK-10812-spark-hadoop-util-support-switching-to-yarn
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/8911.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #8911
----
commit 04c26b15ef06cb7751d1c7853db3708188e5e512
Author: Holden Karau <[email protected]>
Date: 2015-09-24T21:59:33Z
Supply Yarn or regular hadoop libs as required
commit 1915e7dfb95994986d3adac57f9f7c5ce9790dd9
Author: Holden Karau <[email protected]>
Date: 2015-09-24T21:59:59Z
Check to make sure changing the system property changes the hadoop utils as
expected
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]