This is an automated email from the ASF dual-hosted git repository.
panjuan 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 c7c30b5 Add show-process-list-enabled switch for execution process
(#10541)
c7c30b5 is described below
commit c7c30b5737ebb9119837c902b007b6eb3761ec40
Author: sandynz <[email protected]>
AuthorDate: Sun May 30 15:29:51 2021 +0800
Add show-process-list-enabled switch for execution process (#10541)
* Prepare ConfigurationProperties for evaluate
* Add show-process-list-enabled
* Add show-process-list-enabled
---
.../infra/config/properties/ConfigurationPropertyKey.java | 5 +++++
.../infra/executor/sql/execute/engine/raw/RawExecutor.java | 5 ++++-
.../executor/sql/optimize/schema/row/CalciteRowExecutor.java | 7 +++++--
.../infra/executor/sql/process/ExecuteProcessEngine.java | 6 ++++--
.../executor/sql/process/ExecuteProcessStrategyEvaluator.java | 9 +++++++--
.../shardingsphere/driver/executor/DriverJDBCExecutor.java | 6 +++---
.../jdbc/core/statement/ShardingSpherePreparedStatement.java | 5 ++---
.../driver/jdbc/core/statement/ShardingSphereStatement.java | 5 ++---
.../proxy/backend/communication/ProxySQLExecutor.java | 9 +++++----
.../backend/communication/jdbc/executor/ProxyJDBCExecutor.java | 6 ++++--
.../src/main/resources/conf/server.yaml | 1 +
11 files changed, 42 insertions(+), 22 deletions(-)
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/properties/ConfigurationPropertyKey.java
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/properties/ConfigurationPropertyKey.java
index db41931..07fca08 100644
---
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/properties/ConfigurationPropertyKey.java
+++
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/properties/ConfigurationPropertyKey.java
@@ -114,6 +114,11 @@ public enum ConfigurationPropertyKey implements
TypedPropertyKey {
PROXY_HINT_ENABLED("proxy-hint-enabled", String.valueOf(Boolean.FALSE),
boolean.class),
/**
+ * Whether enable show process list.
+ */
+ SHOW_PROCESS_LIST_ENABLED("show-process-list-enabled",
String.valueOf(false), boolean.class),
+
+ /**
* The length of time in milliseconds an SQL waits for a global lock
before giving up.
*/
LOCK_WAIT_TIMEOUT_MILLISECONDS("lock-wait-timeout-milliseconds",
String.valueOf(50000L), long.class),
diff --git
a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/raw/RawExecutor.java
b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/raw/RawExecutor.java
index 6ff6a59..3e530b7 100644
---
a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/raw/RawExecutor.java
+++
b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/raw/RawExecutor.java
@@ -19,6 +19,7 @@ package
org.apache.shardingsphere.infra.executor.sql.execute.engine.raw;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
+import
org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;
import org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine;
import
org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroupContext;
import
org.apache.shardingsphere.infra.executor.sql.execute.engine.SQLExecutorExceptionHandler;
@@ -42,6 +43,8 @@ public final class RawExecutor {
private final boolean serial;
+ private final ConfigurationProperties props;
+
/**
* Execute.
*
@@ -55,7 +58,7 @@ public final class RawExecutor {
final SQLStatementContext<?>
sqlStatementContext,
final RawSQLExecutorCallback
callback) throws SQLException {
try {
- ExecuteProcessEngine.initialize(sqlStatementContext,
executionGroupContext);
+ ExecuteProcessEngine.initialize(sqlStatementContext,
executionGroupContext, props);
// TODO Load query header for first query
List<ExecuteResult> results = execute(executionGroupContext,
(RawSQLExecutorCallback) null, callback);
ExecuteProcessEngine.finish(executionGroupContext.getExecutionID());
diff --git
a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/optimize/schema/row/CalciteRowExecutor.java
b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/optimize/schema/row/CalciteRowExecutor.java
index b103e1d..4d9fc99 100644
---
a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/optimize/schema/row/CalciteRowExecutor.java
+++
b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/optimize/schema/row/CalciteRowExecutor.java
@@ -19,6 +19,8 @@ package
org.apache.shardingsphere.infra.executor.sql.optimize.schema.row;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
+import
org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;
+import
org.apache.shardingsphere.infra.config.properties.ConfigurationPropertyKey;
import org.apache.shardingsphere.infra.exception.ShardingSphereException;
import
org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroupContext;
import org.apache.shardingsphere.infra.executor.sql.context.ExecutionContext;
@@ -48,7 +50,7 @@ public final class CalciteRowExecutor {
// TODO Consider use emptyList
private final Collection<ShardingSphereRule> rules;
- private final int maxConnectionsSizePerQuery;
+ private final ConfigurationProperties props;
private final ExecutorJDBCManager jdbcManager;
@@ -68,7 +70,7 @@ public final class CalciteRowExecutor {
public Collection<QueryResult> execute(final ExecutionContext context) {
try {
ExecutionGroupContext<JDBCExecutionUnit> executionGroupContext =
createExecutionGroupContext(context);
- ExecuteProcessEngine.initialize(context.getSqlStatementContext(),
executionGroupContext);
+ ExecuteProcessEngine.initialize(context.getSqlStatementContext(),
executionGroupContext, props);
Collection<QueryResult> result =
jdbcExecutor.execute(executionGroupContext, callback).stream().map(each ->
(QueryResult) each).collect(Collectors.toList());
ExecuteProcessEngine.finish(executionGroupContext.getExecutionID());
return result;
@@ -81,6 +83,7 @@ public final class CalciteRowExecutor {
private ExecutionGroupContext<JDBCExecutionUnit>
createExecutionGroupContext(final ExecutionContext executionContext) throws
SQLException {
// TODO Set parameters for StatementOption
+ int maxConnectionsSizePerQuery =
props.getValue(ConfigurationPropertyKey.MAX_CONNECTIONS_SIZE_PER_QUERY);
DriverExecutionPrepareEngine<JDBCExecutionUnit, Connection>
prepareEngine = new DriverExecutionPrepareEngine<>(
JDBCDriverType.STATEMENT, maxConnectionsSizePerQuery,
jdbcManager, new StatementOption(true), rules);
return prepareEngine.prepare(executionContext.getRouteContext(),
executionContext.getExecutionUnits());
diff --git
a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/process/ExecuteProcessEngine.java
b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/process/ExecuteProcessEngine.java
index 2db3630..7c90045 100644
---
a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/process/ExecuteProcessEngine.java
+++
b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/process/ExecuteProcessEngine.java
@@ -20,6 +20,7 @@ package org.apache.shardingsphere.infra.executor.sql.process;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
+import
org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;
import
org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroupContext;
import org.apache.shardingsphere.infra.executor.kernel.model.ExecutorDataMap;
import
org.apache.shardingsphere.infra.executor.sql.execute.engine.SQLExecutionUnit;
@@ -47,9 +48,10 @@ public final class ExecuteProcessEngine {
*
* @param context context
* @param executionGroupContext execution group context
+ * @param props configuration properties
*/
- public static void initialize(final SQLStatementContext<?> context, final
ExecutionGroupContext<? extends SQLExecutionUnit> executionGroupContext) {
- if (!HANDLERS.isEmpty() &&
ExecuteProcessStrategyEvaluator.evaluate(context, executionGroupContext)) {
+ public static void initialize(final SQLStatementContext<?> context, final
ExecutionGroupContext<? extends SQLExecutionUnit> executionGroupContext, final
ConfigurationProperties props) {
+ if (!HANDLERS.isEmpty() &&
ExecuteProcessStrategyEvaluator.evaluate(context, executionGroupContext,
props)) {
ExecutorDataMap.getValue().put(ExecuteProcessConstants.EXECUTE_ID.name(),
executionGroupContext.getExecutionID());
HANDLERS.iterator().next().report(context, executionGroupContext,
ExecuteProcessConstants.EXECUTE_STATUS_START);
}
diff --git
a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/process/ExecuteProcessStrategyEvaluator.java
b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/process/ExecuteProcessStrategyEvaluator.java
index f7e7e90..49c5f3f 100644
---
a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/process/ExecuteProcessStrategyEvaluator.java
+++
b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/process/ExecuteProcessStrategyEvaluator.java
@@ -20,8 +20,11 @@ package org.apache.shardingsphere.infra.executor.sql.process;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
+import
org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;
+import
org.apache.shardingsphere.infra.config.properties.ConfigurationPropertyKey;
import
org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroupContext;
import
org.apache.shardingsphere.infra.executor.sql.execute.engine.SQLExecutionUnit;
+import
org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.DDLStatement;
/**
* Process strategy evaluator.
@@ -34,10 +37,12 @@ public final class ExecuteProcessStrategyEvaluator {
*
* @param context context
* @param executionGroupContext execution group context
+ * @param props configuration properties
* @return submit or not
*/
- public static boolean evaluate(final SQLStatementContext<?> context, final
ExecutionGroupContext<? extends SQLExecutionUnit> executionGroupContext) {
+ public static boolean evaluate(final SQLStatementContext<?> context, final
ExecutionGroupContext<? extends SQLExecutionUnit> executionGroupContext, final
ConfigurationProperties props) {
// TODO : Add more conditions to evaluate whether to submit this
process task or not
- return false;
+ boolean showProcessListEnabled =
props.getValue(ConfigurationPropertyKey.SHOW_PROCESS_LIST_ENABLED);
+ return showProcessListEnabled && context.getSqlStatement() instanceof
DDLStatement;
}
}
diff --git
a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/DriverJDBCExecutor.java
b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/DriverJDBCExecutor.java
index 1e650d9..47f31c9 100644
---
a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/DriverJDBCExecutor.java
+++
b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/DriverJDBCExecutor.java
@@ -65,7 +65,7 @@ public final class DriverJDBCExecutor {
public List<QueryResult> executeQuery(final
ExecutionGroupContext<JDBCExecutionUnit> executionGroupContext,
final SQLStatementContext<?>
sqlStatementContext, final ExecuteQueryCallback callback) throws SQLException {
try {
- ExecuteProcessEngine.initialize(sqlStatementContext,
executionGroupContext);
+ ExecuteProcessEngine.initialize(sqlStatementContext,
executionGroupContext, metaDataContexts.getProps());
List<QueryResult> result =
jdbcExecutor.execute(executionGroupContext, callback);
ExecuteProcessEngine.finish(executionGroupContext.getExecutionID());
return result;
@@ -87,7 +87,7 @@ public final class DriverJDBCExecutor {
public int executeUpdate(final ExecutionGroupContext<JDBCExecutionUnit>
executionGroupContext,
final SQLStatementContext<?> sqlStatementContext,
final Collection<RouteUnit> routeUnits, final JDBCExecutorCallback<Integer>
callback) throws SQLException {
try {
- ExecuteProcessEngine.initialize(sqlStatementContext,
executionGroupContext);
+ ExecuteProcessEngine.initialize(sqlStatementContext,
executionGroupContext, metaDataContexts.getProps());
List<Integer> results =
jdbcLockEngine.execute(executionGroupContext, sqlStatementContext, routeUnits,
callback);
int result =
isNeedAccumulate(metaDataContexts.getDefaultMetaData().getRuleMetaData().getRules(),
sqlStatementContext) ? accumulate(results) : results.get(0);
ExecuteProcessEngine.finish(executionGroupContext.getExecutionID());
@@ -118,7 +118,7 @@ public final class DriverJDBCExecutor {
public boolean execute(final ExecutionGroupContext<JDBCExecutionUnit>
executionGroupContext, final SQLStatementContext<?> sqlStatementContext,
final Collection<RouteUnit> routeUnits, final
JDBCExecutorCallback<Boolean> callback) throws SQLException {
try {
- ExecuteProcessEngine.initialize(sqlStatementContext,
executionGroupContext);
+ ExecuteProcessEngine.initialize(sqlStatementContext,
executionGroupContext, metaDataContexts.getProps());
List<Boolean> results =
jdbcLockEngine.execute(executionGroupContext, sqlStatementContext, routeUnits,
callback);
boolean result = null != results && !results.isEmpty() && null !=
results.get(0) && results.get(0);
ExecuteProcessEngine.finish(executionGroupContext.getExecutionID());
diff --git
a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java
b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java
index bffb9bd..a5f47fb 100644
---
a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java
+++
b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java
@@ -166,7 +166,7 @@ public final class ShardingSpherePreparedStatement extends
AbstractPreparedState
parameterMetaData = new ShardingSphereParameterMetaData(sqlStatement);
statementOption = returnGeneratedKeys ? new StatementOption(true) :
new StatementOption(resultSetType, resultSetConcurrency, resultSetHoldability);
JDBCExecutor jdbcExecutor = new
JDBCExecutor(metaDataContexts.getExecutorEngine(),
connection.isHoldTransaction());
- rawExecutor = new RawExecutor(metaDataContexts.getExecutorEngine(),
connection.isHoldTransaction());
+ rawExecutor = new RawExecutor(metaDataContexts.getExecutorEngine(),
connection.isHoldTransaction(), metaDataContexts.getProps());
driverJDBCExecutor = new DriverJDBCExecutor(metaDataContexts,
jdbcExecutor);
batchPreparedStatementExecutor = new
BatchPreparedStatementExecutor(metaDataContexts, jdbcExecutor);
kernelProcessor = new KernelProcessor();
@@ -219,11 +219,10 @@ public final class ShardingSpherePreparedStatement
extends AbstractPreparedState
}
private CalciteExecutor createCalciteExecutor() {
- int maxConnectionsSizePerQuery =
metaDataContexts.getProps().<Integer>getValue(ConfigurationPropertyKey.MAX_CONNECTIONS_SIZE_PER_QUERY);
StatementExecuteQueryCallback callback = new
StatementExecuteQueryCallback(metaDataContexts.getDefaultMetaData().getResource().getDatabaseType(),
executionContext.getSqlStatementContext().getSqlStatement(),
SQLExecutorExceptionHandler.isExceptionThrown());
CalciteRowExecutor executor = new
CalciteRowExecutor(metaDataContexts.getDefaultMetaData().getRuleMetaData().getRules(),
- maxConnectionsSizePerQuery, connection,
driverJDBCExecutor.getJdbcExecutor(), executionContext, callback);
+ metaDataContexts.getProps(), connection,
driverJDBCExecutor.getJdbcExecutor(), executionContext, callback);
// TODO Consider CalciteRawExecutor
CalciteLogicSchema logicSchema = new
CalciteLogicSchema(metaDataContexts.getOptimizeContextFactory().getSchemaMetadatas().getSchemas().get(DefaultSchema.LOGIC_NAME),
executor);
return new
CalciteJDBCExecutor(metaDataContexts.getOptimizeContextFactory().create(DefaultSchema.LOGIC_NAME,
logicSchema));
diff --git
a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java
b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java
index 5a81e10..8832265 100644
---
a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java
+++
b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java
@@ -135,7 +135,7 @@ public final class ShardingSphereStatement extends
AbstractStatementAdapter {
statementOption = new StatementOption(resultSetType,
resultSetConcurrency, resultSetHoldability);
JDBCExecutor jdbcExecutor = new
JDBCExecutor(metaDataContexts.getExecutorEngine(),
connection.isHoldTransaction());
driverJDBCExecutor = new DriverJDBCExecutor(metaDataContexts,
jdbcExecutor);
- rawExecutor = new RawExecutor(metaDataContexts.getExecutorEngine(),
connection.isHoldTransaction());
+ rawExecutor = new RawExecutor(metaDataContexts.getExecutorEngine(),
connection.isHoldTransaction(), metaDataContexts.getProps());
kernelProcessor = new KernelProcessor();
}
@@ -189,11 +189,10 @@ public final class ShardingSphereStatement extends
AbstractStatementAdapter {
}
private CalciteExecutor createCalciteExecutor() {
- int maxConnectionsSizePerQuery =
metaDataContexts.getProps().<Integer>getValue(ConfigurationPropertyKey.MAX_CONNECTIONS_SIZE_PER_QUERY);
StatementExecuteQueryCallback callback = new
StatementExecuteQueryCallback(metaDataContexts.getDefaultMetaData().getResource().getDatabaseType(),
executionContext.getSqlStatementContext().getSqlStatement(),
SQLExecutorExceptionHandler.isExceptionThrown());
CalciteRowExecutor executor = new
CalciteRowExecutor(metaDataContexts.getDefaultMetaData().getRuleMetaData().getRules(),
- maxConnectionsSizePerQuery, connection,
driverJDBCExecutor.getJdbcExecutor(), executionContext, callback);
+ metaDataContexts.getProps(), connection,
driverJDBCExecutor.getJdbcExecutor(), executionContext, callback);
// TODO Consider CalciteRawExecutor
CalciteLogicSchema logicSchema = new
CalciteLogicSchema(metaDataContexts.getOptimizeContextFactory().getSchemaMetadatas().getSchemas().get(DefaultSchema.LOGIC_NAME),
executor);
return new
CalciteJDBCExecutor(metaDataContexts.getOptimizeContextFactory().create(DefaultSchema.LOGIC_NAME,
logicSchema));
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/ProxySQLExecutor.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/ProxySQLExecutor.java
index e6dd740..3c8d26f 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/ProxySQLExecutor.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/ProxySQLExecutor.java
@@ -80,7 +80,8 @@ public final class ProxySQLExecutor {
ExecutorEngine executorEngine =
BackendExecutorContext.getInstance().getExecutorEngine();
boolean isSerialExecute = backendConnection.isSerialExecute();
jdbcExecutor = new ProxyJDBCExecutor(type, backendConnection, new
JDBCExecutor(executorEngine, isSerialExecute));
- rawExecutor = new RawExecutor(executorEngine, isSerialExecute);
+ MetaDataContexts metaDataContexts =
ProxyContext.getInstance().getMetaDataContexts();
+ rawExecutor = new RawExecutor(executorEngine, isSerialExecute,
metaDataContexts.getProps());
}
/**
@@ -119,7 +120,7 @@ public final class ProxySQLExecutor {
return rawExecute(executionContext, rules,
maxConnectionsSizePerQuery);
}
if (executionContext.getRouteContext().isToCalcite()) {
- return useCalciteToExecute(executionContext, rules,
maxConnectionsSizePerQuery, isReturnGeneratedKeys,
SQLExecutorExceptionHandler.isExceptionThrown());
+ return useCalciteToExecute(executionContext, rules,
isReturnGeneratedKeys, SQLExecutorExceptionHandler.isExceptionThrown());
}
return useDriverToExecute(executionContext, rules,
maxConnectionsSizePerQuery, isReturnGeneratedKeys,
SQLExecutorExceptionHandler.isExceptionThrown());
}
@@ -137,14 +138,14 @@ public final class ProxySQLExecutor {
}
private Collection<ExecuteResult> useCalciteToExecute(final
ExecutionContext executionContext, final Collection<ShardingSphereRule> rules,
- final int
maxConnectionsSizePerQuery, final boolean isReturnGeneratedKeys, final boolean
isExceptionThrown) throws SQLException {
+ final boolean
isReturnGeneratedKeys, final boolean isExceptionThrown) throws SQLException {
if (executionContext.getExecutionUnits().isEmpty()) {
return Collections.emptyList();
}
MetaDataContexts metaData =
ProxyContext.getInstance().getMetaDataContexts();
ProxyJDBCExecutorCallback callback =
ProxyJDBCExecutorCallbackFactory.newInstance(type,
metaData.getMetaData(backendConnection.getSchemaName()).getResource().getDatabaseType(),
executionContext.getSqlStatementContext().getSqlStatement(),
backendConnection, isReturnGeneratedKeys, isExceptionThrown, true);
- CalciteRowExecutor executor = new CalciteRowExecutor(rules,
maxConnectionsSizePerQuery, backendConnection, jdbcExecutor.getJdbcExecutor(),
executionContext, callback);
+ CalciteRowExecutor executor = new CalciteRowExecutor(rules,
metaData.getProps(), backendConnection, jdbcExecutor.getJdbcExecutor(),
executionContext, callback);
CalciteLogicSchema logicSchema = new
CalciteLogicSchema(metaData.getOptimizeContextFactory().getSchemaMetadatas().getSchemas().get(backendConnection.getSchemaName()),
executor);
CalciteExecutor calciteExecutor = new
CalciteJDBCExecutor(metaData.getOptimizeContextFactory().create(backendConnection.getSchemaName(),
logicSchema));
backendConnection.setCalciteExecutor(calciteExecutor);
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/executor/ProxyJDBCExecutor.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/executor/ProxyJDBCExecutor.java
index a3ca2ee..4087d10 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/executor/ProxyJDBCExecutor.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/executor/ProxyJDBCExecutor.java
@@ -20,6 +20,7 @@ package
org.apache.shardingsphere.proxy.backend.communication.jdbc.executor;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
+import org.apache.shardingsphere.infra.context.metadata.MetaDataContexts;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import
org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroupContext;
import
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutionUnit;
@@ -59,8 +60,9 @@ public final class ProxyJDBCExecutor {
public Collection<ExecuteResult> execute(final SQLStatementContext<?>
context, final ExecutionGroupContext<JDBCExecutionUnit> executionGroupContext,
final boolean
isReturnGeneratedKeys, final boolean isExceptionThrown) throws SQLException {
try {
- DatabaseType databaseType =
ProxyContext.getInstance().getMetaDataContexts().getMetaData(backendConnection.getSchemaName()).getResource().getDatabaseType();
- ExecuteProcessEngine.initialize(context, executionGroupContext);
+ MetaDataContexts metaDataContexts =
ProxyContext.getInstance().getMetaDataContexts();
+ DatabaseType databaseType =
metaDataContexts.getMetaData(backendConnection.getSchemaName()).getResource().getDatabaseType();
+ ExecuteProcessEngine.initialize(context, executionGroupContext,
metaDataContexts.getProps());
Collection<ExecuteResult> result =
jdbcExecutor.execute(executionGroupContext,
ProxyJDBCExecutorCallbackFactory.newInstance(type,
databaseType, context.getSqlStatement(), backendConnection,
isReturnGeneratedKeys, isExceptionThrown, true),
ProxyJDBCExecutorCallbackFactory.newInstance(type,
databaseType, context.getSqlStatement(), backendConnection,
isReturnGeneratedKeys, isExceptionThrown, false));
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/resources/conf/server.yaml
b/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/resources/conf/server.yaml
index 2e4d7c2..5f776be 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/resources/conf/server.yaml
+++
b/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/resources/conf/server.yaml
@@ -59,3 +59,4 @@
# sql-show: false
# check-table-metadata-enabled: false
# lock-wait-timeout-milliseconds: 50000 # The maximum time to wait for a lock
+# show-process-list-enabled: false