Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-36842] FlinkPipelineComposer allows injecting StreamExecutionEnvironment #3775

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maxf-decodable
Copy link

As a user of the FlinkPipelineComposer API, I would like to run jobs with a pre-configured StreamExecutionEnvironment of my choosing, for commonality with executing non-Flink-CDC jobs. However, the API only allows me to pass a Configuration object, which FlinkPipelineComposer uses to build its own StreamExecutionEnvironment.

In addition, I would like to retrieve a JobClient from submitted jobs, again for commonality with non-Flink-CDC jobs.

public static FlinkPipelineComposer ofStreamExecutionEnvironment(
StreamExecutionEnvironment env) {
return new FlinkPipelineComposer(env, false);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm to me this essentially expose the constructor and it's a bit opaque to set isBlocking=false statically here as you can have blocking mode for stream execution env too. My proposal is to make the constructor below public.

  private FlinkPipelineComposer(StreamExecutionEnvironment env, boolean isBlocking) {
        this.env = env;
        this.isBlocking = isBlocking;
    }

@PatrickRen I see that you are tagged in the history of the class. Any opinions?


public ExecutionInfo(String id, String description) {
this.id = id;
this.description = description;
this.jobClient = null;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd try to avoid null usage as much as possible to avoid potential NPEs. It does look like the jobClient is available in all the places that construct ExecutionInfo. So can we just change the constructor? If not, please add @Nullable wherever is applicable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants