This is an automated email from the ASF dual-hosted git repository.
tuichenchuxin 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 7508cfdffa1 Rename CHECK_TABLE_META_DATA_ENABLED to
CHECK_TABLE_METADATA_ENABLED for SHOW DIST VARIABLE (#25334)
7508cfdffa1 is described below
commit 7508cfdffa16e02de9492305659ef5b26f87e0c9
Author: Zhengqiang Duan <[email protected]>
AuthorDate: Wed Apr 26 17:29:34 2023 +0800
Rename CHECK_TABLE_META_DATA_ENABLED to CHECK_TABLE_METADATA_ENABLED for
SHOW DIST VARIABLE (#25334)
---
.../sharding/metadata/reviser/ShardingMetaDataReviseEntry.java | 2 +-
.../shardingsphere/infra/config/props/ConfigurationPropertyKey.java | 4 ++--
.../metadata/database/schema/builder/GenericSchemaBuilder.java | 2 +-
.../infra/config/props/ConfigurationPropertiesTest.java | 6 +++---
.../infra/config/props/ConfigurationPropertyKeyTest.java | 3 ++-
5 files changed, 9 insertions(+), 8 deletions(-)
diff --git
a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/metadata/reviser/ShardingMetaDataReviseEntry.java
b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/metadata/reviser/ShardingMetaDataReviseEntry.java
index aaa26cbb448..365a4d5bf4a 100644
---
a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/metadata/reviser/ShardingMetaDataReviseEntry.java
+++
b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/metadata/reviser/ShardingMetaDataReviseEntry.java
@@ -38,7 +38,7 @@ public final class ShardingMetaDataReviseEntry implements
MetaDataReviseEntry<Sh
@Override
public Optional<? extends SchemaTableAggregationReviser<ShardingRule>>
getSchemaTableAggregationReviser(final ConfigurationProperties props) {
- return Optional.of(new
ShardingSchemaTableAggregationReviser(props.getValue(ConfigurationPropertyKey.CHECK_TABLE_META_DATA_ENABLED)));
+ return Optional.of(new
ShardingSchemaTableAggregationReviser(props.getValue(ConfigurationPropertyKey.CHECK_TABLE_METADATA_ENABLED)));
}
@Override
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
index ccf4dc16ba9..a30cc91dd5c 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
@@ -58,9 +58,9 @@ public enum ConfigurationPropertyKey implements
TypedPropertyKey {
MAX_CONNECTIONS_SIZE_PER_QUERY("max-connections-size-per-query",
String.valueOf(1), int.class, false),
/**
- * Whether validate table meta data consistency when application startup
or updated.
+ * Whether validate table metadata consistency when application startup or
updated.
*/
- CHECK_TABLE_META_DATA_ENABLED("check-table-metadata-enabled",
String.valueOf(Boolean.FALSE), boolean.class, false),
+ CHECK_TABLE_METADATA_ENABLED("check-table-metadata-enabled",
String.valueOf(Boolean.FALSE), boolean.class, false),
/**
* SQL federation type.
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/GenericSchemaBuilder.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/GenericSchemaBuilder.java
index ca171f9551d..9e86483bc61 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/GenericSchemaBuilder.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/GenericSchemaBuilder.java
@@ -97,7 +97,7 @@ public final class GenericSchemaBuilder {
}
private static Map<String, SchemaMetaData> loadSchemas(final
Collection<String> tableNames, final GenericSchemaBuilderMaterial material)
throws SQLException {
- boolean checkMetaDataEnable =
material.getProps().getValue(ConfigurationPropertyKey.CHECK_TABLE_META_DATA_ENABLED);
+ boolean checkMetaDataEnable =
material.getProps().getValue(ConfigurationPropertyKey.CHECK_TABLE_METADATA_ENABLED);
Collection<SchemaMetaDataLoaderMaterial> schemaMetaDataLoaderMaterials
= SchemaMetaDataUtils.getSchemaMetaDataLoaderMaterials(tableNames, material,
checkMetaDataEnable);
if (schemaMetaDataLoaderMaterials.isEmpty()) {
return Collections.emptyMap();
diff --git
a/infra/common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertiesTest.java
b/infra/common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertiesTest.java
index 586b2db6208..fb41998a9f2 100644
---
a/infra/common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertiesTest.java
+++
b/infra/common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertiesTest.java
@@ -38,7 +38,7 @@ class ConfigurationPropertiesTest {
assertTrue((Boolean)
actual.getValue(ConfigurationPropertyKey.SQL_SIMPLE));
assertThat(actual.getValue(ConfigurationPropertyKey.KERNEL_EXECUTOR_SIZE),
is(20));
assertThat(actual.getValue(ConfigurationPropertyKey.MAX_CONNECTIONS_SIZE_PER_QUERY),
is(20));
- assertTrue((Boolean)
actual.getValue(ConfigurationPropertyKey.CHECK_TABLE_META_DATA_ENABLED));
+ assertTrue((Boolean)
actual.getValue(ConfigurationPropertyKey.CHECK_TABLE_METADATA_ENABLED));
assertThat(actual.getValue(ConfigurationPropertyKey.SQL_FEDERATION_TYPE),
is("ORIGINAL"));
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_FRONTEND_DATABASE_PROTOCOL_TYPE),
is("PostgreSQL"));
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_FRONTEND_FLUSH_THRESHOLD),
is(20));
@@ -58,7 +58,7 @@ class ConfigurationPropertiesTest {
new Property(ConfigurationPropertyKey.SQL_SIMPLE.getKey(),
Boolean.TRUE.toString()),
new
Property(ConfigurationPropertyKey.KERNEL_EXECUTOR_SIZE.getKey(), "20"),
new
Property(ConfigurationPropertyKey.MAX_CONNECTIONS_SIZE_PER_QUERY.getKey(),
"20"),
- new
Property(ConfigurationPropertyKey.CHECK_TABLE_META_DATA_ENABLED.getKey(),
Boolean.TRUE.toString()),
+ new
Property(ConfigurationPropertyKey.CHECK_TABLE_METADATA_ENABLED.getKey(),
Boolean.TRUE.toString()),
new
Property(ConfigurationPropertyKey.SQL_FEDERATION_TYPE.getKey(), "ORIGINAL"),
new
Property(ConfigurationPropertyKey.PROXY_FRONTEND_DATABASE_PROTOCOL_TYPE.getKey(),
"PostgreSQL"),
new
Property(ConfigurationPropertyKey.PROXY_FRONTEND_FLUSH_THRESHOLD.getKey(),
"20"),
@@ -79,7 +79,7 @@ class ConfigurationPropertiesTest {
assertFalse((Boolean)
actual.getValue(ConfigurationPropertyKey.SQL_SIMPLE));
assertThat(actual.getValue(ConfigurationPropertyKey.KERNEL_EXECUTOR_SIZE),
is(0));
assertThat(actual.getValue(ConfigurationPropertyKey.MAX_CONNECTIONS_SIZE_PER_QUERY),
is(1));
- assertFalse((Boolean)
actual.getValue(ConfigurationPropertyKey.CHECK_TABLE_META_DATA_ENABLED));
+ assertFalse((Boolean)
actual.getValue(ConfigurationPropertyKey.CHECK_TABLE_METADATA_ENABLED));
assertThat(actual.getValue(ConfigurationPropertyKey.SQL_FEDERATION_TYPE),
is("NONE"));
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_FRONTEND_DATABASE_PROTOCOL_TYPE),
is(""));
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_FRONTEND_FLUSH_THRESHOLD),
is(128));
diff --git
a/infra/common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKeyTest.java
b/infra/common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKeyTest.java
index 9ad45d2089c..db94d63dc42 100644
---
a/infra/common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKeyTest.java
+++
b/infra/common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKeyTest.java
@@ -22,8 +22,8 @@ import org.junit.jupiter.api.Test;
import java.util.Collection;
import static org.hamcrest.CoreMatchers.is;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
class ConfigurationPropertyKeyTest {
@@ -32,5 +32,6 @@ class ConfigurationPropertyKeyTest {
Collection<String> keyNames = ConfigurationPropertyKey.getKeyNames();
assertThat(keyNames.size(),
is(ConfigurationPropertyKey.values().length));
keyNames.forEach(each ->
assertNotNull(ConfigurationPropertyKey.valueOf(each)));
+ keyNames.forEach(each -> assertThat(each.toLowerCase().replace("_",
"-"), is(ConfigurationPropertyKey.valueOf(each).getKey())));
}
}