john
john

Reputation: 729

Apache Flink (How to uniquely tag Jobs)

Is it possible to tag jobs with a unique name so I can stop them at a later date?. I don't really want to grep and persist Job IDs.

In a nutshell I want to stop a job as part of my deployment and deploy the new one.

Upvotes: 5

Views: 4568

Answers (1)

Fabian Hueske
Fabian Hueske

Reputation: 18987

You can name jobs when you start them in the execute(name: String) call, e.g.,

val env: StreamExecutionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment()

val result: DataStream[] = ???       // your job logic
result.addSink(new YourSinkFunction) // add a sink

env.execute("Name of your job")      // execute and assign a name

The REST API of the JobManager provides a list of job details which include the name of the job and its JobId.

Upvotes: 6

Related Questions