From d22149325f394f46b4d199dbd41a28c569ad5a0e Mon Sep 17 00:00:00 2001 From: Hong Shen Date: Fri, 13 Feb 2015 11:53:27 +0800 Subject: [PATCH] Fix test failed --- .../src/main/scala/org/apache/spark/HeartbeatReceiver.scala | 2 +- core/src/main/scala/org/apache/spark/SparkContext.scala | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/scala/org/apache/spark/HeartbeatReceiver.scala b/core/src/main/scala/org/apache/spark/HeartbeatReceiver.scala index ccc1ddbc22a23..06123daa9626f 100644 --- a/core/src/main/scala/org/apache/spark/HeartbeatReceiver.scala +++ b/core/src/main/scala/org/apache/spark/HeartbeatReceiver.scala @@ -83,7 +83,7 @@ private[spark] class HeartbeatReceiver(sc: SparkContext, scheduler: TaskSchedule logWarning(s"Removing executor $executorId with no recent heartbeats: " + s"${now - lastSeenMs} ms exceeds timeout $executorTimeout ms") scheduler.executorLost(executorId, SlaveLost()) - if (sc.supportKillExecutor()) { + if (sc.supportKillExecutor) { sc.killExecutor(executorId) } executorLastSeen.remove(executorId) diff --git a/core/src/main/scala/org/apache/spark/SparkContext.scala b/core/src/main/scala/org/apache/spark/SparkContext.scala index 2db07caafb640..ae16eff31e642 100644 --- a/core/src/main/scala/org/apache/spark/SparkContext.scala +++ b/core/src/main/scala/org/apache/spark/SparkContext.scala @@ -379,7 +379,7 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli private val dynamicAllocationTesting = conf.getBoolean("spark.dynamicAllocation.testing", false) private[spark] val executorAllocationManager: Option[ExecutorAllocationManager] = if (dynamicAllocationEnabled) { - assert(supportKillExecutor(), + assert(supportKillExecutor, "Dynamic allocation of executors is currently only supported in YARN mode") Some(new ExecutorAllocationManager(this, listenerBus, conf)) } else { @@ -1053,7 +1053,7 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli */ @DeveloperApi override def requestExecutors(numAdditionalExecutors: Int): Boolean = { - assert(supportKillExecutor(), "Requesting executors is currently only supported in YARN mode") + assert(supportKillExecutor, "Requesting executors is currently only supported in YARN mode") schedulerBackend match { case b: CoarseGrainedSchedulerBackend => b.requestExecutors(numAdditionalExecutors) @@ -1070,7 +1070,7 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli */ @DeveloperApi override def killExecutors(executorIds: Seq[String]): Boolean = { - assert(supportKillExecutor(), "Killing executors is currently only supported in YARN mode") + assert(supportKillExecutor, "Killing executors is currently only supported in YARN mode") schedulerBackend match { case b: CoarseGrainedSchedulerBackend => b.killExecutors(executorIds)