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.AvailabilityHelper
AVAILABLE
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. |
MemorySegment |
requestMemorySegment()
Returns a
MemorySegment instance from the buffer provider. |
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.
InterruptedException
BufferBuilder 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.InterruptedException
boolean 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 MemorySegment requestMemorySegment()
MemorySegment
instance from the buffer provider.null
if no memory segment is available or the buffer provider has been
destroyed.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.
InterruptedException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.