Class HeapByteBufAllocator

java.lang.Object
org.apache.hbase.thirdparty.io.netty.buffer.AbstractByteBufAllocator
org.apache.hadoop.hbase.ipc.HeapByteBufAllocator
All Implemented Interfaces:
org.apache.hbase.thirdparty.io.netty.buffer.ByteBufAllocator

@Private public class HeapByteBufAllocator extends org.apache.hbase.thirdparty.io.netty.buffer.AbstractByteBufAllocator
A pooled ByteBufAllocator that does not prefer direct buffers regardless of platform settings.

In some cases direct buffers are still required, like IO buffers where the buffer will be used in conjunction with a native method call, so we cannot force all buffer usage on heap. But we can strongly prefer it.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
    private final org.apache.hbase.thirdparty.io.netty.buffer.PooledByteBufAllocator
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    protected org.apache.hbase.thirdparty.io.netty.buffer.ByteBuf
    newDirectBuffer(int initialCapacity, int maxCapacity)
     
    protected org.apache.hbase.thirdparty.io.netty.buffer.ByteBuf
    newHeapBuffer(int initialCapacity, int maxCapacity)
     

    Methods inherited from class org.apache.hbase.thirdparty.io.netty.buffer.AbstractByteBufAllocator

    buffer, buffer, buffer, calculateNewCapacity, compositeBuffer, compositeBuffer, compositeDirectBuffer, compositeDirectBuffer, compositeHeapBuffer, compositeHeapBuffer, directBuffer, directBuffer, directBuffer, heapBuffer, heapBuffer, heapBuffer, ioBuffer, ioBuffer, ioBuffer, toLeakAwareBuffer, toLeakAwareBuffer, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • isDirectBufferPooled

      public boolean isDirectBufferPooled()
    • newHeapBuffer

      protected org.apache.hbase.thirdparty.io.netty.buffer.ByteBuf newHeapBuffer(int initialCapacity, int maxCapacity)
      Specified by:
      newHeapBuffer in class org.apache.hbase.thirdparty.io.netty.buffer.AbstractByteBufAllocator
    • newDirectBuffer

      protected org.apache.hbase.thirdparty.io.netty.buffer.ByteBuf newDirectBuffer(int initialCapacity, int maxCapacity)
      Specified by:
      newDirectBuffer in class org.apache.hbase.thirdparty.io.netty.buffer.AbstractByteBufAllocator