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

Cody Koeninger commented on SPARK-9059:
---------------------------------------

How is this different from SPARK-8390 ?

I thought the idea there was to keep word count simple, and have separate 
examples for offsets.

Restarting from specific offsets is a good idea, but requires storage. If we 
want to move the examples from my external repo 
https://github.com/koeninger/kafka-exactly-once into spark, it would probably 
require switching from postgres to an in memory database.

> Update Direct Kafka Word count examples to show the use of HasOffsetRanges
> --------------------------------------------------------------------------
>
>                 Key: SPARK-9059
>                 URL: https://issues.apache.org/jira/browse/SPARK-9059
>             Project: Spark
>          Issue Type: Sub-task
>          Components: Streaming
>            Reporter: Tathagata Das
>              Labels: starter
>
> Update Scala, Java and Python examples of Direct Kafka word count to access 
> the offset ranges using HasOffsetRanges and print it. For example in Scala,
>  
> {code}
> var offsetRanges: Array[OffsetRange] = _
> ...
> directKafkaDStream.foreachRDD { rdd => 
>     offsetRanges = rdd.asInstanceOf[HasOffsetRanges]  
> }
> ...
> transformedDStream.foreachRDD { rdd => 
>     // some operation
>     println("Processed ranges: " + offsetRanges)
> }
> {code}
> See https://spark.apache.org/docs/latest/streaming-kafka-integration.html for 
> more info, and the master source code for more updated information on python. 



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to