Class NettyUnsafeUtils

java.lang.Object
org.apache.hadoop.hbase.util.NettyUnsafeUtils

@Private public final class NettyUnsafeUtils extends Object
Wraps some usages of netty's unsafe API, for ease of maintainability.
  • Constructor Details

  • Method Details

    • closeImmediately

      public static 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. 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