Skip to content

Commit

Permalink
A minor change in sparkContext and heartbeatReceiver
Browse files Browse the repository at this point in the history
  • Loading branch information
shenh062326 committed Feb 12, 2015
1 parent b904aed commit 7448ac6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 2 additions & 8 deletions core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1034,14 +1034,8 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
logInfo("Added file " + path + " at " + key + " with timestamp " + addedFiles(key))
postEnvironmentUpdate()
}

def supportKillExecutor(): Boolean = {
if(master.contains("yarn") || dynamicAllocationTesting) {
true
} else {
false
}
}

private[spark] def supportKillExecutor = master.contains("yarn") || dynamicAllocationTesting

/**
* :: DeveloperApi ::
Expand Down

0 comments on commit 7448ac6

Please sign in to comment.