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
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, consumedSubpartitionIndexSet, currentBackoff, initialBackoff, inputGate, maxBackoff, numBuffersIn, numBytesIn, partitionId -
Constructor Summary
ConstructorsConstructorDescriptionLocalInputChannel(SingleInputGate inputGate, int channelIndex, ResultPartitionID partitionId, ResultSubpartitionIndexSet consumedSubpartitionIndexSet, ResultPartitionManager partitionManager, TaskEventPublisher taskEventPublisher, int initialBackoff, int maxBackoff, org.apache.flink.metrics.Counter numBytesIn, org.apache.flink.metrics.Counter numBuffersIn, ChannelStateWriter stateWriter) -
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.Returns the next buffer from the consumed subpartitions orOptional.empty()if there is no data to return.voidCalled whenever there might be new data available.voidnotifyRequiredSegmentId(int subpartitionId, int segmentId) Notify the upstream the id of required segment that should be sent to netty connection.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.protected voidvoidAfter sending aCheckpointBarrierof exactly-once mode, the upstream will be blocked and become unavailable.toString()intMethods inherited from class org.apache.flink.runtime.io.network.partition.consumer.InputChannel
checkError, convertToPriorityEvent, getChannelIndex, getChannelInfo, getConsumedSubpartitionIndexSet, getCurrentBackoff, getPartitionId, increaseBackoff, notifyBufferAvailable, notifyChannelNonEmpty, notifyPriorityEvent, peekNextBufferSubpartitionId, setError, unsynchronizedGetSizeOfQueuedBuffersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.flink.runtime.io.network.partition.BufferAvailabilityListener
notifyPriorityEvent
-
Constructor Details
-
LocalInputChannel
public LocalInputChannel(SingleInputGate inputGate, int channelIndex, ResultPartitionID partitionId, ResultSubpartitionIndexSet consumedSubpartitionIndexSet, ResultPartitionManager partitionManager, TaskEventPublisher taskEventPublisher, int initialBackoff, int maxBackoff, org.apache.flink.metrics.Counter numBytesIn, org.apache.flink.metrics.Counter numBuffersIn, ChannelStateWriter stateWriter)
-
-
Method Details
-
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
-
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
-
requestSubpartitions
- 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
-
notifyDataAvailable
Description copied from interface:BufferAvailabilityListenerCalled whenever there might be new data available.- Specified by:
notifyDataAvailablein interfaceBufferAvailabilityListener- Parameters:
view- theResultSubpartitionViewcontaining available data.
-
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
-
unsynchronizedGetNumberOfQueuedBuffers
public int unsynchronizedGetNumberOfQueuedBuffers()- Overrides:
unsynchronizedGetNumberOfQueuedBuffersin classInputChannel
-
notifyRequiredSegmentId
public void notifyRequiredSegmentId(int subpartitionId, 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:
subpartitionId- The id of the corresponding subpartition.segmentId- The id of required segment.
-
toString
-