MINOR: Refactor high watermark access and validation#7055
Merged
hachikuji merged 2 commits intoapache:trunkfrom Jul 11, 2019
Merged
MINOR: Refactor high watermark access and validation#7055hachikuji merged 2 commits intoapache:trunkfrom
hachikuji merged 2 commits intoapache:trunkfrom
Conversation
mumrah
approved these changes
Jul 10, 2019
| else | ||
| hw | ||
| updateHighWatermarkMetadata(LogOffsetMetadata(newHighWatermark)) | ||
| newHighWatermark |
Member
There was a problem hiding this comment.
Should we return the long value only or the whole LogOffsetMetadata?
Contributor
Author
There was a problem hiding this comment.
We could, but I was trying to avoid exposing LogOffsetMetadata unless we were willing to materialize it.
| * @param hw the suggested new value for the high watermark | ||
| * @return the updated high watermark offset | ||
| */ | ||
| def updateHighWatermark(hw: Long): Long = { |
Member
There was a problem hiding this comment.
Should this be named initializeHighWatermark maybe?
Contributor
Author
There was a problem hiding this comment.
I called it update since it is also used in the fetcher when updating the high watermark after a fetch response.
Contributor
Author
|
retest this please |
bfncs
pushed a commit
to bfncs/kafka
that referenced
this pull request
Jul 12, 2019
The purpose of this patch is to restrict the paths for updating and accessing the high watermark and the last stable offset. By doing so, we can validate that these offsets always remain within the range of the log. We also ensure that we never expose `LogOffsetMetadata` unless it is fully materialized. Finally, this patch makes a few naming changes. In particular, we remove the `highWatermark_=` and `highWatermarkMetadata_=` which are both misleading and cumbersome to test. Reviewers: David Arthur <mumrah@gmail.com>
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.
The purpose of this patch is to restrict the paths for updating and accessing the high watermark and the last stable offset. By doing so, we can validate that these offsets always remain within the range of the log. We also ensure that we never expose
LogOffsetMetadataunless it is fully materialized. Finally, this patch makes a few naming changes. In particular, we remove thehighWatermark_=andhighWatermarkMetadata_=which are both misleading and cumbersome to test.Committer Checklist (excluded from commit message)