You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by "hangc0276 (via GitHub)" <gi...@apache.org> on 2023/06/13 03:39:27 UTC
[GitHub] [bookkeeper] hangc0276 opened a new pull request, #3985: Unify ByteBufAllocator for the DirectIO component
hangc0276 opened a new pull request, #3985:
URL: https://github.com/apache/bookkeeper/pull/3985
### Motivation
Some classes in the DirectIO component use `PooledByteBufAllocator` to create ByteBuf instead of using the BookKeeper-initiated allocator. When we configured the BookKeeper allocator OOM policy to shut down, the OOM policy can't apply to those classes which use `PooledByteBufAllocator` to create ByteBuf.
### Modifications
- Unify ByteBufAllocator for the DirectIO component.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@bookkeeper.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [bookkeeper] zymap merged pull request #3985: Unify ByteBufAllocator for the DirectIO component
Posted by "zymap (via GitHub)" <gi...@apache.org>.
zymap merged PR #3985:
URL: https://github.com/apache/bookkeeper/pull/3985
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@bookkeeper.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [bookkeeper] zymap commented on a diff in pull request #3985: Unify ByteBufAllocator for the DirectIO component
Posted by "zymap (via GitHub)" <gi...@apache.org>.
zymap commented on code in PR #3985:
URL: https://github.com/apache/bookkeeper/pull/3985#discussion_r1231727977
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/directentrylogger/Buffer.java:
##########
@@ -60,21 +60,23 @@ class Buffer {
final int bufferSize;
ByteBuf buffer;
ByteBuffer byteBuffer;
+ ByteBufAllocator allocator;
long pointer = 0;
- Buffer(NativeIO nativeIO, int bufferSize) throws IOException {
+ Buffer(NativeIO nativeIO, ByteBufAllocator allocator, int bufferSize) throws IOException {
checkArgument(isAligned(bufferSize),
"Buffer size not aligned %d", bufferSize);
this.buffer = allocateAligned(ALIGNMENT, bufferSize);
this.nativeIO = nativeIO;
this.bufferSize = bufferSize;
+ this.allocator = allocator;
Review Comment:
Need to declare at line 69. The `allocateAligned` uses the allocator.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@bookkeeper.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org