Github user tdas commented on a diff in the pull request:
https://github.com/apache/spark/pull/9075#discussion_r42307531
--- Diff:
streaming/src/test/scala/org/apache/spark/streaming/scheduler/ReceiverTrackerSuite.scala
---
@@ -80,6 +82,28 @@ class ReceiverTrackerSuite extends TestSuiteBase {
}
}
}
+
+ test("SPARK-11063: TaskSetManager should use Receiver RDD's
preferredLocations") {
+ // Use ManualClock to prevent from starting batches so that we can
make sure the only task is
+ // for starting the Receiver
+ val _conf = conf.clone.set("spark.streaming.clock",
"org.apache.spark.util.ManualClock")
+ withStreamingContext(new StreamingContext(_conf, Milliseconds(100))) {
ssc =>
+ @volatile var receiverTaskLocality: TaskLocality = null
+ ssc.sparkContext.addSparkListener(new SparkListener {
+ override def onTaskStart(taskStart: SparkListenerTaskStart): Unit
= {
+ receiverTaskLocality = taskStart.taskInfo.taskLocality
+ }
+ })
+ val input = ssc.receiverStream(new TestReceiver)
+ val output = new TestOutputStream(input)
+ output.register()
+ ssc.start()
+ eventually(timeout(10 seconds), interval(10 millis)) {
+ // If preferredLocations is set correctly, receiverTaskLocality
should be NODE_LOCAL
+ assert(receiverTaskLocality === TaskLocality.NODE_LOCAL)
--- End diff --
What will it be if it is not set correctly? That is, without the fix above,
what would locality be
---
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]