You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2025/05/09 09:56:07 UTC
(shardingsphere) branch master updated: Refactor AbstractExecutionPrepareEngine (#35353)
This is an automated email from the ASF dual-hosted git repository.
zhangliang 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 46f58926347 Refactor AbstractExecutionPrepareEngine (#35353)
46f58926347 is described below
commit 46f58926347e480c4350d316965ab2012dab1d8b
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Fri May 9 17:56:01 2025 +0800
Refactor AbstractExecutionPrepareEngine (#35353)
---
.../infra/executor/sql/prepare/AbstractExecutionPrepareEngine.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/prepare/AbstractExecutionPrepareEngine.java b/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/prepare/AbstractExecutionPrepareEngine.java
index 81df7d15a8b..63f0416ebfd 100644
--- a/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/prepare/AbstractExecutionPrepareEngine.java
+++ b/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/prepare/AbstractExecutionPrepareEngine.java
@@ -81,13 +81,14 @@ public abstract class AbstractExecutionPrepareEngine<T> implements ExecutionPrep
return Lists.partition(sqlUnits, desiredPartitionSize);
}
- protected abstract List<ExecutionGroup<T>> group(String databaseName, String dataSourceName, int connectionOffset, List<List<ExecutionUnit>> executionUnitGroups,
- ConnectionMode connectionMode) throws SQLException;
+ protected abstract List<ExecutionGroup<T>> group(String databaseName, String dataSourceName,
+ int connectionOffset, List<List<ExecutionUnit>> executionUnitGroups, ConnectionMode connectionMode) throws SQLException;
private Map<String, List<ExecutionUnit>> aggregateExecutionUnitGroups(final Collection<ExecutionUnit> executionUnits) {
Map<String, List<ExecutionUnit>> result = new TreeMap<>();
for (ExecutionUnit each : executionUnits) {
- result.computeIfAbsent(each.getDataSourceName(), unused -> new ArrayList<>(executionUnits.size())).add(each);
+ String dataSourceName = each.getDataSourceName();
+ result.computeIfAbsent(dataSourceName, unused -> new ArrayList<>(executionUnits.size())).add(each);
}
return result;
}