Github user tdas commented on a diff in the pull request:
https://github.com/apache/spark/pull/8340#discussion_r37799147
--- Diff:
streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverTracker.scala
---
@@ -244,24 +244,38 @@ class ReceiverTracker(ssc: StreamingContext,
skipReceiverLaunch: Boolean = false
}
if (isTrackerStopping || isTrackerStopped) {
- false
- } else if (!scheduleReceiver(streamId).contains(hostPort)) {
- // Refuse it since it's scheduled to a wrong executor
- false
+ return false
+ }
+
+ val scheduledExecutors =
receiverTrackingInfos(streamId).scheduledExecutors
--- End diff --
It might be more intuitive rewrite this nested if to the following:
```
val scheduledExecutors = receiverTrackingInfos(streamId).scheduledExecutors
val accetableExecutors = if (scheduledExecutors.nonEmpty) {
scheduledExecutors
} else {
scheduleReceiver(streamId).contains(hostPort)
}
if (!accetableExecutors.contains(hostPort)) {
false
} else {
// existing code
}
```
---
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]