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-9964] Setting --workerCacheMB for Streaming Pipeline #11710

Merged
merged 2 commits into from
May 15, 2020
Merged

[BEAM-9964] Setting --workerCacheMB for Streaming Pipeline #11710

merged 2 commits into from
May 15, 2020

Conversation

omarismail94
Copy link
Contributor

@omarismail94 omarismail94 commented May 14, 2020

R:@pabloem

Setting --workerCacheMB seems to affect batch pipelines only. For Streaming, the cache seems to be hardcoded to 100Mb [1]. If possible, I would like to make it allowable to change the cache value in Streaming when setting -workerCacheMB.

Passed ./gradlew -p runners/google-cloud-dataflow-java check on my computer

[1]

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.
  • 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.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- Build Status --- --- Build Status
Java Build Status Build Status Build Status
Build Status
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
Build Status
Build Status
Build Status
Build Status
--- --- Build Status
XLang --- --- --- 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 Build Status
Portable --- Build Status --- ---

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

…ateCache constructor. Right now, this is hardcoded at 100MB
@@ -130,7 +133,8 @@ private static StateNamespace triggerNamespace(long start, int triggerIdx) {

@Before
public void setUp() {
cache = new WindmillStateCache();
options = PipelineOptionsFactory.as(DataflowWorkerHarnessOptions.class);
cache = new WindmillStateCache(options.getWorkerCacheMb());
assertEquals(0, cache.getWeight());
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a check to this test to make sure that the maximumWeight of the cache is the 100 MB? (perhaps use a number different than 100 to be sure).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed this by adding a new Test method in WindmillStateCacheTest class. I created a new getter in the WindmillStateCache to retrieve the size of max weight on bytes, and compared it to the initial value set

@steveniemitz
Copy link
Contributor

ahh this is great. We've been running a similar patch in our fork forever.

@lukecwik
Copy link
Member

ahh this is great. We've been running a similar patch in our fork forever.

Feel free to submit patches upstream

@steveniemitz
Copy link
Contributor

ahh this is great. We've been running a similar patch in our fork forever.

Feel free to submit patches upstream

heh, I've been choosing my battles ;)

@lukecwik
Copy link
Member

ahh this is great. We've been running a similar patch in our fork forever.

Feel free to submit patches upstream

heh, I've been choosing my battles ;)

These shouldn't need to be battles but more like:

you: dev@ hey we got this patch we use locally it is X
dev@: sounds great, submit a PR or we have a larger plan around this do you want to work on it with us

@steveniemitz
Copy link
Contributor

These shouldn't need to be battles but more like:

you: dev@ hey we got this patch we use locally it is X
dev@: sounds great, submit a PR or we have a larger plan around this do you want to work on it with us

heh, I feel bad clogging up this PR with unrelated conversations. If that process you described was how it worked in real life, that'd be great. Feel free to ping me on the ASF slack (at-steve) if you want to chat more about this.

@omarismail94
Copy link
Contributor Author

retest this please

@omarismail94
Copy link
Contributor Author

New changes passed ./gradlew -p runners/google-cloud-dataflow-java check on my computer

@pabloem
Copy link
Member

pabloem commented May 14, 2020

retest this please

1 similar comment
@pabloem
Copy link
Member

pabloem commented May 14, 2020

retest this please

@pabloem
Copy link
Member

pabloem commented May 14, 2020

Run Java PostCommit

1 similar comment
@pabloem
Copy link
Member

pabloem commented May 14, 2020

Run Java PostCommit

@pabloem
Copy link
Member

pabloem commented May 15, 2020

Seems like java precommits are broken on master - but this change LGTM. I'll wait for precommits to be fixed if possible. Thanks @omarismail94 !

@ibzib
Copy link
Contributor

ibzib commented May 15, 2020

Run Java PreCommit

2 similar comments
@ibzib
Copy link
Contributor

ibzib commented May 15, 2020

Run Java PreCommit

@pabloem
Copy link
Member

pabloem commented May 15, 2020

Run Java PreCommit

@pabloem pabloem merged commit ac190b8 into apache:master May 15, 2020
@pabloem
Copy link
Member

pabloem commented May 15, 2020

thanks @omarismail94 !

@omarismail94 omarismail94 deleted the windowCache branch May 17, 2020 17:38
@steveniemitz
Copy link
Contributor

hm, I was just rebasing my work against this commit and realized something. I had moved the flag to DataflowPipelineDebugOptions. DataflowWorkerHarnessOptions are not included in the options set visible to the "client" side of things.

This means that you can't actually set this flag from a job submission, eg:

$ java -jar myjob.jar  ... --runner=DataflowRunner --workerCacheMb=400
Exception in thread "main" java.lang.IllegalArgumentException: Class interface ...MyOptions missing a property named 'workerCacheMb'.
	at org.apache.beam.sdk.options.PipelineOptionsFactory.parseObjects(PipelineOptionsFactory.java:1625)

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.

None yet

5 participants