DStream.
window
Return a new DStream in which each RDD contains all the elements in seen in a sliding window of time over this DStream.
width of the window; must be a multiple of this DStream’s batching interval
sliding interval of the window (i.e., the interval after which the new DStream will generate RDDs); must be a multiple of this DStream’s batching interval