public abstract class RecoveredInputChannel extends InputChannel implements ChannelStateHolder
InputChannel.BufferAndAvailability| Modifier and Type | Field and Description |
|---|---|
protected BufferManager |
bufferManager |
protected ChannelStateWriter |
channelStateWriter |
protected int |
networkBuffersPerChannel |
channelInfo, consumedSubpartitionIndexSet, currentBackoff, initialBackoff, inputGate, maxBackoff, numBuffersIn, numBytesIn, partitionId| Modifier and Type | Method and Description |
|---|---|
void |
acknowledgeAllRecordsProcessed()
When received
EndOfData from one channel, it need to acknowledge after this event get
processed. |
void |
checkpointStarted(CheckpointBarrier barrier)
Called by task thread when checkpointing is started (e.g., any input channel received
barrier).
|
void |
checkpointStopped(long checkpointId)
Called by task thread on cancel/complete to clean-up temporary data.
|
void |
finishReadRecoveredState() |
Optional<InputChannel.BufferAndAvailability> |
getNextBuffer()
Returns the next buffer from the consumed subpartitions or
Optional.empty() if there
is no data to return. |
protected int |
getNumberOfQueuedBuffers() |
void |
onRecoveredStateBuffer(Buffer buffer) |
protected int |
peekNextBufferSubpartitionIdInternal()
Returns the index of the subpartition where the next buffer locates, or -1 if there is no
buffer available and the subpartition to be consumed is not determined.
|
Buffer |
requestBufferBlocking() |
void |
resumeConsumption()
After sending a
CheckpointBarrier of
exactly-once mode, the upstream will be blocked and become unavailable. |
void |
setChannelStateWriter(ChannelStateWriter channelStateWriter)
Injects the
ChannelStateWriter. |
InputChannel |
toInputChannel() |
protected abstract InputChannel |
toInputChannelInternal() |
checkError, convertToPriorityEvent, getChannelIndex, getChannelInfo, getConsumedSubpartitionIndexSet, getCurrentBackoff, getPartitionId, increaseBackoff, notifyBufferAvailable, notifyChannelNonEmpty, notifyPriorityEvent, notifyRequiredSegmentId, peekNextBufferSubpartitionId, setError, unsynchronizedGetNumberOfQueuedBuffers, unsynchronizedGetSizeOfQueuedBuffersprotected final BufferManager bufferManager
protected ChannelStateWriter channelStateWriter
protected final int networkBuffersPerChannel
public void setChannelStateWriter(ChannelStateWriter channelStateWriter)
ChannelStateHolderChannelStateWriter. Must only be called once.setChannelStateWriter in interface ChannelStateHolderpublic final InputChannel toInputChannel() throws IOException
IOExceptionpublic void checkpointStopped(long checkpointId)
InputChannelcheckpointStopped in class InputChannelprotected abstract InputChannel toInputChannelInternal() throws IOException
IOExceptionpublic void onRecoveredStateBuffer(Buffer buffer)
public void finishReadRecoveredState()
throws IOException
IOExceptionprotected int peekNextBufferSubpartitionIdInternal()
throws IOException
InputChannelpeekNextBufferSubpartitionIdInternal in class InputChannelIOExceptionpublic Optional<InputChannel.BufferAndAvailability> getNextBuffer() throws IOException
InputChannelOptional.empty() if there
is no data to return.getNextBuffer in class InputChannelIOExceptionpublic void resumeConsumption()
InputChannelCheckpointBarrier of
exactly-once mode, the upstream will be blocked and become unavailable. This method tries to
unblock the corresponding upstream and resume data consumption.resumeConsumption in class InputChannelpublic void acknowledgeAllRecordsProcessed()
throws IOException
InputChannelEndOfData from one channel, it need to acknowledge after this event get
processed.acknowledgeAllRecordsProcessed in class InputChannelIOException@VisibleForTesting protected int getNumberOfQueuedBuffers()
public Buffer requestBufferBlocking() throws InterruptedException, IOException
InterruptedExceptionIOExceptionpublic void checkpointStarted(CheckpointBarrier barrier) throws CheckpointException
InputChannelcheckpointStarted in class InputChannelCheckpointExceptionCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.