属性 [region] 被标记为具有矛盾的注解 + Apache Beam 2.23

huangapple go评论71阅读模式
英文:

Property [region] is marked with contradictory annotations + Apache Beam 2.23

问题

我正在升级Beam SDK版本从2.14到2.23。在进行此操作时,我遇到了错误Missing required values: region at org.apache.beam.runners.dataflow.DataflowRunner.fromOptions。因此,我将区域作为命令行参数添加了--region=us-central1,并在我的Pipeline Options类中添加了获取器和设置器方法如下:

@Description("VM region")
@Default.String("us-central1")
public String getRegion();
public void setRegion(String value);

由于这样做,现在我遇到了错误java.lang.IllegalArgumentException: Property [region] is marked with contradictory annotations。任何帮助将不胜感激。

英文:

I am upgrading beam sdks from 2.14 to 2.23. While doing this, I came across error Missing required values: region at org.apache.beam.runners.dataflow.DataflowRunner.fromOptions So, I added region as command line arg --region=us-central1 and also added getter setter method in my Pipeline Options class as

@Description("VM region") 
@Default.String("us-central1")
public String getRegion();
public void setRegion(String value);

With this, now I am getting error as java.lang.IllegalArgumentException: Property [region] is marked with contradictory annotations

Any help will be appreciated.

答案1

得分: 1

我遇到了同样的问题,只是在CLI中添加了--region=us-central1,而没有添加getter和setter。 这样做可以正常工作!

mvn  compile exec:java -Dexec.mainClass=org.omar.$CLASS_NAME -Dexec.cleanupDaemonThreads=false -Dexec.args=" --project=$PROJECT_ID --stagingLocation=gs://$BUCKET_NAME/staging --tempLocation=gs://$BUCKET_NAME/temp --templateLocation=gs://$BUCKET_NAME/templates/$TEMPLATE_NAME.json --runner=DataflowRunner --region=us-central1"
英文:

I had the same issue and I just added --region=us-central1 to the CLI without adding the getter and setter. It worked!

mvn  compile exec:java -Dexec.mainClass=org.omar.$CLASS_NAME -Dexec.cleanupDaemonThreads=false -Dexec.args=" --project=$PROJECT_ID --stagingLocation=gs://$BUCKET_NAME/staging --tempLocation=gs://$BUCKET_NAME/temp --templateLocation=gs://$BUCKET_NAME/templates/$TEMPLATE_NAME.json --runner=DataflowRunner --region=us-central1"

huangapple
  • 本文由 发表于 2020年8月5日 21:34:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/63266371.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定