public interface BufferProvider extends AvailabilityProvider
The data producing side (result partition writers) request buffers in a synchronous fashion, whereas the input side requests asynchronously.
AvailabilityProvider.AvailabilityHelperAVAILABLE| Modifier and Type | Method and Description |
|---|---|
boolean |
addBufferListener(BufferListener listener)
Adds a buffer availability listener to the buffer provider.
|
boolean |
isDestroyed()
Returns whether the buffer provider has been destroyed.
|
Buffer |
requestBuffer()
Returns a
Buffer instance from the buffer provider, if one is available. |
BufferBuilder |
requestBufferBuilder()
Returns a
BufferBuilder instance from the buffer provider. |
BufferBuilder |
requestBufferBuilder(int targetChannel)
Returns a
BufferBuilder instance from the buffer provider. |
BufferBuilder |
requestBufferBuilderBlocking()
Returns a
BufferBuilder instance from the buffer provider. |
BufferBuilder |
requestBufferBuilderBlocking(int targetChannel)
Returns a
BufferBuilder instance from the buffer provider. |
org.apache.flink.core.memory.MemorySegment |
requestMemorySegment()
Returns a
MemorySegment instance from the buffer provider. |
org.apache.flink.core.memory.MemorySegment |
requestMemorySegmentBlocking()
Returns a
MemorySegment instance from the buffer provider. |
and, getAvailableFuture, isApproximatelyAvailable, isAvailable, or@Nullable Buffer requestBuffer()
Buffer instance from the buffer provider, if one is available.null if no buffer is available or the buffer provider has been destroyed.@Nullable BufferBuilder requestBufferBuilder()
BufferBuilder instance from the buffer provider. This equals to requestBufferBuilder(int) with unknown target channel.null if no buffer is available or the buffer provider has been destroyed.@Nullable BufferBuilder requestBufferBuilder(int targetChannel)
BufferBuilder instance from the buffer provider.targetChannel - to which the request will be accounted to.null if no buffer is available or the buffer provider has been destroyed.BufferBuilder requestBufferBuilderBlocking() throws InterruptedException
BufferBuilder instance from the buffer provider. This equals to requestBufferBuilderBlocking(int) with unknown target channel.
If there is no buffer available, the call will block until one becomes available again or the buffer provider has been destroyed.
InterruptedExceptionBufferBuilder requestBufferBuilderBlocking(int targetChannel) throws InterruptedException
BufferBuilder instance from the buffer provider.
If there is no buffer available, the call will block until one becomes available again or the buffer provider has been destroyed.
targetChannel - to which the request will be accounted to.InterruptedExceptionboolean addBufferListener(BufferListener listener)
The operation fails with return value false, when there is a buffer available
or the buffer provider has been destroyed.
boolean isDestroyed()
@Nullable org.apache.flink.core.memory.MemorySegment requestMemorySegment()
MemorySegment instance from the buffer provider.null if no memory segment is available or the buffer provider has been
destroyed.org.apache.flink.core.memory.MemorySegment requestMemorySegmentBlocking()
throws InterruptedException
MemorySegment instance from the buffer provider.
If there is no memory segment available, the call will block until one becomes available again or the buffer provider has been destroyed.
InterruptedExceptionCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.