public class RemoteInputChannel extends InputChannel implements BufferRecycler, BufferListener
InputChannel.BufferAndAvailability
BufferListener.NotificationResult
channelIndex, inputGate, numBuffersIn, numBytesIn, partitionId
Constructor and Description |
---|
RemoteInputChannel(SingleInputGate inputGate,
int channelIndex,
ResultPartitionID partitionId,
ConnectionID connectionId,
ConnectionManager connectionManager,
int initialBackOff,
int maxBackoff,
InputChannelMetrics metrics,
MemorySegmentProvider memorySegmentProvider) |
Modifier and Type | Method and Description |
---|---|
int |
getAndResetUnannouncedCredit()
Gets the unannounced credit and resets it to 0 atomically.
|
BufferProvider |
getBufferProvider() |
int |
getInitialCredit() |
InputChannelID |
getInputChannelId() |
Buffer |
getNextReceivedBuffer() |
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() |
BufferListener.NotificationResult |
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 |
unsynchronizedGetExclusiveBuffersUsed() |
int |
unsynchronizedGetFloatingBuffersAvailable() |
int |
unsynchronizedGetNumberOfQueuedBuffers() |
checkError, getCurrentBackoff, getPartitionId, increaseBackoff, notifyChannelNonEmpty, setError
public RemoteInputChannel(SingleInputGate inputGate, int channelIndex, ResultPartitionID partitionId, ConnectionID connectionId, ConnectionManager connectionManager, int initialBackOff, int maxBackoff, InputChannelMetrics metrics, @Nonnull MemorySegmentProvider memorySegmentProvider)
@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()
@VisibleForTesting public Buffer getNextReceivedBuffer()
public BufferListener.NotificationResult 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()
unsynchronizedGetNumberOfQueuedBuffers
in class InputChannel
public int unsynchronizedGetExclusiveBuffersUsed()
public int unsynchronizedGetFloatingBuffersAvailable()
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–2020 The Apache Software Foundation. All rights reserved.