第25课:spark streaming的streamingContext启动及Jobschedule启动源码图解

来源:互联网 发布:知乎反对能看到吗 编辑:程序博客网 时间:2024/05/21 05:23

第25课:spark streaming的streamingContext启动及Jobschedule启动源码图解

1 streamingContext启动
2 Jobschedule启动源码图解


/* * *王家林老师授课http://weibo.com/ilovepains */  每天晚上20:00YY频道现场授课频道68917580

 

StreamingContext.start:

1,validate

2,newThread(JobScheduler)

3,state:ACTIVE

4,metricsSystem

5,uiTab

 

 

 

JobScheduler.start 会引发三个消息循环体的运行,其中有两个是本地的消息循环体,另外一个是RPC消息循环体

eventLoop:

 

onReceive(JobSchedulerEvent)

1,JobStarted:handleJobStart

2,JobCompleted:handleJobCompletion

3,ErrorReported:handleError

 

 

endpointRPC

onReceive(RPCMessage)

1StartAllReceivers

2,CleanupOldBlocks

3,UpdateReceiverRateLimit

4,AddBlock

。。。。

 

 

 

eventLoop:EventLoop[JobGeneratorEvent]

onReceive(JobGeneratorEvent)

case GenerateJobs(time)=> generateJobs(time)

      case ClearMetadata(time) =>clearMetadata(time)

      case DoCheckpoint(time,clearCheckpointDataLater) =>

        doCheckpoint(time,clearCheckpointDataLater)

      case ClearCheckpointData(time) =>clearCheckpointData(time)

 

 

 

 

 

0 0
原创粉丝点击