public class InputGateWithMetrics extends IndexedInputGate
InputGate provided by shuffle service and it is mainly used for
increasing general input metrics from TaskIOMetricGroup.InputGate.InputWithData<INPUT,DATA>AvailabilityProvider.AvailabilityHelperavailabilityHelper, priorityAvailabilityHelperAVAILABLE| Constructor and Description |
|---|
InputGateWithMetrics(IndexedInputGate inputGate,
org.apache.flink.metrics.Counter numBytesIn) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
finishReadRecoveredState() |
CompletableFuture<?> |
getAvailableFuture() |
InputChannel |
getChannel(int channelIndex)
Returns the channel of this gate.
|
int |
getGateIndex()
Returns the index of this input gate.
|
Optional<BufferOrEvent> |
getNext()
Blocking call waiting for next
BufferOrEvent. |
int |
getNumberOfInputChannels() |
CompletableFuture<?> |
getPriorityEventAvailableFuture()
Notifies when a priority event has been enqueued.
|
CompletableFuture<Void> |
getStateConsumedFuture() |
boolean |
isFinished() |
Optional<BufferOrEvent> |
pollNext()
Poll the
BufferOrEvent. |
void |
requestPartitions() |
void |
resumeConsumption(InputChannelInfo channelInfo) |
void |
sendTaskEvent(TaskEvent event) |
void |
setChannelStateWriter(ChannelStateWriter channelStateWriter)
Injects the
ChannelStateWriter. |
void |
setup()
Setup gate, potentially heavy-weight, blocking operation comparing to just creation.
|
blockConsumption, checkpointStarted, checkpointStopped, convertToPriorityEvent, getInputGateIndexgetChannelInfosclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetChannelInfosand, isApproximatelyAvailable, isAvailable, orpublic InputGateWithMetrics(IndexedInputGate inputGate, org.apache.flink.metrics.Counter numBytesIn)
public CompletableFuture<?> getAvailableFuture()
getAvailableFuture in interface AvailabilityProvidergetAvailableFuture in class InputGateAvailabilityProvider.AVAILABLE should be returned. Previously returned
not completed futures should become completed once there are more records available.public void resumeConsumption(InputChannelInfo channelInfo) throws IOException
resumeConsumption in interface CheckpointableInputresumeConsumption in class InputGateIOExceptionpublic int getNumberOfInputChannels()
getNumberOfInputChannels in interface CheckpointableInputgetNumberOfInputChannels in class InputGatepublic InputChannel getChannel(int channelIndex)
InputGategetChannel in class InputGatepublic int getGateIndex()
IndexedInputGategetGateIndex in class IndexedInputGatepublic boolean isFinished()
isFinished in interface PullingAsyncDataInput<BufferOrEvent>isFinished in class InputGatepublic void setup()
throws IOException
InputGatesetup in class InputGateIOExceptionpublic CompletableFuture<Void> getStateConsumedFuture()
getStateConsumedFuture in class InputGatepublic void requestPartitions()
throws IOException
requestPartitions in class InputGateIOExceptionpublic void setChannelStateWriter(ChannelStateWriter channelStateWriter)
ChannelStateHolderChannelStateWriter. Must only be called once.setChannelStateWriter in interface ChannelStateHoldersetChannelStateWriter in class InputGatepublic Optional<BufferOrEvent> getNext() throws IOException, InterruptedException
InputGateBufferOrEvent.
Note: It should be guaranteed that the previous returned buffer has been recycled before getting next one.
getNext in class InputGateOptional.empty() if InputGate.isFinished() returns true.IOExceptionInterruptedExceptionpublic Optional<BufferOrEvent> pollNext() throws IOException, InterruptedException
InputGateBufferOrEvent.
Note: It should be guaranteed that the previous returned buffer has been recycled before polling next one.
pollNext in interface PullingAsyncDataInput<BufferOrEvent>pollNext in class InputGateOptional.empty() if there is no data to return or if InputGate.isFinished()
returns true.IOExceptionInterruptedExceptionpublic void sendTaskEvent(TaskEvent event) throws IOException
sendTaskEvent in class InputGateIOExceptionpublic CompletableFuture<?> getPriorityEventAvailableFuture()
InputGateInputGate.getNext().getPriorityEventAvailableFuture in class InputGatepublic void finishReadRecoveredState()
throws IOException
finishReadRecoveredState in class InputGateIOExceptionCopyright © 2014–2021 The Apache Software Foundation. All rights reserved.