srowen commented on a change in pull request #24241:
[SPARK-27323][CORE][SQL][STREAMING] Use Single-Abstract-Method support in Scala
2.12 to simplify code
URL: https://github.com/apache/spark/pull/24241#discussion_r271000195
##########
File path:
streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverTracker.scala
##########
@@ -255,9 +255,7 @@ class ReceiverTracker(ssc: StreamingContext,
skipReceiverLaunch: Boolean = false
}
}
- def numReceivers(): Int = {
- receiverInputStreams.size
- }
+ def numReceivers(): Int = receiverInputStreams.length
Review comment:
Yep, we ought to make this kind of change (and use `lengthCompare` on a
similar note where sizes are compared) wherever perf matters. Probably a good
habit in general, but, wouldn't change it unless the code is already changing.
Here I just took the liberty of adjusting this one, though there's no big
reason for it here.
More generally I have a number of large code cleanup changes I want to get
into Spark 3, and although I won't change this particular issue wholesale, I do
want to get in some code cleanup before a new major version.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]