Github user PraveenSeluka commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2840#discussion_r19053493
  
    --- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala ---
    @@ -851,6 +851,38 @@ class SparkContext(config: SparkConf) extends Logging {
         listenerBus.addListener(listener)
       }
     
    +  /**
    +   * :: DeveloperApi ::
    +   * Request a number of executors from the cluster manager.
    +   */
    +  @DeveloperApi
    +  def requestExecutors(numExecutors: Int): Unit = {
    +    if (taskScheduler == null) {
    +      logWarning("Attempted to request executors before initializing task 
scheduler.")
    +      return
    +    }
    +    taskScheduler match {
    +      case scheduler: TaskSchedulerImpl => 
scheduler.requestExecutors(numExecutors)
    --- End diff --
    
    Minor comment : Can we skip `TaskSchedulerImpl` and directly call 
`CoarseGrainedSchedulerBackend`. I think, `createTaskScheduler()` in 
`SparkContext` is creating the `CoarseGrainedSchedulerBackend` instance itself, 
so it must be possible to do that


---
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]

Reply via email to