Repository navigation
[FileWrites] Allow maxNumWritersPerBundle to exceed DEFAULT_MAX_NUM_WRITERS_PER_BUNDLE (20) - #40842
Merged
Merged
Conversation
…RITERS_PER_BUNDLE (20)
Contributor
There was a problem hiding this comment.
📋 Review Summary
This PR removes the upper-bound restriction (<= DEFAULT_MAX_NUM_WRITERS_PER_BUNDLE) in WriteFiles.withMaxNumWritersPerBundle(int) so users can configure a higher per-bundle writer limit when appropriate, while retaining the > 0 validation. The changes in WriteFiles.java and the unit tests in WriteFilesTest.java are clean, well-motivated, and safe.
🔍 General Feedback
- The
LinkedHashMapinitialization and writer management inWriteUnshardedTempFilesFnhandle values exceedingDEFAULT_MAX_NUM_WRITERS_PER_BUNDLEproperly. - Javadoc and test updates accurately reflect the new behavior.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
Contributor
|
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Java SDK - WriteFiles] Allow
maxNumWritersPerBundleto exceedDEFAULT_MAX_NUM_WRITERS_PER_BUNDLE(20)Summary & Motivation
Currently,
WriteFiles.withMaxNumWritersPerBundle(int)enforces an upper bound ofDEFAULT_MAX_NUM_WRITERS_PER_BUNDLE(20):While 20 is a conservative default to bound per-bundle buffer memory, pipelines writing to many dynamic destinations (especially when paired with .withEvictWritersWhenFull() introduced in #40200, or on workers with higher memory capacity) need the ability to increase maxNumWritersPerBundle above 20 (e.g., 50) to reduce writer eviction frequency or shuffle spilling.
As already documented in the WriteFiles.withMaxNumWritersPerBundle(int) Javadoc trade-offs, tuning maxNumWritersPerBundle higher trades additional worker memory for fewer writer evictions / less shuffle spilling.
Changes Made
• Removed the maxNumWritersPerBundle <= DEFAULT_MAX_NUM_WRITERS_PER_BUNDLE upper-bound check while retaining maxNumWritersPerBundle > 0.
• Updated the Javadoc to note that DEFAULT_MAX_NUM_WRITERS_PER_BUNDLE (20) is the default value rather than a hard maximum.
• Added assertions in WriteFilesTest.testBuildWrite verifying that withMaxNumWritersPerBundle(50) succeeds and withMaxNumWritersPerBundle(0) throws IllegalArgumentException.