You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/08/13 03:22:34 UTC

[shardingsphere] branch master updated: Rename DialectSQLExceptionMapper (#20136)

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

duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new b42aed00d0b Rename DialectSQLExceptionMapper (#20136)
b42aed00d0b is described below

commit b42aed00d0be8badeec1f50777999c288cd02f1c
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sat Aug 13 11:22:28 2022 +0800

    Rename DialectSQLExceptionMapper (#20136)
---
 .../org/apache/shardingsphere/error/SQLExceptionHandler.java   |  4 ++--
 ...{SQLExceptionMapper.java => DialectSQLExceptionMapper.java} |  4 ++--
 ...apperFactory.java => DialectSQLExceptionMapperFactory.java} | 10 +++++-----
 ...{MySQLSQLExceptionMapper.java => MySQLExceptionMapper.java} |  6 +++---
 ...ache.shardingsphere.error.mapper.DialectSQLExceptionMapper} |  2 +-
 ...LSQLExceptionMapper.java => PostgreSQLExceptionMapper.java} |  6 +++---
 ...ache.shardingsphere.error.mapper.DialectSQLExceptionMapper} |  2 +-
 7 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/SQLExceptionHandler.java b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/SQLExceptionHandler.java
index ad0addca1e6..3f1716bc89a 100644
--- a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/SQLExceptionHandler.java
+++ b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/SQLExceptionHandler.java
@@ -21,7 +21,7 @@ import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import org.apache.shardingsphere.error.code.SQLErrorCode;
 import org.apache.shardingsphere.error.code.StandardSQLErrorCode;
-import org.apache.shardingsphere.error.mapper.SQLExceptionMapperFactory;
+import org.apache.shardingsphere.error.mapper.DialectSQLExceptionMapperFactory;
 import org.apache.shardingsphere.infra.config.exception.ShardingSphereConfigurationException;
 import org.apache.shardingsphere.infra.exception.CircuitBreakException;
 import org.apache.shardingsphere.infra.exception.ResourceNotExistedException;
