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, consumedSubpartitionIndex, 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 subpartition or
Optional.empty() if there
is no data to return. |
protected int |
getNumberOfQueuedBuffers() |
void |
onRecoveredStateBuffer(Buffer buffer) |
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, getConsumedSubpartitionIndex, getCurrentBackoff, getPartitionId, increaseBackoff, notifyBufferAvailable, notifyChannelNonEmpty, notifyPriorityEvent, notifyRequiredSegmentId, setError, unsynchronizedGetNumberOfQueuedBuffers, unsynchronizedGetSizeOfQueuedBuffers
protected final BufferManager bufferManager
protected ChannelStateWriter channelStateWriter
protected final int networkBuffersPerChannel
public void setChannelStateWriter(ChannelStateWriter channelStateWriter)
ChannelStateHolder
ChannelStateWriter
. Must only be called once.setChannelStateWriter
in interface ChannelStateHolder
public final InputChannel toInputChannel() throws IOException
IOException
public void checkpointStopped(long checkpointId)
InputChannel
checkpointStopped
in class InputChannel
protected abstract InputChannel toInputChannelInternal() throws IOException
IOException
public void onRecoveredStateBuffer(Buffer buffer)
public void finishReadRecoveredState() throws IOException
IOException
public Optional<InputChannel.BufferAndAvailability> getNextBuffer() throws IOException
InputChannel
Optional.empty()
if there
is no data to return.getNextBuffer
in class InputChannel
IOException
public void resumeConsumption()
InputChannel
CheckpointBarrier
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 InputChannel
public void acknowledgeAllRecordsProcessed() throws IOException
InputChannel
EndOfData
from one channel, it need to acknowledge after this event get
processed.acknowledgeAllRecordsProcessed
in class InputChannel
IOException
@VisibleForTesting protected int getNumberOfQueuedBuffers()
public Buffer requestBufferBlocking() throws InterruptedException, IOException
InterruptedException
IOException
public void checkpointStarted(CheckpointBarrier barrier) throws CheckpointException
InputChannel
checkpointStarted
in class InputChannel
CheckpointException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.