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
SAMZA-2406: Add ConfigLoader interface and default PropertiesConfigLo… #1226
Conversation
…ader implementation Design: https://cwiki.apache.org/confluence/display/SAMZA/SEP-23%3A+Simplify+Job+Runner Changes: 1. Add ConfigLoader interface which will be used in job coordinator to retrieve config from. 2. Add PropertiesConfigLoader which is a default implementation of ConfigLoader that reads a local properties file given the file path. Tests: 1. Add TestPropertiesConfigLoader to unit test PropertiesConfigLoader.
@bharathkk and @abhishekshivanna offered to look at this. @kw2542 Can you update usage/upgrade instructions in the description with changes required for using this new feature? This information will be collected for the release notes and changelog for the next release. Let's also fix the commit title (wrapping). |
/** | ||
* Build a {@link org.apache.samza.config.Config} | ||
*/ | ||
public interface ConfigLoader { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add more descriptive java docs?
- It will be helpful if you can talk about how and when this interface is used.
- What if
ConfigLoader
implementors want to handle dependency injection? Do we need to provide a factory for the config loader implementors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added more descriptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a default constructor with config
is too restrictive and violates separation of concerns, if we were to evolve ConfigLoader
. ConfigLoader
should not have to deal with dependency object construction and use. I'd prefer a factory that manages dependency injection for ConfigLoader
so that its evolution doesn't affect the framework as long as the contract is maintained.
samza-api/src/main/java/org/apache/samza/config/ConfigLoader.java
Outdated
Show resolved
Hide resolved
samza-core/src/main/scala/org/apache/samza/config/loaders/PropertiesConfigLoader.scala
Outdated
Show resolved
Hide resolved
samza-core/src/main/scala/org/apache/samza/config/loaders/PropertiesConfigLoader.scala
Outdated
Show resolved
Hide resolved
samza-core/src/test/scala/org/apache/samza/config/loaders/TestPropertiesConfigLoader.scala
Outdated
Show resolved
Hide resolved
@kw2542 Can you also update the API changes in the description and add more details about this API (internal vs external) etc |
@kw2542 , could you also clarify as part of this patch the reason we need this new implementation over the existing |
|
Updated both the PR description as well as SEP itself. ConfigLoader will replace ConfigFactory interface, which will be deleted in the following PRs. |
Discard to start a new PR clean. |
Add ConfigLoader interface and default PropertiesConfigLoader implementation, which will be used on AM to fetch configs.
The existing ConfigFactory interface will be deprecated and removed as we will not fetch configs on start up script run-app.sh anymore.
Design:
https://cwiki.apache.org/confluence/display/SAMZA/SEP-23%3A+Simplify+Job+Runner
Changes:
API Changes:
N/A. This is part of a series PRs, detailed information will be provided in the last/main PR.
Upgrade Instructions:
N/A. This is part of a series PRs, detailed information will be provided in the last/main PR.
Usage Instructions:
N/A. This is part of a series PRs, detailed information will be provided in the last/main PR.
Tests: