This is an automated email from the ASF dual-hosted git repository.
totalo 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 afcd678fe3b Adjust sequence of ConfigurationPropertyKey (#19729)
afcd678fe3b is described below
commit afcd678fe3b1451797845fe2e7d8e812dbdfafa5
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Aug 1 00:39:20 2022 +0800
Adjust sequence of ConfigurationPropertyKey (#19729)
---
.../infra/config/props/ConfigurationPropertyKey.java | 10 +++++-----
.../apache/shardingsphere/infra/hint/SQLHintExtractor.java | 3 ++-
.../infra/config/props/ConfigurationPropertyKeyTest.java | 14 +++++++-------
3 files changed, 14 insertions(+), 13 deletions(-)
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
index d3f3ecc3964..39eaf9338ed 100644
---
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
+++
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
@@ -57,6 +57,11 @@ public enum ConfigurationPropertyKey implements
TypedPropertyKey {
*/
CHECK_TABLE_METADATA_ENABLED("check-table-metadata-enabled",
String.valueOf(Boolean.FALSE), boolean.class, false),
+ /**
+ * Whether enable SQL federation.
+ */
+ SQL_FEDERATION_ENABLED("sql-federation-enabled",
String.valueOf(Boolean.FALSE), boolean.class, false),
+
/**
* Frontend database protocol type for ShardingSphere-Proxy.
*/
@@ -94,11 +99,6 @@ public enum ConfigurationPropertyKey implements
TypedPropertyKey {
*/
PROXY_FRONTEND_MAX_CONNECTIONS("proxy-frontend-max-connections", "0",
int.class, false),
- /**
- * Whether enable SQL federation.
- */
- SQL_FEDERATION_ENABLED("sql-federation-enabled",
String.valueOf(Boolean.FALSE), boolean.class, false),
-
/**
* Proxy backend driver type..
*/
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/hint/SQLHintExtractor.java
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/hint/SQLHintExtractor.java
index eaa2e573d16..47f475e1e72 100644
---
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/hint/SQLHintExtractor.java
+++
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/hint/SQLHintExtractor.java
@@ -36,7 +36,8 @@ public final class SQLHintExtractor {
private final SQLHintProperties sqlHintProperties;
public SQLHintExtractor(final SQLStatement sqlStatement) {
- sqlHintProperties = sqlStatement instanceof AbstractSQLStatement &&
!((AbstractSQLStatement) sqlStatement).getCommentSegments().isEmpty() ?
extract((AbstractSQLStatement) sqlStatement)
+ sqlHintProperties = sqlStatement instanceof AbstractSQLStatement &&
!((AbstractSQLStatement) sqlStatement).getCommentSegments().isEmpty()
+ ? extract((AbstractSQLStatement) sqlStatement)
: DEFAULT_SQL_HINT_PROPERTIES;
}
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKeyTest.java
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKeyTest.java
index 6f9fe07c2b5..7e5fcc5f08d 100644
---
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKeyTest.java
+++
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKeyTest.java
@@ -17,20 +17,20 @@
package org.apache.shardingsphere.infra.config.props;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertNotNull;
+import org.junit.Test;
import java.util.Collection;
-import org.junit.Test;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
public final class ConfigurationPropertyKeyTest {
@Test
public void assertKeyNames() {
- Collection<String> configurationPropertyKeyNames =
ConfigurationPropertyKey.getKeyNames();
- assertThat(configurationPropertyKeyNames.size(),
is(ConfigurationPropertyKey.values().length));
- configurationPropertyKeyNames.forEach(keyName ->
assertNotNull(ConfigurationPropertyKey.valueOf(keyName)));
+ Collection<String> keyNames = ConfigurationPropertyKey.getKeyNames();
+ assertThat(keyNames.size(),
is(ConfigurationPropertyKey.values().length));
+ keyNames.forEach(each ->
assertNotNull(ConfigurationPropertyKey.valueOf(each)));
}
}