Just make sure you import the followings:

import org.apache.spark.SparkContext._
import org.apache.spark.StreamingContext._



Thanks
Best Regards

On Wed, Apr 8, 2015 at 6:38 AM, Su She <suhsheka...@gmail.com> wrote:

> Hello Everyone,
>
> I am trying to implement this example (Spark Streaming with Twitter).
>
>
> https://github.com/apache/spark/blob/master/examples/src/main/scala/org/apache/spark/examples/streaming/TwitterPopularTags.scala
>
> I am able to do:
>
> hashTags.print() to get a live stream of filtered hashtags, but I get
> these warnings, not sure if they're related to the error:
>
> WARN BlockManager: Block input-0-1428450594600 replicated to only 0
> peer(s) instead of 1 peers
>
> then when I try to print out topCounts60 or topCounts10, I get this
> error when building:
>
>
>  
> /home/ec2-user/sparkApps/TwitterApp/src/main/scala/TwitterPopularTags.scala:35:
> error: value reduceByKeyAndWindow is not a member of
> org.apache.spark.streaming.dstream.DStream[(String, Int)]
> [INFO]     val topCounts60 = hashTags.map((_,
> 1)).reduceByKeyAndWindow(_ + _, Seconds(60)).map{case (topic, count)
> => (count, topic)}.transform(_.sortByKey(false))
>
>
> Thank you for the help!
>
> Best,
>
> Su
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
> For additional commands, e-mail: user-h...@spark.apache.org
>
>

Reply via email to