Package org.apache.hadoop.hbase.util
Class NettyUnsafeUtils
java.lang.Object
org.apache.hadoop.hbase.util.NettyUnsafeUtils
Wraps some usages of netty's unsafe API, for ease of maintainability.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
closeImmediately
(org.apache.hbase.thirdparty.io.netty.channel.Channel channel) Directly closes the channel, setting SO_LINGER to 0 and skipping any handlers in the pipeline.static long
getTotalPendingOutboundBytes
(org.apache.hbase.thirdparty.io.netty.channel.Channel channel) Get total bytes pending write to socket
-
Constructor Details
-
NettyUnsafeUtils
private NettyUnsafeUtils()
-
-
Method Details
-
closeImmediately
Directly closes the channel, setting SO_LINGER to 0 and skipping any handlers in the pipeline. This is useful for cases where it's important to immediately close without any delay. Otherwise, pipeline handlers and even general TCP flows can cause a normal close to take upwards of a few second or more. This will likely cause the client side to see either a "Connection reset by peer" or unexpected ConnectionClosedException.It's necessary to call this from within the channel's eventLoop!
-
getTotalPendingOutboundBytes
public static long getTotalPendingOutboundBytes(org.apache.hbase.thirdparty.io.netty.channel.Channel channel) Get total bytes pending write to socket
-