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 0c41fc82dde Rename DistSQLExecutorConnectionSizeAware (#29873)
0c41fc82dde is described below
commit 0c41fc82dde4f7ebceb8e822f3dd25f248bc1e01
Author: Liang Zhang <[email protected]>
AuthorDate: Sat Jan 27 18:09:46 2024 +0800
Rename DistSQLExecutorConnectionSizeAware (#29873)
---
.../DistSQLExecutorConnectionSizeAware.java} | 9 ++-------
.../handler/type/ral/query/QueryableRALExecuteEngine.java | 6 +++---
.../handler/distsql/ral/queryable/ShowDistVariableExecutor.java | 5 +++--
.../handler/distsql/ral/queryable/ShowDistVariablesExecutor.java | 5 +++--
4 files changed, 11 insertions(+), 14 deletions(-)
diff --git
a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/type/ral/query/aware/ConnectionSizeAwareQueryableRALExecutor.java
b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/aware/DistSQLExecutorConnectionSizeAware.java
similarity index 71%
rename from
infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/type/ral/query/aware/ConnectionSizeAwareQueryableRALExecutor.java
rename to
infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/aware/DistSQLExecutorConnectionSizeAware.java
index de452f45a57..42890750269 100644
---
a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/type/ral/query/aware/ConnectionSizeAwareQueryableRALExecutor.java
+++
b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/aware/DistSQLExecutorConnectionSizeAware.java
@@ -15,17 +15,12 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.distsql.handler.type.ral.query.aware;
-
-import
org.apache.shardingsphere.distsql.handler.type.ral.query.QueryableRALExecutor;
-import
org.apache.shardingsphere.distsql.statement.ral.queryable.QueryableRALStatement;
+package org.apache.shardingsphere.distsql.handler.aware;
/**
* Connection size aware queryable RAL executor.
- *
- * @param <T> type of SQL statement
*/
-public interface ConnectionSizeAwareQueryableRALExecutor<T extends
QueryableRALStatement> extends QueryableRALExecutor<T> {
+public interface DistSQLExecutorConnectionSizeAware {
/**
* Set connection size.
diff --git
a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/type/ral/query/QueryableRALExecuteEngine.java
b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/type/ral/query/QueryableRALExecuteEngine.java
index a89fccdfbcd..ffe483ff28a 100644
---
a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/type/ral/query/QueryableRALExecuteEngine.java
+++
b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/type/ral/query/QueryableRALExecuteEngine.java
@@ -20,7 +20,7 @@ package
org.apache.shardingsphere.distsql.handler.type.ral.query;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import
org.apache.shardingsphere.distsql.handler.aware.DistSQLExecutorDatabaseAware;
-import
org.apache.shardingsphere.distsql.handler.type.ral.query.aware.ConnectionSizeAwareQueryableRALExecutor;
+import
org.apache.shardingsphere.distsql.handler.aware.DistSQLExecutorConnectionSizeAware;
import org.apache.shardingsphere.distsql.handler.util.DatabaseNameUtils;
import
org.apache.shardingsphere.distsql.statement.ral.queryable.QueryableRALStatement;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
@@ -64,8 +64,8 @@ public abstract class QueryableRALExecuteEngine {
if (executor instanceof DistSQLExecutorDatabaseAware) {
((DistSQLExecutorDatabaseAware)
executor).setDatabase(getDatabase(DatabaseNameUtils.getDatabaseName(sqlStatement,
currentDatabaseName)));
}
- if (executor instanceof ConnectionSizeAwareQueryableRALExecutor) {
- ((ConnectionSizeAwareQueryableRALExecutor)
executor).setConnectionSize(getConnectionSize());
+ if (executor instanceof DistSQLExecutorConnectionSizeAware) {
+ ((DistSQLExecutorConnectionSizeAware)
executor).setConnectionSize(getConnectionSize());
}
return executor.getRows(sqlStatement, contextManager);
}
diff --git
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariableExecutor.java
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariableExecutor.java
index a90adf5eccf..ed92e021a2c 100644
---
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariableExecutor.java
+++
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariableExecutor.java
@@ -18,6 +18,8 @@
package org.apache.shardingsphere.proxy.backend.handler.distsql.ral.queryable;
import lombok.Setter;
+import
org.apache.shardingsphere.distsql.handler.aware.DistSQLExecutorConnectionSizeAware;
+import
org.apache.shardingsphere.distsql.handler.type.ral.query.QueryableRALExecutor;
import
org.apache.shardingsphere.distsql.statement.ral.queryable.show.ShowDistVariableStatement;
import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
import
org.apache.shardingsphere.infra.config.props.temporary.TemporaryConfigurationPropertyKey;
@@ -31,7 +33,6 @@ import org.apache.shardingsphere.logging.util.LoggingUtils;
import org.apache.shardingsphere.mode.manager.ContextManager;
import
org.apache.shardingsphere.proxy.backend.exception.UnsupportedVariableException;
import
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.common.DistSQLVariable;
-import
org.apache.shardingsphere.distsql.handler.type.ral.query.aware.ConnectionSizeAwareQueryableRALExecutor;
import java.util.Arrays;
import java.util.Collection;
@@ -43,7 +44,7 @@ import java.util.Properties;
* Show dist variable executor.
*/
@Setter
-public final class ShowDistVariableExecutor implements
ConnectionSizeAwareQueryableRALExecutor<ShowDistVariableStatement> {
+public final class ShowDistVariableExecutor implements
QueryableRALExecutor<ShowDistVariableStatement>,
DistSQLExecutorConnectionSizeAware {
private int connectionSize;
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 23f2ce06318..869aedd0308 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
@@ -18,6 +18,8 @@
package org.apache.shardingsphere.proxy.backend.handler.distsql.ral.queryable;
import lombok.Setter;
+import
org.apache.shardingsphere.distsql.handler.aware.DistSQLExecutorConnectionSizeAware;
+import
org.apache.shardingsphere.distsql.handler.type.ral.query.QueryableRALExecutor;
import
org.apache.shardingsphere.distsql.statement.ral.queryable.show.ShowDistVariablesStatement;
import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
import
org.apache.shardingsphere.infra.config.props.temporary.TemporaryConfigurationPropertyKey;
@@ -29,7 +31,6 @@ import
org.apache.shardingsphere.logging.logger.ShardingSphereLogger;
import org.apache.shardingsphere.logging.util.LoggingUtils;
import org.apache.shardingsphere.mode.manager.ContextManager;
import
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.common.DistSQLVariable;
-import
org.apache.shardingsphere.distsql.handler.type.ral.query.aware.ConnectionSizeAwareQueryableRALExecutor;
import org.apache.shardingsphere.sql.parser.sql.common.util.SQLUtils;
import java.util.Arrays;
@@ -44,7 +45,7 @@ import java.util.stream.Collectors;
* Show dist variables executor.
*/
@Setter
-public final class ShowDistVariablesExecutor implements
ConnectionSizeAwareQueryableRALExecutor<ShowDistVariablesStatement> {
+public final class ShowDistVariablesExecutor implements
QueryableRALExecutor<ShowDistVariablesStatement>,
DistSQLExecutorConnectionSizeAware {
private int connectionSize;