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

    https://github.com/apache/spark/pull/7276#discussion_r34753069
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverTracker.scala
 ---
    @@ -371,4 +490,59 @@ class ReceiverTracker(ssc: StreamingContext, 
skipReceiverLaunch: Boolean = false
           logInfo("Sent stop signal to all " + receiverInfo.size + " 
receivers")
         }
       }
    +
    +  def initReceiverTrackingInfos(receivers: Seq[Receiver[_]]): Unit = 
synchronized {
    +    for (receiver <- receivers) {
    +      receiverPreferredLocations(receiver.streamId) = 
receiver.preferredLocation
    +      receiverTrackingInfos.put(receiver.streamId, ReceiverTrackingInfo(
    +        receiver.streamId,
    +        ReceiverState.INACTIVE,
    +        None,
    +        None))
    +    }
    +  }
    +
    +  private def getReceiverTrackingInfoMap(): Map[Int, ReceiverTrackingInfo] 
=
    +    receiverTrackingInfosLock.synchronized {
    +      // Copy to an immutable Map so that we don't need to use 
`synchronized` when using it
    +      receiverTrackingInfos.toMap
    +    }
    +
    +  private def updateReceiverScheduledLocations(
    +      receiverId: Int, scheduledLocations: Seq[String]): Unit =
    --- End diff --
    
    I am not sure whether there is a formatting policy about it but I prefer 
always using `{` and `}` in multiline methods.


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