Github user pwendell commented on a diff in the pull request:
https://github.com/apache/spark/pull/4168#discussion_r24373580
--- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala ---
@@ -1105,16 +1105,35 @@ class SparkContext(config: SparkConf) extends
Logging with ExecutorAllocationCli
/**
* :: DeveloperApi ::
+ * Express a preference to the cluster manager for a given total number
of executors. This will
+ * result in either canceling pending requests or filing additional
requests.
+ * This is currently only supported in Yarn mode. Return whether the
request is received.
+ */
+ @DeveloperApi
+ override def requestTotalExecutors(numExecutors: Int): Boolean = {
+ assert(master.contains("yarn") || dynamicAllocationTesting,
+ "Requesting executors is currently only supported in YARN mode")
+ schedulerBackend match {
+ case b: CoarseGrainedSchedulerBackend =>
+ b.requestTotalExecutors(numExecutors)
+ case _ =>
+ logWarning("Requesting executors is only supported in
coarse-grained mode")
+ false
+ }
+ }
+
+ /**
+ * :: DeveloperApi ::
* Request an additional number of executors from the cluster manager.
* This is currently only supported in Yarn mode. Return whether the
request is received.
*/
@DeveloperApi
- override def requestExecutors(numAdditionalExecutors: Int): Boolean = {
+ override def requestExecutors(numExecutors: Int): Boolean = {
--- End diff --
Changing this name is also an API break since in Scala you can refer to
variables by name. I do agree `numExecutors` seems better since it's obvious
that they are additional.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]