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();

1 Answer 1

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. 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.