aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubhobrata Dey <sbcd90@gmail.com>2016-04-26 11:46:24 +0100
committerSean Owen <sowen@cloudera.com>2016-04-26 11:46:24 +0100
commitf70e4fff0e7adb8d6fe774daf11fb0dfb080cf31 (patch)
treed6b3f40023480c5c2003881a23845dd2c280d3a4
parent6a7ba1ff7431281f4c3994a8db70a8fb6eefbf00 (diff)
downloadspark-f70e4fff0e7adb8d6fe774daf11fb0dfb080cf31.tar.gz
spark-f70e4fff0e7adb8d6fe774daf11fb0dfb080cf31.tar.bz2
spark-f70e4fff0e7adb8d6fe774daf11fb0dfb080cf31.zip
[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.
-rw-r--r--core/src/main/scala/org/apache/spark/scheduler/Pool.scala2
-rw-r--r--core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala2
2 files changed, 4 insertions, 0 deletions
diff --git a/core/src/main/scala/org/apache/spark/scheduler/Pool.scala b/core/src/main/scala/org/apache/spark/scheduler/Pool.scala
index 4cd13e2fea..a79e71ec7c 100644
--- a/core/src/main/scala/org/apache/spark/scheduler/Pool.scala
+++ b/core/src/main/scala/org/apache/spark/scheduler/Pool.scala
@@ -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")
}
}
diff --git a/core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala b/core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala
index c3159188d9..f31ec2af4e 100644
--- a/core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala
+++ b/core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala
@@ -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()