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 int |
index
The index of the subpartition at the parent partition.
|
protected ResultPartition |
parent
The parent partition this subpartition belongs to.
|
Constructor and Description |
---|
ResultSubpartition(int index,
ResultPartition parent) |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
add(BufferConsumer bufferConsumer)
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() |
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 . |
abstract void |
release() |
abstract int |
unsynchronizedGetNumberOfQueuedBuffers()
Makes a best effort to get the current size of the queue.
|
protected final int index
protected final ResultPartition parent
public ResultSubpartition(int index, ResultPartition parent)
protected boolean canBeCompressed(Buffer buffer)
protected abstract long getTotalNumberOfBuffers()
protected abstract long getTotalNumberOfBytes()
protected void onConsumedSubpartition()
ResultSubpartitionView
.public abstract 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–2020 The Apache Software Foundation. All rights reserved.