2017-01-15 61 views

回答

3

之所以能夠啓動與下面的代碼排水:

// spawn child pipe 
    DataflowPipelineRunner runner = DataflowPipelineRunner.fromOptions(options); 
    DataflowPipelineJob job = runner.run(p); 

    // under the some condition later, drain the spawned pipe: 
    Dataflow client = com.google.cloud.dataflow.sdk.util.Transport.newDataflowClient(options).build(); 
    Job content = new Job(); 
    content.setProjectId(options.getProject()); 
    content.setId(job.getJobId()); 
    content.setRequestedState("JOB_STATE_DRAINING"); 
    client.projects().jobs() 
      .update(options.getProject(), job.getJobId(), content) 
      .execute();