第19课:Spark Streaming架构设计和运行机制大总结
1 spark streaming中的架构设计和运行机制
2 spark streaming的深度思考
Rdd的模板是Dstream,但Dstream操作和RDD不是一一对应的,Dstream和DstreamGraph 不过是幻象。
Spark Streaming本质上RDD+Timer,在RDD的基础之上,Timer在时间驱动下不断循环,周而复始的接收数据处理数据。
recurringTimer
/**
* Repeatedly call the callback every interval.
*/
private def loop() {
try {
while (!stopped) {
triggerActionForNextInterval()
}
triggerActionForNextInterval()
} catch {
case e: InterruptedException =>
}
}
