Class LocalInputChannel
- java.lang.Object
-
- org.apache.flink.runtime.io.network.partition.consumer.InputChannel
-
- org.apache.flink.runtime.io.network.partition.consumer.LocalInputChannel
-
- All Implemented Interfaces:
BufferAvailabilityListener
public class LocalInputChannel extends InputChannel implements BufferAvailabilityListener
An input channel, which requests a local subpartition.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.runtime.io.network.partition.consumer.InputChannel
InputChannel.BufferAndAvailability
-
-
Field Summary
-
Fields inherited from class org.apache.flink.runtime.io.network.partition.consumer.InputChannel
channelInfo, consumedSubpartitionIndex, initialBackoff, inputGate, maxBackoff, numBuffersIn, numBytesIn, partitionId
-
-
Constructor Summary
Constructors Constructor Description LocalInputChannel(SingleInputGate inputGate, int channelIndex, ResultPartitionID partitionId, int consumedSubpartitionIndex, ResultPartitionManager partitionManager, TaskEventPublisher taskEventPublisher, int initialBackoff, int maxBackoff, org.apache.flink.metrics.Counter numBytesIn, org.apache.flink.metrics.Counter numBuffersIn, ChannelStateWriter stateWriter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacknowledgeAllRecordsProcessed()When 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.Optional<InputChannel.BufferAndAvailability>getNextBuffer()Returns the next buffer from the consumed subpartition orOptional.empty()if there is no data to return.voidnotifyDataAvailable()Called whenever there might be new data available.voidnotifyRequiredSegmentId(int segmentId)Notify the upstream the id of required segment that should be sent to netty connection.protected voidrequestSubpartition()voidresumeConsumption()After sending aCheckpointBarrierof exactly-once mode, the upstream will be blocked and become unavailable.StringtoString()intunsynchronizedGetNumberOfQueuedBuffers()-
Methods inherited from class org.apache.flink.runtime.io.network.partition.consumer.InputChannel
checkError, convertToPriorityEvent, getChannelIndex, getChannelInfo, getConsumedSubpartitionIndex, getCurrentBackoff, getPartitionId, increaseBackoff, notifyBufferAvailable, notifyChannelNonEmpty, notifyPriorityEvent, setError, unsynchronizedGetSizeOfQueuedBuffers
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.flink.runtime.io.network.partition.BufferAvailabilityListener
notifyPriorityEvent
-
-
-
-
Constructor Detail
-
LocalInputChannel
public LocalInputChannel(SingleInputGate inputGate, int channelIndex, ResultPartitionID partitionId, int consumedSubpartitionIndex, ResultPartitionManager partitionManager, TaskEventPublisher taskEventPublisher, int initialBackoff, int maxBackoff, org.apache.flink.metrics.Counter numBytesIn, org.apache.flink.metrics.Counter numBuffersIn, ChannelStateWriter stateWriter)
-
-
Method Detail
-
checkpointStarted
public void checkpointStarted(CheckpointBarrier barrier) throws CheckpointException
Description copied from class:InputChannelCalled by task thread when checkpointing is started (e.g., any input channel received barrier).- Overrides:
checkpointStartedin classInputChannel- Throws:
CheckpointException
-
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
-
requestSubpartition
protected void requestSubpartition() throws IOException- Throws:
IOException
-
getNextBuffer
public Optional<InputChannel.BufferAndAvailability> getNextBuffer() throws IOException
Description copied from class:InputChannelReturns the next buffer from the consumed subpartition orOptional.empty()if there is no data to return.- Specified by:
getNextBufferin classInputChannel- Throws:
IOException
-
notifyDataAvailable
public void notifyDataAvailable()
Description copied from interface:BufferAvailabilityListenerCalled whenever there might be new data available.- Specified by:
notifyDataAvailablein interfaceBufferAvailabilityListener
-
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
public void acknowledgeAllRecordsProcessed() throws IOExceptionDescription copied from class:InputChannelWhen receivedEndOfDatafrom one channel, it need to acknowledge after this event get processed.- Specified by:
acknowledgeAllRecordsProcessedin classInputChannel- Throws:
IOException
-
unsynchronizedGetNumberOfQueuedBuffers
public int unsynchronizedGetNumberOfQueuedBuffers()
- Overrides:
unsynchronizedGetNumberOfQueuedBuffersin classInputChannel
-
notifyRequiredSegmentId
public void notifyRequiredSegmentId(int segmentId)
Description copied from class:InputChannelNotify the upstream the id of required segment that should be sent to netty connection.- Overrides:
notifyRequiredSegmentIdin classInputChannel- Parameters:
segmentId- segment id indicates the id of segment.
-
-