public class RemoteInputChannel extends InputChannel implements BufferRecycler, BufferListener
InputChannel.BufferAndAvailability
channelIndex, inputGate, numBuffersIn, numBytesIn, partitionId
Constructor and Description |
---|
RemoteInputChannel(SingleInputGate inputGate,
int channelIndex,
ResultPartitionID partitionId,
ConnectionID connectionId,
ConnectionManager connectionManager,
int initialBackOff,
int maxBackoff,
TaskIOMetricGroup metrics) |
RemoteInputChannel(SingleInputGate inputGate,
int channelIndex,
ResultPartitionID partitionId,
ConnectionID connectionId,
ConnectionManager connectionManager,
TaskIOMetricGroup metrics) |
Modifier and Type | Method and Description |
---|---|
int |
getAndResetUnannouncedCredit()
Gets the unannounced credit and resets it to 0 atomically.
|
BufferProvider |
getBufferProvider() |
int |
getInitialCredit() |
InputChannelID |
getInputChannelId() |
int |
getNumberOfAvailableBuffers() |
int |
getNumberOfQueuedBuffers()
Gets the current number of received buffers which have not been processed yet.
|
int |
getNumberOfRequiredBuffers() |
int |
getSenderBacklog() |
int |
getUnannouncedCredit()
Gets the currently unannounced credit.
|
boolean |
isReleased() |
boolean |
notifyBufferAvailable(Buffer buffer)
The Buffer pool notifies this channel of an available floating buffer.
|
void |
notifyBufferDestroyed()
Notification callback if the buffer provider is destroyed.
|
void |
onBuffer(Buffer buffer,
int sequenceNumber,
int backlog) |
void |
onEmptyBuffer(int sequenceNumber,
int backlog) |
void |
onError(Throwable cause) |
void |
onFailedPartitionRequest() |
void |
recycle(MemorySegment segment)
Exclusive buffer is recycled to this input channel directly and it may trigger return extra
floating buffer and notify increased credit to the producer.
|
Buffer |
requestBuffer()
Requests buffer from input channel directly for receiving network data.
|
void |
requestSubpartition(int subpartitionIndex)
Requests a remote subpartition.
|
String |
toString() |
int |
unsynchronizedGetNumberOfQueuedBuffers() |
checkError, getCurrentBackoff, getPartitionId, increaseBackoff, notifyChannelNonEmpty, setError
public RemoteInputChannel(SingleInputGate inputGate, int channelIndex, ResultPartitionID partitionId, ConnectionID connectionId, ConnectionManager connectionManager, TaskIOMetricGroup metrics)
public RemoteInputChannel(SingleInputGate inputGate, int channelIndex, ResultPartitionID partitionId, ConnectionID connectionId, ConnectionManager connectionManager, int initialBackOff, int maxBackoff, TaskIOMetricGroup metrics)
@VisibleForTesting public void requestSubpartition(int subpartitionIndex) throws IOException, InterruptedException
IOException
InterruptedException
public boolean isReleased()
public void recycle(MemorySegment segment)
recycle
in interface BufferRecycler
segment
- The exclusive segment of this channel.public int getNumberOfAvailableBuffers()
public int getNumberOfRequiredBuffers()
public int getSenderBacklog()
public boolean notifyBufferAvailable(Buffer buffer)
notifyBufferAvailable
in interface BufferListener
buffer
- Buffer that becomes available in buffer pool.public void notifyBufferDestroyed()
BufferListener
notifyBufferDestroyed
in interface BufferListener
public int getUnannouncedCredit()
public int getAndResetUnannouncedCredit()
public int getNumberOfQueuedBuffers()
public int unsynchronizedGetNumberOfQueuedBuffers()
public InputChannelID getInputChannelId()
public int getInitialCredit()
public BufferProvider getBufferProvider() throws IOException
IOException
@Nullable public Buffer requestBuffer()
public void onBuffer(Buffer buffer, int sequenceNumber, int backlog) throws IOException
IOException
public void onEmptyBuffer(int sequenceNumber, int backlog) throws IOException
IOException
public void onFailedPartitionRequest()
public void onError(Throwable cause)
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.