Skip to content

Commit

Permalink
DBZ-3697 Adding metadata to fields for SQLServerConnector
Browse files Browse the repository at this point in the history
  • Loading branch information
mdrillin authored and rk3rn3r committed Dec 2, 2021
1 parent b72c03d commit b922e34
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ public static SnapshotIsolationMode parse(String value, String defaultValue) {
public static final Field INSTANCE = Field.create(DATABASE_CONFIG_PREFIX + SqlServerConnection.INSTANCE_NAME)
.withDisplayName("Instance name")
.withType(Type.STRING)
.withGroup(Field.createGroupEntry(Field.Group.CONNECTION, 8))
.withImportance(Importance.LOW)
.withValidation(Field::isOptional)
.withDescription("The SQL Server instance name");
Expand All @@ -236,6 +237,7 @@ public static SnapshotIsolationMode parse(String value, String defaultValue) {
public static final Field DATABASE_NAMES = Field.create(DATABASE_CONFIG_PREFIX + "names")
.withDisplayName("Databases")
.withType(Type.LIST)
.withGroup(Field.createGroupEntry(Field.Group.CONNECTION, 7))
.withWidth(Width.MEDIUM)
.withImportance(Importance.HIGH)
.withValidation(SqlServerConnectorConfig::validateDatabaseNames)
Expand Down Expand Up @@ -276,6 +278,7 @@ public static SnapshotIsolationMode parse(String value, String defaultValue) {
.withDisplayName("Max transactions per iteration")
.withDefault(DEFAULT_MAX_TRANSACTIONS_PER_ITERATION)
.withType(Type.INT)
.withGroup(Field.createGroupEntry(Field.Group.CONNECTOR_ADVANCED, 1))
.withImportance(Importance.MEDIUM)
.withValidation(Field::isNonNegativeInteger)
.withDescription("This property can be used to reduce the connector memory usage footprint when changes are streamed from multiple tables per database.");
Expand All @@ -284,6 +287,7 @@ public static SnapshotIsolationMode parse(String value, String defaultValue) {
.withDisplayName("Source timestamp mode")
.withDefault(SourceTimestampMode.COMMIT.getValue())
.withType(Type.STRING)
.withGroup(Field.createGroupEntry(Field.Group.CONNECTOR_ADVANCED, 0))
.withWidth(Width.SHORT)
.withImportance(Importance.LOW)
.withDescription("Configures the criteria of the attached timestamp within the source record (ts_ms)." +
Expand All @@ -296,6 +300,7 @@ public static SnapshotIsolationMode parse(String value, String defaultValue) {
public static final Field SNAPSHOT_MODE = Field.create("snapshot.mode")
.withDisplayName("Snapshot mode")
.withEnum(SnapshotMode.class, SnapshotMode.INITIAL)
.withGroup(Field.createGroupEntry(Field.Group.CONNECTOR_SNAPSHOT, 0))
.withWidth(Width.SHORT)
.withImportance(Importance.LOW)
.withDescription("The criteria for running a snapshot upon startup of the connector. "
Expand All @@ -306,6 +311,7 @@ public static SnapshotIsolationMode parse(String value, String defaultValue) {
public static final Field SNAPSHOT_ISOLATION_MODE = Field.create("snapshot.isolation.mode")
.withDisplayName("Snapshot isolation mode")
.withEnum(SnapshotIsolationMode.class, SnapshotIsolationMode.REPEATABLE_READ)
.withGroup(Field.createGroupEntry(Field.Group.CONNECTOR_SNAPSHOT, 1))
.withWidth(Width.SHORT)
.withImportance(Importance.LOW)
.withDescription("Controls which transaction isolation level is used and how long the connector locks the monitored tables. "
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright Debezium Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/

package io.debezium.connector.sqlserver;

import org.junit.Before;

import io.debezium.config.AbstractFieldTest;

public class FieldTest extends AbstractFieldTest {

@Before
public void before() {
setAllConnectorFields(SqlServerConnectorConfig.ALL_FIELDS);
}

}

0 comments on commit b922e34

Please sign in to comment.