You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/11/12 10:55:11 UTC
[shardingsphere] branch master updated: Rename variable name from properties to props (#22109)
This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang 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 c5bceca18e8 Rename variable name from properties to props (#22109)
c5bceca18e8 is described below
commit c5bceca18e824f991da1bb74116a37b054cf976f
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sat Nov 12 18:55:04 2022 +0800
Rename variable name from properties to props (#22109)
* Rename variable name from environment to env
* Rename variable name from properties to props
* Rename variable name from properties to props
* Rename variable name from properties to props
* Rename variable name from properties to props
---
.../parser/DatabaseDiscoveryDistSQLTest.java | 6 ++--
.../encrypt/distsql/parser/EncryptDistSqlTest.java | 6 ++--
.../shadow/distsql/parser/ShadowDistSQLTest.java | 8 ++---
.../standard/ShardingStandardRoutingEngine.java | 6 ++--
.../sharding/mod/ModShardingAlgorithmTest.java | 12 +++----
.../type/c3p0/C3P0DataSourcePoolMetaData.java | 38 ++++++++++----------
.../type/hikari/HikariDataSourcePoolMetaData.java | 40 +++++++++++-----------
.../infra/hint/SQLHintExtractor.java | 8 ++---
.../api/impl/PipelineDataSourcePersistService.java | 6 ++--
.../common/constant/DistSQLScriptConstants.java | 2 +-
.../queryable/ConvertYamlConfigurationHandler.java | 8 ++---
.../updatable/RefreshTableMetadataHandlerTest.java | 4 +--
.../container/compose/NativeContainerComposer.java | 6 ++--
.../core/api/impl/MigrationJobAPIImplTest.java | 4 +--
14 files changed, 76 insertions(+), 78 deletions(-)
diff --git a/features/db-discovery/distsql/parser/src/test/java/org/apache/shardingsphere/dbdiscovery/distsql/parser/DatabaseDiscoveryDistSQLTest.java b/features/db-discovery/distsql/parser/src/test/java/org/apache/shardingsphere/dbdiscovery/distsql/parser/DatabaseDiscoveryDistSQLTest.java
index 89abdd33902..5bf6bc90d5b 100644
--- a/features/db-discovery/distsql/parser/src/test/java/org/apache/shardingsphere/dbdiscovery/distsql/parser/DatabaseDiscoveryDistSQLTest.java
+++ b/features/db-discovery/distsql/parser/src/test/java/org/apache/shardingsphere/dbdiscovery/distsql/parser/DatabaseDiscoveryDistSQLTest.java
@@ -62,10 +62,10 @@ public class DatabaseDiscoveryDistSQLTest {
private void assertDiscoverySegment(final DatabaseDiscoveryDefinitionSegment discoverySegment) {
assertThat(discoverySegment.getName(), is("db_discovery_group_0"));
assertThat(discoverySegment.getDataSources(), is(Arrays.asList("ds_0", "ds_1")));
- Properties properties = new Properties();
- properties.setProperty("group-name", "92504d5b");
+ Properties props = new Properties();
+ props.setProperty("group-name", "92504d5b");
assertThat(discoverySegment.getDiscoveryType().getName(), equalTo("mgr"));
- assertThat(discoverySegment.getDiscoveryType().getProps(), equalTo(properties));
+ assertThat(discoverySegment.getDiscoveryType().getProps(), equalTo(props));
Properties heartbeatProps = new Properties();
heartbeatProps.setProperty("keep-alive-cron", "0/5 * * * * ?");
assertThat(discoverySegment.getDiscoveryHeartbeat(), is(heartbeatProps));
diff --git a/features/encrypt/distsql/parser/src/test/java/org/apache/shardingsphere/encrypt/distsql/parser/EncryptDistSqlTest.java b/features/encrypt/distsql/parser/src/test/java/org/apache/shardingsphere/encrypt/distsql/parser/EncryptDistSqlTest.java
index 69056bda18f..58af8e253ae 100644
--- a/features/encrypt/distsql/parser/src/test/java/org/apache/shardingsphere/encrypt/distsql/parser/EncryptDistSqlTest.java
+++ b/features/encrypt/distsql/parser/src/test/java/org/apache/shardingsphere/encrypt/distsql/parser/EncryptDistSqlTest.java
@@ -71,9 +71,9 @@ public final class EncryptDistSqlTest {
assertThat(userEncryptColumn.getPlainColumn(), is("user_plain"));
assertThat(userEncryptColumn.getCipherColumn(), is("user_cipher"));
assertThat(userEncryptColumn.getEncryptor().getName(), is("AES"));
- Properties properties = new Properties();
- properties.setProperty("aes-key-value", "123456abc");
- assertThat(userEncryptColumn.getEncryptor().getProps(), is(properties));
+ Properties props = new Properties();
+ props.setProperty("aes-key-value", "123456abc");
+ assertThat(userEncryptColumn.getEncryptor().getProps(), is(props));
EncryptColumnSegment orderEncryptColumn = encryptRuleColumns.next();
assertThat(orderEncryptColumn.getName(), is("order_id"));
assertNull(orderEncryptColumn.getPlainColumn());
diff --git a/features/shadow/distsql/parser/src/test/java/org/apache/shardingsphere/shadow/distsql/parser/ShadowDistSQLTest.java b/features/shadow/distsql/parser/src/test/java/org/apache/shardingsphere/shadow/distsql/parser/ShadowDistSQLTest.java
index 1fde612735f..50a02c6fe81 100644
--- a/features/shadow/distsql/parser/src/test/java/org/apache/shardingsphere/shadow/distsql/parser/ShadowDistSQLTest.java
+++ b/features/shadow/distsql/parser/src/test/java/org/apache/shardingsphere/shadow/distsql/parser/ShadowDistSQLTest.java
@@ -63,10 +63,10 @@ public final class ShadowDistSQLTest {
ShadowAlgorithmSegment shadowAlgorithmSegment = shadowRuleSegment.getShadowTableRules().get("t_order").iterator().next();
assertThat(shadowAlgorithmSegment.getAlgorithmName(), is("shadow_rule_t_order_simple_hint_0"));
assertThat(shadowAlgorithmSegment.getAlgorithmSegment().getName(), is("SIMPLE_HINT"));
- Properties properties = new Properties();
- properties.setProperty("shadow", "true");
- properties.setProperty("foo", "bar");
- assertThat(shadowAlgorithmSegment.getAlgorithmSegment().getProps(), is(properties));
+ Properties props = new Properties();
+ props.setProperty("shadow", "true");
+ props.setProperty("foo", "bar");
+ assertThat(shadowAlgorithmSegment.getAlgorithmSegment().getProps(), is(props));
}
@SneakyThrows(ReflectiveOperationException.class)
diff --git a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/route/engine/type/standard/ShardingStandardRoutingEngine.java b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/route/engine/type/standard/ShardingStandardRoutingEngine.java
index 4f4cc4f37e1..35ddf1de8c0 100644
--- a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/route/engine/type/standard/ShardingStandardRoutingEngine.java
+++ b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/route/engine/type/standard/ShardingStandardRoutingEngine.java
@@ -63,7 +63,7 @@ public final class ShardingStandardRoutingEngine implements ShardingRouteEngine
private final SQLStatementContext<?> sqlStatementContext;
- private final ConfigurationProperties properties;
+ private final ConfigurationProperties props;
private final Collection<Collection<DataNode>> originalDataNodes = new LinkedList<>();
@@ -253,7 +253,7 @@ public final class ShardingStandardRoutingEngine implements ShardingRouteEngine
if (databaseShardingValues.isEmpty()) {
return tableRule.getActualDataSourceNames();
}
- Collection<String> result = databaseShardingStrategy.doSharding(tableRule.getActualDataSourceNames(), databaseShardingValues, tableRule.getDataSourceDataNode(), properties);
+ Collection<String> result = databaseShardingStrategy.doSharding(tableRule.getActualDataSourceNames(), databaseShardingValues, tableRule.getDataSourceDataNode(), props);
Preconditions.checkState(!result.isEmpty(), "No database route info");
Preconditions.checkState(tableRule.getActualDataSourceNames().containsAll(result),
"Some routed data sources do not belong to configured data sources. routed data sources: `%s`, configured data sources: `%s`", result, tableRule.getActualDataSourceNames());
@@ -265,7 +265,7 @@ public final class ShardingStandardRoutingEngine implements ShardingRouteEngine
Collection<String> availableTargetTables = tableRule.getActualTableNames(routedDataSource);
Collection<String> routedTables = tableShardingValues.isEmpty()
? availableTargetTables
- : tableShardingStrategy.doSharding(availableTargetTables, tableShardingValues, tableRule.getTableDataNode(), properties);
+ : tableShardingStrategy.doSharding(availableTargetTables, tableShardingValues, tableRule.getTableDataNode(), props);
Collection<DataNode> result = new LinkedList<>();
for (String each : routedTables) {
result.add(new DataNode(routedDataSource, each));
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/mod/ModShardingAlgorithmTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/mod/ModShardingAlgorithmTest.java
index 358bdb8e692..76d43719dff 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/mod/ModShardingAlgorithmTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/mod/ModShardingAlgorithmTest.java
@@ -93,17 +93,17 @@ public final class ModShardingAlgorithmTest {
@Test(expected = IllegalArgumentException.class)
public void assertRangeDoShardingWithWrongArgumentForStartOffset() {
- Properties properties = createZeroPaddingProperties();
- properties.setProperty("start-offset", "-1");
- ModShardingAlgorithm algorithm = (ModShardingAlgorithm) ShardingAlgorithmFactory.newInstance(new AlgorithmConfiguration("MOD", properties));
+ Properties props = createZeroPaddingProperties();
+ props.setProperty("start-offset", "-1");
+ ModShardingAlgorithm algorithm = (ModShardingAlgorithm) ShardingAlgorithmFactory.newInstance(new AlgorithmConfiguration("MOD", props));
assertThat(algorithm.doSharding(createAvailableIncludeZeroTargetNames(), new PreciseShardingValue<>("t_order", "order_id", DATA_NODE_INFO, "12345678910111213141516")), is("t_order_07"));
}
@Test(expected = IllegalArgumentException.class)
public void assertRangeDoShardingWithWrongArgumentForStopOffset() {
- Properties properties = createZeroPaddingProperties();
- properties.setProperty("stop-offset", "-1");
- ModShardingAlgorithm algorithm = (ModShardingAlgorithm) ShardingAlgorithmFactory.newInstance(new AlgorithmConfiguration("MOD", properties));
+ Properties props = createZeroPaddingProperties();
+ props.setProperty("stop-offset", "-1");
+ ModShardingAlgorithm algorithm = (ModShardingAlgorithm) ShardingAlgorithmFactory.newInstance(new AlgorithmConfiguration("MOD", props));
assertThat(algorithm.doSharding(createAvailableIncludeZeroTargetNames(), new PreciseShardingValue<>("t_order", "order_id", DATA_NODE_INFO, "12345678910111213141516")), is("t_order_07"));
}
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/pool/metadata/type/c3p0/C3P0DataSourcePoolMetaData.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/pool/metadata/type/c3p0/C3P0DataSourcePoolMetaData.java
index 3d8676cd393..ea8a01988e5 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/pool/metadata/type/c3p0/C3P0DataSourcePoolMetaData.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/pool/metadata/type/c3p0/C3P0DataSourcePoolMetaData.java
@@ -29,11 +29,11 @@ import java.util.Map;
*/
public final class C3P0DataSourcePoolMetaData implements DataSourcePoolMetaData {
- private static final Map<String, Object> DEFAULT_PROPERTIES = new HashMap<>(6, 1);
+ private static final Map<String, Object> DEFAULT_PROPS = new HashMap<>(6, 1);
- private static final Map<String, Object> INVALID_PROPERTIES = new HashMap<>(2, 1);
+ private static final Map<String, Object> INVALID_PROPS = new HashMap<>(2, 1);
- private static final Map<String, String> PROPERTY_SYNONYMS = new HashMap<>(5, 1);
+ private static final Map<String, String> PROP_SYNONYMS = new HashMap<>(5, 1);
private static final Collection<String> TRANSIENT_FIELD_NAMES = new LinkedList<>();
@@ -45,25 +45,25 @@ public final class C3P0DataSourcePoolMetaData implements DataSourcePoolMetaData
}
private static void buildDefaultProperties() {
- DEFAULT_PROPERTIES.put("checkoutTimeout", 20 * 1000L);
- DEFAULT_PROPERTIES.put("maxIdleTime", 60 * 1000L);
- DEFAULT_PROPERTIES.put("maxIdleTimeExcessConnections", 30 * 70 * 1000L);
- DEFAULT_PROPERTIES.put("maxPoolSize", 15);
- DEFAULT_PROPERTIES.put("minPoolSize", 3);
- DEFAULT_PROPERTIES.put("readOnly", false);
+ DEFAULT_PROPS.put("checkoutTimeout", 20 * 1000L);
+ DEFAULT_PROPS.put("maxIdleTime", 60 * 1000L);
+ DEFAULT_PROPS.put("maxIdleTimeExcessConnections", 30 * 70 * 1000L);
+ DEFAULT_PROPS.put("maxPoolSize", 15);
+ DEFAULT_PROPS.put("minPoolSize", 3);
+ DEFAULT_PROPS.put("readOnly", false);
}
private static void buildInvalidProperties() {
- INVALID_PROPERTIES.put("minPoolSize", -1);
- INVALID_PROPERTIES.put("maxPoolSize", -1);
+ INVALID_PROPS.put("minPoolSize", -1);
+ INVALID_PROPS.put("maxPoolSize", -1);
}
private static void buildPropertySynonyms() {
- PROPERTY_SYNONYMS.put("username", "user");
- PROPERTY_SYNONYMS.put("url", "jdbcUrl");
- PROPERTY_SYNONYMS.put("connectionTimeoutMilliseconds", "checkoutTimeout");
- PROPERTY_SYNONYMS.put("idleTimeoutMilliseconds", "maxIdleTime");
- PROPERTY_SYNONYMS.put("maxLifetimeMilliseconds", "maxIdleTimeExcessConnections");
+ PROP_SYNONYMS.put("username", "user");
+ PROP_SYNONYMS.put("url", "jdbcUrl");
+ PROP_SYNONYMS.put("connectionTimeoutMilliseconds", "checkoutTimeout");
+ PROP_SYNONYMS.put("idleTimeoutMilliseconds", "maxIdleTime");
+ PROP_SYNONYMS.put("maxLifetimeMilliseconds", "maxIdleTimeExcessConnections");
}
private static void buildTransientFieldNames() {
@@ -73,17 +73,17 @@ public final class C3P0DataSourcePoolMetaData implements DataSourcePoolMetaData
@Override
public Map<String, Object> getDefaultProperties() {
- return DEFAULT_PROPERTIES;
+ return DEFAULT_PROPS;
}
@Override
public Map<String, Object> getInvalidProperties() {
- return INVALID_PROPERTIES;
+ return INVALID_PROPS;
}
@Override
public Map<String, String> getPropertySynonyms() {
- return PROPERTY_SYNONYMS;
+ return PROP_SYNONYMS;
}
@Override
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/pool/metadata/type/hikari/HikariDataSourcePoolMetaData.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/pool/metadata/type/hikari/HikariDataSourcePoolMetaData.java
index 88a67ef1254..98fb1a6bbf3 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/pool/metadata/type/hikari/HikariDataSourcePoolMetaData.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/pool/metadata/type/hikari/HikariDataSourcePoolMetaData.java
@@ -29,11 +29,11 @@ import java.util.Map;
*/
public final class HikariDataSourcePoolMetaData implements DataSourcePoolMetaData {
- private static final Map<String, Object> DEFAULT_PROPERTIES = new HashMap<>(6, 1);
+ private static final Map<String, Object> DEFAULT_PROPS = new HashMap<>(6, 1);
- private static final Map<String, Object> INVALID_PROPERTIES = new HashMap<>(2, 1);
+ private static final Map<String, Object> INVALID_PROPS = new HashMap<>(2, 1);
- private static final Map<String, String> PROPERTY_SYNONYMS = new HashMap<>(6, 1);
+ private static final Map<String, String> PROP_SYNONYMS = new HashMap<>(6, 1);
private static final Collection<String> TRANSIENT_FIELD_NAMES = new LinkedList<>();
@@ -45,26 +45,26 @@ public final class HikariDataSourcePoolMetaData implements DataSourcePoolMetaDat
}
private static void buildDefaultProperties() {
- DEFAULT_PROPERTIES.put("connectionTimeout", 30 * 1000L);
- DEFAULT_PROPERTIES.put("idleTimeout", 60 * 1000L);
- DEFAULT_PROPERTIES.put("maxLifetime", 30 * 70 * 1000L);
- DEFAULT_PROPERTIES.put("maximumPoolSize", 50);
- DEFAULT_PROPERTIES.put("minimumIdle", 1);
- DEFAULT_PROPERTIES.put("readOnly", false);
+ DEFAULT_PROPS.put("connectionTimeout", 30 * 1000L);
+ DEFAULT_PROPS.put("idleTimeout", 60 * 1000L);
+ DEFAULT_PROPS.put("maxLifetime", 30 * 70 * 1000L);
+ DEFAULT_PROPS.put("maximumPoolSize", 50);
+ DEFAULT_PROPS.put("minimumIdle", 1);
+ DEFAULT_PROPS.put("readOnly", false);
}
private static void buildInvalidProperties() {
- INVALID_PROPERTIES.put("minimumIdle", -1);
- INVALID_PROPERTIES.put("maximumPoolSize", -1);
+ INVALID_PROPS.put("minimumIdle", -1);
+ INVALID_PROPS.put("maximumPoolSize", -1);
}
private static void buildPropertySynonyms() {
- PROPERTY_SYNONYMS.put("url", "jdbcUrl");
- PROPERTY_SYNONYMS.put("connectionTimeoutMilliseconds", "connectionTimeout");
- PROPERTY_SYNONYMS.put("idleTimeoutMilliseconds", "idleTimeout");
- PROPERTY_SYNONYMS.put("maxLifetimeMilliseconds", "maxLifetime");
- PROPERTY_SYNONYMS.put("maxPoolSize", "maximumPoolSize");
- PROPERTY_SYNONYMS.put("minPoolSize", "minimumIdle");
+ PROP_SYNONYMS.put("url", "jdbcUrl");
+ PROP_SYNONYMS.put("connectionTimeoutMilliseconds", "connectionTimeout");
+ PROP_SYNONYMS.put("idleTimeoutMilliseconds", "idleTimeout");
+ PROP_SYNONYMS.put("maxLifetimeMilliseconds", "maxLifetime");
+ PROP_SYNONYMS.put("maxPoolSize", "maximumPoolSize");
+ PROP_SYNONYMS.put("minPoolSize", "minimumIdle");
}
private static void buildTransientFieldNames() {
@@ -75,17 +75,17 @@ public final class HikariDataSourcePoolMetaData implements DataSourcePoolMetaDat
@Override
public Map<String, Object> getDefaultProperties() {
- return DEFAULT_PROPERTIES;
+ return DEFAULT_PROPS;
}
@Override
public Map<String, Object> getInvalidProperties() {
- return INVALID_PROPERTIES;
+ return INVALID_PROPS;
}
@Override
public Map<String, String> getPropertySynonyms() {
- return PROPERTY_SYNONYMS;
+ return PROP_SYNONYMS;
}
@Override
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/hint/SQLHintExtractor.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/hint/SQLHintExtractor.java
index 0398c42ee95..0b305748a83 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/hint/SQLHintExtractor.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/hint/SQLHintExtractor.java
@@ -34,20 +34,18 @@ import java.util.Properties;
@Getter
public final class SQLHintExtractor {
- private static final SQLHintProperties DEFAULT_SQL_HINT_PROPERTIES = new SQLHintProperties(new Properties());
+ private static final SQLHintProperties DEFAULT_SQL_HINT_PROPS = new SQLHintProperties(new Properties());
private final SQLHintProperties sqlHintProperties;
public SQLHintExtractor(final SQLStatement sqlStatement) {
sqlHintProperties = sqlStatement instanceof AbstractSQLStatement && !((AbstractSQLStatement) sqlStatement).getCommentSegments().isEmpty()
? extract((AbstractSQLStatement) sqlStatement)
- : DEFAULT_SQL_HINT_PROPERTIES;
+ : DEFAULT_SQL_HINT_PROPS;
}
public SQLHintExtractor(final String sqlComment) {
- sqlHintProperties = Strings.isNullOrEmpty(sqlComment)
- ? DEFAULT_SQL_HINT_PROPERTIES
- : new SQLHintProperties(SQLHintUtils.getSQLHintProps(sqlComment));
+ sqlHintProperties = Strings.isNullOrEmpty(sqlComment) ? DEFAULT_SQL_HINT_PROPS : new SQLHintProperties(SQLHintUtils.getSQLHintProps(sqlComment));
}
private SQLHintProperties extract(final AbstractSQLStatement statement) {
diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/api/impl/PipelineDataSourcePersistService.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/api/impl/PipelineDataSourcePersistService.java
index 5f33da53f5e..ae457b2ddd4 100644
--- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/api/impl/PipelineDataSourcePersistService.java
+++ b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/api/impl/PipelineDataSourcePersistService.java
@@ -40,11 +40,11 @@ public final class PipelineDataSourcePersistService implements PipelineMetaDataP
@Override
@SuppressWarnings("unchecked")
public Map<String, DataSourceProperties> load(final JobType jobType) {
- String dataSourcesProperties = PipelineAPIFactory.getGovernanceRepositoryAPI().getMetaDataDataSources(jobType);
- if (Strings.isNullOrEmpty(dataSourcesProperties)) {
+ String dataSourcesProps = PipelineAPIFactory.getGovernanceRepositoryAPI().getMetaDataDataSources(jobType);
+ if (Strings.isNullOrEmpty(dataSourcesProps)) {
return Collections.emptyMap();
}
- Map<String, Map<String, Object>> yamlDataSources = YamlEngine.unmarshal(dataSourcesProperties, Map.class);
+ Map<String, Map<String, Object>> yamlDataSources = YamlEngine.unmarshal(dataSourcesProps, Map.class);
Map<String, DataSourceProperties> result = new LinkedHashMap<>(yamlDataSources.size());
yamlDataSources.forEach((key, value) -> result.put(key, swapper.swapToDataSourceProperties(value)));
return result;
diff --git a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/constant/DistSQLScriptConstants.java b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/constant/DistSQLScriptConstants.java
index c78b2579c22..ab030cbe6b2 100644
--- a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/constant/DistSQLScriptConstants.java
+++ b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/constant/DistSQLScriptConstants.java
@@ -162,7 +162,7 @@ public final class DistSQLScriptConstants {
public static final String ALGORITHM_TYPE = "TYPE(NAME='%s', PROPERTIES(%s))";
- public static final String ALGORITHM_TYPE_WITHOUT_PROPERTIES = "TYPE(NAME='%s')";
+ public static final String ALGORITHM_TYPE_WITHOUT_PROPS = "TYPE(NAME='%s')";
public static final String CREATE_SHADOW = "CREATE SHADOW RULE";
diff --git a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ConvertYamlConfigurationHandler.java b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ConvertYamlConfigurationHandler.java
index 65d44407458..a31bcfee088 100644
--- a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ConvertYamlConfigurationHandler.java
+++ b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ConvertYamlConfigurationHandler.java
@@ -488,19 +488,19 @@ public final class ConvertYamlConfigurationHandler extends QueryableRALBackendHa
}
String type = algorithmConfig.getType().toLowerCase();
if (algorithmConfig.getProps().isEmpty()) {
- result.append(String.format(DistSQLScriptConstants.ALGORITHM_TYPE_WITHOUT_PROPERTIES, type));
+ result.append(String.format(DistSQLScriptConstants.ALGORITHM_TYPE_WITHOUT_PROPS, type));
} else {
result.append(String.format(DistSQLScriptConstants.ALGORITHM_TYPE, type, getAlgorithmProperties(algorithmConfig.getProps())));
}
return result.toString();
}
- private String getAlgorithmProperties(final Properties properties) {
+ private String getAlgorithmProperties(final Properties props) {
StringBuilder result = new StringBuilder();
- Iterator<String> iterator = new TreeMap(properties).keySet().iterator();
+ Iterator<String> iterator = new TreeMap(props).keySet().iterator();
while (iterator.hasNext()) {
String key = iterator.next();
- String value = properties.getProperty(key);
+ String value = props.getProperty(key);
if (null == value) {
continue;
}
diff --git a/proxy/backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/RefreshTableMetadataHandlerTest.java b/proxy/backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/RefreshTableMetadataHandlerTest.java
index 2595a66cc02..d66a279f2fb 100644
--- a/proxy/backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/RefreshTableMetadataHandlerTest.java
+++ b/proxy/backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/RefreshTableMetadataHandlerTest.java
@@ -59,9 +59,9 @@ public final class RefreshTableMetadataHandlerTest extends ProxyContextRestorer
@Before
public void setup() {
ProxyContext.init(contextManager);
- ConfigurationProperties configurationProperties = new ConfigurationProperties(createProperties());
+ ConfigurationProperties configurationProps = new ConfigurationProperties(createProperties());
when(contextManager.getMetaDataContexts().getMetaData()).thenReturn(shardingSphereMetaData);
- when(shardingSphereMetaData.getProps()).thenReturn(configurationProperties);
+ when(shardingSphereMetaData.getProps()).thenReturn(configurationProps);
connectionSession = mock(ConnectionSession.class, RETURNS_DEEP_STUBS);
}
diff --git a/test/integration-test/scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/framework/container/compose/NativeContainerComposer.java b/test/integration-test/scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/framework/container/compose/NativeContainerComposer.java
index fe660fcebc9..3600641678f 100644
--- a/test/integration-test/scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/framework/container/compose/NativeContainerComposer.java
+++ b/test/integration-test/scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/framework/container/compose/NativeContainerComposer.java
@@ -62,9 +62,9 @@ public final class NativeContainerComposer extends BaseContainerComposer {
case "MySQL":
String queryAllTables = String.format("select table_name from information_schema.tables where table_schema='%s' and table_type='BASE TABLE'", databaseName);
jdbcUrl = DataSourceEnvironment.getURL(databaseType, "localhost", actualDatabasePort, databaseName);
- Properties properties = new Properties();
- properties.setProperty("allowPublicKeyRetrieval", "true");
- try (Connection connection = DriverManager.getConnection(jdbcUrlAppender.appendQueryProperties(jdbcUrl, properties), username, password)) {
+ Properties props = new Properties();
+ props.setProperty("allowPublicKeyRetrieval", "true");
+ try (Connection connection = DriverManager.getConnection(jdbcUrlAppender.appendQueryProperties(jdbcUrl, props), username, password)) {
try (ResultSet resultSet = connection.createStatement().executeQuery(queryAllTables)) {
List<String> actualTableNames = getFirstColumnValueFromResult(resultSet);
for (String each : actualTableNames) {
diff --git a/test/pipeline/src/test/java/org/apache/shardingsphere/data/pipeline/core/api/impl/MigrationJobAPIImplTest.java b/test/pipeline/src/test/java/org/apache/shardingsphere/data/pipeline/core/api/impl/MigrationJobAPIImplTest.java
index f69b7a1a2fb..3817a5a8584 100644
--- a/test/pipeline/src/test/java/org/apache/shardingsphere/data/pipeline/core/api/impl/MigrationJobAPIImplTest.java
+++ b/test/pipeline/src/test/java/org/apache/shardingsphere/data/pipeline/core/api/impl/MigrationJobAPIImplTest.java
@@ -262,8 +262,8 @@ public final class MigrationJobAPIImplTest {
private void initIntPrimaryEnvironment() throws SQLException {
Map<String, DataSourceProperties> metaDataDataSource = new PipelineDataSourcePersistService().load(JobType.MIGRATION);
- DataSourceProperties dataSourceProperties = metaDataDataSource.get("ds_0");
- DataSource dataSource = DataSourcePoolCreator.create(dataSourceProperties);
+ DataSourceProperties dataSourceProps = metaDataDataSource.get("ds_0");
+ DataSource dataSource = DataSourcePoolCreator.create(dataSourceProps);
try (
Connection connection = dataSource.getConnection();
Statement statement = connection.createStatement()) {