HeartSaVioR commented on code in PR #41525:
URL: https://github.com/apache/spark/pull/41525#discussion_r1234531788
##########
connector/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/consumer/KafkaDataConsumer.scala:
##########
@@ -548,7 +572,10 @@ private[kafka010] class KafkaDataConsumer(
fetchedData: FetchedData,
offset: Long,
pollTimeoutMs: Long): Unit = {
- val (records, offsetAfterPoll, range) = consumer.fetch(offset,
pollTimeoutMs)
+ val (records, offsetAfterPoll, range) = timeNanos {
+ consumer.fetch(offset, pollTimeoutMs)
+ }
+ numPolls += 1
Review Comment:
There is no guarantee that the implementation of List will provide size as
O(1), but most implementations are happy to spare slight overhead cost to track
the total number of elements, since size has been one of most calling methods
in List. (Implementations in Java standard library are mostly following)
Please update this and let me know, I guess this is the last one remaining.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]