[英]Beam template for dataflow will not upload to bucket
I've followed all the quickstarts/documentation for creating Java-based dataflow templates.我已经按照所有快速入门/文档来创建基于 Java 的数据流模板。 The steps I've found and done is:我找到并完成的步骤是:
1) Create the project: 1)创建项目:
mvn archetype:generate \
-DarchetypeGroupId=org.apache.beam \
-DarchetypeArtifactId=beam-sdks-java-maven-archetypes-examples \
-DarchetypeVersion=2.22.0 \
-DgroupId=com.example \
-DartifactId=JsonToBucket \
-Dversion="0.1" \
-Dpackage=com.example.dataflow \
-DinteractiveMode=false
2) mvn clean && mvn compile 2) mvn clean && mvn 编译
This reports build success这报告构建成功
3) Compile and upload to bucket 3)编译上传到bucket
mvn compile exec:java -Pdataflow-runner \
-Dexec.mainClass=com.example.dataflow.JsonToBucket -Dexec.cleanupDaemonThreads=false \
-Dexec.args="--runner=DataflowRunner \
--project=PROJECT \
--stagingLocation=gs://some-bucket/staging \
--templateLocation=gs://some-bucket/beam_templates/DisruptivePubSubToBucket"
The output of this is: output 是:
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< com.example:jsonToBucket >----------------------
[INFO] Building jsonToBucket 0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jsonToBucket ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /somepath/jsonToBucket/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ jsonToBucket ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 4 source files to /somepath/jsonToBucket/target/classes
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:java (default-cli) @ jsonToBucket ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.161 s
[INFO] Finished at: 2020-06-19T14:05:52+02:00
[INFO] ------------------------------------------------------------------------
No files are uploaded to the bucket set in step 3.没有文件上传到步骤 3 中设置的存储桶。
What could be wrong?有什么问题?
The issue was with the run()
method.问题出在run()
方法上。 Taken from @gixen comment:取自@gixen 评论:
The problem was a real small thing, the run() method was never triggered问题是一件真正的小事,run() 方法从未被触发
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.