This is an automated email from the ASF dual-hosted git repository.

wuweijie 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 9e35a891fb4 Rename DistSQLDataSourcePoolPropertiesValidator (#30700)
9e35a891fb4 is described below

commit 9e35a891fb4a2b9a852c504fe0b4444f8e34c2cf
Author: Liang Zhang <[email protected]>
AuthorDate: Sat Mar 30 18:52:50 2024 +0800

    Rename DistSQLDataSourcePoolPropertiesValidator (#30700)
---
 .../handler/executor/rdl/resource/AlterStorageUnitExecutor.java  | 4 ++--
 .../executor/rdl/resource/RegisterStorageUnitExecutor.java       | 4 ++--
 ...idator.java => DistSQLDataSourcePoolPropertiesValidator.java} | 9 +++++----
 .../executor/rdl/resource/AlterStorageUnitExecutorTest.java      | 4 ++--
 .../executor/rdl/resource/RegisterStorageUnitExecutorTest.java   | 4 ++--
 .../update/RegisterMigrationSourceStorageUnitExecutor.java       | 4 ++--
 .../backend/util/YamlDatabaseConfigurationImportExecutor.java    | 4 ++--
 .../ral/updatable/ImportDatabaseConfigurationExecutorTest.java   | 5 +++--
 8 files changed, 20 insertions(+), 18 deletions(-)

diff --git 
a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rdl/resource/AlterStorageUnitExecutor.java
 
b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rdl/resource/AlterStorageUnitExecutor.java
index 0a13cdc59c4..69176855659 100644
--- 
a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rdl/resource/AlterStorageUnitExecutor.java
+++ 
b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rdl/resource/AlterStorageUnitExecutor.java
@@ -24,7 +24,7 @@ import 
org.apache.shardingsphere.infra.exception.storageunit.DuplicateStorageUni
 import 
org.apache.shardingsphere.infra.exception.storageunit.InvalidStorageUnitsException;
 import 
org.apache.shardingsphere.infra.exception.storageunit.MissingRequiredStorageUnitsException;
 import 
org.apache.shardingsphere.distsql.handler.engine.update.DistSQLUpdateExecutor;
-import 
org.apache.shardingsphere.distsql.handler.validate.DataSourcePoolPropertiesValidator;
+import 
org.apache.shardingsphere.distsql.handler.validate.DistSQLDataSourcePoolPropertiesValidator;
 import org.apache.shardingsphere.distsql.segment.DataSourceSegment;
 import 
org.apache.shardingsphere.distsql.segment.HostnameAndPortBasedDataSourceSegment;
 import org.apache.shardingsphere.distsql.segment.URLBasedDataSourceSegment;
@@ -55,7 +55,7 @@ import java.util.stream.Collectors;
 @Slf4j
 public final class AlterStorageUnitExecutor implements 
DistSQLUpdateExecutor<AlterStorageUnitStatement>, DistSQLExecutorDatabaseAware {
     
-    private final DataSourcePoolPropertiesValidator validateHandler = new 
DataSourcePoolPropertiesValidator();
+    private final DistSQLDataSourcePoolPropertiesValidator validateHandler = 
new DistSQLDataSourcePoolPropertiesValidator();
     
     private ShardingSphereDatabase database;
     
diff --git 
a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rdl/resource/RegisterStorageUnitExecutor.java
 
b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rdl/resource/RegisterStorageUnitExecutor.java
index 2d0e500f92b..b0369d2e4c6 100644
--- 
a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rdl/resource/RegisterStorageUnitExecutor.java
+++ 
b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/rdl/resource/RegisterStorageUnitExecutor.java
@@ -23,7 +23,7 @@ import 
org.apache.shardingsphere.distsql.handler.aware.DistSQLExecutorDatabaseAw
 import 
org.apache.shardingsphere.distsql.handler.engine.update.DistSQLUpdateExecutor;
 import 
org.apache.shardingsphere.infra.exception.storageunit.DuplicateStorageUnitExceptionDefinition;
 import 
org.apache.shardingsphere.infra.exception.storageunit.InvalidStorageUnitsException;
-import 
org.apache.shardingsphere.distsql.handler.validate.DataSourcePoolPropertiesValidator;
+import 
org.apache.shardingsphere.distsql.handler.validate.DistSQLDataSourcePoolPropertiesValidator;
 import org.apache.shardingsphere.distsql.segment.DataSourceSegment;
 import 
org.apache.shardingsphere.distsql.segment.converter.DataSourceSegmentsConverter;
 import 
org.apache.shardingsphere.distsql.statement.rdl.resource.unit.type.RegisterStorageUnitStatement;
@@ -49,7 +49,7 @@ import java.util.stream.Collectors;
 @Slf4j
 public final class RegisterStorageUnitExecutor implements 
DistSQLUpdateExecutor<RegisterStorageUnitStatement>, 
DistSQLExecutorDatabaseAware {
     
-    private final DataSourcePoolPropertiesValidator validateHandler = new 
DataSourcePoolPropertiesValidator();
+    private final DistSQLDataSourcePoolPropertiesValidator validateHandler = 
new DistSQLDataSourcePoolPropertiesValidator();
     
     private ShardingSphereDatabase database;
     
diff --git 
a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/validate/DataSourcePoolPropertiesValidator.java
 
b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/validate/DistSQLDataSourcePoolPropertiesValidator.java
similarity index 85%
rename from 
infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/validate/DataSourcePoolPropertiesValidator.java
rename to 
infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/validate/DistSQLDataSourcePoolPropertiesValidator.java
index 0fdceb7b6e7..cf3fd37891c 100644
--- 
a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/validate/DataSourcePoolPropertiesValidator.java
+++ 
b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/validate/DistSQLDataSourcePoolPropertiesValidator.java
@@ -17,17 +17,18 @@
 
 package org.apache.shardingsphere.distsql.handler.validate;
 
-import 
org.apache.shardingsphere.infra.exception.storageunit.InvalidStorageUnitsException;
 import 
org.apache.shardingsphere.infra.datasource.pool.props.domain.DataSourcePoolProperties;
+import 
org.apache.shardingsphere.infra.datasource.pool.props.validator.DataSourcePoolPropertiesValidator;
 import 
org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
+import 
org.apache.shardingsphere.infra.exception.storageunit.InvalidStorageUnitsException;
 
 import java.util.Collection;
 import java.util.Map;
 
 /**
- * Data source pool properties validator.
+ * DistSQL data source pool properties validator.
  */
-public final class DataSourcePoolPropertiesValidator {
+public final class DistSQLDataSourcePoolPropertiesValidator {
     
     /**
      * Validate data source properties map.
@@ -36,7 +37,7 @@ public final class DataSourcePoolPropertiesValidator {
      * @throws InvalidStorageUnitsException invalid storage units exception
      */
     public void validate(final Map<String, DataSourcePoolProperties> propsMap) 
{
-        Collection<String> errorMessages = 
org.apache.shardingsphere.infra.datasource.pool.props.validator.DataSourcePoolPropertiesValidator.validate(propsMap);
+        Collection<String> errorMessages = 
DataSourcePoolPropertiesValidator.validate(propsMap);
         ShardingSpherePreconditions.checkState(errorMessages.isEmpty(), () -> 
new InvalidStorageUnitsException(errorMessages));
     }
 }
diff --git 
a/infra/distsql-handler/src/test/java/org/apache/shardingsphere/distsql/handler/executor/rdl/resource/AlterStorageUnitExecutorTest.java
 
b/infra/distsql-handler/src/test/java/org/apache/shardingsphere/distsql/handler/executor/rdl/resource/AlterStorageUnitExecutorTest.java
index 0c750dc6d68..09c240d5450 100644
--- 
a/infra/distsql-handler/src/test/java/org/apache/shardingsphere/distsql/handler/executor/rdl/resource/AlterStorageUnitExecutorTest.java
+++ 
b/infra/distsql-handler/src/test/java/org/apache/shardingsphere/distsql/handler/executor/rdl/resource/AlterStorageUnitExecutorTest.java
@@ -20,7 +20,7 @@ package 
org.apache.shardingsphere.distsql.handler.executor.rdl.resource;
 import 
org.apache.shardingsphere.infra.exception.storageunit.DuplicateStorageUnitExceptionDefinition;
 import 
org.apache.shardingsphere.infra.exception.storageunit.InvalidStorageUnitsException;
 import 
org.apache.shardingsphere.infra.exception.storageunit.MissingRequiredStorageUnitsException;
-import 
org.apache.shardingsphere.distsql.handler.validate.DataSourcePoolPropertiesValidator;
+import 
org.apache.shardingsphere.distsql.handler.validate.DistSQLDataSourcePoolPropertiesValidator;
 import 
org.apache.shardingsphere.distsql.segment.HostnameAndPortBasedDataSourceSegment;
 import org.apache.shardingsphere.distsql.segment.URLBasedDataSourceSegment;
 import 
org.apache.shardingsphere.distsql.statement.rdl.resource.unit.type.AlterStorageUnitStatement;
@@ -59,7 +59,7 @@ class AlterStorageUnitExecutorTest {
     @BeforeEach
     void setUp() throws ReflectiveOperationException {
         executor.setDatabase(database);
-        
Plugins.getMemberAccessor().set(executor.getClass().getDeclaredField("validateHandler"),
 executor, mock(DataSourcePoolPropertiesValidator.class));
+        
Plugins.getMemberAccessor().set(executor.getClass().getDeclaredField("validateHandler"),
 executor, mock(DistSQLDataSourcePoolPropertiesValidator.class));
     }
     
     @Test
diff --git 
a/infra/distsql-handler/src/test/java/org/apache/shardingsphere/distsql/handler/executor/rdl/resource/RegisterStorageUnitExecutorTest.java
 
b/infra/distsql-handler/src/test/java/org/apache/shardingsphere/distsql/handler/executor/rdl/resource/RegisterStorageUnitExecutorTest.java
index 7fdd9c19290..de633ba262d 100644
--- 
a/infra/distsql-handler/src/test/java/org/apache/shardingsphere/distsql/handler/executor/rdl/resource/RegisterStorageUnitExecutorTest.java
+++ 
b/infra/distsql-handler/src/test/java/org/apache/shardingsphere/distsql/handler/executor/rdl/resource/RegisterStorageUnitExecutorTest.java
@@ -19,7 +19,7 @@ package 
org.apache.shardingsphere.distsql.handler.executor.rdl.resource;
 
 import 
org.apache.shardingsphere.infra.exception.storageunit.DuplicateStorageUnitExceptionDefinition;
 import 
org.apache.shardingsphere.infra.exception.storageunit.InvalidStorageUnitsException;
-import 
org.apache.shardingsphere.distsql.handler.validate.DataSourcePoolPropertiesValidator;
+import 
org.apache.shardingsphere.distsql.handler.validate.DistSQLDataSourcePoolPropertiesValidator;
 import 
org.apache.shardingsphere.distsql.segment.HostnameAndPortBasedDataSourceSegment;
 import org.apache.shardingsphere.distsql.segment.URLBasedDataSourceSegment;
 import 
org.apache.shardingsphere.distsql.statement.rdl.resource.unit.type.RegisterStorageUnitStatement;
@@ -61,7 +61,7 @@ class RegisterStorageUnitExecutorTest {
         when(database.getName()).thenReturn("foo_db");
         when(database.getRuleMetaData()).thenReturn(mock(RuleMetaData.class));
         executor.setDatabase(database);
-        
Plugins.getMemberAccessor().set(executor.getClass().getDeclaredField("validateHandler"),
 executor, mock(DataSourcePoolPropertiesValidator.class));
+        
Plugins.getMemberAccessor().set(executor.getClass().getDeclaredField("validateHandler"),
 executor, mock(DistSQLDataSourcePoolPropertiesValidator.class));
     }
     
     @Test
diff --git 
a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/update/RegisterMigrationSourceStorageUnitExecutor.java
 
b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/update/RegisterMigrationSourceStorageUnitExecutor.java
index 904b8b658cc..73d1862ae20 100644
--- 
a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/update/RegisterMigrationSourceStorageUnitExecutor.java
+++ 
b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/update/RegisterMigrationSourceStorageUnitExecutor.java
@@ -23,7 +23,7 @@ import 
org.apache.shardingsphere.data.pipeline.core.job.api.TransmissionJobAPI;
 import 
org.apache.shardingsphere.data.pipeline.migration.distsql.statement.updatable.RegisterMigrationSourceStorageUnitStatement;
 import 
org.apache.shardingsphere.data.pipeline.scenario.migration.api.MigrationJobAPI;
 import 
org.apache.shardingsphere.distsql.handler.engine.update.DistSQLUpdateExecutor;
-import 
org.apache.shardingsphere.distsql.handler.validate.DataSourcePoolPropertiesValidator;
+import 
org.apache.shardingsphere.distsql.handler.validate.DistSQLDataSourcePoolPropertiesValidator;
 import org.apache.shardingsphere.distsql.segment.DataSourceSegment;
 import 
org.apache.shardingsphere.distsql.segment.HostnameAndPortBasedDataSourceSegment;
 import org.apache.shardingsphere.distsql.segment.URLBasedDataSourceSegment;
@@ -49,7 +49,7 @@ public final class RegisterMigrationSourceStorageUnitExecutor 
implements DistSQL
     
     private final MigrationJobAPI jobAPI = (MigrationJobAPI) 
TypedSPILoader.getService(TransmissionJobAPI.class, "MIGRATION");
     
-    private final DataSourcePoolPropertiesValidator validateHandler = new 
DataSourcePoolPropertiesValidator();
+    private final DistSQLDataSourcePoolPropertiesValidator validateHandler = 
new DistSQLDataSourcePoolPropertiesValidator();
     
     @Override
     public void executeUpdate(final 
RegisterMigrationSourceStorageUnitStatement sqlStatement, final ContextManager 
contextManager) {
diff --git 
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/util/YamlDatabaseConfigurationImportExecutor.java
 
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/util/YamlDatabaseConfigurationImportExecutor.java
index f7068df35fe..58b32e02583 100644
--- 
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/util/YamlDatabaseConfigurationImportExecutor.java
+++ 
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/util/YamlDatabaseConfigurationImportExecutor.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.proxy.backend.util;
 import 
org.apache.shardingsphere.infra.config.rule.checker.RuleConfigurationCheckEngine;
 import 
org.apache.shardingsphere.distsql.handler.exception.datasource.MissingRequiredDataSourcesException;
 import 
org.apache.shardingsphere.infra.exception.storageunit.InvalidStorageUnitsException;
-import 
org.apache.shardingsphere.distsql.handler.validate.DataSourcePoolPropertiesValidator;
+import 
org.apache.shardingsphere.distsql.handler.validate.DistSQLDataSourcePoolPropertiesValidator;
 import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
 import org.apache.shardingsphere.infra.database.DatabaseTypeEngine;
 import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
@@ -68,7 +68,7 @@ public final class YamlDatabaseConfigurationImportExecutor {
     
     private final YamlProxyDataSourceConfigurationSwapper 
dataSourceConfigSwapper = new YamlProxyDataSourceConfigurationSwapper();
     
-    private final DataSourcePoolPropertiesValidator validateHandler = new 
DataSourcePoolPropertiesValidator();
+    private final DistSQLDataSourcePoolPropertiesValidator validateHandler = 
new DistSQLDataSourcePoolPropertiesValidator();
     
     /**
      * Import proxy database from yaml configuration.
diff --git 
a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/ImportDatabaseConfigurationExecutorTest.java
 
b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/ImportDatabaseConfigurationExecutorTest.java
index 5d52e443707..787a08f2fd3 100644
--- 
a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/ImportDatabaseConfigurationExecutorTest.java
+++ 
b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/ImportDatabaseConfigurationExecutorTest.java
@@ -20,7 +20,7 @@ package 
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.updatable;
 import lombok.SneakyThrows;
 import 
org.apache.shardingsphere.distsql.handler.exception.datasource.MissingRequiredDataSourcesException;
 import org.apache.shardingsphere.infra.exception.rule.DuplicateRuleException;
-import 
org.apache.shardingsphere.distsql.handler.validate.DataSourcePoolPropertiesValidator;
+import 
org.apache.shardingsphere.distsql.handler.validate.DistSQLDataSourcePoolPropertiesValidator;
 import 
org.apache.shardingsphere.distsql.statement.ral.updatable.ImportDatabaseConfigurationStatement;
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
 import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
@@ -135,7 +135,8 @@ class ImportDatabaseConfigurationExecutorTest {
         executor = new ImportDatabaseConfigurationExecutor();
         YamlDatabaseConfigurationImportExecutor databaseConfigImportExecutor = 
new YamlDatabaseConfigurationImportExecutor();
         
Plugins.getMemberAccessor().set(executor.getClass().getDeclaredField("databaseConfigImportExecutor"),
 executor, databaseConfigImportExecutor);
-        
Plugins.getMemberAccessor().set(databaseConfigImportExecutor.getClass().getDeclaredField("validateHandler"),
 databaseConfigImportExecutor, mock(DataSourcePoolPropertiesValidator.class));
+        Plugins.getMemberAccessor().set(
+                
databaseConfigImportExecutor.getClass().getDeclaredField("validateHandler"), 
databaseConfigImportExecutor, 
mock(DistSQLDataSourcePoolPropertiesValidator.class));
     }
     
     private ContextManager mockContextManager(final String databaseName) {

Reply via email to