Class NettyBufferPool
- java.lang.Object
-
- org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufAllocator
-
- org.apache.flink.shaded.netty4.io.netty.buffer.PooledByteBufAllocator
-
- org.apache.flink.runtime.io.network.netty.NettyBufferPool
-
- All Implemented Interfaces:
org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufAllocator,org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufAllocatorMetricProvider
public class NettyBufferPool extends org.apache.flink.shaded.netty4.io.netty.buffer.PooledByteBufAllocatorExtends around Netty'sPooledByteBufAllocatorwith strict control over the number of created arenas.
-
-
Constructor Summary
Constructors Constructor Description NettyBufferPool(int numberOfArenas)Creates Netty's buffer pool with the specified number of direct arenas.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.flink.shaded.netty4.io.netty.buffer.CompositeByteBufcompositeHeapBuffer()org.apache.flink.shaded.netty4.io.netty.buffer.CompositeByteBufcompositeHeapBuffer(int maxNumComponents)Optional<Long>getNumberOfAllocatedBytes()Returns the number of currently allocated bytes.org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufheapBuffer()org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufheapBuffer(int initialCapacity)org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufheapBuffer(int initialCapacity, int maxCapacity)-
Methods inherited from class org.apache.flink.shaded.netty4.io.netty.buffer.PooledByteBufAllocator
chunkSize, defaultMaxOrder, defaultNormalCacheSize, defaultNumDirectArena, defaultNumHeapArena, defaultPageSize, defaultPreferDirect, defaultSmallCacheSize, defaultTinyCacheSize, defaultUseCacheForAllThreads, directArenas, dumpStats, freeThreadLocalCache, hasThreadLocalCache, heapArenas, isDirectBufferPooled, isDirectMemoryCacheAlignmentSupported, metric, newDirectBuffer, newHeapBuffer, normalCacheSize, numDirectArenas, numHeapArenas, numThreadLocalCaches, pinnedDirectMemory, pinnedHeapMemory, smallCacheSize, tinyCacheSize, trimCurrentThreadCache
-
Methods inherited from class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufAllocator
buffer, buffer, buffer, calculateNewCapacity, compositeBuffer, compositeBuffer, compositeDirectBuffer, compositeDirectBuffer, directBuffer, directBuffer, directBuffer, ioBuffer, ioBuffer, ioBuffer, toLeakAwareBuffer, toLeakAwareBuffer, toString
-
-
-
-
Method Detail
-
getNumberOfAllocatedBytes
public Optional<Long> getNumberOfAllocatedBytes() throws NoSuchFieldException, IllegalAccessException
Returns the number of currently allocated bytes.The stats are gathered via Reflection and are mostly relevant for debugging purposes.
- Returns:
- Number of currently allocated bytes.
- Throws:
NoSuchFieldException- Error getting the statistics (should not happen when the Netty version stays the same).IllegalAccessException- Error getting the statistics (should not happen when the Netty version stays the same).
-
heapBuffer
public org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf heapBuffer()
- Specified by:
heapBufferin interfaceorg.apache.flink.shaded.netty4.io.netty.buffer.ByteBufAllocator- Overrides:
heapBufferin classorg.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufAllocator
-
heapBuffer
public org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf heapBuffer(int initialCapacity)
- Specified by:
heapBufferin interfaceorg.apache.flink.shaded.netty4.io.netty.buffer.ByteBufAllocator- Overrides:
heapBufferin classorg.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufAllocator
-
heapBuffer
public org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf heapBuffer(int initialCapacity, int maxCapacity)- Specified by:
heapBufferin interfaceorg.apache.flink.shaded.netty4.io.netty.buffer.ByteBufAllocator- Overrides:
heapBufferin classorg.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufAllocator
-
compositeHeapBuffer
public org.apache.flink.shaded.netty4.io.netty.buffer.CompositeByteBuf compositeHeapBuffer()
- Specified by:
compositeHeapBufferin interfaceorg.apache.flink.shaded.netty4.io.netty.buffer.ByteBufAllocator- Overrides:
compositeHeapBufferin classorg.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufAllocator
-
compositeHeapBuffer
public org.apache.flink.shaded.netty4.io.netty.buffer.CompositeByteBuf compositeHeapBuffer(int maxNumComponents)
- Specified by:
compositeHeapBufferin interfaceorg.apache.flink.shaded.netty4.io.netty.buffer.ByteBufAllocator- Overrides:
compositeHeapBufferin classorg.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufAllocator
-
-