Package org.apache.drill.exec.memory
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
-
Method Summary
Modifier and TypeMethodDescriptionio.netty.buffer.ByteBuf
buffer()
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
ioBuffer()
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
-
Constructor Details
-
DrillByteBufAllocator
-
-
Method Details
-
buffer
public io.netty.buffer.ByteBuf buffer()- Specified by:
buffer
in interfaceio.netty.buffer.ByteBufAllocator
- Overrides:
buffer
in classio.netty.buffer.AbstractByteBufAllocator
-
buffer
public io.netty.buffer.ByteBuf buffer(int initialCapacity) - Specified by:
buffer
in interfaceio.netty.buffer.ByteBufAllocator
- Overrides:
buffer
in classio.netty.buffer.AbstractByteBufAllocator
-
buffer
public io.netty.buffer.ByteBuf buffer(int initialCapacity, int maxCapacity) - Specified by:
buffer
in interfaceio.netty.buffer.ByteBufAllocator
- Overrides:
buffer
in classio.netty.buffer.AbstractByteBufAllocator
-
ioBuffer
public io.netty.buffer.ByteBuf ioBuffer()- Specified by:
ioBuffer
in interfaceio.netty.buffer.ByteBufAllocator
- Overrides:
ioBuffer
in classio.netty.buffer.AbstractByteBufAllocator
-
ioBuffer
public io.netty.buffer.ByteBuf ioBuffer(int initialCapacity) - Specified by:
ioBuffer
in interfaceio.netty.buffer.ByteBufAllocator
- Overrides:
ioBuffer
in classio.netty.buffer.AbstractByteBufAllocator
-
ioBuffer
public io.netty.buffer.ByteBuf ioBuffer(int initialCapacity, int maxCapacity) - Specified by:
ioBuffer
in interfaceio.netty.buffer.ByteBufAllocator
- Overrides:
ioBuffer
in classio.netty.buffer.AbstractByteBufAllocator
-
directBuffer
public io.netty.buffer.ByteBuf directBuffer()- Specified by:
directBuffer
in interfaceio.netty.buffer.ByteBufAllocator
- Overrides:
directBuffer
in classio.netty.buffer.AbstractByteBufAllocator
-
directBuffer
public io.netty.buffer.ByteBuf directBuffer(int initialCapacity) - Specified by:
directBuffer
in interfaceio.netty.buffer.ByteBufAllocator
- Overrides:
directBuffer
in classio.netty.buffer.AbstractByteBufAllocator
-
directBuffer
public io.netty.buffer.ByteBuf directBuffer(int initialCapacity, int maxCapacity) - Specified by:
directBuffer
in interfaceio.netty.buffer.ByteBufAllocator
- Overrides:
directBuffer
in classio.netty.buffer.AbstractByteBufAllocator
-
compositeBuffer
public io.netty.buffer.CompositeByteBuf compositeBuffer()- Specified by:
compositeBuffer
in interfaceio.netty.buffer.ByteBufAllocator
- Overrides:
compositeBuffer
in classio.netty.buffer.AbstractByteBufAllocator
-
compositeBuffer
public io.netty.buffer.CompositeByteBuf compositeBuffer(int maxNumComponents) - Specified by:
compositeBuffer
in interfaceio.netty.buffer.ByteBufAllocator
- Overrides:
compositeBuffer
in classio.netty.buffer.AbstractByteBufAllocator
-
compositeDirectBuffer
public io.netty.buffer.CompositeByteBuf compositeDirectBuffer()- Specified by:
compositeDirectBuffer
in interfaceio.netty.buffer.ByteBufAllocator
- Overrides:
compositeDirectBuffer
in classio.netty.buffer.AbstractByteBufAllocator
-
compositeDirectBuffer
public io.netty.buffer.CompositeByteBuf compositeDirectBuffer(int maxNumComponents) - Specified by:
compositeDirectBuffer
in interfaceio.netty.buffer.ByteBufAllocator
- Overrides:
compositeDirectBuffer
in classio.netty.buffer.AbstractByteBufAllocator
-
newHeapBuffer
protected io.netty.buffer.ByteBuf newHeapBuffer(int initialCapacity, int maxCapacity) - Specified by:
newHeapBuffer
in classio.netty.buffer.AbstractByteBufAllocator
-
newDirectBuffer
protected io.netty.buffer.ByteBuf newDirectBuffer(int initialCapacity, int maxCapacity) - Specified by:
newDirectBuffer
in classio.netty.buffer.AbstractByteBufAllocator
-
isDirectBufferPooled
public boolean isDirectBufferPooled() -
compositeHeapBuffer
public io.netty.buffer.CompositeByteBuf compositeHeapBuffer()- Specified by:
compositeHeapBuffer
in interfaceio.netty.buffer.ByteBufAllocator
- Overrides:
compositeHeapBuffer
in classio.netty.buffer.AbstractByteBufAllocator
-
compositeHeapBuffer
public io.netty.buffer.CompositeByteBuf compositeHeapBuffer(int maxNumComponents) - Specified by:
compositeHeapBuffer
in interfaceio.netty.buffer.ByteBufAllocator
- Overrides:
compositeHeapBuffer
in classio.netty.buffer.AbstractByteBufAllocator
-