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-3904] GlobalConfiguration doesn't ensure config has been loaded #2123

Closed
wants to merge 4 commits into from

Conversation

mxm
Copy link
Contributor

@mxm mxm commented Jun 17, 2016

This PR contains two commits. The first commit simply checks whether loadConfiguration(..) has been called. The second commit adds additional tests and forbids malformed XML files.

@mxm mxm force-pushed the FLINK-3904 branch 2 times, most recently from bceca69 to 4f81995 Compare June 30, 2016 12:30
@uce
Copy link
Contributor

uce commented Jul 4, 2016

This problem sounds like it might cause very hard to debug problems.

@StephanEwen
Copy link
Contributor

Looks like a good fix for now.

I would eventually really like to get rid of the GlobalConfiguration singleton - it causes issues with embedding, testing, and encourages to not cleanly think through designs.

In the end, the GlobalConfiguration would only be an XML / YAML loader that returns a Configuration object.

@mxm
Copy link
Contributor Author

mxm commented Jul 22, 2016

That's odd. I was working on exactly these changes and have just pushed them (without seeing your comment before).

@mxm
Copy link
Contributor Author

mxm commented Jul 22, 2016

Brief summary of changes:

  • fail if config couldn't be loaded
  • make globalconfiguration non-global and remove static SINGLETON
  • remove duplicate api methods
  • remove undocumented XML loading feature
  • generate yaml conf in tests instead of xml conf
  • only load one config file instead of all xml or yaml files (flink-conf.yaml)
  • fix test cases
  • add test cases

protected static void loadGlobalConfigParams() {
int maxSamples = GlobalConfiguration.getInteger(ConfigConstants.DELIMITED_FORMAT_MAX_LINE_SAMPLES_KEY,

protected static void loadConfigParameters(Configuration parameters) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is a public API change. The class is annotated with @Public and the method is protected, which means that some users might have extended this input format and rely on this method. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to the plugin which checks API changes, it is not breaking. I don't know whether this is a shortcoming of the plugin or actually ok. We can still keep the old method.

@uce
Copy link
Contributor

uce commented Jul 25, 2016

Very good work Max! The changes look good to me and I think it's much cleaner this way. The DelimitedInputFormat API change question needs to be addressed before merging I think.

Regarding the other "API breaking" changes I'm undecided right now. I fully agree that they are not documented and hence should be fine to remove. On the other hand, the code is not expensive to maintain and if someone is relying on loading of multiple YAML files for example, that will be hard to debug for the user. I feel like it might make sense to get more community feedback before merging this for 1.1 release. What do you think?

@mxm
Copy link
Contributor Author

mxm commented Jul 25, 2016

Thanks for the review! Although the changes in DelimitedInputFormat don't break the API according to the API Maven plugin, we can simply deprecate the existing method and call the new method from it. That should be safe.

Regarding the other changes in behavior (removing XML loading, only loading from one flink-conf.yaml file instead of all Yaml/Xml files found): All these changes are in line with our documentation which doesn't mention the removed features. However, I agree that some users may rely on this. All in all, it might be safer to merge this immediately to the master after we have forked off the release branch.

mxm added 2 commits July 27, 2016 13:35
- fail if config couldn't be loaded
- remove duplicate api methods
- remove undocumented XML loading feature
- generate yaml conf in tests instead of xml conf
- only load one config file instead of all xml or yaml files (flink-conf.yaml)
- make globalconfiguration non-global and remove static SINGLETON
- fix test cases
- add test cases
@mxm
Copy link
Contributor Author

mxm commented Jul 27, 2016

Rebased to latest master. Merging this once Travis passes.

@asfgit asfgit closed this in 5eb0e38 Jul 27, 2016
delding pushed a commit to delding/flink that referenced this pull request Aug 2, 2016
- fail if config couldn't be loaded
- remove duplicate api methods
- remove undocumented XML loading feature
- generate yaml conf in tests instead of xml conf
- only load one config file instead of all xml or yaml files (flink-conf.yaml)
- make globalconfiguration non-global and remove static SINGLETON
- fix test cases
- add test cases

This closes apache#2123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants