BP-47 (task4): Aligned native buffer wrapper#3253
Merged
eolivelli merged 7 commits intoapache:masterfrom May 4, 2022
Merged
Conversation
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)
Contributor
Author
|
rerun failure checks |
merlimat
approved these changes
Apr 30, 2022
Contributor
Author
|
rerun failure checks |
Contributor
Author
|
rerun failure checks |
4 similar comments
Contributor
Author
|
rerun failure checks |
Contributor
Author
|
rerun failure checks |
Contributor
Author
|
rerun failure checks |
Contributor
Author
|
rerun failure checks |
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.
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