Skip to content

Commit e76dd15

Browse files
author
Marcelo Vanzin
committed
Throw error from mesos code, update docs.
1 parent b7486cc commit e76dd15

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

docs/configuration.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,8 @@ Apart from these, the following properties are also available, and may be useful
581581
<td><code>spark.io.encryption.enabled</code></td>
582582
<td>false</td>
583583
<td>
584-
Enable IO encryption. Only supported in YARN mode.
584+
Enable IO encryption. Currently supported by all modes except Mesos. It's recommended that RPC encryption
585+
be enabled when using this feature.
585586
</td>
586587
</tr>
587588
<tr>

mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosClusterManager.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.apache.spark.scheduler.cluster.mesos
1919

2020
import org.apache.spark.{SparkContext, SparkException}
21+
import org.apache.spark.internal.config._
2122
import org.apache.spark.scheduler.{ExternalClusterManager, SchedulerBackend, TaskScheduler, TaskSchedulerImpl}
2223

2324
/**
@@ -37,6 +38,9 @@ private[spark] class MesosClusterManager extends ExternalClusterManager {
3738
override def createSchedulerBackend(sc: SparkContext,
3839
masterURL: String,
3940
scheduler: TaskScheduler): SchedulerBackend = {
41+
require(!sc.conf.get(IO_ENCRYPTION_ENABLED),
42+
"I/O encryption is currently not supported in Mesos.")
43+
4044
val mesosUrl = MESOS_REGEX.findFirstMatchIn(masterURL).get.group(1)
4145
val coarse = sc.conf.getBoolean("spark.mesos.coarse", defaultValue = true)
4246
if (coarse) {

mesos/src/test/scala/org/apache/spark/scheduler/cluster/mesos/MesosClusterManagerSuite.scala

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
package org.apache.spark.scheduler.cluster.mesos
1919

20-
import org.apache.spark.{LocalSparkContext, SparkConf, SparkContext, SparkFunSuite}
20+
import org.apache.spark._
21+
import org.apache.spark.internal.config._
2122

2223
class MesosClusterManagerSuite extends SparkFunSuite with LocalSparkContext {
2324
def testURL(masterURL: String, expectedClass: Class[_], coarse: Boolean) {
@@ -44,4 +45,12 @@ class MesosClusterManagerSuite extends SparkFunSuite with LocalSparkContext {
4445
classOf[MesosFineGrainedSchedulerBackend],
4546
coarse = false)
4647
}
48+
49+
test("mesos with i/o encryption throws error") {
50+
val se = intercept[SparkException] {
51+
val conf = new SparkConf().setAppName("test").set(IO_ENCRYPTION_ENABLED, true)
52+
sc = new SparkContext("mesos", "test", conf)
53+
}
54+
assert(se.getCause().isInstanceOf[IllegalArgumentException])
55+
}
4756
}

0 commit comments

Comments
 (0)