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

    https://github.com/apache/spark/pull/6607#discussion_r31863524
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverTracker.scala
 ---
    @@ -271,27 +272,71 @@ class ReceiverTracker(ssc: StreamingContext, 
skipReceiverLaunch: Boolean = false
         }
     
         /**
    -     * Get the receivers from the ReceiverInputDStreams, distributes them 
to the
    -     * worker nodes as a parallel collection, and runs them.
    +     * Get the list of executors excluding driver
          */
    -    private def startReceivers() {
    -      val receivers = receiverInputStreams.map(nis => {
    -        val rcvr = nis.getReceiver()
    -        rcvr.setReceiverId(nis.id)
    -        rcvr
    -      })
    +    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))
    +    }
     
    -      // Right now, we only honor preferences if all receivers have them
    +    /* Schedule receivers using preferredLocation if specified
    +     * and round-robin otherwise
    +     */
    +    private def scheduleReceivers(receivers: Seq[Receiver[_]]): 
RDD[Receiver[_]] = {
    --- End diff --
    
    Might be a good idea to make this `private[scheduler]` and take a list of 
executors as input, so that you can call this from unit tests with various 
numbers of receivers w/ or w/o locations AND various numbers of executor host 
names.


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