From eb58f47861f24d79168d5256173b973fc22c18e2 Mon Sep 17 00:00:00 2001 From: terrymanu Date: Sun, 2 Jun 2024 00:38:14 +0800 Subject: [PATCH 1/3] Refactor TrafficExecutorCallback --- .../driver/executor/DriverExecutor.java | 2 +- .../ShardingSpherePreparedStatement.java | 4 ++-- .../core/statement/ShardingSphereStatement.java | 16 ++++++++-------- .../executor/TrafficExecutorCallback.java | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/jdbc/src/main/java/org/apache/shardingsphere/driver/executor/DriverExecutor.java b/jdbc/src/main/java/org/apache/shardingsphere/driver/executor/DriverExecutor.java index 8d2430f191c64..cd371bcc711d3 100644 --- a/jdbc/src/main/java/org/apache/shardingsphere/driver/executor/DriverExecutor.java +++ b/jdbc/src/main/java/org/apache/shardingsphere/driver/executor/DriverExecutor.java @@ -164,7 +164,7 @@ public ResultSet executeQuery(final ShardingSphereDatabase database, final Query } private TrafficExecutorCallback getTrafficExecuteQueryCallback(final String jdbcDriverType) { - return JDBCDriverType.STATEMENT.equals(jdbcDriverType) ? Statement::executeQuery : ((statement, sql) -> ((PreparedStatement) statement).executeQuery()); + return JDBCDriverType.STATEMENT.equals(jdbcDriverType) ? ((sql, statement) -> statement.executeQuery(sql)) : ((sql, statement) -> ((PreparedStatement) statement).executeQuery()); } private ExecuteQueryCallback getExecuteQueryCallback(final ShardingSphereDatabase database, final QueryContext queryContext, final String jdbcDriverType) { diff --git a/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java b/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java index 198fe9bb813c7..e97550e0e2610 100644 --- a/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java +++ b/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java @@ -261,7 +261,7 @@ public int executeUpdate() throws SQLException { handleAutoCommit(queryContext.getSqlStatementContext().getSqlStatement()); ShardingSphereDatabase database = metaData.getDatabase(databaseName); final int result = executor.executeUpdate(database, queryContext, createDriverExecutionPrepareEngine(database), - (statement, sql) -> ((PreparedStatement) statement).executeUpdate(), null, (StatementReplayCallback) this::replay); + (sql, statement) -> ((PreparedStatement) statement).executeUpdate(), null, (StatementReplayCallback) this::replay); for (Statement each : executor.getStatements()) { statements.add((PreparedStatement) each); } @@ -289,7 +289,7 @@ public boolean execute() throws SQLException { QueryContext queryContext = createQueryContext(); handleAutoCommit(queryContext.getSqlStatementContext().getSqlStatement()); ShardingSphereDatabase database = metaData.getDatabase(databaseName); - final boolean result = executor.executeAdvance(database, queryContext, createDriverExecutionPrepareEngine(database), (statement, sql) -> ((PreparedStatement) statement).execute(), + final boolean result = executor.executeAdvance(database, queryContext, createDriverExecutionPrepareEngine(database), (sql, statement) -> ((PreparedStatement) statement).execute(), null, (StatementReplayCallback) this::replay); for (Statement each : executor.getStatements()) { statements.add((PreparedStatement) each); diff --git a/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java b/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java index 7cb715a0b5fa6..ca458c094d895 100644 --- a/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java +++ b/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java @@ -151,7 +151,7 @@ private DriverExecutionPrepareEngine createDriver @Override public int executeUpdate(final String sql) throws SQLException { try { - return executeUpdate(sql, (actualSQL, statement) -> statement.executeUpdate(actualSQL), Statement::executeUpdate); + return executeUpdate(sql, (actualSQL, statement) -> statement.executeUpdate(actualSQL), (actualSQL, statement) -> statement.executeUpdate(actualSQL)); // CHECKSTYLE:OFF } catch (final RuntimeException ex) { // CHECKSTYLE:ON @@ -169,7 +169,7 @@ public int executeUpdate(final String sql, final int autoGeneratedKeys) throws S } try { return executeUpdate(sql, (actualSQL, statement) -> statement.executeUpdate(actualSQL, autoGeneratedKeys), - (statement, actualSQL) -> statement.executeUpdate(actualSQL, autoGeneratedKeys)); + (actualSQL, statement) -> statement.executeUpdate(actualSQL, autoGeneratedKeys)); // CHECKSTYLE:OFF } catch (final RuntimeException ex) { // CHECKSTYLE:ON @@ -184,7 +184,7 @@ public int executeUpdate(final String sql, final int autoGeneratedKeys) throws S public int executeUpdate(final String sql, final int[] columnIndexes) throws SQLException { returnGeneratedKeys = true; try { - return executeUpdate(sql, (actualSQL, statement) -> statement.executeUpdate(actualSQL, columnIndexes), (statement, actualSQL) -> statement.executeUpdate(actualSQL, columnIndexes)); + return executeUpdate(sql, (actualSQL, statement) -> statement.executeUpdate(actualSQL, columnIndexes), (actualSQL, statement) -> statement.executeUpdate(actualSQL, columnIndexes)); // CHECKSTYLE:OFF } catch (final RuntimeException ex) { // CHECKSTYLE:ON @@ -199,7 +199,7 @@ public int executeUpdate(final String sql, final int[] columnIndexes) throws SQL public int executeUpdate(final String sql, final String[] columnNames) throws SQLException { returnGeneratedKeys = true; try { - return executeUpdate(sql, (actualSQL, statement) -> statement.executeUpdate(actualSQL, columnNames), (statement, actualSQL) -> statement.executeUpdate(actualSQL, columnNames)); + return executeUpdate(sql, (actualSQL, statement) -> statement.executeUpdate(actualSQL, columnNames), (actualSQL, statement) -> statement.executeUpdate(actualSQL, columnNames)); // CHECKSTYLE:OFF } catch (final RuntimeException ex) { // CHECKSTYLE:ON @@ -228,7 +228,7 @@ private int executeUpdate(final String sql, final ExecuteUpdateCallback updateCa @Override public boolean execute(final String sql) throws SQLException { try { - return execute0(sql, (actualSQL, statement) -> statement.execute(actualSQL), Statement::execute); + return execute0(sql, (actualSQL, statement) -> statement.execute(actualSQL), (actualSQL, statement) -> statement.execute(actualSQL)); // CHECKSTYLE:OFF } catch (final SQLException ex) { // CHECKSTYLE:ON @@ -243,7 +243,7 @@ public boolean execute(final String sql, final int autoGeneratedKeys) throws SQL if (RETURN_GENERATED_KEYS == autoGeneratedKeys) { returnGeneratedKeys = true; } - return execute0(sql, (actualSQL, statement) -> statement.execute(actualSQL, autoGeneratedKeys), (statement, actualSQL) -> statement.execute(actualSQL, autoGeneratedKeys)); + return execute0(sql, (actualSQL, statement) -> statement.execute(actualSQL, autoGeneratedKeys), (actualSQL, statement) -> statement.execute(actualSQL, autoGeneratedKeys)); // CHECKSTYLE:OFF } catch (final SQLException ex) { // CHECKSTYLE:ON @@ -256,7 +256,7 @@ public boolean execute(final String sql, final int autoGeneratedKeys) throws SQL public boolean execute(final String sql, final int[] columnIndexes) throws SQLException { try { returnGeneratedKeys = true; - return execute0(sql, (actualSQL, statement) -> statement.execute(actualSQL, columnIndexes), (statement, actualSQL) -> statement.execute(actualSQL, columnIndexes)); + return execute0(sql, (actualSQL, statement) -> statement.execute(actualSQL, columnIndexes), (actualSQL, statement) -> statement.execute(actualSQL, columnIndexes)); // CHECKSTYLE:OFF } catch (final SQLException ex) { // CHECKSTYLE:ON @@ -269,7 +269,7 @@ public boolean execute(final String sql, final int[] columnIndexes) throws SQLEx public boolean execute(final String sql, final String[] columnNames) throws SQLException { try { returnGeneratedKeys = true; - return execute0(sql, (actualSQL, statement) -> statement.execute(actualSQL, columnNames), (statement, actualSQL) -> statement.execute(actualSQL, columnNames)); + return execute0(sql, (actualSQL, statement) -> statement.execute(actualSQL, columnNames), (actualSQL, statement) -> statement.execute(actualSQL, columnNames)); // CHECKSTYLE:OFF } catch (final SQLException ex) { // CHECKSTYLE:ON diff --git a/kernel/traffic/core/src/main/java/org/apache/shardingsphere/traffic/executor/TrafficExecutorCallback.java b/kernel/traffic/core/src/main/java/org/apache/shardingsphere/traffic/executor/TrafficExecutorCallback.java index bc6a5140d378e..e6b25160ef023 100644 --- a/kernel/traffic/core/src/main/java/org/apache/shardingsphere/traffic/executor/TrafficExecutorCallback.java +++ b/kernel/traffic/core/src/main/java/org/apache/shardingsphere/traffic/executor/TrafficExecutorCallback.java @@ -30,10 +30,10 @@ public interface TrafficExecutorCallback { /** * Execute. * - * @param statement statement * @param sql SQL + * @param statement statement * @return execution result * @throws SQLException SQL exception */ - T execute(Statement statement, String sql) throws SQLException; + T execute(String sql, Statement statement) throws SQLException; } From 5edf825a36d26219316dc0ab0442539f46f2d595 Mon Sep 17 00:00:00 2001 From: terrymanu Date: Sun, 2 Jun 2024 00:43:24 +0800 Subject: [PATCH 2/3] Refactor TrafficExecutorCallback --- .../apache/shardingsphere/traffic/executor/TrafficExecutor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/traffic/core/src/main/java/org/apache/shardingsphere/traffic/executor/TrafficExecutor.java b/kernel/traffic/core/src/main/java/org/apache/shardingsphere/traffic/executor/TrafficExecutor.java index 7706ac2365005..56e42edf71393 100644 --- a/kernel/traffic/core/src/main/java/org/apache/shardingsphere/traffic/executor/TrafficExecutor.java +++ b/kernel/traffic/core/src/main/java/org/apache/shardingsphere/traffic/executor/TrafficExecutor.java @@ -65,7 +65,7 @@ public T execute(final String processId, final String databaseName, final St JDBCExecutionUnit executionUnit = createTrafficExecutionUnit(processId, databaseName, trafficInstanceId, queryContext, prepareEngine); SQLUnit sqlUnit = executionUnit.getExecutionUnit().getSqlUnit(); cacheStatement(sqlUnit.getParameters(), executionUnit.getStorageResource()); - T result = callback.execute(statement, sqlUnit.getSql()); + T result = callback.execute(sqlUnit.getSql(), statement); resultSet = statement.getResultSet(); return result; } From bc24a8e58785b5104761931910de7e8512979fbe Mon Sep 17 00:00:00 2001 From: terrymanu Date: Sun, 2 Jun 2024 00:56:42 +0800 Subject: [PATCH 3/3] Refactor TrafficExecutorCallback --- .../driver/executor/DriverExecutor.java | 10 +++---- .../ShardingSpherePreparedStatement.java | 4 +-- .../statement/ShardingSphereStatement.java | 26 +++++++++---------- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/jdbc/src/main/java/org/apache/shardingsphere/driver/executor/DriverExecutor.java b/jdbc/src/main/java/org/apache/shardingsphere/driver/executor/DriverExecutor.java index cd371bcc711d3..42f7ebc869191 100644 --- a/jdbc/src/main/java/org/apache/shardingsphere/driver/executor/DriverExecutor.java +++ b/jdbc/src/main/java/org/apache/shardingsphere/driver/executor/DriverExecutor.java @@ -257,7 +257,6 @@ private List getResultSets() throws SQLException { * @param database database * @param queryContext query context * @param prepareEngine prepare engine - * @param trafficCallback traffic callback * @param updateCallback update callback * @param statementReplayCallback statement replay callback * @return updated row count @@ -265,11 +264,11 @@ private List getResultSets() throws SQLException { */ @SuppressWarnings("rawtypes") public int executeUpdate(final ShardingSphereDatabase database, final QueryContext queryContext, - final DriverExecutionPrepareEngine prepareEngine, final TrafficExecutorCallback trafficCallback, + final DriverExecutionPrepareEngine prepareEngine, final ExecuteUpdateCallback updateCallback, final StatementReplayCallback statementReplayCallback) throws SQLException { Optional trafficInstanceId = connection.getTrafficInstanceId(metaData.getGlobalRuleMetaData().getSingleRule(TrafficRule.class), queryContext); if (trafficInstanceId.isPresent()) { - return trafficExecutor.execute(connection.getProcessId(), database.getName(), trafficInstanceId.get(), queryContext, prepareEngine, trafficCallback); + return trafficExecutor.execute(connection.getProcessId(), database.getName(), trafficInstanceId.get(), queryContext, prepareEngine, updateCallback::executeUpdate); } ExecutionContext executionContext = createExecutionContext(database, queryContext); return database.getRuleMetaData().getAttributes(RawExecutionRuleAttribute.class).isEmpty() @@ -360,7 +359,6 @@ private int accumulate(final Collection results) { * @param database database * @param queryContext query context * @param prepareEngine prepare engine - * @param trafficCallback traffic callback * @param executeCallback execute callback * @param statementReplayCallback statement replay callback * @return execute result @@ -368,12 +366,12 @@ private int accumulate(final Collection results) { */ @SuppressWarnings("rawtypes") public boolean executeAdvance(final ShardingSphereDatabase database, final QueryContext queryContext, - final DriverExecutionPrepareEngine prepareEngine, final TrafficExecutorCallback trafficCallback, + final DriverExecutionPrepareEngine prepareEngine, final ExecuteCallback executeCallback, final StatementReplayCallback statementReplayCallback) throws SQLException { Optional trafficInstanceId = connection.getTrafficInstanceId(metaData.getGlobalRuleMetaData().getSingleRule(TrafficRule.class), queryContext); if (trafficInstanceId.isPresent()) { executeType = ExecuteType.TRAFFIC; - return trafficExecutor.execute(connection.getProcessId(), database.getName(), trafficInstanceId.get(), queryContext, prepareEngine, trafficCallback); + return trafficExecutor.execute(connection.getProcessId(), database.getName(), trafficInstanceId.get(), queryContext, prepareEngine, executeCallback::execute); } if (sqlFederationEngine.decide(queryContext.getSqlStatementContext(), queryContext.getParameters(), database, metaData.getGlobalRuleMetaData())) { executeType = ExecuteType.FEDERATION; diff --git a/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java b/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java index e97550e0e2610..a3dfffaa2fa88 100644 --- a/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java +++ b/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java @@ -261,7 +261,7 @@ public int executeUpdate() throws SQLException { handleAutoCommit(queryContext.getSqlStatementContext().getSqlStatement()); ShardingSphereDatabase database = metaData.getDatabase(databaseName); final int result = executor.executeUpdate(database, queryContext, createDriverExecutionPrepareEngine(database), - (sql, statement) -> ((PreparedStatement) statement).executeUpdate(), null, (StatementReplayCallback) this::replay); + (sql, statement) -> ((PreparedStatement) statement).executeUpdate(), (StatementReplayCallback) this::replay); for (Statement each : executor.getStatements()) { statements.add((PreparedStatement) each); } @@ -290,7 +290,7 @@ public boolean execute() throws SQLException { handleAutoCommit(queryContext.getSqlStatementContext().getSqlStatement()); ShardingSphereDatabase database = metaData.getDatabase(databaseName); final boolean result = executor.executeAdvance(database, queryContext, createDriverExecutionPrepareEngine(database), (sql, statement) -> ((PreparedStatement) statement).execute(), - null, (StatementReplayCallback) this::replay); + (StatementReplayCallback) this::replay); for (Statement each : executor.getStatements()) { statements.add((PreparedStatement) each); } diff --git a/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java b/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java index ca458c094d895..2437e7a54dc36 100644 --- a/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java +++ b/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java @@ -55,7 +55,6 @@ import org.apache.shardingsphere.parser.rule.SQLParserRule; import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement; import org.apache.shardingsphere.sql.parser.sql.common.statement.dal.DALStatement; -import org.apache.shardingsphere.traffic.executor.TrafficExecutorCallback; import org.apache.shardingsphere.transaction.util.AutoCommitUtils; import java.sql.Connection; @@ -151,7 +150,7 @@ private DriverExecutionPrepareEngine createDriver @Override public int executeUpdate(final String sql) throws SQLException { try { - return executeUpdate(sql, (actualSQL, statement) -> statement.executeUpdate(actualSQL), (actualSQL, statement) -> statement.executeUpdate(actualSQL)); + return executeUpdate(sql, (actualSQL, statement) -> statement.executeUpdate(actualSQL)); // CHECKSTYLE:OFF } catch (final RuntimeException ex) { // CHECKSTYLE:ON @@ -168,8 +167,7 @@ public int executeUpdate(final String sql, final int autoGeneratedKeys) throws S returnGeneratedKeys = true; } try { - return executeUpdate(sql, (actualSQL, statement) -> statement.executeUpdate(actualSQL, autoGeneratedKeys), - (actualSQL, statement) -> statement.executeUpdate(actualSQL, autoGeneratedKeys)); + return executeUpdate(sql, (actualSQL, statement) -> statement.executeUpdate(actualSQL, autoGeneratedKeys)); // CHECKSTYLE:OFF } catch (final RuntimeException ex) { // CHECKSTYLE:ON @@ -184,7 +182,7 @@ public int executeUpdate(final String sql, final int autoGeneratedKeys) throws S public int executeUpdate(final String sql, final int[] columnIndexes) throws SQLException { returnGeneratedKeys = true; try { - return executeUpdate(sql, (actualSQL, statement) -> statement.executeUpdate(actualSQL, columnIndexes), (actualSQL, statement) -> statement.executeUpdate(actualSQL, columnIndexes)); + return executeUpdate(sql, (actualSQL, statement) -> statement.executeUpdate(actualSQL, columnIndexes)); // CHECKSTYLE:OFF } catch (final RuntimeException ex) { // CHECKSTYLE:ON @@ -199,7 +197,7 @@ public int executeUpdate(final String sql, final int[] columnIndexes) throws SQL public int executeUpdate(final String sql, final String[] columnNames) throws SQLException { returnGeneratedKeys = true; try { - return executeUpdate(sql, (actualSQL, statement) -> statement.executeUpdate(actualSQL, columnNames), (actualSQL, statement) -> statement.executeUpdate(actualSQL, columnNames)); + return executeUpdate(sql, (actualSQL, statement) -> statement.executeUpdate(actualSQL, columnNames)); // CHECKSTYLE:OFF } catch (final RuntimeException ex) { // CHECKSTYLE:ON @@ -210,7 +208,7 @@ public int executeUpdate(final String sql, final String[] columnNames) throws SQ } } - private int executeUpdate(final String sql, final ExecuteUpdateCallback updateCallback, final TrafficExecutorCallback trafficCallback) throws SQLException { + private int executeUpdate(final String sql, final ExecuteUpdateCallback updateCallback) throws SQLException { QueryContext queryContext = createQueryContext(sql); handleAutoCommit(queryContext.getSqlStatementContext().getSqlStatement()); databaseName = queryContext.getDatabaseNameFromSQLStatement().orElse(connection.getDatabaseName()); @@ -218,7 +216,7 @@ private int executeUpdate(final String sql, final ExecuteUpdateCallback updateCa ShardingSphereDatabase database = metaData.getDatabase(databaseName); sqlStatementContext = queryContext.getSqlStatementContext(); clearStatements(); - int result = executor.executeUpdate(database, queryContext, createDriverExecutionPrepareEngine(database), trafficCallback, updateCallback, + int result = executor.executeUpdate(database, queryContext, createDriverExecutionPrepareEngine(database), updateCallback, (StatementReplayCallback) (statements, parameterSets) -> replay(statements)); statements.addAll(executor.getStatements()); replay(statements); @@ -228,7 +226,7 @@ private int executeUpdate(final String sql, final ExecuteUpdateCallback updateCa @Override public boolean execute(final String sql) throws SQLException { try { - return execute0(sql, (actualSQL, statement) -> statement.execute(actualSQL), (actualSQL, statement) -> statement.execute(actualSQL)); + return execute0(sql, (actualSQL, statement) -> statement.execute(actualSQL)); // CHECKSTYLE:OFF } catch (final SQLException ex) { // CHECKSTYLE:ON @@ -243,7 +241,7 @@ public boolean execute(final String sql, final int autoGeneratedKeys) throws SQL if (RETURN_GENERATED_KEYS == autoGeneratedKeys) { returnGeneratedKeys = true; } - return execute0(sql, (actualSQL, statement) -> statement.execute(actualSQL, autoGeneratedKeys), (actualSQL, statement) -> statement.execute(actualSQL, autoGeneratedKeys)); + return execute0(sql, (actualSQL, statement) -> statement.execute(actualSQL, autoGeneratedKeys)); // CHECKSTYLE:OFF } catch (final SQLException ex) { // CHECKSTYLE:ON @@ -256,7 +254,7 @@ public boolean execute(final String sql, final int autoGeneratedKeys) throws SQL public boolean execute(final String sql, final int[] columnIndexes) throws SQLException { try { returnGeneratedKeys = true; - return execute0(sql, (actualSQL, statement) -> statement.execute(actualSQL, columnIndexes), (actualSQL, statement) -> statement.execute(actualSQL, columnIndexes)); + return execute0(sql, (actualSQL, statement) -> statement.execute(actualSQL, columnIndexes)); // CHECKSTYLE:OFF } catch (final SQLException ex) { // CHECKSTYLE:ON @@ -269,7 +267,7 @@ public boolean execute(final String sql, final int[] columnIndexes) throws SQLEx public boolean execute(final String sql, final String[] columnNames) throws SQLException { try { returnGeneratedKeys = true; - return execute0(sql, (actualSQL, statement) -> statement.execute(actualSQL, columnNames), (actualSQL, statement) -> statement.execute(actualSQL, columnNames)); + return execute0(sql, (actualSQL, statement) -> statement.execute(actualSQL, columnNames)); // CHECKSTYLE:OFF } catch (final SQLException ex) { // CHECKSTYLE:ON @@ -278,7 +276,7 @@ public boolean execute(final String sql, final String[] columnNames) throws SQLE } } - private boolean execute0(final String sql, final ExecuteCallback executeCallback, final TrafficExecutorCallback trafficCallback) throws SQLException { + private boolean execute0(final String sql, final ExecuteCallback executeCallback) throws SQLException { currentResultSet = null; QueryContext queryContext = createQueryContext(sql); handleAutoCommit(queryContext.getSqlStatementContext().getSqlStatement()); @@ -287,7 +285,7 @@ private boolean execute0(final String sql, final ExecuteCallback executeCallback ShardingSphereDatabase database = metaData.getDatabase(databaseName); sqlStatementContext = queryContext.getSqlStatementContext(); clearStatements(); - boolean result = executor.executeAdvance(database, queryContext, createDriverExecutionPrepareEngine(database), trafficCallback, + boolean result = executor.executeAdvance(database, queryContext, createDriverExecutionPrepareEngine(database), executeCallback, (StatementReplayCallback) (statements, parameterSets) -> replay(statements)); statements.addAll(executor.getStatements()); return result;