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

LISAMZA-36419: support offspring #110

Merged
merged 12 commits into from
Jan 29, 2024

Conversation

MabelYC
Copy link

@MabelYC MabelYC commented Jan 23, 2024

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 known
pipelineOptions 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:

  • Mention the appropriate issue in your description (for example: 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, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

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)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI.

@MabelYC
Copy link
Author

MabelYC commented Jan 23, 2024

/rerun-check


@SuppressWarnings("rawtypes")
/**
* Interface to support offspring wire-in for Li

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.

Copy link
Author

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.

public interface CustomPipelineOptionsInitializer<T> {
void init(T pipelineOptions, Class<T> clazz);

interface Registrar {

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?

Copy link
Author

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

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?

Copy link
Author

Choose a reason for hiding this comment

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

Updated

public interface CustomPipelineOptionsInitializer<T> {
void init(T pipelineOptions, Class<T> clazz);

interface Registrar {

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?

@yananhao12 yananhao12 merged commit 33b0bc7 into linkedin:li_trunk Jan 29, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants