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| 构造器和说明 |
|---|
InputGateWithMetrics(IndexedInputGate inputGate,
org.apache.flink.metrics.Counter numBytesIn,
ThroughputCalculator throughputCalculator) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
acknowledgeAllRecordsProcessed(InputChannelInfo channelInfo) |
void |
announceBufferSize(int bufferSize) |
void |
close() |
void |
finishReadRecoveredState() |
CompletableFuture<?> |
getAvailableFuture() |
int |
getBuffersInUseCount() |
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() |
List<InputChannelInfo> |
getUnfinishedChannels()
Returns the list of channels that have not received EndOfPartitionEvent.
|
boolean |
hasReceivedEndOfData() |
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, ThroughputCalculator throughputCalculator)
public CompletableFuture<?> getAvailableFuture()
getAvailableFuture 在接口中 AvailabilityProvidergetAvailableFuture 在类中 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 在接口中 CheckpointableInputresumeConsumption 在类中 InputGateIOExceptionpublic void acknowledgeAllRecordsProcessed(InputChannelInfo channelInfo) throws IOException
acknowledgeAllRecordsProcessed 在类中 InputGateIOExceptionpublic int getNumberOfInputChannels()
getNumberOfInputChannels 在接口中 CheckpointableInputgetNumberOfInputChannels 在类中 InputGatepublic InputChannel getChannel(int channelIndex)
InputGategetChannel 在类中 InputGatepublic int getGateIndex()
IndexedInputGategetGateIndex 在类中 IndexedInputGatepublic List<InputChannelInfo> getUnfinishedChannels()
IndexedInputGategetUnfinishedChannels 在类中 IndexedInputGatepublic int getBuffersInUseCount()
getBuffersInUseCount 在类中 IndexedInputGatepublic void announceBufferSize(int bufferSize)
announceBufferSize 在类中 IndexedInputGatepublic boolean isFinished()
isFinished 在接口中 PullingAsyncDataInput<BufferOrEvent>isFinished 在类中 InputGatepublic boolean hasReceivedEndOfData()
hasReceivedEndOfData 在接口中 PullingAsyncDataInput<BufferOrEvent>hasReceivedEndOfData 在类中 InputGatepublic void setup()
throws IOException
InputGatesetup 在类中 InputGateIOExceptionpublic CompletableFuture<Void> getStateConsumedFuture()
getStateConsumedFuture 在类中 InputGatepublic void requestPartitions()
throws IOException
requestPartitions 在类中 InputGateIOExceptionpublic void setChannelStateWriter(ChannelStateWriter channelStateWriter)
ChannelStateHolderChannelStateWriter. Must only be called once.setChannelStateWriter 在接口中 ChannelStateHoldersetChannelStateWriter 在类中 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 在类中 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 在接口中 PullingAsyncDataInput<BufferOrEvent>pollNext 在类中 InputGateOptional.empty() if there is no data to return or if InputGate.isFinished()
returns true.IOExceptionInterruptedExceptionpublic void sendTaskEvent(TaskEvent event) throws IOException
sendTaskEvent 在类中 InputGateIOExceptionpublic CompletableFuture<?> getPriorityEventAvailableFuture()
InputGateInputGate.getNext().public void finishReadRecoveredState()
throws IOException
finishReadRecoveredState 在类中 InputGateIOExceptionCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.