From 43438e5a4b7ee1a0d9758d6236f59fad56c019fd Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Thu, 15 Feb 2024 18:50:00 +0800 Subject: [PATCH] Rname YamlShardingSphereDataSourceFactory.RULE_CONFIG_SWAPPER (#30136) --- .../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 a89aa183ddb64..7da615d2c0329 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 @@ @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 static DataSource createDataSourceWithoutCache(final YamlRootConfiguratio private static DataSource createDataSource(final Map dataSourceMap, final YamlRootConfiguration rootConfig) throws SQLException { ModeConfiguration modeConfig = null == rootConfig.getMode() ? null : new YamlModeConfigurationSwapper().swapToObject(rootConfig.getMode()); - Collection ruleConfigs = SWAPPER_ENGINE.swapToRuleConfigurations(rootConfig.getRules()); + Collection ruleConfigs = RULE_CONFIG_SWAPPER.swapToRuleConfigurations(rootConfig.getRules()); return ShardingSphereDataSourceFactory.createDataSource(rootConfig.getDatabaseName(), modeConfig, dataSourceMap, ruleConfigs, rootConfig.getProps()); } @@ -163,7 +163,7 @@ private static DataSource createDataSource(final DataSource dataSource, final Ya private static DataSource createDataSource(final Map dataSourceMap, final YamlJDBCConfiguration jdbcConfig) throws SQLException { rebuildGlobalRuleConfiguration(jdbcConfig); ModeConfiguration modeConfig = null == jdbcConfig.getMode() ? null : new YamlModeConfigurationSwapper().swapToObject(jdbcConfig.getMode()); - Collection ruleConfigs = SWAPPER_ENGINE.swapToRuleConfigurations(jdbcConfig.getRules()); + Collection ruleConfigs = RULE_CONFIG_SWAPPER.swapToRuleConfigurations(jdbcConfig.getRules()); return ShardingSphereDataSourceFactory.createDataSource(jdbcConfig.getDatabaseName(), modeConfig, dataSourceMap, ruleConfigs, jdbcConfig.getProps()); }