Hi Dmitry,
I think currently the simplest way to do this is simply to add a
program argument as a flag to whether or not the current run
is from a savepoint (so you manually supply the flag whenever you’re starting the
job from a savepoint), and check that flag in the main method.
The main method will only be executed at the client once on every job submit,
and not on job auto restarts from checkpoints due to failures.
Cheers,
Gordon
On February 9, 2017 at 11:08:54 PM, Dmitry Golubets ([hidden email]) wrote:
Hi,
I need to re-create a Kafka topic when a job is started in "clean"
mode.
I can do it, but I'm not sure if I do it in the right place.
Is it fine to put this kind of code in the "main"?
Then it's called on every job submit.
But.. how to detect if a job is being started from a
savepoint?
Or is there a different approach?