Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

There is an existing JobListener which will be notified when job is submitted. Before job submission event should be added to the listener is submitted, Flink should create an event with source/sink list in for the job and notify the listener, then users can do their customized validation such as whether a table is written by multiple jobs. JobSubmissionEvent is created for the listener and onJobBeforeSubmitted onEvent method is added to the listener  as follows.

Code Block
@PublicEvolving
public interface JobListener {
    /* Event is fired before a job is submitted. */
    void onJobPreSubmittedonEvent(JobSubmissionEvent submissionEvent);

    /* Event for job submission. */
    @PublicEvolving
    public interface JobSubmissionEvent {
        JobID jobId();
        String jobName();
        JobLogicalPlan plan();
    }

    @Deprecated
    void onJobSubmitted(@Nullable JobClient jobClient, @Nullable Throwable throwable);

    @Deprecated
    void onJobExecuted(
            @Nullable JobExecutionResult jobExecutionResult, @Nullable Throwable throwable);

    @PublicEvolving
    public interface JobPreSubmitEvent extends JobSubmissionEvent { }

    @PublicEvolving
    public interface JobSubmittedEvent extends JobSubmissionEvent {
        @Nullable JobClient jobClient();
        @Nullable Throwable throwable();
    }

    @PublicEvolving
    public interface JobExecutedEvent extends JobSubmissionEvent {
        @Nullable JobExecutionResult jobExecutionResult();
        @Nullable Throwable throwable();
    }
}

JobExecutionListener

...