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

    https://github.com/apache/spark/pull/12188#discussion_r58632162
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala
 ---
    @@ -43,24 +44,30 @@ class CoarseGrainedSchedulerBackend(scheduler: 
TaskSchedulerImpl, val rpcEnv: Rp
       extends ExecutorAllocationClient with SchedulerBackend with Logging
     {
       // Use an atomic variable to track total number of cores in the cluster 
for simplicity and speed
    -  var totalCoreCount = new AtomicInteger(0)
    +  protected val totalCoreCount = new AtomicInteger(0)
       // Total number of executors that are currently registered
    -  var totalRegisteredExecutors = new AtomicInteger(0)
    -  val conf = scheduler.sc.conf
    +  protected val totalRegisteredExecutors = new AtomicInteger(0)
    +  protected val conf = scheduler.sc.conf
       private val maxRpcMessageSize = RpcUtils.maxMessageSizeBytes(conf)
       // Submit tasks only after (registered resources / total expected 
resources)
       // is equal to at least this value, that is double between 0 and 1.
    -  var minRegisteredRatio =
    +  protected val minRegisteredRatio =
         math.min(1, 
conf.getDouble("spark.scheduler.minRegisteredResourcesRatio", 0))
       // Submit tasks after maxRegisteredWaitingTime milliseconds
       // if minRegisteredRatio has not yet been reached
    -  val maxRegisteredWaitingTimeMs =
    +  private val maxRegisteredWaitingTimeMs =
         conf.getTimeAsMs("spark.scheduler.maxRegisteredResourcesWaitingTime", 
"30s")
    -  val createTime = System.currentTimeMillis()
    +  private val createTime = System.currentTimeMillis()
     
    +  // Accessing `executorDataMap` in 
`DriverEndpoint.receive/receiveAndReply` doesn't need any
    +  // protection. But accessing `executorDataMap` out of 
`DriverEndpoint.receive/receiveAndReply`
    +  // must be protected by `CoarseGrainedSchedulerBackend.this`. Besides, 
`executorDataMap` should
    +  // only be modified in `DriverEndpoint.receive/receiveAndReply` with 
protection by
    +  // `CoarseGrainedSchedulerBackend.this`.
    --- End diff --
    
    great.


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