public interface BufferProvider
The data producing side (result partition writers) request buffers in a synchronous fashion, whereas the input side requests asynchronously.
Modifier and Type | Method and Description |
---|---|
boolean |
addListener(EventListener<Buffer> listener)
Adds a buffer availability listener to the buffer provider.
|
int |
getMemorySegmentSize()
Returns the size of the underlying memory segments.
|
boolean |
isDestroyed()
Returns whether the buffer provider has been destroyed.
|
Buffer |
requestBuffer()
Returns a
Buffer instance from the buffer provider, if one is available. |
Buffer |
requestBufferBlocking()
Returns a
Buffer instance from the buffer provider. |
Buffer requestBuffer() throws IOException
Buffer
instance from the buffer provider, if one is available.
Returns null
if no buffer is available or the buffer provider has been destroyed.
IOException
Buffer requestBufferBlocking() throws IOException, InterruptedException
Buffer
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.
IOException
InterruptedException
boolean addListener(EventListener<Buffer> listener)
The operation fails with return value false
, when there is a buffer available or
the buffer provider has been destroyed.
If the buffer provider gets destroyed while the listener is registered the listener will be
notified with a null
value.
boolean isDestroyed()
int getMemorySegmentSize()
Buffer
instance can have.Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.