-
Notifications
You must be signed in to change notification settings - Fork 5
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
LISAMZA-36419: support offspring #110
Conversation
/rerun-check |
|
||
@SuppressWarnings("rawtypes") | ||
/** | ||
* Interface to support offspring wire-in for Li |
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 you elaborate more on how this interface is supposed to be used, as the term InvokePipelineOptionsFactory
seems ambiguous to me.
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.
Add some comments.
So this interface is to designed to check if the input class meets the requirements to initialize some other object underneath to support further execution.
sdks/java/core/src/main/java/org/apache/beam/sdk/options/ProxyInvocationHandler.java
Show resolved
Hide resolved
sdks/java/core/src/main/java/org/apache/beam/sdk/options/CustomPipelineOptionsInitializer.java
Outdated
Show resolved
Hide resolved
public interface CustomPipelineOptionsInitializer<T> { | ||
void init(T pipelineOptions, Class<T> clazz); | ||
|
||
interface Registrar { |
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.
how will the Registrar be used?
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.
In the implementation, we will have a class annotated as AutoService(CustomePipelineOptionsInitializer.Registrar.class). It returns an instance of the implementation, so beam will know which implementation to use during runtime
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.
Got it. Can you add an example of usage in the javadoc?
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.
Updated
sdks/java/core/src/main/java/org/apache/beam/sdk/options/CustomPipelineOptionsInitializer.java
Outdated
Show resolved
Hide resolved
sdks/java/core/src/main/java/org/apache/beam/sdk/options/CustomPipelineOptionsInitializer.java
Outdated
Show resolved
Hide resolved
public interface CustomPipelineOptionsInitializer<T> { | ||
void init(T pipelineOptions, Class<T> clazz); | ||
|
||
interface Registrar { |
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.
Got it. Can you add an example of usage in the javadoc?
Please add a meaningful description for your change here
LISAMZA-36419: support offspring
initialize offspring generator of
UserPipelineOptionsFactory.class
when we call pipelineOptions.as(UserPipelineOptionsFactory.class). The Factory is singleton and also beam provides a cache of knownpipelineOptions so we don't need to care about the factory will be initialized several times.
Tested locally with snapshot versions.
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123
), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>
instead.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI.