Class BinlogOffsetUtils
- java.lang.Object
-
- org.apache.flink.cdc.connectors.mysql.source.offset.BinlogOffsetUtils
-
public class BinlogOffsetUtils extends Object
Utils for handlingBinlogOffset.
-
-
Constructor Summary
Constructors Constructor Description BinlogOffsetUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BinlogOffsetinitializeEffectiveOffset(BinlogOffset offset, MySqlConnection connection, MySqlSourceConfig mySqlSourceConfig)Initialize the binlog offset according to the kind of binlog offset, so that the debezium reader could interpret it and seek the reader to the offset.static booleanisNonStoppingOffset(BinlogOffset binlogOffset)
-
-
-
Method Detail
-
initializeEffectiveOffset
public static BinlogOffset initializeEffectiveOffset(BinlogOffset offset, MySqlConnection connection, MySqlSourceConfig mySqlSourceConfig)
Initialize the binlog offset according to the kind of binlog offset, so that the debezium reader could interpret it and seek the reader to the offset.This method will be used in binlog reading phase, when the
StatefulTaskContextis being initialized to load the actual effective binlog offset.The binlog offset kind will be overridden to
BinlogOffsetKind.SPECIFICafter the initialization, as the initialized effective offset describes a specific position in binlog.Initialization strategy:
- EARLIEST: binlog filename = "", position = 0
- TIMESTAMP: set to earliest, as the current implementation is reading from the earliest offset and drop events earlier than the specified timestamp.
- LATEST: fetch the current binlog by JDBC
-
isNonStoppingOffset
public static boolean isNonStoppingOffset(BinlogOffset binlogOffset)
-
-