You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "stream2000 (via GitHub)" <gi...@apache.org> on 2023/08/09 09:39:52 UTC
[GitHub] [hudi] stream2000 commented on a diff in pull request #9395: [HUDI-6669] HoodieEngineContext should not use parallel stream with parallelism greater than CPU cores
stream2000 commented on code in PR #9395:
URL: https://github.com/apache/hudi/pull/9395#discussion_r1288224103
##########
hudi-client/hudi-flink-client/src/main/java/org/apache/hudi/client/common/HoodieFlinkEngineContext.java:
##########
@@ -102,12 +102,12 @@ public RuntimeContext getRuntimeContext() {
@Override
public <I, O> List<O> map(List<I> data, SerializableFunction<I, O> func, int parallelism) {
- return data.stream().parallel().map(throwingMapWrapper(func)).collect(Collectors.toList());
+ return stream(data, parallelism).map(throwingMapWrapper(func)).collect(Collectors.toList());
}
Review Comment:
Hi @SteNicholas, correct me if I'm wrong. Do we just run the map function sequentially when the parallelism is larger than the default parallelism? And why there is an `OutOfMemoryError ` risk when we use `stream().parallel()` which will submit some future tasks to the default thread pool which may not cost a lot of memory?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org