[ 
https://issues.apache.org/jira/browse/SPARK-13106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15126054#comment-15126054
 ] 

Luis Alves commented on SPARK-13106:
------------------------------------

In my case, I want to store in a database the last offset processed for each 
partition. The method signature with the fromOffSets argument is useful when I 
already the lastest processed offset. But when I'm starting, I need to know the 
earliest offset in Kafka for each partition, so ideally I would call the method 
that receives the topics (but the messages should have the same metadata).
Another alternative would be to use the method getFromOffsets but it's private.



> KafkaUtils.createDirectStream method with messageHandler and topics
> -------------------------------------------------------------------
>
>                 Key: SPARK-13106
>                 URL: https://issues.apache.org/jira/browse/SPARK-13106
>             Project: Spark
>          Issue Type: Improvement
>          Components: Streaming
>            Reporter: Luis Alves
>              Labels: newbie
>
> Regarding the KafkaUtils.createDirectStream method here: 
> https://github.com/apache/spark/blob/master/external/kafka/src/main/scala/org/apache/spark/streaming/kafka/KafkaUtils.scala#L473
> I purpose to also allow to pass the a messageHandler as argument instead of 
> using the one that is setted inside the method:
> {code}
>  val messageHandler = (mmd: MessageAndMetadata[K, V]) => (mmd.key, 
> mmd.message)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to