What I am trying ot achieve is basically print "hello world"
each time I receive a stream of data.
I know that on each stream I can call the function foreachRDD
but that does not help me because:
- It might be that there is no data processed
- I don't want to print hello on each rdd, I want to print hello on the entire stream (whether I received data or not).
Basicaly, each time the program tries to fetch data (and it does so every 30 seconds lets say because of the spark streaming context) I would like to print hello.
Is there a way of doing this? is there like a onlisten event for spark streaming?