Skip to content

Commit

Permalink
[Chore] Remove unused JDBCDataSourceProvider (#16881)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanwenjun authored Dec 7, 2024
1 parent 28e849e commit 0d9dba2
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 414 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -69,8 +68,7 @@ public static DataSourceClient getPooledDataSourceClient(DbType dbType,
BaseConnectionParam baseConnectionParam = (BaseConnectionParam) connectionParam;
String datasourceUniqueId = DataSourceUtils.getDatasourceUniqueId(baseConnectionParam, dbType);
return POOLED_DATASOURCE_CLIENT_CACHE.get(datasourceUniqueId, () -> {
Map<String, DataSourceChannel> dataSourceChannelMap = dataSourcePluginManager.getDataSourceChannelMap();
DataSourceChannel dataSourceChannel = dataSourceChannelMap.get(dbType.getName());
DataSourceChannel dataSourceChannel = dataSourcePluginManager.getDataSourceChannel(dbType);
if (null == dataSourceChannel) {
throw new RuntimeException(String.format("datasource plugin '%s' is not found", dbType.getName()));
}
Expand All @@ -85,8 +83,7 @@ public static Connection getPooledConnection(DbType dbType,

public static AdHocDataSourceClient getAdHocDataSourceClient(DbType dbType, ConnectionParam connectionParam) {
BaseConnectionParam baseConnectionParam = (BaseConnectionParam) connectionParam;
Map<String, DataSourceChannel> dataSourceChannelMap = dataSourcePluginManager.getDataSourceChannelMap();
DataSourceChannel dataSourceChannel = dataSourceChannelMap.get(dbType.getName());
DataSourceChannel dataSourceChannel = dataSourcePluginManager.getDataSourceChannel(dbType);
if (null == dataSourceChannel) {
throw new RuntimeException(String.format("datasource plugin '%s' is not found", dbType.getName()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

import org.apache.dolphinscheduler.spi.datasource.DataSourceChannel;
import org.apache.dolphinscheduler.spi.datasource.DataSourceChannelFactory;
import org.apache.dolphinscheduler.spi.enums.DbType;
import org.apache.dolphinscheduler.spi.plugin.PrioritySPIFactory;

import java.util.Collections;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

Expand All @@ -34,8 +34,8 @@ public class DataSourcePluginManager {

private final Map<String, DataSourceChannel> datasourceChannelMap = new ConcurrentHashMap<>();

public Map<String, DataSourceChannel> getDataSourceChannelMap() {
return Collections.unmodifiableMap(datasourceChannelMap);
public DataSourceChannel getDataSourceChannel(final DbType dbType) {
return datasourceChannelMap.get(dbType.getName());
}

public void installPlugin() {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 0d9dba2

Please sign in to comment.