Integrating Kafka and Spark Streaming: Code Examples and State of the Game http://ift.tt/1wknimY...

Please Visit: http://ift.tt/1ajReyV

Integrating Kafka and Spark Streaming: Code Examples and State of the Game
http://ift.tt/1wYz6aX
http://ift.tt/1z2Zshr

http://ift.tt/1z2ZqWM
val lines = KafkaUtils.createStream(ssc, zkQuorum, group, topicMap).map(_._2)
val words = lines.flatMap(_.split(" "))
val wordCounts = words.map(x => (x, 1L))
  .reduceByKeyAndWindow(_ + _, _ - _, Minutes(10), Seconds(2), 2)

val producer = new Producer[String, String](config)
producer.send(messages: _*)


from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1z2ZqWQ
via LifeLong Community

No comments:

Post a Comment