public class NetworkBufferPool extends Object implements BufferPoolFactory
MemorySegment instances
for the network stack.
The NetworkBufferPool creates LocalBufferPools from which the individual tasks draw
the buffers for the network data transfer. When new local buffer pools are created, the
NetworkBufferPool dynamically redistributes the buffers between the pools.| Modifier and Type | Field and Description |
|---|---|
Set<org.apache.flink.runtime.io.network.buffer.LocalBufferPool> |
allBufferPools |
| Constructor and Description |
|---|
NetworkBufferPool(int numberOfSegmentsToAllocate,
int segmentSize,
org.apache.flink.core.memory.MemoryType memoryType)
Allocates all
MemorySegment instances managed by this pool. |
| Modifier and Type | Method and Description |
|---|---|
int |
countBuffers() |
BufferPool |
createBufferPool(int numRequiredBuffers,
boolean isFixedSize)
Tries to create a buffer pool, which is guaranteed to provide at least the number of required
buffers.
|
void |
destroy() |
void |
destroyAllBufferPools()
Destroys all buffer pools that allocate their buffers from this
buffer pool (created via
createBufferPool(int, boolean)). |
void |
destroyBufferPool(BufferPool bufferPool)
Destroy callback for updating factory book keeping.
|
int |
getMemorySegmentSize() |
int |
getNumberOfAvailableMemorySegments() |
int |
getNumberOfRegisteredBufferPools() |
int |
getTotalNumberOfMemorySegments() |
boolean |
isDestroyed() |
void |
recycle(org.apache.flink.core.memory.MemorySegment segment) |
org.apache.flink.core.memory.MemorySegment |
requestMemorySegment() |
public final Set<org.apache.flink.runtime.io.network.buffer.LocalBufferPool> allBufferPools
public NetworkBufferPool(int numberOfSegmentsToAllocate,
int segmentSize,
org.apache.flink.core.memory.MemoryType memoryType)
MemorySegment instances managed by this pool.public org.apache.flink.core.memory.MemorySegment requestMemorySegment()
public void recycle(org.apache.flink.core.memory.MemorySegment segment)
public void destroy()
public boolean isDestroyed()
public int getMemorySegmentSize()
public int getTotalNumberOfMemorySegments()
public int getNumberOfAvailableMemorySegments()
public int getNumberOfRegisteredBufferPools()
public int countBuffers()
public BufferPool createBufferPool(int numRequiredBuffers, boolean isFixedSize) throws IOException
BufferPoolFactoryThe buffer pool is either of dynamic size or fixed.
createBufferPool in interface BufferPoolFactoryIOExceptionpublic void destroyBufferPool(BufferPool bufferPool)
BufferPoolFactorydestroyBufferPool in interface BufferPoolFactorypublic void destroyAllBufferPools()
createBufferPool(int, boolean)).Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.