0

我有一个使用直接运行器运行的 java 中的 apache 梁程序。Apache Beam 使用线程来实现分布式处理。

  1. 在运行时如何知道 apache Beam 产生的线程数?
  2. 如何设置运行时使用的最大线程数?
4

2 回答 2

0

您可以为此使用getTargetParallelism和函数:setTargetParallelism

https://beam.apache.org/releases/javadoc/2.35.0/index.html?org/apache/beam/runners/direct/DirectOptions.html

于 2022-01-13T08:12:48.810 回答
0

下面的这个链接可能会有所帮助。截至 2021 年 2 月,在 Java 中你似乎不能。在 Python 中你可以。

https://beam.apache.org/documentation/runners/direct/#parallel-execution

于 2021-02-06T10:06:24.447 回答