This is an automated email from the ASF dual-hosted git repository.
zhaojinchao 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 e9c32ebf5fe Move props into common module (#27595)
e9c32ebf5fe is described below
commit e9c32ebf5fe33d288aac76c8dc057db0d90211d1
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Jul 31 23:06:38 2023 +0800
Move props into common module (#27595)
* Move ShardingSphereAlgorithm into common module
* Move props into common module
* Remove RegularUtils
---
.../handler/query/ShowEncryptRuleExecutor.java | 2 +-
.../handler/query/ShowMaskRuleExecutor.java | 2 +-
.../query/ShowReadwriteSplittingRuleExecutor.java | 2 +-
.../query/ShowDefaultShadowAlgorithmExecutor.java | 2 +-
.../query/ShowShadowAlgorithmsExecutor.java | 2 +-
.../handler/query/ShowShadowRuleExecutor.java | 2 +-
.../query/ShowShardingAlgorithmExecutor.java | 2 +-
.../query/ShowShardingTableRuleExecutor.java | 4 +-
.../ShowUnusedShardingAlgorithmsExecutor.java | 2 +-
.../ShowUnusedShardingKeyGeneratorExecutor.java | 2 +-
.../config/props/ConfigurationProperties.java | 2 +-
.../config/props/ConfigurationPropertyKey.java | 2 +-
.../TemporaryConfigurationProperties.java | 2 +-
.../TemporaryConfigurationPropertyKey.java | 2 +-
.../infra/hint/SQLHintPropertiesKey.java | 2 +-
.../infra}/props/PropertiesConverter.java | 2 +-
.../infra}/props/TypedProperties.java | 6 +--
.../infra}/props/TypedPropertyKey.java | 2 +-
.../infra}/props/TypedPropertyValue.java | 4 +-
.../exception/TypedPropertiesServerException.java | 8 ++--
.../exception/TypedPropertyValueException.java | 9 +++--
.../infra}/props/PropertiesConverterTest.java | 2 +-
.../infra}/props/TypedPropertiesTest.java | 8 ++--
.../infra}/props/TypedPropertyValueTest.java | 10 ++---
.../exception/TypedPropertiesExceptionTest.java | 2 +-
.../exception/TypedPropertyValueExceptionTest.java | 4 +-
.../props/fixture/TypedPropertiesFixture.java | 4 +-
.../props/fixture/TypedPropertyKeyFixture.java | 8 ++--
.../fixture/enums/TypedPropertyEnumFixture.java | 2 +-
.../fixture/typed/PropertiesTypedSPIFixture.java | 2 +-
.../typed/PropertiesTypedSPIFixtureImpl.java | 2 +-
....props.fixture.typed.PropertiesTypedSPIFixture} | 2 +-
.../infra/util/regular/RegularUtils.java | 44 ----------------------
.../infra/util/regular/RegularUtilsTest.java | 40 --------------------
.../type/tso/provider/RedisTSOPropertyKey.java | 2 +-
.../handler/query/ShowSingleTableExecutor.java | 10 ++---
.../handler/query/ShowTrafficRuleExecutor.java | 2 +-
.../handler/query/ShowTransactionRuleExecutor.java | 2 +-
.../AlterTransactionRuleStatementUpdaterTest.java | 2 +-
.../lock/creator/DistributedLockCreator.java | 2 +-
.../cluster/lock/holder/DistributedLockHolder.java | 2 +-
.../lock/impl/props/DefaultLockPropertyKey.java | 2 +-
.../impl/props/DefaultLockTypedProperties.java | 2 +-
.../cluster/consul/props/ConsulProperties.java | 2 +-
.../cluster/consul/props/ConsulPropertyKey.java | 2 +-
.../cluster/etcd/props/EtcdProperties.java | 2 +-
.../cluster/etcd/props/EtcdPropertyKey.java | 2 +-
.../cluster/nacos/props/NacosProperties.java | 2 +-
.../cluster/nacos/props/NacosPropertyKey.java | 2 +-
.../zookeeper/props/ZookeeperProperties.java | 2 +-
.../zookeeper/props/ZookeeperPropertyKey.java | 2 +-
.../jdbc/props/JDBCRepositoryProperties.java | 2 +-
.../jdbc/props/JDBCRepositoryPropertyKey.java | 2 +-
.../ral/queryable/ShowDistVariablesExecutor.java | 4 +-
.../ral/updatable/SetDistVariableUpdater.java | 6 +--
.../distsql/rql/rule/ShowLogicalTableExecutor.java | 19 ++++------
.../rql/rule/ShowLogicalTableExecutorTest.java | 5 +--
.../proxy/backend/hbase/props/HBaseProperties.java | 2 +-
.../backend/hbase/props/HBasePropertyKey.java | 2 +-
.../handler/admin/executor/ShowTablesExecutor.java | 10 ++---
60 files changed, 99 insertions(+), 188 deletions(-)
diff --git
a/features/encrypt/distsql/handler/src/main/java/org/apache/shardingsphere/encrypt/distsql/handler/query/ShowEncryptRuleExecutor.java
b/features/encrypt/distsql/handler/src/main/java/org/apache/shardingsphere/encrypt/distsql/handler/query/ShowEncryptRuleExecutor.java
index 121c7638384..301226857c4 100644
---
a/features/encrypt/distsql/handler/src/main/java/org/apache/shardingsphere/encrypt/distsql/handler/query/ShowEncryptRuleExecutor.java
+++
b/features/encrypt/distsql/handler/src/main/java/org/apache/shardingsphere/encrypt/distsql/handler/query/ShowEncryptRuleExecutor.java
@@ -28,7 +28,7 @@ import org.apache.shardingsphere.encrypt.rule.EncryptRule;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
-import org.apache.shardingsphere.infra.util.props.PropertiesConverter;
+import org.apache.shardingsphere.infra.props.PropertiesConverter;
import java.util.Arrays;
import java.util.Collection;
diff --git
a/features/mask/distsql/handler/src/main/java/org/apache/shardingsphere/mask/distsql/handler/query/ShowMaskRuleExecutor.java
b/features/mask/distsql/handler/src/main/java/org/apache/shardingsphere/mask/distsql/handler/query/ShowMaskRuleExecutor.java
index 39cd45eae47..6c4d80d4ecf 100644
---
a/features/mask/distsql/handler/src/main/java/org/apache/shardingsphere/mask/distsql/handler/query/ShowMaskRuleExecutor.java
+++
b/features/mask/distsql/handler/src/main/java/org/apache/shardingsphere/mask/distsql/handler/query/ShowMaskRuleExecutor.java
@@ -21,7 +21,7 @@ import
org.apache.shardingsphere.distsql.handler.query.RQLExecutor;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
-import org.apache.shardingsphere.infra.util.props.PropertiesConverter;
+import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.mask.api.config.MaskRuleConfiguration;
import
org.apache.shardingsphere.mask.api.config.rule.MaskTableRuleConfiguration;
import
org.apache.shardingsphere.mask.distsql.parser.statement.ShowMaskRulesStatement;
diff --git
a/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowReadwriteSplittingRuleExecutor.java
b/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowReadwriteSplittingRuleExecutor.java
index 7f41911cdeb..ba97d2fa4af 100644
---
a/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowReadwriteSplittingRuleExecutor.java
+++
b/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowReadwriteSplittingRuleExecutor.java
@@ -24,7 +24,7 @@ import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryRes
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import
org.apache.shardingsphere.infra.rule.identifier.type.exportable.constant.ExportableConstants;
import
org.apache.shardingsphere.infra.rule.identifier.type.exportable.constant.ExportableItemConstants;
-import org.apache.shardingsphere.infra.util.props.PropertiesConverter;
+import org.apache.shardingsphere.infra.props.PropertiesConverter;
import
org.apache.shardingsphere.readwritesplitting.api.ReadwriteSplittingRuleConfiguration;
import
org.apache.shardingsphere.readwritesplitting.api.rule.ReadwriteSplittingDataSourceRuleConfiguration;
import
org.apache.shardingsphere.readwritesplitting.distsql.parser.statement.ShowReadwriteSplittingRulesStatement;
diff --git
a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowDefaultShadowAlgorithmExecutor.java
b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowDefaultShadowAlgorithmExecutor.java
index 162d5d23e23..e7cc7baa2cf 100644
---
a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowDefaultShadowAlgorithmExecutor.java
+++
b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowDefaultShadowAlgorithmExecutor.java
@@ -21,7 +21,7 @@ import
org.apache.shardingsphere.distsql.handler.query.RQLExecutor;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
-import org.apache.shardingsphere.infra.util.props.PropertiesConverter;
+import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
import
org.apache.shardingsphere.shadow.distsql.parser.statement.ShowDefaultShadowAlgorithmStatement;
import org.apache.shardingsphere.shadow.rule.ShadowRule;
diff --git
a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowAlgorithmsExecutor.java
b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowAlgorithmsExecutor.java
index 1d11f7e6d23..3dc46912be8 100644
---
a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowAlgorithmsExecutor.java
+++
b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowAlgorithmsExecutor.java
@@ -21,7 +21,7 @@ import
org.apache.shardingsphere.distsql.handler.query.RQLExecutor;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
-import org.apache.shardingsphere.infra.util.props.PropertiesConverter;
+import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
import
org.apache.shardingsphere.shadow.distsql.parser.statement.ShowShadowAlgorithmsStatement;
import org.apache.shardingsphere.shadow.rule.ShadowRule;
diff --git
a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowRuleExecutor.java
b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowRuleExecutor.java
index 8d84f8df88d..ba98afce781 100644
---
a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowRuleExecutor.java
+++
b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowRuleExecutor.java
@@ -21,7 +21,7 @@ import
org.apache.shardingsphere.distsql.handler.query.RQLExecutor;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
-import org.apache.shardingsphere.infra.util.props.PropertiesConverter;
+import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
import
org.apache.shardingsphere.shadow.api.config.datasource.ShadowDataSourceConfiguration;
import
org.apache.shardingsphere.shadow.api.config.table.ShadowTableConfiguration;
diff --git
a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingAlgorithmExecutor.java
b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingAlgorithmExecutor.java
index 9271eddfb60..9242da1382a 100644
---
a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingAlgorithmExecutor.java
+++
b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingAlgorithmExecutor.java
@@ -21,7 +21,7 @@ import
org.apache.shardingsphere.distsql.handler.query.RQLExecutor;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
-import org.apache.shardingsphere.infra.util.props.PropertiesConverter;
+import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingAlgorithmsStatement;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
diff --git
a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableRuleExecutor.java
b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableRuleExecutor.java
index a142c046e95..4f5d07f20d1 100644
---
a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableRuleExecutor.java
+++
b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableRuleExecutor.java
@@ -21,7 +21,7 @@ import
org.apache.shardingsphere.distsql.handler.query.RQLExecutor;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
-import org.apache.shardingsphere.infra.util.props.PropertiesConverter;
+import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import
org.apache.shardingsphere.sharding.api.config.rule.ShardingAutoTableRuleConfiguration;
import
org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
@@ -130,7 +130,7 @@ public final class ShowShardingTableRuleExecutor implements
RQLExecutor<ShowShar
private Optional<ShardingStrategyConfiguration>
getDatabaseShardingStrategy(final ShardingTableRuleConfiguration
shardingTableRuleConfig) {
return null == shardingTableRuleConfig.getDatabaseShardingStrategy()
?
Optional.ofNullable(shardingRuleConfig.getDefaultDatabaseShardingStrategy())
- :
Optional.ofNullable(shardingTableRuleConfig.getDatabaseShardingStrategy());
+ :
Optional.of(shardingTableRuleConfig.getDatabaseShardingStrategy());
}
private AlgorithmConfiguration getAlgorithmConfiguration(final String
algorithmName) {
diff --git
a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingAlgorithmsExecutor.java
b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingAlgorithmsExecutor.java
index 0648765ced4..8c459146638 100644
---
a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingAlgorithmsExecutor.java
+++
b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingAlgorithmsExecutor.java
@@ -22,7 +22,7 @@ import
org.apache.shardingsphere.distsql.handler.query.RQLExecutor;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
-import org.apache.shardingsphere.infra.util.props.PropertiesConverter;
+import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import
org.apache.shardingsphere.sharding.api.config.strategy.sharding.ShardingStrategyConfiguration;
import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowUnusedShardingAlgorithmsStatement;
diff --git
a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingKeyGeneratorExecutor.java
b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingKeyGeneratorExecutor.java
index cdae93e1448..8b902311e7a 100644
---
a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingKeyGeneratorExecutor.java
+++
b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingKeyGeneratorExecutor.java
@@ -22,7 +22,7 @@ import
org.apache.shardingsphere.distsql.handler.query.RQLExecutor;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
-import org.apache.shardingsphere.infra.util.props.PropertiesConverter;
+import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import
org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowUnusedShardingKeyGeneratorsStatement;
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationProperties.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationProperties.java
index 19566b188f1..b46d3a15a84 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationProperties.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationProperties.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.infra.config.props;
-import org.apache.shardingsphere.infra.util.props.TypedProperties;
+import org.apache.shardingsphere.infra.props.TypedProperties;
import java.util.Properties;
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 1657b6f4c32..e2fcfca5688 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
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.infra.config.props;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
-import org.apache.shardingsphere.infra.util.props.TypedPropertyKey;
+import org.apache.shardingsphere.infra.props.TypedPropertyKey;
import java.util.Arrays;
import java.util.Collection;
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/temporary/TemporaryConfigurationProperties.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/temporary/TemporaryConfigurationProperties.java
index f7275533dc8..38aaf9ecae6 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/temporary/TemporaryConfigurationProperties.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/temporary/TemporaryConfigurationProperties.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.infra.config.props.temporary;
-import org.apache.shardingsphere.infra.util.props.TypedProperties;
+import org.apache.shardingsphere.infra.props.TypedProperties;
import java.util.Properties;
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/temporary/TemporaryConfigurationPropertyKey.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/temporary/TemporaryConfigurationPropertyKey.java
index 587931e9d09..e0ff9589411 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/temporary/TemporaryConfigurationPropertyKey.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/temporary/TemporaryConfigurationPropertyKey.java
@@ -19,7 +19,7 @@ package
org.apache.shardingsphere.infra.config.props.temporary;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.infra.util.props.TypedPropertyKey;
+import org.apache.shardingsphere.infra.props.TypedPropertyKey;
import java.util.Arrays;
import java.util.Collection;
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/hint/SQLHintPropertiesKey.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/hint/SQLHintPropertiesKey.java
index 2b595f1b707..66b1528a012 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/hint/SQLHintPropertiesKey.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/hint/SQLHintPropertiesKey.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.infra.hint;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.infra.util.props.TypedPropertyKey;
+import org.apache.shardingsphere.infra.props.TypedPropertyKey;
/**
* Typed property key of SQL Hint.
diff --git
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/props/PropertiesConverter.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/props/PropertiesConverter.java
similarity index 96%
rename from
infra/util/src/main/java/org/apache/shardingsphere/infra/util/props/PropertiesConverter.java
rename to
infra/common/src/main/java/org/apache/shardingsphere/infra/props/PropertiesConverter.java
index 519a96867b6..8c5cc71be29 100644
---
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/props/PropertiesConverter.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/props/PropertiesConverter.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.util.props;
+package org.apache.shardingsphere.infra.props;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
diff --git
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/props/TypedProperties.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/props/TypedProperties.java
similarity index 91%
rename from
infra/util/src/main/java/org/apache/shardingsphere/infra/util/props/TypedProperties.java
rename to
infra/common/src/main/java/org/apache/shardingsphere/infra/props/TypedProperties.java
index d89a9080725..8ca078fd8bb 100644
---
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/props/TypedProperties.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/props/TypedProperties.java
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.util.props;
+package org.apache.shardingsphere.infra.props;
import lombok.Getter;
-import
org.apache.shardingsphere.infra.util.props.exception.TypedPropertiesServerException;
-import
org.apache.shardingsphere.infra.util.props.exception.TypedPropertyValueException;
+import
org.apache.shardingsphere.infra.props.exception.TypedPropertiesServerException;
+import
org.apache.shardingsphere.infra.props.exception.TypedPropertyValueException;
import java.util.Collection;
import java.util.HashMap;
diff --git
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/props/TypedPropertyKey.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/props/TypedPropertyKey.java
similarity index 95%
rename from
infra/util/src/main/java/org/apache/shardingsphere/infra/util/props/TypedPropertyKey.java
rename to
infra/common/src/main/java/org/apache/shardingsphere/infra/props/TypedPropertyKey.java
index 846f2351bd6..a4bdf7b7d7c 100644
---
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/props/TypedPropertyKey.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/props/TypedPropertyKey.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.util.props;
+package org.apache.shardingsphere.infra.props;
/**
* Typed property key.
diff --git
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/props/TypedPropertyValue.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/props/TypedPropertyValue.java
similarity index 95%
rename from
infra/util/src/main/java/org/apache/shardingsphere/infra/util/props/TypedPropertyValue.java
rename to
infra/common/src/main/java/org/apache/shardingsphere/infra/props/TypedPropertyValue.java
index 2be028185c9..c6d93669a6d 100644
---
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/props/TypedPropertyValue.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/props/TypedPropertyValue.java
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.util.props;
+package org.apache.shardingsphere.infra.props;
import com.google.common.base.Strings;
import lombok.Getter;
-import
org.apache.shardingsphere.infra.util.props.exception.TypedPropertyValueException;
+import
org.apache.shardingsphere.infra.props.exception.TypedPropertyValueException;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
diff --git
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertiesServerException.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/props/exception/TypedPropertiesServerException.java
similarity index 77%
rename from
infra/util/src/main/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertiesServerException.java
rename to
infra/common/src/main/java/org/apache/shardingsphere/infra/props/exception/TypedPropertiesServerException.java
index e7225355275..d9fe1236de5 100644
---
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertiesServerException.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/props/exception/TypedPropertiesServerException.java
@@ -15,14 +15,16 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.util.props.exception;
+package org.apache.shardingsphere.infra.props.exception;
+
+import
org.apache.shardingsphere.infra.exception.core.external.server.ShardingSphereServerException;
import java.util.Collection;
/**
* Typed properties exception.
*/
-public final class TypedPropertiesServerException extends RuntimeException {
+public final class TypedPropertiesServerException extends
ShardingSphereServerException {
private static final long serialVersionUID = -8301410307117564844L;
@@ -31,6 +33,6 @@ public final class TypedPropertiesServerException extends
RuntimeException {
private static final int ERROR_CODE = 1;
public TypedPropertiesServerException(final Collection<String>
errorMessages) {
- super(String.format("%s-%05d: %s", ERROR_CATEGORY, ERROR_CODE,
String.join(System.lineSeparator(), errorMessages)));
+ super(ERROR_CATEGORY, ERROR_CODE, String.join(System.lineSeparator(),
errorMessages));
}
}
diff --git
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertyValueException.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/props/exception/TypedPropertyValueException.java
similarity index 71%
rename from
infra/util/src/main/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertyValueException.java
rename to
infra/common/src/main/java/org/apache/shardingsphere/infra/props/exception/TypedPropertyValueException.java
index add7fed14fb..bc9f1022f99 100644
---
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertyValueException.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/props/exception/TypedPropertyValueException.java
@@ -15,18 +15,19 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.util.props.exception;
+package org.apache.shardingsphere.infra.props.exception;
-import org.apache.shardingsphere.infra.util.props.TypedPropertyKey;
+import
org.apache.shardingsphere.infra.exception.core.internal.ShardingSphereInternalException;
+import org.apache.shardingsphere.infra.props.TypedPropertyKey;
/**
* Typed property value exception.
*/
-public final class TypedPropertyValueException extends Exception {
+public final class TypedPropertyValueException extends
ShardingSphereInternalException {
private static final long serialVersionUID = -2989212435757964906L;
public TypedPropertyValueException(final TypedPropertyKey key, final
String value) {
- super(String.format("Value `%s` of `%s` cannot convert to type `%s`",
value, key.getKey(), key.getType().getName()));
+ super("Value `%s` of `%s` cannot convert to type `%s`", value,
key.getKey(), key.getType().getName());
}
}
diff --git
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/PropertiesConverterTest.java
b/infra/common/src/test/java/org/apache/shardingsphere/infra/props/PropertiesConverterTest.java
similarity index 96%
rename from
infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/PropertiesConverterTest.java
rename to
infra/common/src/test/java/org/apache/shardingsphere/infra/props/PropertiesConverterTest.java
index 39d0fbd3115..ecfb8872947 100644
---
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/PropertiesConverterTest.java
+++
b/infra/common/src/test/java/org/apache/shardingsphere/infra/props/PropertiesConverterTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.util.props;
+package org.apache.shardingsphere.infra.props;
import org.apache.shardingsphere.test.util.PropertiesBuilder;
import org.apache.shardingsphere.test.util.PropertiesBuilder.Property;
diff --git
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/TypedPropertiesTest.java
b/infra/common/src/test/java/org/apache/shardingsphere/infra/props/TypedPropertiesTest.java
similarity index 93%
rename from
infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/TypedPropertiesTest.java
rename to
infra/common/src/test/java/org/apache/shardingsphere/infra/props/TypedPropertiesTest.java
index 11e723d2a3e..002cb293cd2 100644
---
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/TypedPropertiesTest.java
+++
b/infra/common/src/test/java/org/apache/shardingsphere/infra/props/TypedPropertiesTest.java
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.util.props;
+package org.apache.shardingsphere.infra.props;
-import
org.apache.shardingsphere.infra.util.props.exception.TypedPropertiesServerException;
-import
org.apache.shardingsphere.infra.util.props.fixture.TypedPropertiesFixture;
-import
org.apache.shardingsphere.infra.util.props.fixture.TypedPropertyKeyFixture;
+import
org.apache.shardingsphere.infra.props.exception.TypedPropertiesServerException;
+import org.apache.shardingsphere.infra.props.fixture.TypedPropertiesFixture;
+import org.apache.shardingsphere.infra.props.fixture.TypedPropertyKeyFixture;
import org.apache.shardingsphere.test.util.PropertiesBuilder;
import org.apache.shardingsphere.test.util.PropertiesBuilder.Property;
import org.junit.jupiter.api.Test;
diff --git
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/TypedPropertyValueTest.java
b/infra/common/src/test/java/org/apache/shardingsphere/infra/props/TypedPropertyValueTest.java
similarity index 90%
rename from
infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/TypedPropertyValueTest.java
rename to
infra/common/src/test/java/org/apache/shardingsphere/infra/props/TypedPropertyValueTest.java
index c642f818bf3..9aa368b735a 100644
---
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/TypedPropertyValueTest.java
+++
b/infra/common/src/test/java/org/apache/shardingsphere/infra/props/TypedPropertyValueTest.java
@@ -15,12 +15,12 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.util.props;
+package org.apache.shardingsphere.infra.props;
-import
org.apache.shardingsphere.infra.util.props.exception.TypedPropertyValueException;
-import
org.apache.shardingsphere.infra.util.props.fixture.enums.TypedPropertyEnumFixture;
-import
org.apache.shardingsphere.infra.util.props.fixture.TypedPropertyKeyFixture;
-import
org.apache.shardingsphere.infra.util.props.fixture.typed.PropertiesTypedSPIFixture;
+import
org.apache.shardingsphere.infra.props.exception.TypedPropertyValueException;
+import
org.apache.shardingsphere.infra.props.fixture.enums.TypedPropertyEnumFixture;
+import org.apache.shardingsphere.infra.props.fixture.TypedPropertyKeyFixture;
+import
org.apache.shardingsphere.infra.props.fixture.typed.PropertiesTypedSPIFixture;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
import org.junit.jupiter.api.Test;
diff --git
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertiesExceptionTest.java
b/infra/common/src/test/java/org/apache/shardingsphere/infra/props/exception/TypedPropertiesExceptionTest.java
similarity index 95%
rename from
infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertiesExceptionTest.java
rename to
infra/common/src/test/java/org/apache/shardingsphere/infra/props/exception/TypedPropertiesExceptionTest.java
index cfd882827bc..2fd1bd119ef 100644
---
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertiesExceptionTest.java
+++
b/infra/common/src/test/java/org/apache/shardingsphere/infra/props/exception/TypedPropertiesExceptionTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.util.props.exception;
+package org.apache.shardingsphere.infra.props.exception;
import org.junit.jupiter.api.Test;
diff --git
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertyValueExceptionTest.java
b/infra/common/src/test/java/org/apache/shardingsphere/infra/props/exception/TypedPropertyValueExceptionTest.java
similarity index 89%
rename from
infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertyValueExceptionTest.java
rename to
infra/common/src/test/java/org/apache/shardingsphere/infra/props/exception/TypedPropertyValueExceptionTest.java
index 103894bda9b..e2094eb361b 100644
---
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertyValueExceptionTest.java
+++
b/infra/common/src/test/java/org/apache/shardingsphere/infra/props/exception/TypedPropertyValueExceptionTest.java
@@ -15,9 +15,9 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.util.props.exception;
+package org.apache.shardingsphere.infra.props.exception;
-import
org.apache.shardingsphere.infra.util.props.fixture.TypedPropertyKeyFixture;
+import org.apache.shardingsphere.infra.props.fixture.TypedPropertyKeyFixture;
import org.junit.jupiter.api.Test;
import static org.hamcrest.CoreMatchers.is;
diff --git
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/fixture/TypedPropertiesFixture.java
b/infra/common/src/test/java/org/apache/shardingsphere/infra/props/fixture/TypedPropertiesFixture.java
similarity index 89%
rename from
infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/fixture/TypedPropertiesFixture.java
rename to
infra/common/src/test/java/org/apache/shardingsphere/infra/props/fixture/TypedPropertiesFixture.java
index 4ce78834ed1..4b3b22c198f 100644
---
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/fixture/TypedPropertiesFixture.java
+++
b/infra/common/src/test/java/org/apache/shardingsphere/infra/props/fixture/TypedPropertiesFixture.java
@@ -15,9 +15,9 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.util.props.fixture;
+package org.apache.shardingsphere.infra.props.fixture;
-import org.apache.shardingsphere.infra.util.props.TypedProperties;
+import org.apache.shardingsphere.infra.props.TypedProperties;
import java.util.Properties;
diff --git
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/fixture/TypedPropertyKeyFixture.java
b/infra/common/src/test/java/org/apache/shardingsphere/infra/props/fixture/TypedPropertyKeyFixture.java
similarity index 84%
rename from
infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/fixture/TypedPropertyKeyFixture.java
rename to
infra/common/src/test/java/org/apache/shardingsphere/infra/props/fixture/TypedPropertyKeyFixture.java
index 1ba950b0377..09dc5e4b000 100644
---
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/fixture/TypedPropertyKeyFixture.java
+++
b/infra/common/src/test/java/org/apache/shardingsphere/infra/props/fixture/TypedPropertyKeyFixture.java
@@ -15,13 +15,13 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.util.props.fixture;
+package org.apache.shardingsphere.infra.props.fixture;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.infra.util.props.TypedPropertyKey;
-import
org.apache.shardingsphere.infra.util.props.fixture.enums.TypedPropertyEnumFixture;
-import
org.apache.shardingsphere.infra.util.props.fixture.typed.PropertiesTypedSPIFixture;
+import org.apache.shardingsphere.infra.props.TypedPropertyKey;
+import
org.apache.shardingsphere.infra.props.fixture.enums.TypedPropertyEnumFixture;
+import
org.apache.shardingsphere.infra.props.fixture.typed.PropertiesTypedSPIFixture;
@RequiredArgsConstructor
@Getter
diff --git
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/fixture/enums/TypedPropertyEnumFixture.java
b/infra/common/src/test/java/org/apache/shardingsphere/infra/props/fixture/enums/TypedPropertyEnumFixture.java
similarity index 92%
rename from
infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/fixture/enums/TypedPropertyEnumFixture.java
rename to
infra/common/src/test/java/org/apache/shardingsphere/infra/props/fixture/enums/TypedPropertyEnumFixture.java
index 8e7d6e6c439..0b1818a0d87 100644
---
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/fixture/enums/TypedPropertyEnumFixture.java
+++
b/infra/common/src/test/java/org/apache/shardingsphere/infra/props/fixture/enums/TypedPropertyEnumFixture.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.util.props.fixture.enums;
+package org.apache.shardingsphere.infra.props.fixture.enums;
public enum TypedPropertyEnumFixture {
diff --git
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/fixture/typed/PropertiesTypedSPIFixture.java
b/infra/common/src/test/java/org/apache/shardingsphere/infra/props/fixture/typed/PropertiesTypedSPIFixture.java
similarity index 93%
rename from
infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/fixture/typed/PropertiesTypedSPIFixture.java
rename to
infra/common/src/test/java/org/apache/shardingsphere/infra/props/fixture/typed/PropertiesTypedSPIFixture.java
index 488686698ac..41626092582 100644
---
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/fixture/typed/PropertiesTypedSPIFixture.java
+++
b/infra/common/src/test/java/org/apache/shardingsphere/infra/props/fixture/typed/PropertiesTypedSPIFixture.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.util.props.fixture.typed;
+package org.apache.shardingsphere.infra.props.fixture.typed;
import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI;
diff --git
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/fixture/typed/PropertiesTypedSPIFixtureImpl.java
b/infra/common/src/test/java/org/apache/shardingsphere/infra/props/fixture/typed/PropertiesTypedSPIFixtureImpl.java
similarity index 93%
rename from
infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/fixture/typed/PropertiesTypedSPIFixtureImpl.java
rename to
infra/common/src/test/java/org/apache/shardingsphere/infra/props/fixture/typed/PropertiesTypedSPIFixtureImpl.java
index 1a208fcec72..228febde6b7 100644
---
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/props/fixture/typed/PropertiesTypedSPIFixtureImpl.java
+++
b/infra/common/src/test/java/org/apache/shardingsphere/infra/props/fixture/typed/PropertiesTypedSPIFixtureImpl.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.util.props.fixture.typed;
+package org.apache.shardingsphere.infra.props.fixture.typed;
public final class PropertiesTypedSPIFixtureImpl implements
PropertiesTypedSPIFixture {
diff --git
a/infra/util/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.util.props.fixture.typed.PropertiesTypedSPIFixture
b/infra/common/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.props.fixture.typed.PropertiesTypedSPIFixture
similarity index 90%
rename from
infra/util/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.util.props.fixture.typed.PropertiesTypedSPIFixture
rename to
infra/common/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.props.fixture.typed.PropertiesTypedSPIFixture
index 046e45d5e2e..56d9c9d34ab 100644
---
a/infra/util/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.util.props.fixture.typed.PropertiesTypedSPIFixture
+++
b/infra/common/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.props.fixture.typed.PropertiesTypedSPIFixture
@@ -15,4 +15,4 @@
# limitations under the License.
#
-org.apache.shardingsphere.infra.util.props.fixture.typed.PropertiesTypedSPIFixtureImpl
+org.apache.shardingsphere.infra.props.fixture.typed.PropertiesTypedSPIFixtureImpl
diff --git
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/regular/RegularUtils.java
b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/regular/RegularUtils.java
deleted file mode 100644
index 2d673654107..00000000000
---
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/regular/RegularUtils.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.infra.util.regular;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Regular utility class.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class RegularUtils {
-
- /**
- * Tells whether this input string matches the given regular expression.
- *
- * @param regex the regular expression to which the input string is to be
matched
- * @param toBeMatched the string to be matched
- * @return whether the regular expression matches on the input
- */
- public static boolean matchesCaseInsensitive(final String regex, final
String toBeMatched) {
- Pattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
- Matcher m = p.matcher(toBeMatched);
- return m.matches();
- }
-}
diff --git
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/regular/RegularUtilsTest.java
b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/regular/RegularUtilsTest.java
deleted file mode 100644
index 5f68c57f518..00000000000
---
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/regular/RegularUtilsTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.infra.util.regular;
-
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-class RegularUtilsTest {
-
- @Test
- void assertMatchesWithUpperCaseRegex() {
- assertTrue(RegularUtils.matchesCaseInsensitive("T.ORDER", "t_order"));
- }
-
- @Test
- void assertMatchesWithLowerCaseRegex() {
- assertTrue(RegularUtils.matchesCaseInsensitive("t.order", "t_order"));
- }
-
- @Test
- void assertMatchesWithUpperCaseInput() {
- assertTrue(RegularUtils.matchesCaseInsensitive("t.order", "T_ORDER"));
- }
-}
diff --git
a/kernel/global-clock/type/tso/provider/redis/src/main/java/org/apache/shardingsphere/globalclock/type/tso/provider/RedisTSOPropertyKey.java
b/kernel/global-clock/type/tso/provider/redis/src/main/java/org/apache/shardingsphere/globalclock/type/tso/provider/RedisTSOPropertyKey.java
index dbbae4c662e..b800a6e7e57 100644
---
a/kernel/global-clock/type/tso/provider/redis/src/main/java/org/apache/shardingsphere/globalclock/type/tso/provider/RedisTSOPropertyKey.java
+++
b/kernel/global-clock/type/tso/provider/redis/src/main/java/org/apache/shardingsphere/globalclock/type/tso/provider/RedisTSOPropertyKey.java
@@ -19,7 +19,7 @@ package
org.apache.shardingsphere.globalclock.type.tso.provider;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.infra.util.props.TypedPropertyKey;
+import org.apache.shardingsphere.infra.props.TypedPropertyKey;
/**
* Property key of redis timestamp oracle provider.
diff --git
a/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/query/ShowSingleTableExecutor.java
b/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/query/ShowSingleTableExecutor.java
index a4315413bad..d21c27f91e2 100644
---
a/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/query/ShowSingleTableExecutor.java
+++
b/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/query/ShowSingleTableExecutor.java
@@ -21,7 +21,6 @@ import
org.apache.shardingsphere.distsql.handler.query.RQLExecutor;
import org.apache.shardingsphere.infra.datanode.DataNode;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
-import org.apache.shardingsphere.infra.util.regular.RegularUtils;
import
org.apache.shardingsphere.single.distsql.statement.rql.ShowSingleTableStatement;
import org.apache.shardingsphere.single.rule.SingleRule;
import org.apache.shardingsphere.sql.parser.sql.common.util.SQLUtils;
@@ -29,8 +28,8 @@ import
org.apache.shardingsphere.sql.parser.sql.common.util.SQLUtils;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
-import java.util.LinkedList;
import java.util.Objects;
+import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -46,10 +45,7 @@ public final class ShowSingleTableExecutor implements
RQLExecutor<ShowSingleTabl
@Override
public Collection<LocalDataQueryResultRow> getRows(final
ShardingSphereDatabase database, final ShowSingleTableStatement sqlStatement) {
- Collection<LocalDataQueryResultRow> result = new LinkedList<>();
- Collection<DataNode> dataNodes = getDataNodes(database, sqlStatement);
- dataNodes.forEach(each -> result.add(new
LocalDataQueryResultRow(each.getTableName(), each.getDataSourceName())));
- return result;
+ return getDataNodes(database, sqlStatement).stream().map(each -> new
LocalDataQueryResultRow(each.getTableName(),
each.getDataSourceName())).collect(Collectors.toList());
}
private Collection<DataNode> getDataNodes(final ShardingSphereDatabase
database, final ShowSingleTableStatement sqlStatement) {
@@ -60,7 +56,7 @@ public final class ShowSingleTableExecutor implements
RQLExecutor<ShowSingleTabl
}
if (sqlStatement.getLikePattern().isPresent()) {
String pattern =
SQLUtils.convertLikePatternToRegex(sqlStatement.getLikePattern().get());
- singleTableNodes = singleTableNodes.filter(each ->
RegularUtils.matchesCaseInsensitive(pattern,
each.getTableName())).collect(Collectors.toList()).stream();
+ singleTableNodes = singleTableNodes.filter(each ->
Pattern.compile(pattern,
Pattern.CASE_INSENSITIVE).matcher(each.getTableName()).matches()).collect(Collectors.toList()).stream();
}
return
singleTableNodes.sorted(Comparator.comparing(DataNode::getTableName)).collect(Collectors.toList());
}
diff --git
a/kernel/traffic/distsql/handler/src/main/java/org/apache/shardingsphere/traffic/distsql/handler/query/ShowTrafficRuleExecutor.java
b/kernel/traffic/distsql/handler/src/main/java/org/apache/shardingsphere/traffic/distsql/handler/query/ShowTrafficRuleExecutor.java
index fcffe421f86..f239aab4162 100644
---
a/kernel/traffic/distsql/handler/src/main/java/org/apache/shardingsphere/traffic/distsql/handler/query/ShowTrafficRuleExecutor.java
+++
b/kernel/traffic/distsql/handler/src/main/java/org/apache/shardingsphere/traffic/distsql/handler/query/ShowTrafficRuleExecutor.java
@@ -21,7 +21,7 @@ import
org.apache.shardingsphere.distsql.handler.ral.query.MetaDataRequiredQuery
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
-import org.apache.shardingsphere.infra.util.props.PropertiesConverter;
+import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.traffic.api.config.TrafficRuleConfiguration;
import
org.apache.shardingsphere.traffic.api.config.TrafficStrategyConfiguration;
import
org.apache.shardingsphere.traffic.distsql.parser.statement.queryable.ShowTrafficRulesStatement;
diff --git
a/kernel/transaction/distsql/handler/src/main/java/org/apache/shardingsphere/transaction/distsql/handler/query/ShowTransactionRuleExecutor.java
b/kernel/transaction/distsql/handler/src/main/java/org/apache/shardingsphere/transaction/distsql/handler/query/ShowTransactionRuleExecutor.java
index 5f6aa532d56..71a66cad380 100644
---
a/kernel/transaction/distsql/handler/src/main/java/org/apache/shardingsphere/transaction/distsql/handler/query/ShowTransactionRuleExecutor.java
+++
b/kernel/transaction/distsql/handler/src/main/java/org/apache/shardingsphere/transaction/distsql/handler/query/ShowTransactionRuleExecutor.java
@@ -20,7 +20,7 @@ package
org.apache.shardingsphere.transaction.distsql.handler.query;
import
org.apache.shardingsphere.distsql.handler.ral.query.MetaDataRequiredQueryableRALExecutor;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
-import org.apache.shardingsphere.infra.util.props.PropertiesConverter;
+import org.apache.shardingsphere.infra.props.PropertiesConverter;
import
org.apache.shardingsphere.transaction.distsql.parser.statement.queryable.ShowTransactionRuleStatement;
import org.apache.shardingsphere.transaction.rule.TransactionRule;
diff --git
a/kernel/transaction/distsql/handler/src/test/java/org/apache/shardingsphere/transaction/distsql/handler/update/AlterTransactionRuleStatementUpdaterTest.java
b/kernel/transaction/distsql/handler/src/test/java/org/apache/shardingsphere/transaction/distsql/handler/update/AlterTransactionRuleStatementUpdaterTest.java
index 7f9f749bbea..66736125210 100644
---
a/kernel/transaction/distsql/handler/src/test/java/org/apache/shardingsphere/transaction/distsql/handler/update/AlterTransactionRuleStatementUpdaterTest.java
+++
b/kernel/transaction/distsql/handler/src/test/java/org/apache/shardingsphere/transaction/distsql/handler/update/AlterTransactionRuleStatementUpdaterTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.transaction.distsql.handler.update;
-import org.apache.shardingsphere.infra.util.props.PropertiesConverter;
+import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
import org.apache.shardingsphere.test.mock.AutoMockExtension;
import org.apache.shardingsphere.test.mock.StaticMockSettings;
diff --git
a/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/lock/creator/DistributedLockCreator.java
b/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/lock/creator/DistributedLockCreator.java
index 73eec374413..88c42b37849 100644
---
a/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/lock/creator/DistributedLockCreator.java
+++
b/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/lock/creator/DistributedLockCreator.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.mode.repository.cluster.lock.creator;
-import org.apache.shardingsphere.infra.util.props.TypedProperties;
+import org.apache.shardingsphere.infra.props.TypedProperties;
import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI;
import org.apache.shardingsphere.mode.repository.cluster.lock.DistributedLock;
diff --git
a/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/lock/holder/DistributedLockHolder.java
b/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/lock/holder/DistributedLockHolder.java
index 17e608a881e..00c169180f6 100644
---
a/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/lock/holder/DistributedLockHolder.java
+++
b/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/lock/holder/DistributedLockHolder.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.mode.repository.cluster.lock.holder;
-import org.apache.shardingsphere.infra.util.props.TypedProperties;
+import org.apache.shardingsphere.infra.props.TypedProperties;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
import org.apache.shardingsphere.mode.repository.cluster.lock.DistributedLock;
import
org.apache.shardingsphere.mode.repository.cluster.lock.creator.DistributedLockCreator;
diff --git
a/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/lock/impl/props/DefaultLockPropertyKey.java
b/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/lock/impl/props/DefaultLockPropertyKey.java
index 9ec1662da0a..65f3bfcabb6 100644
---
a/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/lock/impl/props/DefaultLockPropertyKey.java
+++
b/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/lock/impl/props/DefaultLockPropertyKey.java
@@ -19,7 +19,7 @@ package
org.apache.shardingsphere.mode.repository.cluster.lock.impl.props;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.infra.util.props.TypedPropertyKey;
+import org.apache.shardingsphere.infra.props.TypedPropertyKey;
/**
* Default lock property key.
diff --git
a/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/lock/impl/props/DefaultLockTypedProperties.java
b/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/lock/impl/props/DefaultLockTypedProperties.java
index 3fbb12c6cb2..230a492a748 100644
---
a/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/lock/impl/props/DefaultLockTypedProperties.java
+++
b/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/lock/impl/props/DefaultLockTypedProperties.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.mode.repository.cluster.lock.impl.props;
-import org.apache.shardingsphere.infra.util.props.TypedProperties;
+import org.apache.shardingsphere.infra.props.TypedProperties;
import java.util.Properties;
diff --git
a/mode/type/cluster/repository/provider/consul/src/main/java/org/apache/shardingsphere/mode/repository/cluster/consul/props/ConsulProperties.java
b/mode/type/cluster/repository/provider/consul/src/main/java/org/apache/shardingsphere/mode/repository/cluster/consul/props/ConsulProperties.java
index 37df4ab43bd..7e19fcd92ee 100644
---
a/mode/type/cluster/repository/provider/consul/src/main/java/org/apache/shardingsphere/mode/repository/cluster/consul/props/ConsulProperties.java
+++
b/mode/type/cluster/repository/provider/consul/src/main/java/org/apache/shardingsphere/mode/repository/cluster/consul/props/ConsulProperties.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.mode.repository.cluster.consul.props;
-import org.apache.shardingsphere.infra.util.props.TypedProperties;
+import org.apache.shardingsphere.infra.props.TypedProperties;
import java.util.Properties;
/**
diff --git
a/mode/type/cluster/repository/provider/consul/src/main/java/org/apache/shardingsphere/mode/repository/cluster/consul/props/ConsulPropertyKey.java
b/mode/type/cluster/repository/provider/consul/src/main/java/org/apache/shardingsphere/mode/repository/cluster/consul/props/ConsulPropertyKey.java
index 7b4aa8f427d..b6cb2536e0a 100644
---
a/mode/type/cluster/repository/provider/consul/src/main/java/org/apache/shardingsphere/mode/repository/cluster/consul/props/ConsulPropertyKey.java
+++
b/mode/type/cluster/repository/provider/consul/src/main/java/org/apache/shardingsphere/mode/repository/cluster/consul/props/ConsulPropertyKey.java
@@ -19,7 +19,7 @@ package
org.apache.shardingsphere.mode.repository.cluster.consul.props;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.infra.util.props.TypedPropertyKey;
+import org.apache.shardingsphere.infra.props.TypedPropertyKey;
/**
* Typed property key of Consul.
diff --git
a/mode/type/cluster/repository/provider/etcd/src/main/java/org/apache/shardingsphere/mode/repository/cluster/etcd/props/EtcdProperties.java
b/mode/type/cluster/repository/provider/etcd/src/main/java/org/apache/shardingsphere/mode/repository/cluster/etcd/props/EtcdProperties.java
index ca11e3604ac..9bfd3fe0e0b 100644
---
a/mode/type/cluster/repository/provider/etcd/src/main/java/org/apache/shardingsphere/mode/repository/cluster/etcd/props/EtcdProperties.java
+++
b/mode/type/cluster/repository/provider/etcd/src/main/java/org/apache/shardingsphere/mode/repository/cluster/etcd/props/EtcdProperties.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.mode.repository.cluster.etcd.props;
-import org.apache.shardingsphere.infra.util.props.TypedProperties;
+import org.apache.shardingsphere.infra.props.TypedProperties;
import java.util.Properties;
diff --git
a/mode/type/cluster/repository/provider/etcd/src/main/java/org/apache/shardingsphere/mode/repository/cluster/etcd/props/EtcdPropertyKey.java
b/mode/type/cluster/repository/provider/etcd/src/main/java/org/apache/shardingsphere/mode/repository/cluster/etcd/props/EtcdPropertyKey.java
index 9914545bfc1..70eca0b0f8d 100644
---
a/mode/type/cluster/repository/provider/etcd/src/main/java/org/apache/shardingsphere/mode/repository/cluster/etcd/props/EtcdPropertyKey.java
+++
b/mode/type/cluster/repository/provider/etcd/src/main/java/org/apache/shardingsphere/mode/repository/cluster/etcd/props/EtcdPropertyKey.java
@@ -19,7 +19,7 @@ package
org.apache.shardingsphere.mode.repository.cluster.etcd.props;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.infra.util.props.TypedPropertyKey;
+import org.apache.shardingsphere.infra.props.TypedPropertyKey;
/**
* Typed property key of Etcd.
diff --git
a/mode/type/cluster/repository/provider/nacos/src/main/java/org/apache/shardingsphere/mode/repository/cluster/nacos/props/NacosProperties.java
b/mode/type/cluster/repository/provider/nacos/src/main/java/org/apache/shardingsphere/mode/repository/cluster/nacos/props/NacosProperties.java
index 9c819117028..5b4e3a5b7e6 100644
---
a/mode/type/cluster/repository/provider/nacos/src/main/java/org/apache/shardingsphere/mode/repository/cluster/nacos/props/NacosProperties.java
+++
b/mode/type/cluster/repository/provider/nacos/src/main/java/org/apache/shardingsphere/mode/repository/cluster/nacos/props/NacosProperties.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.mode.repository.cluster.nacos.props;
-import org.apache.shardingsphere.infra.util.props.TypedProperties;
+import org.apache.shardingsphere.infra.props.TypedProperties;
import java.util.Properties;
diff --git
a/mode/type/cluster/repository/provider/nacos/src/main/java/org/apache/shardingsphere/mode/repository/cluster/nacos/props/NacosPropertyKey.java
b/mode/type/cluster/repository/provider/nacos/src/main/java/org/apache/shardingsphere/mode/repository/cluster/nacos/props/NacosPropertyKey.java
index 6d9e1f24c6b..fbec54ac9ee 100644
---
a/mode/type/cluster/repository/provider/nacos/src/main/java/org/apache/shardingsphere/mode/repository/cluster/nacos/props/NacosPropertyKey.java
+++
b/mode/type/cluster/repository/provider/nacos/src/main/java/org/apache/shardingsphere/mode/repository/cluster/nacos/props/NacosPropertyKey.java
@@ -19,7 +19,7 @@ package
org.apache.shardingsphere.mode.repository.cluster.nacos.props;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.infra.util.props.TypedPropertyKey;
+import org.apache.shardingsphere.infra.props.TypedPropertyKey;
/**
* Typed property key of Nacos.
diff --git
a/mode/type/cluster/repository/provider/zookeeper/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/props/ZookeeperProperties.java
b/mode/type/cluster/repository/provider/zookeeper/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/props/ZookeeperProperties.java
index 8344bc193c9..ef3366123ed 100644
---
a/mode/type/cluster/repository/provider/zookeeper/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/props/ZookeeperProperties.java
+++
b/mode/type/cluster/repository/provider/zookeeper/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/props/ZookeeperProperties.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.mode.repository.cluster.zookeeper.props;
-import org.apache.shardingsphere.infra.util.props.TypedProperties;
+import org.apache.shardingsphere.infra.props.TypedProperties;
import java.util.Properties;
diff --git
a/mode/type/cluster/repository/provider/zookeeper/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/props/ZookeeperPropertyKey.java
b/mode/type/cluster/repository/provider/zookeeper/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/props/ZookeeperPropertyKey.java
index 43631b17165..2ec4bd50a60 100644
---
a/mode/type/cluster/repository/provider/zookeeper/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/props/ZookeeperPropertyKey.java
+++
b/mode/type/cluster/repository/provider/zookeeper/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/props/ZookeeperPropertyKey.java
@@ -19,7 +19,7 @@ package
org.apache.shardingsphere.mode.repository.cluster.zookeeper.props;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.infra.util.props.TypedPropertyKey;
+import org.apache.shardingsphere.infra.props.TypedPropertyKey;
/**
* Typed property key of Zookeeper.
diff --git
a/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/props/JDBCRepositoryProperties.java
b/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/props/JDBCRepositoryProperties.java
index c2588fa4069..56f3c799278 100644
---
a/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/props/JDBCRepositoryProperties.java
+++
b/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/props/JDBCRepositoryProperties.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.mode.repository.standalone.jdbc.props;
-import org.apache.shardingsphere.infra.util.props.TypedProperties;
+import org.apache.shardingsphere.infra.props.TypedProperties;
import java.util.Properties;
diff --git
a/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/props/JDBCRepositoryPropertyKey.java
b/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/props/JDBCRepositoryPropertyKey.java
index 7361a038625..09a5c406f8b 100644
---
a/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/props/JDBCRepositoryPropertyKey.java
+++
b/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/props/JDBCRepositoryPropertyKey.java
@@ -19,7 +19,7 @@ package
org.apache.shardingsphere.mode.repository.standalone.jdbc.props;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.infra.util.props.TypedPropertyKey;
+import org.apache.shardingsphere.infra.props.TypedPropertyKey;
/**
* H2 repository property key.
diff --git
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariablesExecutor.java
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariablesExecutor.java
index 0f0ab8e82fb..fde0a2e02ab 100644
---
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariablesExecutor.java
+++
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariablesExecutor.java
@@ -28,7 +28,6 @@ import org.apache.shardingsphere.logging.util.LoggingUtils;
import
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.common.enums.VariableEnum;
import
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.queryable.executor.ConnectionSessionRequiredQueryableRALExecutor;
import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
-import org.apache.shardingsphere.infra.util.regular.RegularUtils;
import org.apache.shardingsphere.sql.parser.sql.common.util.SQLUtils;
import java.util.Arrays;
@@ -36,6 +35,7 @@ import java.util.Collection;
import java.util.Comparator;
import java.util.Optional;
import java.util.Properties;
+import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
@@ -60,7 +60,7 @@ public final class ShowDistVariablesExecutor implements
ConnectionSessionRequire
addLoggingPropsRows(metaData, result);
if (sqlStatement.getLikePattern().isPresent()) {
String pattern =
SQLUtils.convertLikePatternToRegex(sqlStatement.getLikePattern().get());
- result = result.stream().filter(each ->
RegularUtils.matchesCaseInsensitive(pattern, (String)
each.getCell(1))).collect(Collectors.toList());
+ result = result.stream().filter(each -> Pattern.compile(pattern,
Pattern.CASE_INSENSITIVE).matcher((String)
each.getCell(1)).matches()).collect(Collectors.toList());
}
return result.stream().sorted(Comparator.comparing(each ->
each.getCell(1).toString())).collect(Collectors.toList());
}
diff --git
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetDistVariableUpdater.java
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetDistVariableUpdater.java
index 6d7956b6498..f697332b252 100644
---
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetDistVariableUpdater.java
+++
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetDistVariableUpdater.java
@@ -23,9 +23,9 @@ import ch.qos.logback.classic.LoggerContext;
import
org.apache.shardingsphere.distsql.parser.statement.ral.updatable.SetDistVariableStatement;
import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
import
org.apache.shardingsphere.infra.config.props.temporary.TemporaryConfigurationPropertyKey;
-import org.apache.shardingsphere.infra.util.props.TypedPropertyKey;
-import org.apache.shardingsphere.infra.util.props.TypedPropertyValue;
-import
org.apache.shardingsphere.infra.util.props.exception.TypedPropertyValueException;
+import org.apache.shardingsphere.infra.props.TypedPropertyKey;
+import org.apache.shardingsphere.infra.props.TypedPropertyValue;
+import
org.apache.shardingsphere.infra.props.exception.TypedPropertyValueException;
import org.apache.shardingsphere.logging.constant.LoggingConstants;
import org.apache.shardingsphere.logging.util.LoggingUtils;
import org.apache.shardingsphere.mode.manager.ContextManager;
diff --git
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/rule/ShowLogicalTableExecutor.java
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/rule/ShowLogicalTableExecutor.java
index 92929ebb578..5f7ad5cec37 100644
---
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/rule/ShowLogicalTableExecutor.java
+++
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/rule/ShowLogicalTableExecutor.java
@@ -23,12 +23,11 @@ import
org.apache.shardingsphere.infra.database.core.metadata.database.DialectDa
import org.apache.shardingsphere.infra.database.core.type.DatabaseTypeRegistry;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
-import org.apache.shardingsphere.infra.util.regular.RegularUtils;
import org.apache.shardingsphere.sql.parser.sql.common.util.SQLUtils;
import java.util.Collection;
import java.util.Collections;
-import java.util.LinkedList;
+import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
@@ -36,6 +35,11 @@ import java.util.stream.Collectors;
*/
public final class ShowLogicalTableExecutor implements
RQLExecutor<ShowLogicalTablesStatement> {
+ @Override
+ public Collection<String> getColumnNames() {
+ return Collections.singleton("table_name");
+ }
+
@Override
public Collection<LocalDataQueryResultRow> getRows(final
ShardingSphereDatabase database, final ShowLogicalTablesStatement sqlStatement)
{
DialectDatabaseMetaData dialectDatabaseMetaData = new
DatabaseTypeRegistry(database.getProtocolType()).getDialectDatabaseMetaData();
@@ -46,16 +50,9 @@ public final class ShowLogicalTableExecutor implements
RQLExecutor<ShowLogicalTa
Collection<String> tables =
database.getSchema(schemaName).getAllTableNames();
if (sqlStatement.getLikePattern().isPresent()) {
String pattern =
SQLUtils.convertLikePatternToRegex(sqlStatement.getLikePattern().get());
- tables = tables.stream().filter(each ->
RegularUtils.matchesCaseInsensitive(pattern,
each)).collect(Collectors.toList());
+ tables = tables.stream().filter(each -> Pattern.compile(pattern,
Pattern.CASE_INSENSITIVE).matcher(each).matches()).collect(Collectors.toList());
}
- Collection<LocalDataQueryResultRow> result = new LinkedList<>();
- tables.forEach(each -> result.add(new LocalDataQueryResultRow(each)));
- return result;
- }
-
- @Override
- public Collection<String> getColumnNames() {
- return Collections.singletonList("table_name");
+ return
tables.stream().map(LocalDataQueryResultRow::new).collect(Collectors.toList());
}
@Override
diff --git
a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/rule/ShowLogicalTableExecutorTest.java
b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/rule/ShowLogicalTableExecutorTest.java
index 7bc534961fc..bde6a6519b9 100644
---
a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/rule/ShowLogicalTableExecutorTest.java
+++
b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/rule/ShowLogicalTableExecutorTest.java
@@ -45,6 +45,8 @@ import static org.mockito.Mockito.when;
@MockitoSettings(strictness = Strictness.LENIENT)
class ShowLogicalTableExecutorTest {
+ private final RQLExecutor<ShowLogicalTablesStatement> executor = new
ShowLogicalTableExecutor();
+
@Mock
private ShardingSphereDatabase database;
@@ -59,7 +61,6 @@ class ShowLogicalTableExecutorTest {
@Test
void assertGetRowData() {
- RQLExecutor<ShowLogicalTablesStatement> executor = new
ShowLogicalTableExecutor();
Collection<LocalDataQueryResultRow> actual =
executor.getRows(database, mock(ShowLogicalTablesStatement.class));
assertThat(actual.size(), is(2));
Iterator<LocalDataQueryResultRow> iterator = actual.iterator();
@@ -71,7 +72,6 @@ class ShowLogicalTableExecutorTest {
@Test
void assertRowDataWithLike() {
- RQLExecutor<ShowLogicalTablesStatement> executor = new
ShowLogicalTableExecutor();
Collection<LocalDataQueryResultRow> actual =
executor.getRows(database, new ShowLogicalTablesStatement("t_order_%", null));
assertThat(actual.size(), is(1));
Iterator<LocalDataQueryResultRow> iterator = actual.iterator();
@@ -80,7 +80,6 @@ class ShowLogicalTableExecutorTest {
@Test
void assertGetColumnNames() {
- RQLExecutor<ShowLogicalTablesStatement> executor = new
ShowLogicalTableExecutor();
Collection<String> columns = executor.getColumnNames();
assertThat(columns.size(), is(1));
Iterator<String> iterator = columns.iterator();
diff --git
a/proxy/backend/type/hbase/src/main/java/org/apache/shardingsphere/proxy/backend/hbase/props/HBaseProperties.java
b/proxy/backend/type/hbase/src/main/java/org/apache/shardingsphere/proxy/backend/hbase/props/HBaseProperties.java
index b00edd5e327..64b70286086 100644
---
a/proxy/backend/type/hbase/src/main/java/org/apache/shardingsphere/proxy/backend/hbase/props/HBaseProperties.java
+++
b/proxy/backend/type/hbase/src/main/java/org/apache/shardingsphere/proxy/backend/hbase/props/HBaseProperties.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.proxy.backend.hbase.props;
-import org.apache.shardingsphere.infra.util.props.TypedProperties;
+import org.apache.shardingsphere.infra.props.TypedProperties;
import java.util.Properties;
/**
diff --git
a/proxy/backend/type/hbase/src/main/java/org/apache/shardingsphere/proxy/backend/hbase/props/HBasePropertyKey.java
b/proxy/backend/type/hbase/src/main/java/org/apache/shardingsphere/proxy/backend/hbase/props/HBasePropertyKey.java
index d3667d8f2b9..6d73c7f33ab 100644
---
a/proxy/backend/type/hbase/src/main/java/org/apache/shardingsphere/proxy/backend/hbase/props/HBasePropertyKey.java
+++
b/proxy/backend/type/hbase/src/main/java/org/apache/shardingsphere/proxy/backend/hbase/props/HBasePropertyKey.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.proxy.backend.hbase.props;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.infra.util.props.TypedPropertyKey;
+import org.apache.shardingsphere.infra.props.TypedPropertyKey;
/**
* Typed property key of HBase.
diff --git
a/proxy/backend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowTablesExecutor.java
b/proxy/backend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowTablesExecutor.java
index beba3deaa09..00e33cf4f10 100644
---
a/proxy/backend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowTablesExecutor.java
+++
b/proxy/backend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowTablesExecutor.java
@@ -30,7 +30,6 @@ import
org.apache.shardingsphere.infra.executor.sql.execute.result.query.type.me
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import
org.apache.shardingsphere.infra.merge.result.impl.transparent.TransparentMergedResult;
import
org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereTable;
-import org.apache.shardingsphere.infra.util.regular.RegularUtils;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
import
org.apache.shardingsphere.proxy.backend.handler.admin.executor.DatabaseAdminQueryExecutor;
import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
@@ -43,6 +42,7 @@ import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
+import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
@@ -99,10 +99,10 @@ public final class ShowTablesExecutor implements
DatabaseAdminQueryExecutor {
private Collection<String> getAllTableNames(final String databaseName) {
Collection<String> result = ProxyContext.getInstance()
.getDatabase(databaseName).getSchema(databaseName).getTables().values().stream().map(ShardingSphereTable::getName).collect(Collectors.toList());
- if (showTablesStatement.getFilter().isPresent()) {
- Optional<String> pattern =
showTablesStatement.getFilter().get().getLike().map(optional ->
SQLUtils.convertLikePatternToRegex(optional.getPattern()));
- return pattern.isPresent() ? result.stream().filter(each ->
RegularUtils.matchesCaseInsensitive(pattern.get(),
each)).collect(Collectors.toList()) : result;
+ if (!showTablesStatement.getFilter().isPresent()) {
+ return result;
}
- return result;
+ Optional<String> pattern =
showTablesStatement.getFilter().get().getLike().map(optional ->
SQLUtils.convertLikePatternToRegex(optional.getPattern()));
+ return pattern.isPresent() ? result.stream().filter(each ->
Pattern.compile(pattern.get(),
Pattern.CASE_INSENSITIVE).matcher(each).matches()).collect(Collectors.toList())
: result;
}
}