You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by ji...@apache.org on 2022/01/14 15:21:35 UTC
[shardingsphere] branch master updated: Remove useless DataSourcePoolCreatorUtil.getDataSourceProperties() (#14791)
This is an automated email from the ASF dual-hosted git repository.
jianglongtao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new df2e4be Remove useless DataSourcePoolCreatorUtil.getDataSourceProperties() (#14791)
df2e4be is described below
commit df2e4bea098c70b2abf5a5b115ae385fc728c4c8
Author: Liang Zhang <te...@163.com>
AuthorDate: Fri Jan 14 23:19:10 2022 +0800
Remove useless DataSourcePoolCreatorUtil.getDataSourceProperties() (#14791)
---
.../pool/creator/DataSourcePoolCreatorUtil.java | 22 +---------
.../creator/DataSourcePoolCreatorUtilTest.java | 48 ----------------------
.../datasource/props/DataSourcePropertiesTest.java | 5 +--
.../persist/MetaDataPersistServiceTest.java | 12 +++---
.../impl/DataSourceMetaDataPersistServiceTest.java | 8 ++--
.../cluster/ClusterContextManagerBuilder.java | 4 +-
.../ClusterContextManagerCoordinatorTest.java | 14 +++----
.../StandaloneContextManagerBuilder.java | 4 +-
8 files changed, 24 insertions(+), 93 deletions(-)
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/datasource/pool/creator/DataSourcePoolCreatorUtil.java b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/datasource/pool/creator/DataSourcePoolCreatorUtil.java
index 862432c..d6d3d2d 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/datasource/pool/creator/DataSourcePoolCreatorUtil.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/datasource/pool/creator/DataSourcePoolCreatorUtil.java
@@ -35,26 +35,6 @@ import java.util.stream.Collectors;
public final class DataSourcePoolCreatorUtil {
/**
- * Get data source.
- *
- * @param dataSourceProps data source properties
- * @return data source
- */
- public static DataSource getDataSource(final DataSourceProperties dataSourceProps) {
- return DataSourcePoolCreator.create(dataSourceProps);
- }
-
- /**
- * Get data source properties.
- *
- * @param dataSource data source
- * @return data source properties
- */
- public static DataSourceProperties getDataSourceProperties(final DataSource dataSource) {
- return DataSourcePropertiesCreator.create(dataSource);
- }
-
- /**
* Get data source map.
*
* @param dataSourcePropsMap data source configuration map
@@ -73,6 +53,6 @@ public final class DataSourcePoolCreatorUtil {
*/
public static Map<String, DataSourceProperties> getDataSourcePropertiesMap(final Map<String, DataSource> dataSourceMap) {
return dataSourceMap.entrySet().stream().collect(
- Collectors.toMap(Entry::getKey, entry -> getDataSourceProperties(entry.getValue()), (oldValue, currentValue) -> oldValue, LinkedHashMap::new));
+ Collectors.toMap(Entry::getKey, entry -> DataSourcePropertiesCreator.create(entry.getValue()), (oldValue, currentValue) -> oldValue, LinkedHashMap::new));
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/pool/creator/DataSourcePoolCreatorUtilTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/pool/creator/DataSourcePoolCreatorUtilTest.java
index 8f0a15c..e41e1d4 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/pool/creator/DataSourcePoolCreatorUtilTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/pool/creator/DataSourcePoolCreatorUtilTest.java
@@ -24,14 +24,12 @@ import org.apache.shardingsphere.test.mock.MockedDataSource;
import org.junit.Test;
import javax.sql.DataSource;
-import java.sql.SQLException;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
public final class DataSourcePoolCreatorUtilTest {
@@ -52,52 +50,6 @@ public final class DataSourcePoolCreatorUtilTest {
assertNotNull(actual.get("ds_1"));
}
- @Test
- public void assertGetDataSourceConfiguration() throws SQLException {
- HikariDataSource actualDataSource = new HikariDataSource();
- actualDataSource.setDriverClassName(MockedDataSource.class.getName());
- actualDataSource.setJdbcUrl("jdbc:mock://127.0.0.1/foo_ds");
- actualDataSource.setUsername("root");
- actualDataSource.setPassword("root");
- actualDataSource.setLoginTimeout(1);
- DataSourceProperties actual = DataSourcePoolCreatorUtil.getDataSourceProperties(actualDataSource);
- assertThat(actual.getDataSourceClassName(), is(HikariDataSource.class.getName()));
- assertThat(actual.getProps().get("driverClassName").toString(), is(MockedDataSource.class.getCanonicalName()));
- assertThat(actual.getProps().get("jdbcUrl").toString(), is("jdbc:mock://127.0.0.1/foo_ds"));
- assertThat(actual.getProps().get("username").toString(), is("root"));
- assertThat(actual.getProps().get("password").toString(), is("root"));
- assertNull(actual.getProps().get("loginTimeout"));
- }
-
- @Test
- public void assertCreate() {
- HikariDataSource actual = (HikariDataSource) DataSourcePoolCreator.create(createDataSourceProperties());
- assertThat(actual.getDriverClassName(), is(MockedDataSource.class.getCanonicalName()));
- assertThat(actual.getJdbcUrl(), is("jdbc:mock://127.0.0.1/foo_ds"));
- assertThat(actual.getUsername(), is("root"));
- assertThat(actual.getPassword(), is("root"));
- assertThat(actual.getMaximumPoolSize(), is(50));
- assertThat(actual.getMinimumIdle(), is(1));
- assertThat(actual.getMaxLifetime(), is(60000L));
- }
-
- @Test
- public void assertCreateWithIntegerPassword() {
- Map<String, Object> props = new HashMap<>(16, 1);
- props.put("driverClassName", MockedDataSource.class.getCanonicalName());
- props.put("jdbcUrl", "jdbc:mock://127.0.0.1/foo_ds");
- props.put("username", "root");
- props.put("password", 123);
- props.put("loginTimeout", "5000");
- DataSourceProperties dataSourceProps = new DataSourceProperties(HikariDataSource.class.getName());
- dataSourceProps.getProps().putAll(props);
- HikariDataSource actual = (HikariDataSource) DataSourcePoolCreator.create(dataSourceProps);
- assertThat(actual.getDriverClassName(), is(MockedDataSource.class.getCanonicalName()));
- assertThat(actual.getJdbcUrl(), is("jdbc:mock://127.0.0.1/foo_ds"));
- assertThat(actual.getUsername(), is("root"));
- assertThat(actual.getPassword(), is("123"));
- }
-
private Map<String, DataSource> createDataSourceMap() {
Map<String, DataSource> result = new LinkedHashMap<>(2, 1);
result.put("ds_0", createDataSource("ds_0"));
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/props/DataSourcePropertiesTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/props/DataSourcePropertiesTest.java
index 36726d4..a690ae6 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/props/DataSourcePropertiesTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/datasource/props/DataSourcePropertiesTest.java
@@ -19,7 +19,6 @@ package org.apache.shardingsphere.infra.config.datasource.props;
import com.zaxxer.hikari.HikariDataSource;
import org.apache.commons.dbcp2.BasicDataSource;
-import org.apache.shardingsphere.infra.config.datasource.pool.creator.DataSourcePoolCreatorUtil;
import org.apache.shardingsphere.test.mock.MockedDataSource;
import org.junit.Rule;
import org.junit.Test;
@@ -53,7 +52,7 @@ public final class DataSourcePropertiesTest {
actualDataSource.setJdbcUrl("jdbc:mock://127.0.0.1/foo_ds");
actualDataSource.setUsername("root");
actualDataSource.setPassword("root");
- DataSourceProperties actual = DataSourcePoolCreatorUtil.getDataSourceProperties(actualDataSource);
+ DataSourceProperties actual = DataSourcePropertiesCreator.create(actualDataSource);
actual.addPropertySynonym("url", "jdbcUrl");
actual.addPropertySynonym("user", "username");
assertThat(actual.getDataSourceClassName(), is(HikariDataSource.class.getName()));
@@ -132,7 +131,7 @@ public final class DataSourcePropertiesTest {
actualDataSource.setUsername("root");
actualDataSource.setPassword("root");
actualDataSource.setConnectionInitSqls(Arrays.asList("set names utf8mb4;", "set names utf8;"));
- DataSourceProperties actual = DataSourcePoolCreatorUtil.getDataSourceProperties(actualDataSource);
+ DataSourceProperties actual = DataSourcePropertiesCreator.create(actualDataSource);
assertThat(actual.getDataSourceClassName(), is(BasicDataSource.class.getName()));
assertThat(actual.getProps().get("driverClassName").toString(), is(MockedDataSource.class.getCanonicalName()));
assertThat(actual.getProps().get("url").toString(), is("jdbc:mock://127.0.0.1/foo_ds"));
diff --git a/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/MetaDataPersistServiceTest.java b/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/MetaDataPersistServiceTest.java
index b44557c..a5be652 100644
--- a/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/MetaDataPersistServiceTest.java
+++ b/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/MetaDataPersistServiceTest.java
@@ -20,15 +20,15 @@ package org.apache.shardingsphere.mode.metadata.persist;
import lombok.SneakyThrows;
import org.apache.shardingsphere.infra.config.RuleConfiguration;
import org.apache.shardingsphere.infra.config.datasource.props.DataSourceProperties;
-import org.apache.shardingsphere.infra.config.datasource.pool.creator.DataSourcePoolCreatorUtil;
+import org.apache.shardingsphere.infra.config.datasource.props.DataSourcePropertiesCreator;
import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
-import org.apache.shardingsphere.mode.persist.PersistRepository;
+import org.apache.shardingsphere.infra.yaml.config.swapper.YamlRuleConfigurationSwapperEngine;
+import org.apache.shardingsphere.infra.yaml.engine.YamlEngine;
import org.apache.shardingsphere.mode.metadata.persist.service.impl.DataSourcePersistService;
import org.apache.shardingsphere.mode.metadata.persist.service.impl.GlobalRulePersistService;
import org.apache.shardingsphere.mode.metadata.persist.service.impl.PropertiesPersistService;
import org.apache.shardingsphere.mode.metadata.persist.service.impl.SchemaRulePersistService;
-import org.apache.shardingsphere.infra.yaml.config.swapper.YamlRuleConfigurationSwapperEngine;
-import org.apache.shardingsphere.infra.yaml.engine.YamlEngine;
+import org.apache.shardingsphere.mode.persist.PersistRepository;
import org.apache.shardingsphere.test.mock.MockedDataSource;
import org.junit.Before;
import org.junit.Test;
@@ -102,8 +102,8 @@ public final class MetaDataPersistServiceTest {
}
private Map<String, DataSourceProperties> createDataSourcePropertiesMap() {
- return createDataSourceMap().entrySet().stream().collect(Collectors.toMap(Entry::getKey, entry ->
- DataSourcePoolCreatorUtil.getDataSourceProperties(entry.getValue()), (oldValue, currentValue) -> oldValue, LinkedHashMap::new));
+ return createDataSourceMap().entrySet().stream().collect(Collectors.toMap(Entry::getKey, entry ->
+ DataSourcePropertiesCreator.create(entry.getValue()), (oldValue, currentValue) -> oldValue, LinkedHashMap::new));
}
private Map<String, DataSource> createDataSourceMap() {
diff --git a/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/service/impl/DataSourceMetaDataPersistServiceTest.java b/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/service/impl/DataSourceMetaDataPersistServiceTest.java
index e922c60..ada0fc6 100644
--- a/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/service/impl/DataSourceMetaDataPersistServiceTest.java
+++ b/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/service/impl/DataSourceMetaDataPersistServiceTest.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.mode.metadata.persist.service.impl;
import lombok.SneakyThrows;
import org.apache.commons.lang3.StringUtils;
import org.apache.shardingsphere.infra.config.datasource.props.DataSourceProperties;
-import org.apache.shardingsphere.infra.config.datasource.pool.creator.DataSourcePoolCreatorUtil;
+import org.apache.shardingsphere.infra.config.datasource.props.DataSourcePropertiesCreator;
import org.apache.shardingsphere.mode.persist.PersistRepository;
import org.apache.shardingsphere.test.mock.MockedDataSource;
import org.junit.Test;
@@ -55,8 +55,8 @@ public final class DataSourceMetaDataPersistServiceTest {
when(repository.get("/metadata/foo_db/dataSources")).thenReturn(readDataSourceYaml("yaml/persist/data-source.yaml"));
Map<String, DataSourceProperties> actual = new DataSourcePersistService(repository).load("foo_db");
assertThat(actual.size(), is(2));
- assertDataSourceProperties(actual.get("ds_0"), DataSourcePoolCreatorUtil.getDataSourceProperties(createDataSource("ds_0")));
- assertDataSourceProperties(actual.get("ds_1"), DataSourcePoolCreatorUtil.getDataSourceProperties(createDataSource("ds_1")));
+ assertDataSourceProperties(actual.get("ds_0"), DataSourcePropertiesCreator.create(createDataSource("ds_0")));
+ assertDataSourceProperties(actual.get("ds_1"), DataSourcePropertiesCreator.create(createDataSource("ds_1")));
}
@SneakyThrows({IOException.class, URISyntaxException.class})
@@ -82,7 +82,7 @@ public final class DataSourceMetaDataPersistServiceTest {
@Test
public void assertAppend() {
- new DataSourcePersistService(repository).append("foo_db", Collections.singletonMap("foo_ds", DataSourcePoolCreatorUtil.getDataSourceProperties(createDataSource("foo_ds"))));
+ new DataSourcePersistService(repository).append("foo_db", Collections.singletonMap("foo_ds", DataSourcePropertiesCreator.create(createDataSource("foo_ds"))));
String expected = readDataSourceYaml("yaml/persist/data-source-foo.yaml");
verify(repository).persist("/metadata/foo_db/dataSources", expected);
}
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/ClusterContextManagerBuilder.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/ClusterContextManagerBuilder.java
index 35efdee..9e04a54 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/ClusterContextManagerBuilder.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/ClusterContextManagerBuilder.java
@@ -25,6 +25,7 @@ import org.apache.shardingsphere.infra.config.datasource.pool.creator.DataSource
import org.apache.shardingsphere.infra.config.datasource.pool.creator.DataSourcePoolCreatorUtil;
import org.apache.shardingsphere.infra.config.datasource.pool.destroyer.DataSourcePoolDestroyerFactory;
import org.apache.shardingsphere.infra.config.datasource.props.DataSourceProperties;
+import org.apache.shardingsphere.infra.config.datasource.props.DataSourcePropertiesCreator;
import org.apache.shardingsphere.infra.instance.InstanceContext;
import org.apache.shardingsphere.infra.instance.definition.InstanceDefinition;
import org.apache.shardingsphere.infra.metadata.schema.QualifiedSchema;
@@ -187,8 +188,7 @@ public final class ClusterContextManagerBuilder implements ContextManagerBuilder
Map<String, DataSourceProperties> loadedDataSourcePropertiesMap = loadedDataSourcePropertiesMaps.get(each.getKey());
for (Entry<String, DataSourceProperties> entry : loadedDataSourcePropertiesMap.entrySet()) {
Map<String, DataSource> localDataSources = localDataSourceMaps.get(each.getKey());
- if (null != localDataSources && null != localDataSources.get(entry.getKey())
- && DataSourcePoolCreatorUtil.getDataSourceProperties(localDataSources.get(entry.getKey())).equals(entry.getValue())) {
+ if (null != localDataSources && null != localDataSources.get(entry.getKey()) && DataSourcePropertiesCreator.create(localDataSources.get(entry.getKey())).equals(entry.getValue())) {
dataSources.put(entry.getKey(), localDataSources.get(entry.getKey()));
} else {
dataSources.put(entry.getKey(), DataSourcePoolCreator.create(entry.getValue()));
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java
index 76d85f9..4834ecc 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.authority.rule.AuthorityRule;
import org.apache.shardingsphere.infra.config.RuleConfiguration;
import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.infra.config.datasource.props.DataSourceProperties;
-import org.apache.shardingsphere.infra.config.datasource.pool.creator.DataSourcePoolCreatorUtil;
+import org.apache.shardingsphere.infra.config.datasource.props.DataSourcePropertiesCreator;
import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
import org.apache.shardingsphere.infra.config.mode.PersistRepositoryConfiguration;
import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
@@ -134,9 +134,9 @@ public final class ClusterContextManagerCoordinatorTest {
private Map<String, DataSourceProperties> getDataSourcePropertiesMap() {
MockedDataSource dataSource = new MockedDataSource();
Map<String, DataSourceProperties> result = new LinkedHashMap<>(3, 1);
- result.put("primary_ds", DataSourcePoolCreatorUtil.getDataSourceProperties(dataSource));
- result.put("ds_0", DataSourcePoolCreatorUtil.getDataSourceProperties(dataSource));
- result.put("ds_1", DataSourcePoolCreatorUtil.getDataSourceProperties(dataSource));
+ result.put("primary_ds", DataSourcePropertiesCreator.create(dataSource));
+ result.put("ds_0", DataSourcePropertiesCreator.create(dataSource));
+ result.put("ds_1", DataSourcePropertiesCreator.create(dataSource));
return result;
}
@@ -189,9 +189,9 @@ public final class ClusterContextManagerCoordinatorTest {
private Map<String, DataSourceProperties> getChangedDataSourcePropertiesMap() {
MockedDataSource dataSource = new MockedDataSource();
Map<String, DataSourceProperties> result = new LinkedHashMap<>(3, 1);
- result.put("primary_ds", DataSourcePoolCreatorUtil.getDataSourceProperties(dataSource));
- result.put("ds_1", DataSourcePoolCreatorUtil.getDataSourceProperties(dataSource));
- result.put("ds_2", DataSourcePoolCreatorUtil.getDataSourceProperties(dataSource));
+ result.put("primary_ds", DataSourcePropertiesCreator.create(dataSource));
+ result.put("ds_1", DataSourcePropertiesCreator.create(dataSource));
+ result.put("ds_2", DataSourcePropertiesCreator.create(dataSource));
return result;
}
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneContextManagerBuilder.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneContextManagerBuilder.java
index 9c360fb..35fac74 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneContextManagerBuilder.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneContextManagerBuilder.java
@@ -24,6 +24,7 @@ import org.apache.shardingsphere.infra.config.datasource.pool.creator.DataSource
import org.apache.shardingsphere.infra.config.datasource.pool.creator.DataSourcePoolCreatorUtil;
import org.apache.shardingsphere.infra.config.datasource.pool.destroyer.DataSourcePoolDestroyerFactory;
import org.apache.shardingsphere.infra.config.datasource.props.DataSourceProperties;
+import org.apache.shardingsphere.infra.config.datasource.props.DataSourcePropertiesCreator;
import org.apache.shardingsphere.infra.config.mode.PersistRepositoryConfiguration;
import org.apache.shardingsphere.infra.instance.InstanceContext;
import org.apache.shardingsphere.infra.metadata.schema.ShardingSphereSchema;
@@ -140,8 +141,7 @@ public final class StandaloneContextManagerBuilder implements ContextManagerBuil
Map<String, DataSourceProperties> loadDataSourcePropsMap = loadedDataSourcePropsMaps.get(each.getKey());
for (Entry<String, DataSourceProperties> entry : loadDataSourcePropsMap.entrySet()) {
Map<String, DataSource> localDataSources = localDataSourcesMap.get(each.getKey());
- if (null != localDataSources && null != localDataSources.get(entry.getKey())
- && DataSourcePoolCreatorUtil.getDataSourceProperties(localDataSources.get(entry.getKey())).equals(entry.getValue())) {
+ if (null != localDataSources && null != localDataSources.get(entry.getKey()) && DataSourcePropertiesCreator.create(localDataSources.get(entry.getKey())).equals(entry.getValue())) {
dataSources.put(entry.getKey(), localDataSources.get(entry.getKey()));
} else {
dataSources.put(entry.getKey(), DataSourcePoolCreator.create(entry.getValue()));