Class DrillByteBufAllocator

java.lang.Object
io.netty.buffer.AbstractByteBufAllocator
org.apache.drill.exec.memory.DrillByteBufAllocator
All Implemented Interfaces:
io.netty.buffer.ByteBufAllocator

public class DrillByteBufAllocator extends io.netty.buffer.AbstractByteBufAllocator
An extend of AbstractByteBufAllocator that wraps a Drill BufferAllocator. This allows the RPC layer to be accounted and managed using Drill's BufferAllocator infrastructure. The only thin different from a typical BufferAllocator is the signature and the fact that this Allocator returns ExpandableByteBufs which enable otherwise non-expandable DrillBufs to be expandable. Beside it, DrillByteBufAllocator uses PooledByteBufAllocatorL.InnerAllocator as allocator only for heapBuffer's for netty's purposes, when it directly calls heapBuffer methods.
  • Field Summary

    Fields inherited from interface io.netty.buffer.ByteBufAllocator

    DEFAULT
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.netty.buffer.ByteBuf
     
    io.netty.buffer.ByteBuf
    buffer(int initialCapacity)
     
    io.netty.buffer.ByteBuf
    buffer(int initialCapacity, int maxCapacity)
     
    io.netty.buffer.CompositeByteBuf
     
    io.netty.buffer.CompositeByteBuf
    compositeBuffer(int maxNumComponents)
     
    io.netty.buffer.CompositeByteBuf
     
    io.netty.buffer.CompositeByteBuf
    compositeDirectBuffer(int maxNumComponents)
     
    io.netty.buffer.CompositeByteBuf
     
    io.netty.buffer.CompositeByteBuf
    compositeHeapBuffer(int maxNumComponents)
     
    io.netty.buffer.ByteBuf
     
    io.netty.buffer.ByteBuf
    directBuffer(int initialCapacity)
     
    io.netty.buffer.ByteBuf
    directBuffer(int initialCapacity, int maxCapacity)
     
    io.netty.buffer.ByteBuf
     
    io.netty.buffer.ByteBuf
    ioBuffer(int initialCapacity)
     
    io.netty.buffer.ByteBuf
    ioBuffer(int initialCapacity, int maxCapacity)
     
    boolean
     
    protected io.netty.buffer.ByteBuf
    newDirectBuffer(int initialCapacity, int maxCapacity)
     
    protected io.netty.buffer.ByteBuf
    newHeapBuffer(int initialCapacity, int maxCapacity)
     

    Methods inherited from class io.netty.buffer.AbstractByteBufAllocator

    calculateNewCapacity, heapBuffer, heapBuffer, heapBuffer, toLeakAwareBuffer, toLeakAwareBuffer, toString

    Methods inherited from class java.lang.Object

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

    • DrillByteBufAllocator

      public DrillByteBufAllocator(BufferAllocator allocator)
  • Method Details

    • buffer

      public io.netty.buffer.ByteBuf buffer()
      Specified by:
      buffer in interface io.netty.buffer.ByteBufAllocator
      Overrides:
      buffer in class io.netty.buffer.AbstractByteBufAllocator
    • buffer

      public io.netty.buffer.ByteBuf buffer(int initialCapacity)
      Specified by:
      buffer in interface io.netty.buffer.ByteBufAllocator
      Overrides:
      buffer in class io.netty.buffer.AbstractByteBufAllocator
    • buffer

      public io.netty.buffer.ByteBuf buffer(int initialCapacity, int maxCapacity)
      Specified by:
      buffer in interface io.netty.buffer.ByteBufAllocator
      Overrides:
      buffer in class io.netty.buffer.AbstractByteBufAllocator
    • ioBuffer

      public io.netty.buffer.ByteBuf ioBuffer()
      Specified by:
      ioBuffer in interface io.netty.buffer.ByteBufAllocator
      Overrides:
      ioBuffer in class io.netty.buffer.AbstractByteBufAllocator
    • ioBuffer

      public io.netty.buffer.ByteBuf ioBuffer(int initialCapacity)
      Specified by:
      ioBuffer in interface io.netty.buffer.ByteBufAllocator
      Overrides:
      ioBuffer in class io.netty.buffer.AbstractByteBufAllocator
    • ioBuffer

      public io.netty.buffer.ByteBuf ioBuffer(int initialCapacity, int maxCapacity)
      Specified by:
      ioBuffer in interface io.netty.buffer.ByteBufAllocator
      Overrides:
      ioBuffer in class io.netty.buffer.AbstractByteBufAllocator
    • directBuffer

      public io.netty.buffer.ByteBuf directBuffer()
      Specified by:
      directBuffer in interface io.netty.buffer.ByteBufAllocator
      Overrides:
      directBuffer in class io.netty.buffer.AbstractByteBufAllocator
    • directBuffer

      public io.netty.buffer.ByteBuf directBuffer(int initialCapacity)
      Specified by:
      directBuffer in interface io.netty.buffer.ByteBufAllocator
      Overrides:
      directBuffer in class io.netty.buffer.AbstractByteBufAllocator
    • directBuffer

      public io.netty.buffer.ByteBuf directBuffer(int initialCapacity, int maxCapacity)
      Specified by:
      directBuffer in interface io.netty.buffer.ByteBufAllocator
      Overrides:
      directBuffer in class io.netty.buffer.AbstractByteBufAllocator
    • compositeBuffer

      public io.netty.buffer.CompositeByteBuf compositeBuffer()
      Specified by:
      compositeBuffer in interface io.netty.buffer.ByteBufAllocator
      Overrides:
      compositeBuffer in class io.netty.buffer.AbstractByteBufAllocator
    • compositeBuffer

      public io.netty.buffer.CompositeByteBuf compositeBuffer(int maxNumComponents)
      Specified by:
      compositeBuffer in interface io.netty.buffer.ByteBufAllocator
      Overrides:
      compositeBuffer in class io.netty.buffer.AbstractByteBufAllocator
    • compositeDirectBuffer

      public io.netty.buffer.CompositeByteBuf compositeDirectBuffer()
      Specified by:
      compositeDirectBuffer in interface io.netty.buffer.ByteBufAllocator
      Overrides:
      compositeDirectBuffer in class io.netty.buffer.AbstractByteBufAllocator
    • compositeDirectBuffer

      public io.netty.buffer.CompositeByteBuf compositeDirectBuffer(int maxNumComponents)
      Specified by:
      compositeDirectBuffer in interface io.netty.buffer.ByteBufAllocator
      Overrides:
      compositeDirectBuffer in class io.netty.buffer.AbstractByteBufAllocator
    • newHeapBuffer

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

      protected io.netty.buffer.ByteBuf newDirectBuffer(int initialCapacity, int maxCapacity)
      Specified by:
      newDirectBuffer in class io.netty.buffer.AbstractByteBufAllocator
    • isDirectBufferPooled

      public boolean isDirectBufferPooled()
    • compositeHeapBuffer

      public io.netty.buffer.CompositeByteBuf compositeHeapBuffer()
      Specified by:
      compositeHeapBuffer in interface io.netty.buffer.ByteBufAllocator
      Overrides:
      compositeHeapBuffer in class io.netty.buffer.AbstractByteBufAllocator
    • compositeHeapBuffer

      public io.netty.buffer.CompositeByteBuf compositeHeapBuffer(int maxNumComponents)
      Specified by:
      compositeHeapBuffer in interface io.netty.buffer.ByteBufAllocator
      Overrides:
      compositeHeapBuffer in class io.netty.buffer.AbstractByteBufAllocator