This is an automated email from the ASF dual-hosted git repository.
sunnianjun 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 0c03cff716b Remove useless RALBackendHandlerFactory (#30006)
0c03cff716b is described below
commit 0c03cff716b2ad817a3c09f9186e4b25ab1cfe09
Author: Liang Zhang <[email protected]>
AuthorDate: Tue Feb 6 10:34:02 2024 +0800
Remove useless RALBackendHandlerFactory (#30006)
---
.../distsql/DistSQLBackendHandlerFactory.java | 4 +-
.../distsql/ral/RALBackendHandlerFactory.java | 45 ----------------------
2 files changed, 2 insertions(+), 47 deletions(-)
diff --git
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLBackendHandlerFactory.java
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLBackendHandlerFactory.java
index 144853b5d10..b924574edaf 100644
---
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLBackendHandlerFactory.java
+++
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLBackendHandlerFactory.java
@@ -21,12 +21,12 @@ import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.distsql.statement.DistSQLStatement;
import org.apache.shardingsphere.distsql.statement.ral.RALStatement;
+import
org.apache.shardingsphere.distsql.statement.ral.queryable.QueryableRALStatement;
import org.apache.shardingsphere.distsql.statement.rdl.RDLStatement;
import org.apache.shardingsphere.distsql.statement.rql.RQLStatement;
import org.apache.shardingsphere.distsql.statement.rul.RULStatement;
import
org.apache.shardingsphere.infra.exception.core.external.sql.type.generic.UnsupportedSQLOperationException;
import org.apache.shardingsphere.proxy.backend.handler.ProxyBackendHandler;
-import
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.RALBackendHandlerFactory;
import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
/**
@@ -51,7 +51,7 @@ public final class DistSQLBackendHandlerFactory {
return new DistSQLUpdateBackendHandler(sqlStatement,
connectionSession);
}
if (sqlStatement instanceof RALStatement) {
- return RALBackendHandlerFactory.newInstance((RALStatement)
sqlStatement, connectionSession);
+ return sqlStatement instanceof QueryableRALStatement ? new
DistSQLQueryBackendHandler(sqlStatement, connectionSession) : new
DistSQLUpdateBackendHandler(sqlStatement, connectionSession);
}
throw new
UnsupportedSQLOperationException(sqlStatement.getClass().getName());
}
diff --git
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/RALBackendHandlerFactory.java
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/RALBackendHandlerFactory.java
deleted file mode 100644
index 6f8a02bcd85..00000000000
---
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/RALBackendHandlerFactory.java
+++ /dev/null
@@ -1,45 +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.proxy.backend.handler.distsql.ral;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.distsql.statement.ral.RALStatement;
-import
org.apache.shardingsphere.distsql.statement.ral.queryable.QueryableRALStatement;
-import org.apache.shardingsphere.proxy.backend.handler.ProxyBackendHandler;
-import
org.apache.shardingsphere.proxy.backend.handler.distsql.DistSQLQueryBackendHandler;
-import
org.apache.shardingsphere.proxy.backend.handler.distsql.DistSQLUpdateBackendHandler;
-import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
-
-/**
- * RAL backend handler factory.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class RALBackendHandlerFactory {
-
- /**
- * Create new instance of RAL backend handler.
- *
- * @param sqlStatement RAL statement
- * @param connectionSession connection session
- * @return created instance
- */
- public static ProxyBackendHandler newInstance(final RALStatement
sqlStatement, final ConnectionSession connectionSession) {
- return sqlStatement instanceof QueryableRALStatement ? new
DistSQLQueryBackendHandler(sqlStatement, connectionSession) : new
DistSQLUpdateBackendHandler(sqlStatement, connectionSession);
- }
-}