How about calling foreachRDD, and processing whatever data is in each RDD normally, and also keeping track within the foreachRDD function of whether any RDD had a count() > 0? if not, then you can execute at the end your alternate logic in the case of no data. I don't think you want to operate at the DStream level.
On Tue, Sep 9, 2014 at 8:41 AM, julyfire <hellowe...@gmail.com> wrote: > Hi Jerry, > > Thanks for your reply. > I use spark streaming to receive the flume stream, then I need to do a > judgement, in each batchDuration, if the received stream has data, then I > should do something, if no data, do the other thing. Then I thought the > count() can give me the measure, but it returns a DStream, not a number. > so is there a way to achieve this case? > > > > > -- > View this message in context: > http://apache-spark-user-list.1001560.n3.nabble.com/Spark-streaming-size-of-DStream-tp13769p13775.html > Sent from the Apache Spark User List mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@spark.apache.org > For additional commands, e-mail: user-h...@spark.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@spark.apache.org For additional commands, e-mail: user-h...@spark.apache.org