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

[BEAM-3344] Changes for serialize/deserialize PipelineOptions via jackson in DirectRunner #8302

Merged
merged 22 commits into from Apr 30, 2019

Conversation

sudhan499
Copy link
Contributor

@sudhan499 sudhan499 commented Apr 13, 2019


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- --- --- --- ---
Java Build Status Build Status Build Status Build Status
Build Status
Build Status
Build Status Build Status Build Status
Python Build Status
Build Status
--- Build Status
Build Status
Build Status --- --- ---

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website
Non-portable Build Status Build Status Build Status Build Status
Portable --- Build Status --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

@sudhan499
Copy link
Contributor Author

R: @lukecwik

@sudhan499
Copy link
Contributor Author

retest this please

@lukecwik
Copy link
Member

Run Portable_Python PreCommit

@lukecwik
Copy link
Member

Run Java PreCommit


/** Construct a {@link DirectRunner} from the provided options. */
public static DirectRunner fromOptions(PipelineOptions options) {
options = MAPPER.convertValue(MAPPER.valueToTree(options), DirectOptions.class);
Copy link
Member

Choose a reason for hiding this comment

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

convertValue / valueToTree may go through specialized paths which partially convert value types and allow for things like static references to stick around. Instead try using ObjectMapper#readValue and ObjectMapper#writeValues

Can you also add a unit test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lukecwik Thanks for the suggestions.
Added changes as suggested and also added unit test for the same. Please review my changes.

@lukecwik lukecwik changed the title [BEAM-3344] Changes for serialize/deserialize PipelineOptions via jac… [BEAM-3344] Changes for serialize/deserialize PipelineOptions via jackson in DirectRunner Apr 18, 2019
@sudhan499
Copy link
Contributor Author

retest this please

@sudhan499
Copy link
Contributor Author

@lukecwik Could you please review my pull request.

@aaltay
Copy link
Member

aaltay commented Apr 25, 2019

Run Java PreCommit

@aaltay
Copy link
Member

aaltay commented Apr 25, 2019

Run Portable_Python PreCommit

@lukecwik
Copy link
Member

All minor suggestions, please take a look and accept changes that you agree with.

@lukecwik
Copy link
Member

Run Java PreCommit

@lukecwik
Copy link
Member

Run Portable_Python PreCommit

lukecwik and others added 11 commits April 27, 2019 10:58
…ct/DirectRunner.java

Co-Authored-By: sudhan499 <sudhan499@gmail.com>
…ct/DirectRunner.java

Co-Authored-By: sudhan499 <sudhan499@gmail.com>
…ct/DirectRunner.java

Co-Authored-By: sudhan499 <sudhan499@gmail.com>
…ct/DirectRunner.java

Co-Authored-By: sudhan499 <sudhan499@gmail.com>
…ct/DirectRunnerTest.java

Co-Authored-By: sudhan499 <sudhan499@gmail.com>
…ct/DirectRunnerTest.java

Co-Authored-By: sudhan499 <sudhan499@gmail.com>
…ct/DirectRunnerTest.java

Co-Authored-By: sudhan499 <sudhan499@gmail.com>
…ct/DirectRunnerTest.java

Co-Authored-By: sudhan499 <sudhan499@gmail.com>
…ct/DirectRunnerTest.java

Co-Authored-By: sudhan499 <sudhan499@gmail.com>
…ct/DirectRunnerTest.java

Co-Authored-By: sudhan499 <sudhan499@gmail.com>
…ct/DirectRunnerTest.java

Co-Authored-By: sudhan499 <sudhan499@gmail.com>
lukecwik and others added 3 commits April 27, 2019 11:01
…ct/DirectRunnerTest.java

Co-Authored-By: sudhan499 <sudhan499@gmail.com>
…ct/DirectRunnerTest.java

Co-Authored-By: sudhan499 <sudhan499@gmail.com>
…ct/DirectRunnerTest.java

Co-Authored-By: sudhan499 <sudhan499@gmail.com>
@sudhan499
Copy link
Contributor Author

retest this please

@sudhan499
Copy link
Contributor Author

@lukecwik Thanks for the suggestions and time. I agree with all the changes you suggested and accepted them.

@lukecwik
Copy link
Member

Run Java PreCommit

…s invoked to allow

for the correct binding of RuntimeValueProvider to occur.
Copy link
Member

@lukecwik lukecwik left a comment

Choose a reason for hiding this comment

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

I was looking into the test failure for the PR related to DatastoreV1Test and found that doing the serialization/deserialization at construction time instead of at run() causes the ValueProviders to become accessible which breaks all the tests that rely on checking ValueProviders not being set. I opened this PR against your repo with a fix. If you think this still addresses BEAM-3344, please merge my PR into your repo so that this PR gets updated and then we can make sure the tests are passing.

Migrate PipelineOptions serialization/deserialization till when run is invoked to allow for the correct binding of RuntimeValueProvider to occur.
@sudhan499
Copy link
Contributor Author

@lukecwik Yes, your changes will still address BEAM-3344 issue and also it fixed the failing tests of DataStoreV1Test . Thanks for helping me in this.

@lukecwik
Copy link
Member

Thanks, everything looks good and the tests passed.

@lukecwik lukecwik merged commit 3839281 into apache:master Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants