Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-35300][cdc][mysql] Improve MySqlStreamingChangeEventSource to skip null events in event deserializer #3299

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,13 @@
* Copied from Debezium project(1.9.8.Final) to fix
* https://github.com/ververica/flink-cdc-connectors/issues/1944.
*
* <p>Line 1427-1433 : Adjust GTID merging logic to support recovering from job which previously
* <p>Line 263-265: Skip null events in event deserializer to compatible with {@link
* com.github.shyiko.mysql.binlog.BinaryLogFileReader} which reads local binlog files.
*
* <p>Line 1433-1439 : Adjust GTID merging logic to support recovering from job which previously
* specifying starting offset on start.
*
* <p>Line 1485 : Add more error details for some exceptions.
* <p>Line 1491 : Add more error details for some exceptions.
*/
public class MySqlStreamingChangeEventSource
implements StreamingChangeEventSource<MySqlPartition, MySqlOffsetContext> {
Expand Down Expand Up @@ -257,6 +260,9 @@ public Event nextEvent(ByteArrayInputStream inputStream) throws IOException {
try {
// Delegate to the superclass ...
Event event = super.nextEvent(inputStream);
if (event == null) {
return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no logic to go to this place because currently we don't need to read the binlog file on the local path using com.github.shyiko.mysql.binlog.BinaryLogFileReader.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, I also did't see why we need to skip the null events

}

// We have to record the most recent TableMapEventData for each table
// number for our custom deserializers ...
Expand Down