Class RecoveredInputChannel
java.lang.Object
org.apache.flink.runtime.io.network.partition.consumer.InputChannel
org.apache.flink.runtime.io.network.partition.consumer.RecoveredInputChannel
- All Implemented Interfaces:
ChannelStateHolder
- Direct Known Subclasses:
LocalRecoveredInputChannel,RemoteRecoveredInputChannel
An input channel reads recovered state from previous unaligned checkpoint snapshots.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.flink.runtime.io.network.partition.consumer.InputChannel
InputChannel.BufferAndAvailability -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BufferManagerprotected ChannelStateWriterprotected final intFields inherited from class org.apache.flink.runtime.io.network.partition.consumer.InputChannel
channelInfo, consumedSubpartitionIndexSet, currentBackoff, initialBackoff, inputGate, maxBackoff, numBuffersIn, numBytesIn, partitionId -
Method Summary
Modifier and TypeMethodDescriptionvoidWhen receivedEndOfDatafrom one channel, it need to acknowledge after this event get processed.voidcheckpointStarted(CheckpointBarrier barrier) Called by task thread when checkpointing is started (e.g., any input channel received barrier).voidcheckpointStopped(long checkpointId) Called by task thread on cancel/complete to clean-up temporary data.voidReturns the next buffer from the consumed subpartitions orOptional.empty()if there is no data to return.protected intvoidonRecoveredStateBuffer(Buffer buffer) protected intReturns 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.voidAfter sending aCheckpointBarrierof exactly-once mode, the upstream will be blocked and become unavailable.voidsetChannelStateWriter(ChannelStateWriter channelStateWriter) Injects theChannelStateWriter.final InputChannelprotected abstract InputChannelMethods inherited from class org.apache.flink.runtime.io.network.partition.consumer.InputChannel
checkError, convertToPriorityEvent, getChannelIndex, getChannelInfo, getConsumedSubpartitionIndexSet, getCurrentBackoff, getPartitionId, increaseBackoff, notifyBufferAvailable, notifyChannelNonEmpty, notifyPriorityEvent, notifyRequiredSegmentId, peekNextBufferSubpartitionId, setError, unsynchronizedGetNumberOfQueuedBuffers, unsynchronizedGetSizeOfQueuedBuffers
-
Field Details
-
bufferManager
-
channelStateWriter
-
networkBuffersPerChannel
protected final int networkBuffersPerChannel
-
-
Method Details
-
setChannelStateWriter
Description copied from interface:ChannelStateHolderInjects theChannelStateWriter. Must only be called once.- Specified by:
setChannelStateWriterin interfaceChannelStateHolder
-
toInputChannel
- Throws:
IOException
-
checkpointStopped
public void checkpointStopped(long checkpointId) Description copied from class:InputChannelCalled by task thread on cancel/complete to clean-up temporary data.- Overrides:
checkpointStoppedin classInputChannel
-
toInputChannelInternal
- Throws:
IOException
-
onRecoveredStateBuffer
-
finishReadRecoveredState
- Throws:
IOException
-
peekNextBufferSubpartitionIdInternal
Description copied from class:InputChannelReturns 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.- Specified by:
peekNextBufferSubpartitionIdInternalin classInputChannel- Throws:
IOException
-
getNextBuffer
Description copied from class:InputChannelReturns the next buffer from the consumed subpartitions orOptional.empty()if there is no data to return.- Specified by:
getNextBufferin classInputChannel- Throws:
IOException
-
resumeConsumption
public void resumeConsumption()Description copied from class:InputChannelAfter sending aCheckpointBarrierof exactly-once mode, the upstream will be blocked and become unavailable. This method tries to unblock the corresponding upstream and resume data consumption.- Specified by:
resumeConsumptionin classInputChannel
-
acknowledgeAllRecordsProcessed
Description copied from class:InputChannelWhen receivedEndOfDatafrom one channel, it need to acknowledge after this event get processed.- Specified by:
acknowledgeAllRecordsProcessedin classInputChannel- Throws:
IOException
-
getNumberOfQueuedBuffers
@VisibleForTesting protected int getNumberOfQueuedBuffers() -
requestBufferBlocking
- Throws:
InterruptedExceptionIOException
-
checkpointStarted
Description copied from class:InputChannelCalled by task thread when checkpointing is started (e.g., any input channel received barrier).- Overrides:
checkpointStartedin classInputChannel- Throws:
CheckpointException
-