beliefer commented on a change in pull request #24218: [SPARK-27281][DStreams] 
Change the way latest kafka offsets are retrieved to consumer#endOffsets
URL: https://github.com/apache/spark/pull/24218#discussion_r269399030
 
 

 ##########
 File path: 
external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/DirectKafkaInputDStream.scala
 ##########
 @@ -207,8 +207,12 @@ private[spark] class DirectKafkaInputDStream[K, V](
     currentOffsets = currentOffsets ++ newPartitions.map(tp => tp -> 
c.position(tp)).toMap
 
     // find latest available offsets
-    c.seekToEnd(currentOffsets.keySet.asJava)
-    parts.map(tp => tp -> c.position(tp)).toMap
+    val end = c.endOffsets(currentOffsets.keySet.asJava)
 
 Review comment:
   This change maybe resolve your issue, but a solution for common.

----------------------------------------------------------------
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]

Reply via email to