了解在apachebeam直接运行程序中运行的线程数



我有一个用java编写的apachebeam程序,它与directrunner一起运行。Apache beam使用线程来实现分布式处理。

  1. 在运行时,我如何知道apachebeam派生的线程数
  2. 如何设置运行时要使用的最大线程数

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

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

您可以为此使用getTargetParallelismsetTargetParallelism函数:

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

最新更新