From 5b178d05a534bb194d55368810b2bfa1515cf080 Mon Sep 17 00:00:00 2001 From: Matej Marconak Date: Thu, 22 Aug 2024 10:02:34 +0200 Subject: [PATCH] feat: do not use the CD_OLD_SYNCHPOINT as the stop lsn parameter --- .../java/io/debezium/connector/db2/Db2ChangeTable.java | 9 ++++----- .../java/io/debezium/connector/db2/Db2Connection.java | 2 -- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/java/io/debezium/connector/db2/Db2ChangeTable.java b/src/main/java/io/debezium/connector/db2/Db2ChangeTable.java index 33429e8..8df7b20 100644 --- a/src/main/java/io/debezium/connector/db2/Db2ChangeTable.java +++ b/src/main/java/io/debezium/connector/db2/Db2ChangeTable.java @@ -26,22 +26,21 @@ public class Db2ChangeTable extends ChangeTable { /** * A LSN to which the data in the change table are relevant */ - private Lsn stopLsn; + private Lsn stopLsn = Lsn.NULL; /** * The table in the CDC schema that captures changes, suitably quoted for Db2 */ private final String db2CaptureInstance; - public Db2ChangeTable(TableId sourceTableId, String captureInstance, int changeTableObjectId, Lsn startLsn, Lsn stopLsn, String tableCdcSchema) { + public Db2ChangeTable(TableId sourceTableId, String captureInstance, int changeTableObjectId, Lsn startLsn, String tableCdcSchema) { super(captureInstance, sourceTableId, resolveChangeTableId(sourceTableId, captureInstance, tableCdcSchema), changeTableObjectId); this.startLsn = startLsn; - this.stopLsn = stopLsn; this.db2CaptureInstance = Db2ObjectNameQuoter.quoteNameIfNecessary(captureInstance); } - public Db2ChangeTable(String captureInstance, int changeTableObjectId, Lsn startLsn, Lsn stopLsn, String tableCdcSchema) { - this(null, captureInstance, changeTableObjectId, startLsn, stopLsn, tableCdcSchema); + public Db2ChangeTable(String captureInstance, int changeTableObjectId, Lsn startLsn, String tableCdcSchema) { + this(null, captureInstance, changeTableObjectId, startLsn, tableCdcSchema); } public String getCaptureInstance() { diff --git a/src/main/java/io/debezium/connector/db2/Db2Connection.java b/src/main/java/io/debezium/connector/db2/Db2Connection.java index 95220ab..580aeef 100644 --- a/src/main/java/io/debezium/connector/db2/Db2Connection.java +++ b/src/main/java/io/debezium/connector/db2/Db2Connection.java @@ -272,7 +272,6 @@ public Set listOfChangeTables() throws SQLException { rs.getString(4), rs.getInt(9), Lsn.valueOf(rs.getBytes(5)), - Lsn.valueOf(rs.getBytes(6)), connectorConfig.getCdcChangeTablesSchema() )); @@ -295,7 +294,6 @@ public Set listOfNewChangeTables(Lsn fromLsn, Lsn toLsn) throws rs.getString(2), rs.getInt(1), Lsn.valueOf(rs.getBytes(3)), - Lsn.valueOf(rs.getBytes(4)), connectorConfig.getCdcChangeTablesSchema())); } return changeTables;