diff options
-rw-r--r-- | core/src/main/scala/spark/scheduler/cluster/SparkDeploySchedulerBackend.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/src/main/scala/spark/scheduler/cluster/SparkDeploySchedulerBackend.scala b/core/src/main/scala/spark/scheduler/cluster/SparkDeploySchedulerBackend.scala index 7b58d0c022..e2301347e5 100644 --- a/core/src/main/scala/spark/scheduler/cluster/SparkDeploySchedulerBackend.scala +++ b/core/src/main/scala/spark/scheduler/cluster/SparkDeploySchedulerBackend.scala @@ -72,7 +72,10 @@ private[spark] class SparkDeploySchedulerBackend( } def executorRemoved(id: String, message: String, exitStatus: Option[Int]) { - var reason: ExecutorLossReason = exitStatus.map(ExecutorExited).getOrElse(SlaveLost(message)) + val reason: ExecutorLossReason = exitStatus match { + case Some(code) => ExecutorExited(code) + case None => SlaveLost(message) + } logInfo("Executor %s removed: %s".format(id, message)) executorIdToSlaveId.get(id) match { case Some(slaveId) => |