Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/3868#discussion_r22444560
--- Diff:
streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverTracker.scala
---
@@ -285,16 +307,18 @@ class ReceiverTracker(ssc: StreamingContext,
skipReceiverLaunch: Boolean = false
// Distribute the receivers and start them
logInfo("Starting " + receivers.length + " receivers")
+ terminated = false
ssc.sparkContext.runJob(tempRDD,
ssc.sparkContext.clean(startReceiver))
+ terminated = true
logInfo("All of the receivers have been terminated")
}
/** Stops the receivers. */
private def stopReceivers() {
// Signal the receivers to stop
- receiverInfo.values.flatMap { info => Option(info.actor)}
- .foreach { _ ! StopReceiver }
- logInfo("Sent stop signal to all " + receiverInfo.size + "
receivers")
+ val receivers = receiverInfo.values.flatMap { info =>
Option(info.actor) }
+ receivers.foreach { _ ! StopReceiver }
+ logInfo("Sent stop signal to all " + receivers.size + " receivers")
--- End diff --
Might as well use string interpolation here, if you're going to change
things anyways:
```scala
logInfo(s"Sent stop signal to all ${receivers.size} receivers")
```
---
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]