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 |
---|---|
static int |
ADD_BUFFER_ERROR_CODE |
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 |
---|---|
abstract void |
abortCheckpoint(long checkpointId,
CheckpointException cause) |
int |
add(BufferConsumer bufferConsumer) |
abstract int |
add(BufferConsumer bufferConsumer,
int partialRecordLength)
Adds the given buffer.
|
abstract void |
alignedBarrierTimeout(long checkpointId) |
abstract void |
bufferSize(int desirableNewBufferSize) |
abstract ResultSubpartitionView |
createReadView(BufferAvailabilityListener availabilityListener) |
abstract int |
finish()
Writing of data is finished.
|
abstract void |
flush() |
abstract int |
getNumberOfQueuedBuffers()
Get the current size of the queue.
|
int |
getSubPartitionIndex() |
ResultSubpartitionInfo |
getSubpartitionInfo() |
protected abstract long |
getTotalNumberOfBuffersUnsafe()
Gets the total numbers of buffers (data buffers plus events).
|
protected abstract long |
getTotalNumberOfBytesUnsafe() |
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.
|
public static final int ADD_BUFFER_ERROR_CODE
protected final ResultSubpartitionInfo subpartitionInfo
protected final ResultPartition parent
public ResultSubpartition(int index, ResultPartition parent)
public ResultSubpartitionInfo getSubpartitionInfo()
protected abstract long getTotalNumberOfBuffersUnsafe()
protected abstract long getTotalNumberOfBytesUnsafe()
public int getSubPartitionIndex()
protected void onConsumedSubpartition()
ResultSubpartitionView
.public abstract void alignedBarrierTimeout(long checkpointId) throws IOException
IOException
public abstract void abortCheckpoint(long checkpointId, CheckpointException cause)
@VisibleForTesting public final int add(BufferConsumer bufferConsumer) throws IOException
IOException
public abstract int add(BufferConsumer bufferConsumer, int partialRecordLength) 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. Priority events can be added while the previous buffer consumer is still open,
in which case the open buffer consumer is overtaken.
bufferConsumer
- the buffer to add (transferring ownership to this writer)partialRecordLength
- the length of bytes to skip in order to start with a complete
record, from position index 0 of the underlying .ADD_BUFFER_ERROR_CODE
if
the add operation fails.IOException
- thrown in case of errors while adding the bufferpublic abstract void flush()
public abstract int 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()
public abstract int getNumberOfQueuedBuffers()
public abstract void bufferSize(int desirableNewBufferSize)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.