public abstract class ResultSubpartition extends Object
ResultPartition
instance.Modifier and Type | Class and Description |
---|---|
static class |
ResultSubpartition.BufferAndBacklog
A combination of a
Buffer and the backlog length indicating how many non-event
buffers are available in the subpartition. |
Modifier and Type | Field and Description |
---|---|
protected ResultPartition |
parent
The parent partition this subpartition belongs to.
|
protected ResultSubpartitionInfo |
subpartitionInfo
The info of the subpartition to identify it globally within a task.
|
Constructor and Description |
---|
ResultSubpartition(int index,
ResultPartition parent) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(BufferConsumer bufferConsumer)
Adds the given buffer.
|
abstract boolean |
add(BufferConsumer bufferConsumer,
boolean isPriorityEvent)
Adds the given buffer.
|
protected boolean |
canBeCompressed(Buffer buffer)
Whether the buffer can be compressed or not.
|
abstract ResultSubpartitionView |
createReadView(BufferAvailabilityListener availabilityListener) |
abstract void |
finish() |
abstract void |
flush() |
int |
getSubPartitionIndex() |
ResultSubpartitionInfo |
getSubpartitionInfo() |
protected abstract long |
getTotalNumberOfBuffers()
Gets the total numbers of buffers (data buffers plus events).
|
protected abstract long |
getTotalNumberOfBytes() |
abstract boolean |
isReleased() |
protected void |
onConsumedSubpartition()
Notifies the parent partition about a consumed
ResultSubpartitionView . |
void |
readRecoveredState(ChannelStateReader stateReader) |
abstract void |
release() |
abstract List<Buffer> |
requestInflightBufferSnapshot() |
abstract int |
unsynchronizedGetNumberOfQueuedBuffers()
Makes a best effort to get the current size of the queue.
|
protected final ResultSubpartitionInfo subpartitionInfo
protected final ResultPartition parent
public ResultSubpartition(int index, ResultPartition parent)
protected boolean canBeCompressed(Buffer buffer)
public ResultSubpartitionInfo getSubpartitionInfo()
protected abstract long getTotalNumberOfBuffers()
protected abstract long getTotalNumberOfBytes()
public int getSubPartitionIndex()
protected void onConsumedSubpartition()
ResultSubpartitionView
.public void readRecoveredState(ChannelStateReader stateReader) throws IOException, InterruptedException
IOException
InterruptedException
public abstract boolean add(BufferConsumer bufferConsumer, boolean isPriorityEvent) throws IOException
The request may be executed synchronously, or asynchronously, depending on the implementation.
IMPORTANT: Before adding new BufferConsumer
previously added must
be in finished state. Because of the performance reasons, this is only enforced during the
data reading.
bufferConsumer
- the buffer to add (transferring ownership to this writer)isPriorityEvent
- IOException
- thrown in case of errors while adding the bufferpublic boolean add(BufferConsumer bufferConsumer) throws IOException
The request may be executed synchronously, or asynchronously, depending on the implementation.
IMPORTANT: Before adding new BufferConsumer
previously added must
be in finished state. Because of the performance reasons, this is only enforced during the
data reading.
bufferConsumer
- the buffer to add (transferring ownership to this writer)IOException
- thrown in case of errors while adding the bufferpublic abstract void flush()
public abstract void finish() throws IOException
IOException
public abstract void release() throws IOException
IOException
public abstract ResultSubpartitionView createReadView(BufferAvailabilityListener availabilityListener) throws IOException
IOException
public abstract boolean isReleased()
public abstract int unsynchronizedGetNumberOfQueuedBuffers()
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.