Updated Branches: refs/heads/master 740922f25 -> 58d9bbcfe
Re-enable zk:// urls for Mesos SparkContexts This was broken in PR #71 when we explicitly disallow anything that didn't fit a mesos:// url. Although it is not really clear that a zk:// url should match Mesos, it is what the docs say and it is necessary for backwards compatibility. Project: http://git-wip-us.apache.org/repos/asf/incubator-spark/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-spark/commit/37f161cf Tree: http://git-wip-us.apache.org/repos/asf/incubator-spark/tree/37f161cf Diff: http://git-wip-us.apache.org/repos/asf/incubator-spark/diff/37f161cf Branch: refs/heads/master Commit: 37f161cf6b19eb5b70a251340df0caf21afed84a Parents: cb976df Author: Aaron Davidson <[email protected]> Authored: Thu Nov 28 20:36:18 2013 -0800 Committer: Aaron Davidson <[email protected]> Committed: Thu Nov 28 20:37:56 2013 -0800 ---------------------------------------------------------------------- core/src/main/scala/org/apache/spark/SparkContext.scala | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/37f161cf/core/src/main/scala/org/apache/spark/SparkContext.scala ---------------------------------------------------------------------- diff --git a/core/src/main/scala/org/apache/spark/SparkContext.scala b/core/src/main/scala/org/apache/spark/SparkContext.scala index 3a80241..cf1fd49 100644 --- a/core/src/main/scala/org/apache/spark/SparkContext.scala +++ b/core/src/main/scala/org/apache/spark/SparkContext.scala @@ -162,8 +162,8 @@ class SparkContext( val LOCAL_CLUSTER_REGEX = """local-cluster\[\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*]""".r // Regular expression for connecting to Spark deploy clusters val SPARK_REGEX = """spark://(.*)""".r - // Regular expression for connection to Mesos cluster - val MESOS_REGEX = """mesos://(.*)""".r + // Regular expression for connection to Mesos cluster by mesos:// or zk:// url + val MESOS_REGEX = """(mesos|zk)://.*""".r // Regular expression for connection to Simr cluster val SIMR_REGEX = """simr://(.*)""".r @@ -251,14 +251,15 @@ class SparkContext( scheduler.initialize(backend) scheduler - case MESOS_REGEX(mesosUrl) => + case mesosUrl @ MESOS_REGEX(_) => MesosNativeLibrary.load() val scheduler = new ClusterScheduler(this) val coarseGrained = System.getProperty("spark.mesos.coarse", "false").toBoolean + val url = mesosUrl.stripPrefix("mesos://") // strip scheme from raw Mesos URLs val backend = if (coarseGrained) { - new CoarseMesosSchedulerBackend(scheduler, this, mesosUrl, appName) + new CoarseMesosSchedulerBackend(scheduler, this, url, appName) } else { - new MesosSchedulerBackend(scheduler, this, mesosUrl, appName) + new MesosSchedulerBackend(scheduler, this, url, appName) } scheduler.initialize(backend) scheduler
