【问题标题】:How to debug Dataflow/Apache Beam pipeline DoFn functions in eclipse using direct runner如何使用直接运行器在 Eclipse 中调试 Dataflow/Apache Beam 管道 DoFn 函数
【发布时间】:2017-06-14 04:21:50
【问题描述】:

我想在 Eclipse 中使用 direct runner 运行我的管道,并在我的 DoFn 函数和调试执行中放置一个断点。我尝试通过以下步骤设置直接跑步者:

  1. 添加直接runner maven包
  2. 在 pom.xml 中为直接运行程序设置 maven 配置文件。我的 pom.xml 有this profile

<profiles> <profile> <id>direct-runner</id> <activation> <activeByDefault>true</activeByDefault> </activation> <dependencies> <dependency> <groupId>org.apache.beam</groupId> <artifactId>beam-runners-direct-java</artifactId> <version>0.2.0-incubating</version> </dependency> </dependencies> </profile> </profiles>

  1. 我的 pom.xml 中的插件管理下有 this maven 插件

<pluginManagement> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.4.0</version> <executions> <execution> <goals> <goal>java</goal> </goals> </execution> </executions> <configuration> <cleanupDaemonThreads>false</cleanupDaemonThreads> <mainClass>com.MyMainClass</mainClass> </configuration> </plugin> </plugins> </pluginManagement>

  1. 下面是我的eclipse调试配置截图 当我使用上述调试配置运行时,作业在 GCP 数据流而不是本地 JVM 线程中启动,并且我的断点永远不会被命中。

【问题讨论】:

  • 我只是添加一个可能的解决方案,无论如何如果你能把你的测试代码放上去会很有用

标签: eclipse maven google-cloud-dataflow apache-beam direct-runner


【解决方案1】:

可能是您在测试方法中创建管道的方式。尝试像这样使用 TestPipeline util 类创建管道

public TestPipeline p = TestPipeline.create();

【讨论】:

    猜你喜欢
    • 2021-11-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-10
    • 1970-01-01
    • 2018-01-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多