public class InputGateWithMetrics extends InputGate
InputGate provided by shuffle service and it is mainly
used for increasing general input metrics from TaskIOMetricGroup.InputGate.InputWithData<INPUT,DATA>AvailabilityProvider.AvailabilityHelperavailabilityHelperAVAILABLE| Constructor and Description |
|---|
InputGateWithMetrics(InputGate inputGate,
org.apache.flink.metrics.Counter numBytesIn) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
CompletableFuture<?> |
getAvailableFuture() |
Optional<BufferOrEvent> |
getNext()
Blocking call waiting for next
BufferOrEvent. |
int |
getNumberOfInputChannels() |
boolean |
isFinished() |
Optional<BufferOrEvent> |
pollNext()
Poll the
BufferOrEvent. |
void |
sendTaskEvent(TaskEvent event) |
void |
setup()
Setup gate, potentially heavy-weight, blocking operation comparing to just creation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisApproximatelyAvailable, isAvailablepublic InputGateWithMetrics(InputGate 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 int getNumberOfInputChannels()
getNumberOfInputChannels in class InputGatepublic boolean isFinished()
isFinished in interface PullingAsyncDataInput<BufferOrEvent>isFinished in class InputGatepublic void setup()
throws IOException,
InterruptedException
InputGatesetup in class InputGateIOExceptionInterruptedExceptionpublic 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 InputGateIOExceptionCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.