Skip to content

Commit 6afa658

Browse files
committed
Rename 'qualify.table.names' to 'table.names.qualify'
1 parent c640f4a commit 6afa658

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

src/integrationTest/java/io/aiven/kafka/connect/jdbc/postgres/UnqualifiedTableNamesIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ private Map<String, String> basicSourceConnectorConfig() {
182182
final Map<String, String> config = super.basicConnectorConfig();
183183
config.put("name", CONNECTOR_NAME);
184184
config.put("topic.prefix", "");
185-
config.put("qualify.table.names", "false");
185+
config.put("table.names.qualify", "false");
186186
config.put("poll.interval.ms", "1000"); // Poll quickly for shorter tests
187187
config.put("whitelist", TABLE);
188188
config.put("connector.class", JdbcSourceConnector.class.getName());

src/main/java/io/aiven/connect/jdbc/JdbcSourceConnector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public void start(final Map<String, String> properties) throws ConnectException
103103
Set<String> whitelistSet = whitelist.isEmpty() ? null : new HashSet<>(whitelist);
104104
final List<String> blacklist = config.getList(JdbcSourceConnectorConfig.TABLE_BLACKLIST_CONFIG);
105105
final Set<String> blacklistSet = blacklist.isEmpty() ? null : new HashSet<>(blacklist);
106-
final boolean qualifyTableNames = config.getBoolean(JdbcSourceConnectorConfig.QUALIFY_TABLE_NAMES_CONFIG);
106+
final boolean qualifyTableNames = config.getBoolean(JdbcSourceConnectorConfig.TABLE_NAMES_QUALIFY_CONFIG);
107107

108108
if (whitelistSet != null && blacklistSet != null) {
109109
throw new ConnectException(JdbcSourceConnectorConfig.TABLE_WHITELIST_CONFIG + " and "

src/main/java/io/aiven/connect/jdbc/source/JdbcSourceConnectorConfig.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,15 @@ public class JdbcSourceConnectorConfig extends JdbcConfig {
263263
private static final String TABLE_TYPE_DISPLAY = "Table Types";
264264

265265

266-
public static final String QUALIFY_TABLE_NAMES_CONFIG = "qualify.table.names";
267-
private static final String QUALIFY_TABLE_NAMES_DOC =
266+
public static final String TABLE_NAMES_QUALIFY_CONFIG = "table.names.qualify";
267+
private static final String TABLE_NAMES_QUALIFY_DOC =
268268
"Whether to use fully-qualified table names when querying the database. If disabled, "
269269
+ "queries will be performed with unqualified table names. This may be useful if the "
270270
+ "database has been configured with a search path to automatically direct unqualified "
271271
+ "queries to the correct table when there are multiple tables available with the same "
272272
+ "unqualified name";
273-
public static final boolean QUALIFY_TABLE_NAMES_DEFAULT = true;
274-
private static final String QUALIFY_TABLE_NAMES_DISPLAY = "Qualify table names";
273+
public static final boolean TABLE_NAMES_QUALIFY_DEFAULT = true;
274+
private static final String TABLE_NAMES_QUALIFY_DISPLAY = "Qualify table names";
275275

276276
public static ConfigDef baseConfigDef() {
277277
final ConfigDef config = new ConfigDef();
@@ -373,15 +373,15 @@ private static final void addDatabaseOptions(final ConfigDef config) {
373373
NUMERIC_MAPPING_DISPLAY,
374374
NUMERIC_MAPPING_RECOMMENDER
375375
).define(
376-
QUALIFY_TABLE_NAMES_CONFIG,
376+
TABLE_NAMES_QUALIFY_CONFIG,
377377
Type.BOOLEAN,
378-
QUALIFY_TABLE_NAMES_DEFAULT,
378+
TABLE_NAMES_QUALIFY_DEFAULT,
379379
Importance.LOW,
380-
QUALIFY_TABLE_NAMES_DOC,
380+
TABLE_NAMES_QUALIFY_DOC,
381381
DATABASE_GROUP,
382382
++orderInGroup,
383383
Width.SHORT,
384-
QUALIFY_TABLE_NAMES_DISPLAY
384+
TABLE_NAMES_QUALIFY_DISPLAY
385385
);
386386

387387
defineDbTimezone(config, ++orderInGroup);

src/main/java/io/aiven/connect/jdbc/source/TableMonitorThread.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import org.slf4j.Logger;
3939
import org.slf4j.LoggerFactory;
4040

41-
import static io.aiven.connect.jdbc.source.JdbcSourceConnectorConfig.QUALIFY_TABLE_NAMES_CONFIG;
41+
import static io.aiven.connect.jdbc.source.JdbcSourceConnectorConfig.TABLE_NAMES_QUALIFY_CONFIG;
4242

4343
/**
4444
* Thread that monitors the database for changes to the set of tables in the database that this
@@ -134,7 +134,7 @@ public synchronized List<TableId> tables() {
134134
+ "JDBC Source connector fails to start when it detects duplicate table name "
135135
+ "configurations. Update the connector's " + configText + " config to include exactly "
136136
+ "one table in each of the tables listed below or, to use unqualified table names, consider "
137-
+ "setting " + QUALIFY_TABLE_NAMES_CONFIG + " to 'false'.\n\t";
137+
+ "setting " + TABLE_NAMES_QUALIFY_CONFIG + " to 'false'.\n\t";
138138
throw new ConnectException(msg + duplicates.values());
139139
}
140140
return tables;

src/test/java/io/aiven/connect/jdbc/JdbcSourceConnectorTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public void testPartitioningManyTables() throws Exception {
174174

175175
@Test
176176
public void testPartitioningUnqualifiedTables() throws Exception {
177-
connProps.put(JdbcSourceConnectorConfig.QUALIFY_TABLE_NAMES_CONFIG, "false");
177+
connProps.put(JdbcSourceConnectorConfig.TABLE_NAMES_QUALIFY_CONFIG, "false");
178178
// Tests distributing tables across multiple tasks, in this case unevenly
179179
db.createTable("test1", "id", "INT NOT NULL");
180180
db.createTable("test2", "id", "INT NOT NULL");
@@ -222,7 +222,7 @@ public void testConflictingQueryTableSettings() {
222222

223223
connector = new JdbcSourceConnector();
224224
connProps.remove(JdbcSourceConnectorConfig.QUERY_CONFIG);
225-
connProps.put(JdbcSourceConnectorConfig.QUALIFY_TABLE_NAMES_CONFIG, "false");
225+
connProps.put(JdbcSourceConnectorConfig.TABLE_NAMES_QUALIFY_CONFIG, "false");
226226
connProps.put(JdbcSourceConnectorConfig.MODE_CONFIG, JdbcSourceConnectorConfig.MODE_INCREMENTING);
227227
assertThrows(ConnectException.class, () -> connector.start(connProps));
228228

0 commit comments

Comments
 (0)