diff options
author | toddwan <tawan0109@outlook.com> | 2015-11-30 09:26:29 +0000 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2015-11-30 09:26:29 +0000 |
commit | e0749442051d6e29dae4f4cdcb2937c0b015f98f (patch) | |
tree | 673da8985b6e43cc5a9e87108bb9754e540a9b7b /core/src/test | |
parent | 0ddfe7868948e302858a2b03b50762eaefbeb53e (diff) | |
download | spark-e0749442051d6e29dae4f4cdcb2937c0b015f98f.tar.gz spark-e0749442051d6e29dae4f4cdcb2937c0b015f98f.tar.bz2 spark-e0749442051d6e29dae4f4cdcb2937c0b015f98f.zip |
[SPARK-11859][MESOS] SparkContext accepts invalid Master URLs in the form zk://host:port for a multi-master Mesos cluster using ZooKeeper
* According to below doc and validation logic in [SparkSubmit.scala](https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala#L231), master URL for a mesos cluster should always start with `mesos://`
http://spark.apache.org/docs/latest/running-on-mesos.html
`The Master URLs for Mesos are in the form mesos://host:5050 for a single-master Mesos cluster, or mesos://zk://host:2181 for a multi-master Mesos cluster using ZooKeeper.`
* However, [SparkContext.scala](https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/SparkContext.scala#L2749) fails the validation and can receive master URL in the form `zk://host:port`
* For the master URLs in the form `zk:host:port`, the valid form should be `mesos://zk://host:port`
* This PR restrict the validation in `SparkContext.scala`, and now only mesos master URLs prefixed with `mesos://` can be accepted.
* This PR also updated corresponding unit test.
Author: toddwan <tawan0109@outlook.com>
Closes #9886 from toddwan/S11859.
Diffstat (limited to 'core/src/test')
-rw-r--r-- | core/src/test/scala/org/apache/spark/SparkContextSchedulerCreationSuite.scala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/src/test/scala/org/apache/spark/SparkContextSchedulerCreationSuite.scala b/core/src/test/scala/org/apache/spark/SparkContextSchedulerCreationSuite.scala index e5a14a69ef..d18e0782c0 100644 --- a/core/src/test/scala/org/apache/spark/SparkContextSchedulerCreationSuite.scala +++ b/core/src/test/scala/org/apache/spark/SparkContextSchedulerCreationSuite.scala @@ -175,6 +175,11 @@ class SparkContextSchedulerCreationSuite } test("mesos with zookeeper") { + testMesos("mesos://zk://localhost:1234,localhost:2345", + classOf[MesosSchedulerBackend], coarse = false) + } + + test("mesos with zookeeper and Master URL starting with zk://") { testMesos("zk://localhost:1234,localhost:2345", classOf[MesosSchedulerBackend], coarse = false) } } |