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

    https://github.com/apache/spark/pull/6607#discussion_r32361471
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverTracker.scala
 ---
    @@ -271,6 +273,44 @@ class ReceiverTracker(ssc: StreamingContext, 
skipReceiverLaunch: Boolean = false
         }
     
         /**
    +     * Get the list of executors excluding driver
    +     */
    +    private def getExecutors(ssc: StreamingContext): List[String] = {
    +      val executors = 
ssc.sparkContext.getExecutorMemoryStatus.map(_._1.split(":")(0)).toList
    +      val driver = ssc.sparkContext.getConf.get("spark.driver.host")
    +      executors.diff(List(driver))
    +    }
    +
    +    /** Set host location(s) for each receiver so as to distribute them 
over
    +     * executors in a round-robin fashion taking into account 
preferredLocation if set
    +     */
    +    private[streaming] def scheduleReceivers(receivers: Seq[Receiver[_]],
    +      executors: List[String]): Array[ArrayBuffer[String]] = {
    +      val locations = new Array[ArrayBuffer[String]](receivers.length)
    +      if (!executors.isEmpty) {
    +        var i = 0
    +        for (i <- 0 to (receivers.length - 1)) {
    --- End diff --
    
    nit: cleaner to use `0 until X` rather than `0 to X-1`


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to