This is an automated email from the ASF dual-hosted git repository.
soulasuna 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 db8266e125a Refactor DistSQLBackendHandlerFactory (#18985)
db8266e125a is described below
commit db8266e125a7225cda186526605ea3ed0196130b
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Jul 10 12:07:59 2022 +0800
Refactor DistSQLBackendHandlerFactory (#18985)
---
.../backend/text/distsql/DistSQLBackendHandlerFactory.java | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/DistSQLBackendHandlerFactory.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/DistSQLBackendHandlerFactory.java
index 7f5b1dff5a9..096e5afbbf8 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/DistSQLBackendHandlerFactory.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/DistSQLBackendHandlerFactory.java
@@ -20,11 +20,8 @@ package org.apache.shardingsphere.proxy.backend.text.distsql;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.distsql.parser.statement.DistSQLStatement;
-import
org.apache.shardingsphere.distsql.parser.statement.ral.CommonDistSQLStatement;
-import
org.apache.shardingsphere.distsql.parser.statement.ral.QueryableRALStatement;
import org.apache.shardingsphere.distsql.parser.statement.ral.RALStatement;
-import
org.apache.shardingsphere.distsql.parser.statement.ral.scaling.QueryableScalingRALStatement;
-import
org.apache.shardingsphere.distsql.parser.statement.ral.scaling.UpdatableScalingRALStatement;
+import
org.apache.shardingsphere.distsql.parser.statement.ral.UpdatableRALStatement;
import org.apache.shardingsphere.distsql.parser.statement.rdl.RDLStatement;
import org.apache.shardingsphere.distsql.parser.statement.rql.RQLStatement;
import org.apache.shardingsphere.infra.lock.LockContext;
@@ -62,11 +59,9 @@ public final class DistSQLBackendHandlerFactory {
return RDLBackendHandlerFactory.newInstance((RDLStatement)
sqlStatement, connectionSession);
}
if (sqlStatement instanceof RALStatement) {
- if (sqlStatement instanceof CommonDistSQLStatement || sqlStatement
instanceof QueryableRALStatement || sqlStatement instanceof
QueryableScalingRALStatement
- || sqlStatement instanceof UpdatableScalingRALStatement) {
- return RALBackendHandlerFactory.newInstance((RALStatement)
sqlStatement, connectionSession);
+ if (sqlStatement instanceof UpdatableRALStatement) {
+ checkDatabaseLocked(connectionSession);
}
- checkDatabaseLocked(connectionSession);
return RALBackendHandlerFactory.newInstance((RALStatement)
sqlStatement, connectionSession);
}
throw new
UnsupportedOperationException(sqlStatement.getClass().getCanonicalName());