Package org.apache.flink.core.execution
Interface JobStatusHook
-
- All Superinterfaces:
Serializable
@Internal public interface JobStatusHook extends Serializable
Hooks on job status changing. Triggered at the initial(CREATED) and final state(FINISHED/CANCELED/FAILED) of the job.Usage examples:
StreamGraph streamGraph = env.getStreamGraph(); streamGraph.registerJobStatusHook(myJobStatusHook); streamGraph.setJobName("my_flink"); env.execute(streamGraph);
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonCanceled(JobID jobId)When job get canceled by users.voidonCreated(JobID jobId)When Job becomesJobStatus.CREATEDstatus, it would only be called one time.voidonFailed(JobID jobId, Throwable throwable)When job failed finally.voidonFinished(JobID jobId)When job finished successfully.
-
-
-
Method Detail
-
onCreated
void onCreated(JobID jobId)
When Job becomesJobStatus.CREATEDstatus, it would only be called one time.
-
onFinished
void onFinished(JobID jobId)
When job finished successfully.
-
onCanceled
void onCanceled(JobID jobId)
When job get canceled by users.
-
-