0

We have a GCP Dataflow project which requires us to cancel a running Dataflow job.

All we have at the time of cancellation is the Job ID.

From other posts on Stackoverflow, I learned we can cancel a job using something like this:

PipelineResult pipelineResult = pipeline.run();
result.cancel();

However, we don't store the pipelineResult when we create it.

The PipelineResult is just a DataflowPipelineJob. I am wondering if there are any ways I can retrieve a DataflowPipelineJob using its job and cancel it. Something like:

DataflowPipelineJob job = <Get DataflowPipelineJob using Job ID>;
job.cancel();
ZZZ
  • 645
  • 4
  • 17

1 Answers1

0

I looked upon the same inquiry and the solution uses the Dofn interface, It is mentioned that it is within the Dofn Process Element method. 

Nestor Ceniza Jr
  • 976
  • 3
  • 11