如何使用直接运行器在 Eclipse 中调试 Dataflow/Apache Beam 管道 DoFn 功能

编程入门 行业动态 更新时间:2024-10-26 15:16:25
本文介绍了如何使用直接运行器在 Eclipse 中调试 Dataflow/Apache Beam 管道 DoFn 功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我想在 Eclipse 中使用 在 pom.xml 中为直接运行器设置 maven 配置文件.我的 pom.xml 有 当我使用上述调试配置作业在 GCP 数据流而不是本地 JVM 线程中运行时,我的断点永远不会被命中.

解决方案

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

public TestPipeline p = TestPipeline.create();

I want to run my pipeline using direct runner in eclipse and put a break point in my DoFn functions and debug execution. I tried to setup direct runner with following steps:

Add direct runner maven package Setup maven profile for direct runner in pom.xml. My pom.xml has 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>

I have this maven plugin under plugin management in my pom.xml

<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>

Below is a screen shot of my eclipse debug configuration When I run using above debug configuration job starts in GCP dataflow instead of local JVM threads and my breakpoints are never hit.

解决方案

Probably is the way how you are creating your pipeline in your test methods. Try to create the pipeline using the TestPipeline util class like this

public TestPipeline p = TestPipeline.create();

这篇关于如何使用直接运行器在 Eclipse 中调试 Dataflow/Apache Beam 管道 DoFn 功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-19 23:10:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/971338.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   管道   功能   Eclipse   Apache

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!