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

DBZ-7497 Add a configuration based snapshot modes configurable via connector properties #145

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ public enum SnapshotMode implements EnumeratedValue {
*/
WHEN_NEEDED("when_needed"),

/**
* Allows over snapshots by setting connectors properties prefixed with 'snapshot.mode.configuration.based'.
*/
CONFIGURATION_BASED("configuration_based"),

/**
* Inject a custom snapshotter, which allows for more control over snapshots.
*/
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/io/debezium/connector/db2/Db2ConnectorIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ public void testTableIncludeList() throws Exception {
final int TABLES = 1;
final int ID_START = 10;
final Configuration config = TestHelper.defaultConfig()
.with(Db2ConnectorConfig.SNAPSHOT_MODE, SnapshotMode.SCHEMA_ONLY)
.with(Db2ConnectorConfig.SNAPSHOT_MODE, SnapshotMode.NO_DATA)
.with(Db2ConnectorConfig.TABLE_INCLUDE_LIST, "db2inst1.tableb")
.build();
connection.execute(
Expand Down Expand Up @@ -737,7 +737,7 @@ public void testEmptySchemaWarningAfterApplyingFilters() throws Exception {
@FixFor("DBZ-775")
public void shouldConsumeEventsWithMaskedAndTruncatedColumns() throws Exception {
final Configuration config = TestHelper.defaultConfig()
.with(Db2ConnectorConfig.SNAPSHOT_MODE, SnapshotMode.SCHEMA_ONLY)
.with(Db2ConnectorConfig.SNAPSHOT_MODE, SnapshotMode.NO_DATA)
.with("column.mask.with.12.chars", "DB2INST1.MASKED_HASHED_COLUMN_TABLE.NAME")
.with("column.mask.hash.SHA-256.with.salt.CzQMA0cB5K", "DB2INST1.MASKED_HASHED_COLUMN_TABLE.NAME2,DB2INST1.MASKED_HASHED_COLUMN_TABLE.NAME3")
.with("column.truncate.to.4.chars", "DB2INST1.TRUNCATED_COLUMN_TABLE.NAME")
Expand Down Expand Up @@ -792,7 +792,7 @@ record = tableB.get(0);
@FixFor("DBZ-775")
public void shouldRewriteIdentityKey() throws Exception {
final Configuration config = TestHelper.defaultConfig()
.with(Db2ConnectorConfig.SNAPSHOT_MODE, SnapshotMode.SCHEMA_ONLY)
.with(Db2ConnectorConfig.SNAPSHOT_MODE, SnapshotMode.NO_DATA)
.with(Db2ConnectorConfig.MSG_KEY_COLUMNS, "(.*).tablea:id,cola")
.build();

Expand Down Expand Up @@ -823,7 +823,7 @@ public void shouldRewriteIdentityKey() throws Exception {
@FixFor({ "DBZ-1916", "DBZ-1830" })
public void shouldPropagateSourceTypeByDatatype() throws Exception {
final Configuration config = TestHelper.defaultConfig()
.with(Db2ConnectorConfig.SNAPSHOT_MODE, SnapshotMode.SCHEMA_ONLY)
.with(Db2ConnectorConfig.SNAPSHOT_MODE, SnapshotMode.NO_DATA)
.with("datatype.propagate.source.type", ".+\\.NUMERIC,.+\\.VARCHAR,.+\\.DECIMAL,.+\\.REAL")
.build();

Expand Down