-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
MINOR; Validate at least one control record #15912
Conversation
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.
@jsancio : Thanks for the PR. Just a minor comment.
* If this function returns true is means that one of the voter set commits an offset, it means | ||
* that the other voter set cannot commit a conflicting offset. | ||
* If this function returns true, it means that if one of the set of voters commits an offset, the | ||
* the other set of voters cannot commit a conflicting offset. |
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.
the the other => the other
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.
@jsancio nice cleanup. one small comment is left. PTAL
@@ -284,6 +284,8 @@ private int validateMemoryRecordAndReturnCount(MemoryRecords memoryRecord) { | |||
); | |||
} else if (numberOfRecords == null) { | |||
throw new IllegalArgumentException("valueCreator didn't create a batch with the count"); | |||
} else if (numberOfRecords < 1) { |
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.
Is it possible to add new UT to BatchAccumulatorTest
for this case?
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.
Added the test.
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.
@jsancio : Thanks for the updated PR. Just a minor comment.
@@ -256,7 +256,7 @@ public void appendControlMessages(MemoryRecordsCreator valueCreator) { | |||
} | |||
|
|||
private int validateMemoryRecordAndReturnCount(MemoryRecords memoryRecord) { | |||
// Confirm that it is at most one batch and it is a control record | |||
// Confirm that it is one control batch and it is at least one control record |
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.
validateMemoryRecordAndReturnCount => validateMemoryRecordsAndReturnCount
memoryRecord => memoryRecords
Also, there is an existing typo creatte on line 268.
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.
Fixed.
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.
@jsancio : Thanks for the updated PR. LGTM
Have all the test failures been triaged?
Merging. The errors are unrelated to this change. |
Validate that a control batch in the batch accumulator has at least one control record. Reviewers: Jun Rao <junrao@apache.org>, Chia-Ping Tsai <chia7712@apache.org>
Validate that a control batch in the batch accumulator has at least one control record. Reviewers: Jun Rao <junrao@apache.org>, Chia-Ping Tsai <chia7712@apache.org>
Validate that a control batch in the batch accumulator has at least one control record.
Committer Checklist (excluded from commit message)