public abstract class InputChannel extends Object
ResultSubpartitionView
.
For each channel, the consumption life cycle is as follows:
Modifier and Type | Class and Description |
---|---|
static class |
InputChannel.BufferAndAvailability
A combination of a
Buffer and a flag indicating availability of further buffers. |
Modifier and Type | Field and Description |
---|---|
protected int |
channelIndex |
protected SingleInputGate |
inputGate |
protected Counter |
numBytesIn |
protected ResultPartitionID |
partitionId |
Modifier | Constructor and Description |
---|---|
protected |
InputChannel(SingleInputGate inputGate,
int channelIndex,
ResultPartitionID partitionId,
int initialBackoff,
int maxBackoff,
Counter numBytesIn) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkError()
Checks for an error and rethrows it if one was reported.
|
protected int |
getCurrentBackoff()
Returns the current backoff in ms.
|
protected boolean |
increaseBackoff()
Increases the current backoff and returns whether the operation was successful.
|
protected void |
notifyChannelNonEmpty()
Notifies the owning
SingleInputGate that this channel became non-empty. |
protected void |
setError(Throwable cause)
Atomically sets an error for this channel and notifies the input gate about available data to
trigger querying this channel by the task thread.
|
protected final int channelIndex
protected final ResultPartitionID partitionId
protected final SingleInputGate inputGate
protected final Counter numBytesIn
protected InputChannel(SingleInputGate inputGate, int channelIndex, ResultPartitionID partitionId, int initialBackoff, int maxBackoff, Counter numBytesIn)
protected void notifyChannelNonEmpty()
SingleInputGate
that this channel became non-empty.
This is guaranteed to be called only when a Buffer was added to a previously
empty input channel. The notion of empty is atomically consistent with the flag
InputChannel.BufferAndAvailability.moreAvailable()
when polling the next buffer
from this channel.
Note: When the input channel observes an exception, this method is called regardless of whether the channel was empty before. That ensures that the parent InputGate will always be notified about the exception.
protected void checkError() throws IOException
IOException
protected void setError(Throwable cause)
protected int getCurrentBackoff()
protected boolean increaseBackoff()
true
, iff the operation was successful. Otherwise, false
.Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.