Skip to content

Commit b640c84

Browse files
author
Andrew Or
committed
[HOTFIX][SPARK-4136] Fix compilation and tests
1 parent 69bc3bb commit b640c84

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

core/src/main/scala/org/apache/spark/ExecutorAllocationClient.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,25 @@ private[spark] trait ExecutorAllocationClient {
2626
/**
2727
* Express a preference to the cluster manager for a given total number of executors.
2828
* This can result in canceling pending requests or filing additional requests.
29-
* Return whether the request is acknowledged by the cluster manager.
29+
* @return whether the request is acknowledged by the cluster manager.
3030
*/
3131
private[spark] def requestTotalExecutors(numExecutors: Int): Boolean
3232

3333
/**
3434
* Request an additional number of executors from the cluster manager.
35-
* Return whether the request is acknowledged by the cluster manager.
35+
* @return whether the request is acknowledged by the cluster manager.
3636
*/
3737
def requestExecutors(numAdditionalExecutors: Int): Boolean
3838

3939
/**
4040
* Request that the cluster manager kill the specified executors.
41-
* Return whether the request is acknowledged by the cluster manager.
41+
* @return whether the request is acknowledged by the cluster manager.
4242
*/
4343
def killExecutors(executorIds: Seq[String]): Boolean
4444

4545
/**
4646
* Request that the cluster manager kill the specified executor.
47-
* Return whether the request is acknowledged by the cluster manager.
47+
* @return whether the request is acknowledged by the cluster manager.
4848
*/
4949
def killExecutor(executorId: String): Boolean = killExecutors(Seq(executorId))
5050
}

core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ class CoarseGrainedSchedulerBackend(scheduler: TaskSchedulerImpl, val actorSyste
333333
* @return whether the request is acknowledged.
334334
*/
335335
final override def requestTotalExecutors(numExecutors: Int): Boolean = synchronized {
336-
if (numAdditionalExecutors < 0) {
336+
if (numExecutors < 0) {
337337
throw new IllegalArgumentException(
338338
"Attempted to request a negative number of executor(s) " +
339339
s"$numExecutors from the cluster manager. Please specify a positive number!")

core/src/test/scala/org/apache/spark/ExecutorAllocationManagerSuite.scala

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,25 +297,23 @@ class ExecutorAllocationManagerSuite extends FunSuite with LocalSparkContext {
297297
assert(removeExecutor(manager, "5"))
298298
assert(removeExecutor(manager, "6"))
299299
assert(executorIds(manager).size === 10)
300-
assert(addExecutors(manager) === 0) // still at upper limit
300+
assert(addExecutors(manager) === 1)
301301
onExecutorRemoved(manager, "3")
302302
onExecutorRemoved(manager, "4")
303303
assert(executorIds(manager).size === 8)
304304

305305
// Add succeeds again, now that we are no longer at the upper limit
306306
// Number of executors added restarts at 1
307-
assert(addExecutors(manager) === 1)
308-
assert(addExecutors(manager) === 1) // upper limit reached again
307+
assert(addExecutors(manager) === 2)
308+
assert(addExecutors(manager) === 1) // upper limit reached
309309
assert(addExecutors(manager) === 0)
310310
assert(executorIds(manager).size === 8)
311311
onExecutorRemoved(manager, "5")
312312
onExecutorRemoved(manager, "6")
313313
onExecutorAdded(manager, "13")
314314
onExecutorAdded(manager, "14")
315315
assert(executorIds(manager).size === 8)
316-
assert(addExecutors(manager) === 1)
317-
assert(addExecutors(manager) === 1) // upper limit reached again
318-
assert(addExecutors(manager) === 0)
316+
assert(addExecutors(manager) === 0) // still at upper limit
319317
onExecutorAdded(manager, "15")
320318
onExecutorAdded(manager, "16")
321319
assert(executorIds(manager).size === 10)

0 commit comments

Comments
 (0)