英文:
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"
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论