Skip to content
Snippets Groups Projects
Commit f70e4fff authored by Subhobrata Dey's avatar Subhobrata Dey Committed by Sean Owen
Browse files

[SPARK-14889][SPARK CORE] scala.MatchError: NONE (of class scala.Enumeration)...

[SPARK-14889][SPARK CORE] scala.MatchError: NONE (of class scala.Enumeration) when spark.scheduler.mode=NONE

## What changes were proposed in this pull request?

Handling exception for the below mentioned issue

```
➜  spark git:(master) ✗ ./bin/spark-shell -c spark.scheduler.mode=NONE
16/04/25 09:15:00 ERROR SparkContext: Error initializing SparkContext.
scala.MatchError: NONE (of class scala.Enumeration$Val)
	at org.apache.spark.scheduler.Pool.<init>(Pool.scala:53)
	at org.apache.spark.scheduler.TaskSchedulerImpl.initialize(TaskSchedulerImpl.scala:131)
	at org.apache.spark.SparkContext$.org$apache$spark$SparkContext$$createTaskScheduler(SparkContext.scala:2352)
	at org.apache.spark.SparkContext.<init>(SparkContext.scala:492)
```

The exception now looks like

```
java.lang.RuntimeException: The scheduler mode NONE is not supported by Spark.
```

## How was this patch tested?

manual tests

Author: Subhobrata Dey <sbcd90@gmail.com>

Closes #12666 from sbcd90/schedulerModeIssue.
parent 6a7ba1ff
No related branches found
No related tags found
No related merge requests found
......@@ -55,6 +55,8 @@ private[spark] class Pool(
new FairSchedulingAlgorithm()
case SchedulingMode.FIFO =>
new FIFOSchedulingAlgorithm()
case _ =>
throw new IllegalArgumentException(s"Unsupported spark.scheduler.mode: $schedulingMode")
}
}
......
......@@ -135,6 +135,8 @@ private[spark] class TaskSchedulerImpl(
new FIFOSchedulableBuilder(rootPool)
case SchedulingMode.FAIR =>
new FairSchedulableBuilder(rootPool, conf)
case _ =>
throw new IllegalArgumentException(s"Unsupported spark.scheduler.mode: $schedulingMode")
}
}
schedulableBuilder.buildPools()
......
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