diff --git a/src/main/java/io/debezium/connector/db2/Db2SnapshotChangeEventSource.java b/src/main/java/io/debezium/connector/db2/Db2SnapshotChangeEventSource.java index 8b23a1e..b0edb3b 100644 --- a/src/main/java/io/debezium/connector/db2/Db2SnapshotChangeEventSource.java +++ b/src/main/java/io/debezium/connector/db2/Db2SnapshotChangeEventSource.java @@ -51,41 +51,6 @@ public Db2SnapshotChangeEventSource(Db2ConnectorConfig connectorConfig, MainConn this.jdbcConnection = connectionFactory.mainConnection(); } - @Override - public SnapshottingTask getSnapshottingTask(Db2Partition partition, Db2OffsetContext previousOffset) { - - final Snapshotter snapshotter = snapshotterService.getSnapshotter(); - - List dataCollectionsToBeSnapshotted = connectorConfig.getDataCollectionsToBeSnapshotted(); - Map snapshotSelectOverridesByTable = connectorConfig.getSnapshotSelectOverridesByTable().entrySet().stream() - .collect(Collectors.toMap(e -> e.getKey().identifier(), Map.Entry::getValue)); - - boolean offsetExists = previousOffset != null; - boolean snapshotInProgress = false; - - if (offsetExists) { - snapshotInProgress = previousOffset.isSnapshotRunning(); - } - - if (offsetExists && !previousOffset.isSnapshotRunning()) { - LOGGER.info("A previous offset indicating a completed snapshot has been found. Neither schema nor data will be snapshotted."); - } - - boolean shouldSnapshotSchema = snapshotter.shouldSnapshotSchema(offsetExists, snapshotInProgress); - boolean shouldSnapshotData = snapshotter.shouldSnapshotData(offsetExists, snapshotInProgress); - - if (shouldSnapshotData && shouldSnapshotSchema) { - LOGGER.info("According to the connector configuration both schema and data will be snapshot."); - } - else if (shouldSnapshotSchema) { - LOGGER.info("According to the connector configuration only schema will be snapshot."); - } - - return new SnapshottingTask(shouldSnapshotSchema, shouldSnapshotData, - dataCollectionsToBeSnapshotted, snapshotSelectOverridesByTable, - false); - } - @Override protected SnapshotContext prepare(Db2Partition partition, boolean onDemand) { return new Db2SnapshotContext(partition, jdbcConnection.getRealDatabaseName(), onDemand);