[英]Running Google Dataflow with PubsubIO source for testing
我正在使用Google Cloud Dataflow
創建數據處理應用程序-它會將數據從Pubsub
流傳輸到Bigquery
。
我對基礎架構有些困惑。 我創建了我的應用程序原型,並可以使用文件(帶有TextIO
)作為源和目標在本地運行它。
但是,如果我將源更改為PubsubIO.Read.subscription(...)
我將失敗,並出現“ java.lang.IllegalStateException:沒有為PubsubIO.Read注冊評估器”(我並不感到驚訝,因為我仍然看不到任何通過身份驗證的方法) 。
但是我該怎么辦呢? 我應該在Google Cloud Engine
創建一些虛擬機並在其中部署東西,還是應該以某種方式描述一項job
然后將其提交給Dataflow API
(不需要任何顯式的VM-s?)
您能否指點我一些有關此主題的分步說明-或更簡短地解釋工作流程。 我很抱歉這個問題可能很愚蠢。
您需要在Google Cloud基礎結構上運行管道才能訪問PubSub,請參閱: https ://cloud.google.com/dataflow/pipelines/specifying-exec-params#CloudExecution
從他們的頁面:
// Create and set your PipelineOptions.
DataflowPipelineOptions options = PipelineOptionsFactory.as(DataflowPipelineOptions.class);
// For Cloud execution, set the Cloud Platform project, staging location,
// and specify DataflowPipelineRunner or BlockingDataflowPipelineRunner.
options.setProject("my-project-id");
options.setStagingLocation("gs://my-bucket/binaries");
options.setRunner(DataflowPipelineRunner.class);
// Create the Pipeline with the specified options.
Pipeline p = Pipeline.create(options);
// Specify all the pipeline reads, transforms, and writes.
...
// Run the pipeline.
p.run();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.