Typo error in KafkaWordCount example
topicpMap to topicMap Author: Gaspar Munoz <munozs.88@gmail.com> Closes #2614 from gasparms/patch-1 and squashes the following commits: 00aab2c [Gaspar Munoz] Typo error in KafkaWordCount example
This commit is contained in:
parent
8cc70e7e15
commit
b81ee0b46d
|
@ -53,8 +53,8 @@ object KafkaWordCount {
|
||||||
val ssc = new StreamingContext(sparkConf, Seconds(2))
|
val ssc = new StreamingContext(sparkConf, Seconds(2))
|
||||||
ssc.checkpoint("checkpoint")
|
ssc.checkpoint("checkpoint")
|
||||||
|
|
||||||
val topicpMap = topics.split(",").map((_,numThreads.toInt)).toMap
|
val topicMap = topics.split(",").map((_,numThreads.toInt)).toMap
|
||||||
val lines = KafkaUtils.createStream(ssc, zkQuorum, group, topicpMap).map(_._2)
|
val lines = KafkaUtils.createStream(ssc, zkQuorum, group, topicMap).map(_._2)
|
||||||
val words = lines.flatMap(_.split(" "))
|
val words = lines.flatMap(_.split(" "))
|
||||||
val wordCounts = words.map(x => (x, 1L))
|
val wordCounts = words.map(x => (x, 1L))
|
||||||
.reduceByKeyAndWindow(_ + _, _ - _, Minutes(10), Seconds(2), 2)
|
.reduceByKeyAndWindow(_ + _, _ - _, Minutes(10), Seconds(2), 2)
|
||||||
|
|
Loading…
Reference in a new issue