aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/scala/org/apache/spark/ExecutorAllocationClient.scala
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/scala/org/apache/spark/ExecutorAllocationClient.scala')
-rw-r--r--core/src/main/scala/org/apache/spark/ExecutorAllocationClient.scala9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/src/main/scala/org/apache/spark/ExecutorAllocationClient.scala b/core/src/main/scala/org/apache/spark/ExecutorAllocationClient.scala
index 8baddf45bf..5d47f624ac 100644
--- a/core/src/main/scala/org/apache/spark/ExecutorAllocationClient.scala
+++ b/core/src/main/scala/org/apache/spark/ExecutorAllocationClient.scala
@@ -54,13 +54,16 @@ private[spark] trait ExecutorAllocationClient {
/**
* Request that the cluster manager kill the specified executors.
- * @return whether the request is acknowledged by the cluster manager.
+ * @return the ids of the executors acknowledged by the cluster manager to be removed.
*/
- def killExecutors(executorIds: Seq[String]): Boolean
+ def killExecutors(executorIds: Seq[String]): Seq[String]
/**
* Request that the cluster manager kill the specified executor.
* @return whether the request is acknowledged by the cluster manager.
*/
- def killExecutor(executorId: String): Boolean = killExecutors(Seq(executorId))
+ def killExecutor(executorId: String): Boolean = {
+ val killedExecutors = killExecutors(Seq(executorId))
+ killedExecutors.nonEmpty && killedExecutors(0).equals(executorId)
+ }
}