-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[BEAM-222] Don't advance beyond last valid value #248
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
Conversation
|
R: @dhalperi |
|
R: @lukecwik |
| if (current >= numMessagesPerShard) { | ||
| if (current >= numMessagesPerShard - 1) { | ||
| return false; | ||
| } |
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.
should this be reordered below the if below it? Probably little harm.
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.
I prefer this order - if done early exit, if want to repeat repeat, otherwise advance to valid position.
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.
yes. just confirming it's okay that you can't repeat the last element.
|
LGTM |
This is a (partial) backport of: apache/beam#132 apache/beam#235 apache/beam#248
Seq builder2
* docs: adds UPGRADING.md, not to readme, to help inform users about migration to v2 * docs: erroneous version number * Update UPGRADING.md Co-authored-by: BenWhitehead <BenWhitehead@users.noreply.github.com> * docs: clarify enums statement * docs: add migration section to docs index Co-authored-by: BenWhitehead <BenWhitehead@users.noreply.github.com>
Turns out there was a bug with allowing 'advanced beyond last element' to be a valid counter state.
Only an internal reload test caught it.
Included unit test for that case.