Perform action after Dataflow pipeline has processed all data

后端 未结 3 739
别跟我提以往
别跟我提以往 2020-12-20 21:42

Is it possible to perform an action once a batch Dataflow job has finished processing all data? Specifically, I\'d like to move the text file that the pipeline just processe

3条回答
  •  再見小時候
    2020-12-20 22:31

    I don't see why you need to do this post pipeline execution. You could use side outputs to write the file to multiple buckets, and save yourself the copy after the pipeline finishes.

    If that's not going to work for you (for whatever reason), then you can simply run your pipeline in blocking execution mode i.e. use pipeline.run().waitUntilFinish(), and then just write the rest of your code (which does the copy) after that.

    [..]
    // do some stuff before the pipeline runs
    Pipeline pipeline = ...
    pipeline.run().waitUntilFinish();
    // do something after the pipeline finishes here
    [..]
    

提交回复
热议问题