Class BinlogSplitReader
- java.lang.Object
-
- org.apache.flink.cdc.connectors.mysql.debezium.reader.BinlogSplitReader
-
- All Implemented Interfaces:
DebeziumReader<SourceRecords,MySqlSplit>
public class BinlogSplitReader extends Object implements DebeziumReader<SourceRecords,MySqlSplit>
A Debezium binlog reader implementation that also support reads binlog and filter overlapping snapshot data thatSnapshotSplitReaderread.
-
-
Constructor Summary
Constructors Constructor Description BinlogSplitReader(StatefulTaskContext statefulTaskContext, int subtaskId)BinlogSplitReader(MySqlSourceConfig sourceConfig, int subtaskId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the reader and releases all resources.StoppableChangeEventSourceContextgetChangeEventSourceContext()ExecutorServicegetExecutorService()booleanisFinished()Return the current split of the reader is finished or not.Iterator<SourceRecords>pollSplitRecords()Reads records from MySQL.voidstopBinlogReadTask()voidsubmitSplit(MySqlSplit mySqlSplit)Add to split to read, this should call only the when reader is idle.
-
-
-
Constructor Detail
-
BinlogSplitReader
public BinlogSplitReader(MySqlSourceConfig sourceConfig, int subtaskId)
-
BinlogSplitReader
public BinlogSplitReader(StatefulTaskContext statefulTaskContext, int subtaskId)
-
-
Method Detail
-
submitSplit
public void submitSplit(MySqlSplit mySqlSplit)
Description copied from interface:DebeziumReaderAdd to split to read, this should call only the when reader is idle.- Specified by:
submitSplitin interfaceDebeziumReader<SourceRecords,MySqlSplit>
-
isFinished
public boolean isFinished()
Description copied from interface:DebeziumReaderReturn the current split of the reader is finished or not.- Specified by:
isFinishedin interfaceDebeziumReader<SourceRecords,MySqlSplit>
-
pollSplitRecords
@Nullable public Iterator<SourceRecords> pollSplitRecords() throws InterruptedException
Description copied from interface:DebeziumReaderReads records from MySQL. The method should return null when reaching the end of the split, the emptyIteratorwill be returned if the data of split is on pulling.- Specified by:
pollSplitRecordsin interfaceDebeziumReader<SourceRecords,MySqlSplit>- Throws:
InterruptedException
-
close
public void close()
Description copied from interface:DebeziumReaderClose the reader and releases all resources.- Specified by:
closein interfaceDebeziumReader<SourceRecords,MySqlSplit>
-
stopBinlogReadTask
public void stopBinlogReadTask()
-
getExecutorService
@VisibleForTesting public ExecutorService getExecutorService()
-
getChangeEventSourceContext
@VisibleForTesting public StoppableChangeEventSourceContext getChangeEventSourceContext()
-
-