[groovy] branch master updated: Tweak parallel querying in GINQ further

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[groovy] branch master updated: Tweak parallel querying in GINQ further

Daniel.Sun
This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new a965c05  Tweak parallel querying in GINQ further
a965c05 is described below

commit a965c05873326e7a316a88b55edcb41b632d732a
Author: Daniel Sun <[hidden email]>
AuthorDate: Sun Jan 10 02:19:47 2021 +0800

    Tweak parallel querying in GINQ further
---
 .../groovy/ginq/provider/collection/runtime/QueryableCollection.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/runtime/QueryableCollection.java b/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/runtime/QueryableCollection.java
index 5a279da..4db5412 100644
--- a/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/runtime/QueryableCollection.java
+++ b/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/runtime/QueryableCollection.java
@@ -291,7 +291,7 @@ class QueryableCollection<T> implements Queryable<T>, Serializable {
         Stream<U> stream = this.stream().map((T t) -> mapper.apply(t, this));
         if (useWindowFunction && TRUE_STR.equals(originalParallel)) {
             // invoke `collect` to trigger the intermediate operator, which will create `CompletableFuture` instances
-            stream = stream.collect(Collectors.toList()).stream().map((U u) -> {
+            stream = stream.collect(Collectors.toList()).parallelStream().map((U u) -> {
                 Function<? super U, ?> transform = e -> {
                     try {
                         return e instanceof CompletableFuture ? ((CompletableFuture) e).get() : e;

Apache Groovy committer & PMC member

Blog: http://blog.sunlan.me
Twitter: @daniel_sun