Skip to content
Snippets Groups Projects
Commit b6b44853 authored by witgo's avatar witgo Committed by Patrick Wendell
Browse files

SPARK-2248: spark.default.parallelism does not apply in local mode

Author: witgo <witgo@qq.com>

Closes #1194 from witgo/SPARK-2248 and squashes the following commits:

6ac950b [witgo] spark.default.parallelism does not apply in local mode
parent 2714968e
No related branches found
No related tags found
No related merge requests found
......@@ -97,7 +97,8 @@ private[spark] class LocalBackend(scheduler: TaskSchedulerImpl, val totalCores:
localActor ! ReviveOffers
}
override def defaultParallelism() = totalCores
override def defaultParallelism() =
scheduler.conf.getInt("spark.default.parallelism", totalCores)
override def killTask(taskId: Long, executorId: String, interruptThread: Boolean) {
localActor ! KillTask(taskId, interruptThread)
......
......@@ -77,6 +77,22 @@ class SparkContextSchedulerCreationSuite
}
}
test("local-default-parallelism") {
val defaultParallelism = System.getProperty("spark.default.parallelism")
System.setProperty("spark.default.parallelism", "16")
val sched = createTaskScheduler("local")
sched.backend match {
case s: LocalBackend => assert(s.defaultParallelism() === 16)
case _ => fail()
}
Option(defaultParallelism) match {
case Some(v) => System.setProperty("spark.default.parallelism", v)
case _ => System.clearProperty("spark.default.parallelism")
}
}
test("simr") {
createTaskScheduler("simr://uri").backend match {
case s: SimrSchedulerBackend => // OK
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment