public class LocalInputChannel extends InputChannel implements BufferAvailabilityListener
InputChannel.BufferAndAvailability
channelInfo, consumedSubpartitionIndexSet, currentBackoff, initialBackoff, inputGate, maxBackoff, numBuffersIn, numBytesIn, partitionId
Constructor and Description |
---|
LocalInputChannel(SingleInputGate inputGate,
int channelIndex,
ResultPartitionID partitionId,
ResultSubpartitionIndexSet consumedSubpartitionIndexSet,
ResultPartitionManager partitionManager,
TaskEventPublisher taskEventPublisher,
int initialBackoff,
int maxBackoff,
Counter numBytesIn,
Counter numBuffersIn,
ChannelStateWriter stateWriter) |
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.
|
Optional<InputChannel.BufferAndAvailability> |
getNextBuffer()
Returns the next buffer from the consumed subpartitions or
Optional.empty() if there
is no data to return. |
void |
notifyDataAvailable(ResultSubpartitionView view)
Called whenever there might be new data available.
|
void |
notifyRequiredSegmentId(int subpartitionId,
int segmentId)
Notify the upstream the id of required segment that should be sent to netty connection.
|
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.
|
protected void |
requestSubpartitions()
Requests the subpartitions specified by
InputChannel.partitionId and InputChannel.consumedSubpartitionIndexSet . |
void |
resumeConsumption()
After sending a
CheckpointBarrier of
exactly-once mode, the upstream will be blocked and become unavailable. |
String |
toString() |
int |
unsynchronizedGetNumberOfQueuedBuffers() |
checkError, convertToPriorityEvent, getChannelIndex, getChannelInfo, getConsumedSubpartitionIndexSet, getCurrentBackoff, getPartitionId, increaseBackoff, notifyBufferAvailable, notifyChannelNonEmpty, notifyPriorityEvent, peekNextBufferSubpartitionId, setError, unsynchronizedGetSizeOfQueuedBuffers
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
notifyPriorityEvent
public LocalInputChannel(SingleInputGate inputGate, int channelIndex, ResultPartitionID partitionId, ResultSubpartitionIndexSet consumedSubpartitionIndexSet, ResultPartitionManager partitionManager, TaskEventPublisher taskEventPublisher, int initialBackoff, int maxBackoff, Counter numBytesIn, Counter numBuffersIn, ChannelStateWriter stateWriter)
public void checkpointStarted(CheckpointBarrier barrier) throws CheckpointException
InputChannel
checkpointStarted
in class InputChannel
CheckpointException
public void checkpointStopped(long checkpointId)
InputChannel
checkpointStopped
in class InputChannel
protected void requestSubpartitions() throws IOException
InputChannel
InputChannel.partitionId
and InputChannel.consumedSubpartitionIndexSet
.IOException
protected int peekNextBufferSubpartitionIdInternal() throws IOException
InputChannel
peekNextBufferSubpartitionIdInternal
in class InputChannel
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 notifyDataAvailable(ResultSubpartitionView view)
BufferAvailabilityListener
notifyDataAvailable
in interface BufferAvailabilityListener
view
- the ResultSubpartitionView
containing available data.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
public int unsynchronizedGetNumberOfQueuedBuffers()
unsynchronizedGetNumberOfQueuedBuffers
in class InputChannel
public void notifyRequiredSegmentId(int subpartitionId, int segmentId)
InputChannel
notifyRequiredSegmentId
in class InputChannel
subpartitionId
- The id of the corresponding subpartition.segmentId
- The id of required segment.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.