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
BP-47 (task4): Aligned native buffer wrapper #3253
Merged
eolivelli
merged 7 commits into
apache:master
from
hangc0276:chenhang/aligned-native-buffer-wrapper
May 4, 2022
Merged
BP-47 (task4): Aligned native buffer wrapper #3253
eolivelli
merged 7 commits into
apache:master
from
hangc0276:chenhang/aligned-native-buffer-wrapper
May 4, 2022
Conversation
This file contains 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
Utility to make it easier to add context to exception messages. Avoids having to do custom formatting. You just add keyvalues to a builder. Use like: ``` exMsg("something failed").kv("filename", fn).kv("errno", errno).toString() ``` (cherry picked from commit 1dd031d)
A utility buffer class to be used with JNA calls. Buffers are page aligned (4k pages). The wrapper mostly handles writes between ByteBuffers and ByteBufs. It also provides a method for padding the buffer to the next alignment, so writes can have an aligned size also (as required by direct I/O). The padding is done with 0xF0, so that if it is read as an integer, or long, the value will be negative (assuming the read is a java read, and thus an signed int). (cherry picked from commit 9c0e026)
rerun failure checks |
merlimat
approved these changes
Apr 30, 2022
rerun failure checks |
rerun failure checks |
4 similar comments
rerun failure checks |
rerun failure checks |
rerun failure checks |
rerun failure checks |
eolivelli
approved these changes
May 4, 2022
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.
LGTM
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.
Motivation
Task 4 of BP-47, aligned native buffer wrapper to support direct IO.
Changes
A utility buffer class to be used with JNA calls. Buffers are page aligned (4k pages).
The wrapper mostly handles writes between ByteBuffers and ByteBufs. It also provides a method for padding the buffer to the next alignment, so writes can have an aligned size also (as required by direct I/O). The padding is done with 0xF0, so that if it is read as an integer, or long, the value will be negative (assuming the read isa java read, and thus a signed int).
Master Issue: #2943 , Subtask of #2932
Others
The commit is made by @ivankelly . This is the sub task of #2932 , which pushed out by @mauricebarnum. However, this PR contains too many changes and the number of code lines reaches 8K+, and it is hard to review. According to your suggestion #2932 (comment), and after communicate with @mauricebarnum, we are planing to divide the PR into 6 PRs, Please refer to #2943 (comment).
However, @mauricebarnum doesn't have enough time to deal with those issues, and we desperately need this feature. After communicated with @mauricebarnum and @merlimat , I help to work on divide the PRs and push them out. We are hoping to contain this feature in BookKeeper 4.16.0