Flink CDC-增量读取Mysql Binlog时序图
2024-10-25 11:35:51 0 举报
Flink CDC-增量读取Mysql Binlog时序图
作者其他创作
大纲/内容
FlinkPipelineComposer
handleChange()
getComposer()
getEventSourceProvider()
EventDispatcher
MySqlDataSource
CliFrontend
MySqlDataSourceFactory
addSplits()
RelationalChangeRecordEmitter
CliExecutor
注意构造函数中的对象分别为: MySqlSplitReaderMySqlPipelineRecordEmitter
fetch()
compose()
StreamingChangeRecordReceiver
MySqlStreamingChangeEventSource
new MySqlSourceReader()
getBinlogSplitReader()
execute()
SourceReaderBase
SingleThreadFetcherManager
eventHandlers根据EventType处理相应的事件
注意 changeEmitter使用了函数式编程changeEmitter.emit实现对应eventDispatcher.dispatchDataChangeEvent 方法实现
new MySqlSource()
createDataSource()
new MySqlDataSource
submitSplit()
Main方法启动
createExecutor()
Insert事件为例
changeRecord()EventDispatcher.this.queue.enqueue(DataChangeEvent)
注意构造函数中的对象分别为: MySqlEventDeserializerMySqlPipelineRecordEmitter
statefulTaskContext.configure()注意其中构造函数dispatcher 对应于EventDispatcherImpl
pollSplitRecords()
translate()
startFetcher()
MySqlBinlogSplitReadTask
DataSourceTranslator
BinlogSplitReader
dispatchDataChangeEvent()
MySqlSourceReader
MySqlSplitReader
new ChangeRecordEmitter.ReceiverchangeRecord()
MySqlSource
emitChangeRecords()
new MySqlBinlogSplitReadTask()
handleEvent()
handleInsert()
createReader()
run()
0 条评论
下一页