-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-27111 Make Netty channel bytebuf allocator configurable. #4525
Conversation
Update JIRA ID |
Unit test |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
In general I do not think we need to extends PooledByteBufAllocator, just make a global instance with 'new PooledByteBufAllocator(false)' is enough. And I do not think we should mark HeapByteBufAllocator as IA.LP(CONFIG), we will use 'heap' to reference it so users do not need to use the name in config file directly, we could just mark it IA.Private. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
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.
+1
Updated. Additional option for
Also updates |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
Unit test failures are related. Back with a fix. |
Support site configuration of the bytebuf allocator that Netty will use for NettyRpcServer channels. Property name is 'hbase.netty.rpcserver.allocator'. Default is no value, which is equivalent to "pooled". Valid values are: - "pooled": use PooledByteBufAllocator - "unpooled": use UnpooledByteBufAllocator - "heap": use HeapByteBufAllocator, which is a PooledByteBufAllocator that preferentially allocates buffers on heap wherever possible - <class>: If the value is none of the recognized labels, treat it as a class name implementing org.apache.hbase.thirdparty.io.netty.buffer.ByteBufAllocator. This allows the user to add a custom implementation, perhaps for debugging. Also updates ReflectionUtils with a new helper method, and replaces a case in Compression where the new ReflectionUtils method duplicates previous code.
Rebase, test fix. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
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.
+1
|
||
@Override | ||
protected ByteBuf newHeapBuffer(int initialCapacity, int maxCapacity) { | ||
LOG.info("newHeapBuffer initialCapacity={}, maxCapacity={}", initialCapacity, maxCapacity); |
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.
Nice, this is good for debugging
Support site configuration of the bytebuf allocator that Netty will use for NettyRpcServer channels. Property name is 'hbase.netty.rpcserver.allocator'. Default is no value, which is equivalent to "pooled". Valid values are: - "pooled": use PooledByteBufAllocator - "unpooled": use UnpooledByteBufAllocator - "heap": use HeapByteBufAllocator, which is a PooledByteBufAllocator that preferentially allocates buffers on heap wherever possible - <class>: If the value is none of the recognized labels, treat it as a class name implementing org.apache.hbase.thirdparty.io.netty.buffer.ByteBufAllocator. This allows the user to add a custom implementation, perhaps for debugging. Also updates ReflectionUtils with a new helper method. Signed-off-by: Viraj Jasani <vjasani@apache.org> Conflicts: hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcServer.java hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestNettyRpcServer.java
Support site configuration of the bytebuf allocator that Netty will use for NettyRpcServer channels. Property name is 'hbase.netty.rpcserver.allocator'. Default is no value, which is equivalent to "pooled". Valid values are: - "pooled": use PooledByteBufAllocator - "unpooled": use UnpooledByteBufAllocator - "heap": use HeapByteBufAllocator, which is a PooledByteBufAllocator that preferentially allocates buffers on heap wherever possible - <class>: If the value is none of the recognized labels, treat it as a class name implementing org.apache.hbase.thirdparty.io.netty.buffer.ByteBufAllocator. This allows the user to add a custom implementation, perhaps for debugging. Also updates ReflectionUtils with a new helper method. Signed-off-by: Viraj Jasani <vjasani@apache.org> Conflicts: hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcServer.java hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestNettyRpcServer.java
Support site configuration of the bytebuf allocator that Netty will use for
NettyRpcServer
channels. We do not allow the site operator to fine tune this but could. It would be particularly useful to allow preference of heap buffers where direct memory may be limited or utilized for other purposes.New property name is
hbase.netty.rpcserver.allocator
. Default is no value, which is equivalent to "pooled", which is our current default. Valid values are:pooled
: use PooledByteBufAllocatorunpooled
: use UnpooledByteBufAllocatorheap
: use HeapByteBufAllocator, which is a PooledByteBufAllocator that preferentially allocates buffers on heap wherever possible<class>
: If the value is none of the recognized labels, treat it as a class name implementingorg.apache.hbase.thirdparty.io.netty.buffer.ByteBufAllocator
. This allows the user to add a custom implementation, perhaps for debugging.Also updates
ReflectionUtils
with a new helper method, and replaces a case inCompression
where the newReflectionUtils
method duplicates previous code.