Skip to content

Commit

Permalink
[Fix-1672] [cdc] Fix failed to get metadata due to jdbc session timeo…
Browse files Browse the repository at this point in the history
…ut in CDCSOURCE (DataLinkDC#2471)

Co-authored-by: wenmo <[email protected]>
  • Loading branch information
aiwenmo and aiwenmo authored Nov 1, 2023
1 parent b75ed15 commit cbd98dd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public TableResult build(Executor executor) {
final List<String> schemaTableNameList = new ArrayList<>();
if (SplitUtil.isEnabled(cdcSource.getSplit())) {
DriverConfig driverConfig = DriverConfig.build(cdcBuilder.parseMetaDataConfig());
Driver driver = Driver.build(driverConfig);
Driver driver = Driver.buildNewConnection(driverConfig);

// 这直接传正则过去
schemaTableNameList.addAll(tableRegList.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ static Driver build(DriverConfig config) {
}
}

static Driver buildNewConnection(DriverConfig config) {
Optional<Driver> optionalDriver = Driver.get(config);
if (!optionalDriver.isPresent()) {
throw new MetaDataException("Missing " + config.getType() + " dependency package: dinky-metadata-"
+ config.getType().toLowerCase() + ".jar");
}
return optionalDriver.get().connect();
}

static Driver buildUnconnected(DriverConfig config) {
synchronized (Driver.class) {
Optional<Driver> optionalDriver = Driver.get(config);
Expand Down

0 comments on commit cbd98dd

Please sign in to comment.