You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by ch...@apache.org on 2023/06/12 09:00:28 UTC
[shardingsphere] branch master updated: Remove stream api in Process init logic (#26302)
This is an automated email from the ASF dual-hosted git repository.
chengzhang 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 751d52f8ba8 Remove stream api in Process init logic (#26302)
751d52f8ba8 is described below
commit 751d52f8ba88758ddd2e9aa20a3dbe79165666fd
Author: Zhengqiang Duan <du...@apache.org>
AuthorDate: Mon Jun 12 17:00:20 2023 +0800
Remove stream api in Process init logic (#26302)
---
.../shardingsphere/infra/executor/sql/process/Process.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/process/Process.java b/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/process/Process.java
index 50b34d8bf9d..a5f43d2ec3a 100644
--- a/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/process/Process.java
+++ b/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/process/Process.java
@@ -73,12 +73,20 @@ public final class Process {
Grantee grantee = executionGroupContext.getReportContext().getGrantee();
username = null == grantee ? null : grantee.getUsername();
hostname = null == grantee ? null : grantee.getHostname();
- totalUnitCount = executionGroupContext.getInputGroups().stream().mapToInt(each -> each.getInputs().size()).sum();
+ totalUnitCount = getTotalUnitCount(executionGroupContext);
processStatements = getProcessStatements(executionGroupContext);
completedUnitCount = new AtomicInteger(0);
this.idle = idle;
}
+ private int getTotalUnitCount(final ExecutionGroupContext<? extends SQLExecutionUnit> executionGroupContext) {
+ int result = 0;
+ for (ExecutionGroup<? extends SQLExecutionUnit> each : executionGroupContext.getInputGroups()) {
+ result += each.getInputs().size();
+ }
+ return result;
+ }
+
private Collection<Statement> getProcessStatements(final ExecutionGroupContext<? extends SQLExecutionUnit> executionGroupContext) {
Collection<Statement> result = new LinkedList<>();
for (ExecutionGroup<? extends SQLExecutionUnit> each : executionGroupContext.getInputGroups()) {