@@ -51,7 +51,7 @@ public final class SQLExceptionHandler {
      */
     public static SQLException convert(final String databaseType, final ShardingSphereInsideException insideException) {
         if (insideException instanceof InsideDialectSQLException) {
-            return SQLExceptionMapperFactory.getInstance(databaseType).convert((InsideDialectSQLException) insideException);
+            return DialectSQLExceptionMapperFactory.getInstance(databaseType).convert((InsideDialectSQLException) insideException);
         }
         return convert(insideException).orElseGet(() -> toSQLException(StandardSQLErrorCode.UNKNOWN_EXCEPTION, insideException.getMessage()));
     }
diff --git a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/mapper/SQLExceptionMapper.java b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/mapper/DialectSQLExceptionMapper.java
similarity index 93%
rename from shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/mapper/SQLExceptionMapper.java
rename to shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/mapper/DialectSQLExceptionMapper.java
index c91c8ced13e..0f170e9f424 100644
--- a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/mapper/SQLExceptionMapper.java
+++ b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/mapper/DialectSQLExceptionMapper.java
@@ -24,10 +24,10 @@ import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
 import java.sql.SQLException;
 
 /**
- * SQL exception mapper.
+ * Dialect SQL exception mapper.
  */
 @SingletonSPI
-public interface SQLExceptionMapper extends TypedSPI {
+public interface DialectSQLExceptionMapper extends TypedSPI {
     
     /**
      * Convert dialect SQL exception into SQL exception.
diff --git a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/mapper/SQLExceptionMapperFactory.java b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/mapper/DialectSQLExceptionMapperFactory.java
similarity index 78%
rename from shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/mapper/SQLExceptionMapperFactory.java
rename to shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/mapper/DialectSQLExceptionMapperFactory.java
index a80d7da9d7c..14788a8528b 100644
--- a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/mapper/SQLExceptionMapperFactory.java
+++ b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/mapper/DialectSQLExceptionMapperFactory.java
@@ -23,13 +23,13 @@ import org.apache.shardingsphere.infra.util.spi.ShardingSphereServiceLoader;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPIRegistry;
 
 /**
- * SQL exception mapper.
+ * Dialect SQL exception mapper.
  */
 @NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class SQLExceptionMapperFactory {
+public final class DialectSQLExceptionMapperFactory {
     
     static {
-        ShardingSphereServiceLoader.register(SQLExceptionMapper.class);
+        ShardingSphereServiceLoader.register(DialectSQLExceptionMapper.class);
     }
     
     /**
@@ -38,7 +38,7 @@ public final class SQLExceptionMapperFactory {
      * @param databaseType database type
      * @return SQLException
      */
-    public static SQLExceptionMapper getInstance(final String databaseType) {
-        return TypedSPIRegistry.getRegisteredService(SQLExceptionMapper.class, databaseType);
+    public static DialectSQLExceptionMapper getInstance(final String databaseType) {
+        return TypedSPIRegistry.getRegisteredService(DialectSQLExceptionMapper.class, databaseType);
     }
 }
diff --git a/shardingsphere-error/shardingsphere-mysql-error/src/main/java/org/apache/shardingsphere/error/mysql/mapper/MySQLSQLExceptionMapper.java b/shardingsphere-error/shardingsphere-mysql-error/src/main/java/org/apache/shardingsphere/error/mysql/mapper/MySQLExceptionMapper.java
similarity index 96%
rename from shardingsphere-error/shardingsphere-mysql-error/src/main/java/org/apache/shardingsphere/error/mysql/mapper/MySQLSQLExceptionMapper.java
rename to shardingsphere-error/shardingsphere-mysql-error/src/main/java/org/apache/shardingsphere/error/mysql/mapper/MySQLExceptionMapper.java
index 35bbfbd193f..72c366ae4f4 100644
--- a/shardingsphere-error/shardingsphere-mysql-error/src/main/java/org/apache/shardingsphere/error/mysql/mapper/MySQLSQLExceptionMapper.java
+++ b/shardingsphere-error/shardingsphere-mysql-error/src/main/java/org/apache/shardingsphere/error/mysql/mapper/MySQLExceptionMapper.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.error.mysql.mapper;
 
 import org.apache.shardingsphere.error.code.SQLErrorCode;
 import org.apache.shardingsphere.error.code.StandardSQLErrorCode;
-import org.apache.shardingsphere.error.mapper.SQLExceptionMapper;
+import org.apache.shardingsphere.error.mapper.DialectSQLExceptionMapper;
 import org.apache.shardingsphere.error.mysql.code.MySQLServerErrorCode;
 import org.apache.shardingsphere.infra.exception.dialect.DBCreateExistsException;
 import org.apache.shardingsphere.infra.exception.dialect.DBDropNotExistsException;
@@ -35,9 +35,9 @@ import org.apache.shardingsphere.infra.util.exception.inside.InsideDialectSQLExc
 import java.sql.SQLException;
 
 /**
- * SQL exception mapper for MySQL.
+ * MySQL exception mapper.
  */
-public final class MySQLSQLExceptionMapper implements SQLExceptionMapper {
+public final class MySQLExceptionMapper implements DialectSQLExceptionMapper {
     
     @Override
     public SQLException convert(final InsideDialectSQLException dialectSQLException) {
diff --git a/shardingsphere-error/shardingsphere-mysql-error/src/main/resources/META-INF/services/org.apache.shardingsphere.error.mapper.SQLExceptionMapper b/shardingsphere-error/shardingsphere-mysql-error/src/main/resources/META-INF/services/org.apache.shardingsphere.error.mapper.DialectSQLExceptionMapper
similarity index 91%
rename from shardingsphere-error/shardingsphere-mysql-error/src/main/resources/META-INF/services/org.apache.shardingsphere.error.mapper.SQLExceptionMapper
rename to shardingsphere-error/shardingsphere-mysql-error/src/main/resources/META-INF/services/org.apache.shardingsphere.error.mapper.DialectSQLExceptionMapper
index b403b5826a3..da590455cf7 100644
--- a/shardingsphere-error/shardingsphere-mysql-error/src/main/resources/META-INF/services/org.apache.shardingsphere.error.mapper.SQLExceptionMapper
+++ b/shardingsphere-error/shardingsphere-mysql-error/src/main/resources/META-INF/services/org.apache.shardingsphere.error.mapper.DialectSQLExceptionMapper
@@ -15,4 +15,4 @@
 # limitations under the License.
 #
 
-org.apache.shardingsphere.error.mysql.mapper.MySQLSQLExceptionMapper
+org.apache.shardingsphere.error.mysql.mapper.MySQLExceptionMapper
diff --git a/shardingsphere-error/shardingsphere-postgresql-error/src/main/java/org/apache/shardingsphere/error/postgresql/mapper/PostgreSQLSQLExceptionMapper.java b/shardingsphere-error/shardingsphere-postgresql-error/src/main/java/org/apache/shardingsphere/error/postgresql/mapper/PostgreSQLExceptionMapper.java
similarity index 94%
rename from shardingsphere-error/shardingsphere-postgresql-error/src/main/java/org/apache/shardingsphere/error/postgresql/mapper/PostgreSQLSQLExceptionMapper.java
rename to shardingsphere-error/shardingsphere-postgresql-error/src/main/java/org/apache/shardingsphere/error/postgresql/mapper/PostgreSQLExceptionMapper.java
index 69ffaf5c8e6..16d3a81e68f 100644
--- a/shardingsphere-error/shardingsphere-postgresql-error/src/main/java/org/apache/shardingsphere/error/postgresql/mapper/PostgreSQLSQLExceptionMapper.java
+++ b/shardingsphere-error/shardingsphere-postgresql-error/src/main/java/org/apache/shardingsphere/error/postgresql/mapper/PostgreSQLExceptionMapper.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.error.postgresql.mapper;
 
-import org.apache.shardingsphere.error.mapper.SQLExceptionMapper;
+import org.apache.shardingsphere.error.mapper.DialectSQLExceptionMapper;
 import org.apache.shardingsphere.error.postgresql.code.PostgreSQLErrorCode;
 import org.apache.shardingsphere.infra.exception.dialect.DBCreateExistsException;
 import org.apache.shardingsphere.infra.exception.dialect.InTransactionException;
@@ -31,9 +31,9 @@ import org.postgresql.util.PSQLState;
 import java.sql.SQLException;
 
 /**
- * SQL exception mapper for PostgreSQL.
+ * PostgreSQL exception mapper.
  */
-public final class PostgreSQLSQLExceptionMapper implements SQLExceptionMapper {
+public final class PostgreSQLExceptionMapper implements DialectSQLExceptionMapper {
     
     @Override
     public SQLException convert(final InsideDialectSQLException dialectSQLException) {
diff --git a/shardingsphere-error/shardingsphere-postgresql-error/src/main/resources/META-INF/services/org.apache.shardingsphere.error.mapper.SQLExceptionMapper b/shardingsphere-error/shardingsphere-postgresql-error/src/main/resources/META-INF/services/org.apache.shardingsphere.error.mapper.DialectSQLExceptionMapper
similarity index 90%
rename from shardingsphere-error/shardingsphere-postgresql-error/src/main/resources/META-INF/services/org.apache.shardingsphere.error.mapper.SQLExceptionMapper
rename to shardingsphere-error/shardingsphere-postgresql-error/src/main/resources/META-INF/services/org.apache.shardingsphere.error.mapper.DialectSQLExceptionMapper
index f6b7ab704e7..2d4b5c730bd 100644
--- a/shardingsphere-error/shardingsphere-postgresql-error/src/main/resources/META-INF/services/org.apache.shardingsphere.error.mapper.SQLExceptionMapper
+++ b/shardingsphere-error/shardingsphere-postgresql-error/src/main/resources/META-INF/services/org.apache.shardingsphere.error.mapper.DialectSQLExceptionMapper
@@ -15,4 +15,4 @@
 # limitations under the License.
 #
 
-org.apache.shardingsphere.error.postgresql.mapper.PostgreSQLSQLExceptionMapper
+org.apache.shardingsphere.error.postgresql.mapper.PostgreSQLExceptionMapper