This is an automated email from the ASF dual-hosted git repository.
panjuan 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 43438e5a4b7 Rname
YamlShardingSphereDataSourceFactory.RULE_CONFIG_SWAPPER (#30136)
43438e5a4b7 is described below
commit 43438e5a4b7ee1a0d9758d6236f59fad56c019fd
Author: Liang Zhang <[email protected]>
AuthorDate: Thu Feb 15 18:50:00 2024 +0800
Rname YamlShardingSphereDataSourceFactory.RULE_CONFIG_SWAPPER (#30136)
---
.../driver/api/yaml/YamlShardingSphereDataSourceFactory.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
a/jdbc/core/src/main/java/org/apache/shardingsphere/driver/api/yaml/YamlShardingSphereDataSourceFactory.java
b/jdbc/core/src/main/java/org/apache/shardingsphere/driver/api/yaml/YamlShardingSphereDataSourceFactory.java
index a89aa183ddb..7da615d2c03 100644
---
a/jdbc/core/src/main/java/org/apache/shardingsphere/driver/api/yaml/YamlShardingSphereDataSourceFactory.java
+++
b/jdbc/core/src/main/java/org/apache/shardingsphere/driver/api/yaml/YamlShardingSphereDataSourceFactory.java
@@ -47,7 +47,7 @@ import java.util.Map;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class YamlShardingSphereDataSourceFactory {
- private static final YamlRuleConfigurationSwapperEngine SWAPPER_ENGINE =
new YamlRuleConfigurationSwapperEngine();
+ private static final YamlRuleConfigurationSwapperEngine
RULE_CONFIG_SWAPPER = new YamlRuleConfigurationSwapperEngine();
private static final YamlDataSourceConfigurationSwapper
DATA_SOURCE_SWAPPER = new YamlDataSourceConfigurationSwapper();
@@ -72,7 +72,7 @@ public final class YamlShardingSphereDataSourceFactory {
private static DataSource createDataSource(final Map<String, DataSource>
dataSourceMap, final YamlRootConfiguration rootConfig) throws SQLException {
ModeConfiguration modeConfig = null == rootConfig.getMode() ? null :
new YamlModeConfigurationSwapper().swapToObject(rootConfig.getMode());
- Collection<RuleConfiguration> ruleConfigs =
SWAPPER_ENGINE.swapToRuleConfigurations(rootConfig.getRules());
+ Collection<RuleConfiguration> ruleConfigs =
RULE_CONFIG_SWAPPER.swapToRuleConfigurations(rootConfig.getRules());
return
ShardingSphereDataSourceFactory.createDataSource(rootConfig.getDatabaseName(),
modeConfig, dataSourceMap, ruleConfigs, rootConfig.getProps());
}
@@ -163,7 +163,7 @@ public final class YamlShardingSphereDataSourceFactory {
private static DataSource createDataSource(final Map<String, DataSource>
dataSourceMap, final YamlJDBCConfiguration jdbcConfig) throws SQLException {
rebuildGlobalRuleConfiguration(jdbcConfig);
ModeConfiguration modeConfig = null == jdbcConfig.getMode() ? null :
new YamlModeConfigurationSwapper().swapToObject(jdbcConfig.getMode());
- Collection<RuleConfiguration> ruleConfigs =
SWAPPER_ENGINE.swapToRuleConfigurations(jdbcConfig.getRules());
+ Collection<RuleConfiguration> ruleConfigs =
RULE_CONFIG_SWAPPER.swapToRuleConfigurations(jdbcConfig.getRules());
return
ShardingSphereDataSourceFactory.createDataSource(jdbcConfig.getDatabaseName(),
modeConfig, dataSourceMap, ruleConfigs, jdbcConfig.getProps());
}