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-16149][hotfix][core] Use GlobalConfigurationLoader on StreamPlanEnvironment #31

Closed
wants to merge 1 commit into from

Conversation

sjwiesman
Copy link
Contributor

This is a follow up to #27

I noticed when running a container-based deployment that my stateful function-specific configurations were not being respected. Other flink configurations were properly set.

If you follow the execution path of the stateful-function-launcher, you will see that it calls PackagedProgramUtils#createJobGraph which in turn sets an OptimizerPlanEnvironment. This is because it uses a Job-based deployment and the OptimizerPlanEnvironment pulls the job graph without executing the job so it can be embedded in the image.

When this execution environment is set, StreamExecutionEnvironment#getExecutionEnvironment returns a StreamPlanEnvironment. This subclass of StreamExecutionEnvironment calls StreamExecutionEnvironment's no-op constructor which sets an empty configuration object.

Because StreamPlanEnvironment implies job-based deployment, we can safely call GlobalConfiguration#loadConfiguration. In all other cases we fall back to reflection.

I have tested this using statefun images and deployed against a session cluster.

cc @igalshilman @tzulitai

…() on StreamPlanEnvironment

Because the statefun-flink-launcher is based on JobClusterEntrypoint it
pulls the StreamGraph using a StreamPlanEnvironment. In this case, the
StreamExecutionEnviornment configuration is set to an empty object.

The only way to pull the actual flink-conf in this case is via
GlobalConfiguration.loadConfiguration(). This is safe because
StreamPlanEnvironment implies job based deployment. In all other cases
the configuration is still pulled via reflection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant