I am having a batch interval of 5 seconds.
I want to look at the number of rdd's formed in one batch. So i added a time inside forEach to print the time in seconds and count rdd's after 5 seconds.
textStream.foreachRDD(rdd =>{
println("======="+ TimeUnit.MILLISECONDS.toMinutes(Instant.now.toEpochMilli))
rdd.foreach(println(_))
})
This gives the same time (currentl empty input):
=======26461220
=======26461220
=======26461220
=======26461220
The time should change right?
Q1. How to print the time of the current?
Q2. How many rdd's are formed in a dstream ?