Skip to content

Commit 08f7e6e

Browse files
committed
add verification and update docs
1 parent e636139 commit 08f7e6e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

docs/content/connectors/oceanbase-cdc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Connector Options
9797
The OceanBase CDC Connector contains some options for both sql and stream api as the following sheet.
9898

9999
*Note*: The connector supports two ways to specify the table list to listen to, and will get the union of the results when both way are used at the same time.
100-
1. Use `database-name` and `table-name` to match database and table names in regex. Can only be used in `initial` startup mode.
100+
1. Use `database-name` and `table-name` to match database and table names in regex. As the `obcdc` (former `liboblog`) only supports `fnmatch` now, we can't use regex directly to filter change events, so these two options can only be used in `initial` startup mode.
101101
2. Use `table-list` to match the exact value of database and table names.
102102
103103
<div class="highlight">

flink-connector-oceanbase-cdc/src/main/java/com/ververica/cdc/connectors/oceanbase/OceanBaseSource.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,17 @@ public SourceFunction<T> build() {
188188
startupMode + " mode is not supported.");
189189
}
190190

191+
if (StringUtils.isNotEmpty(databaseName) || StringUtils.isNotEmpty(tableName)) {
192+
if (StringUtils.isEmpty(databaseName) || StringUtils.isEmpty(tableName)) {
193+
throw new IllegalArgumentException(
194+
"'database-name' and 'table-name' should be configured at the same time");
195+
}
196+
} else {
197+
checkNotNull(
198+
tableList,
199+
"'database-name', 'table-name' or 'table-list' should be configured");
200+
}
201+
191202
if (serverTimeZone == null) {
192203
serverTimeZone = "UTC";
193204
}

0 commit comments

Comments
 (0)