public class UnionInputGate extends InputGate
Each input gate has input channels attached from which it reads data. At each input gate, the input channels have unique IDs from 0 (inclusive) to the number of input channels (exclusive).
+---+---+ +---+---+---+ | 0 | 1 | | 0 | 1 | 2 | +--------------+--------------+ | Input gate 0 | Input gate 1 | +--------------+--------------+
The union input gate maps these IDs from 0 to the *total* number of input channels across all unioned input gates, e.g. the channels of input gate 0 keep their original indexes and the channel indexes of input gate 1 are set off by 2 to 2--4.
+---+---++---+---+---+ | 0 | 1 || 2 | 3 | 4 | +--------------------+ | Union input gate | +--------------------+It is NOT possible to recursively union union input gates.
InputGate.InputWithData<INPUT,DATA>PullingAsyncDataInput.EndOfDataStatusAvailabilityProvider.AvailabilityHelperavailabilityHelper, priorityAvailabilityHelperAVAILABLE| 构造器和说明 |
|---|
UnionInputGate(IndexedInputGate... inputGates) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
acknowledgeAllRecordsProcessed(InputChannelInfo channelInfo) |
void |
close() |
void |
finishReadRecoveredState() |
InputChannel |
getChannel(int channelIndex)
Returns the channel of this gate.
|
Optional<BufferOrEvent> |
getNext()
Blocking call waiting for next
BufferOrEvent. |
int |
getNumberOfInputChannels()
Returns the total number of input channels across all unioned input gates.
|
CompletableFuture<Void> |
getStateConsumedFuture() |
PullingAsyncDataInput.EndOfDataStatus |
hasReceivedEndOfData()
Tells if we consumed all available data.
|
boolean |
isFinished() |
Optional<BufferOrEvent> |
pollNext()
Poll the
BufferOrEvent. |
void |
requestPartitions() |
void |
resumeConsumption(InputChannelInfo channelInfo) |
void |
sendTaskEvent(TaskEvent event) |
void |
setup()
Setup gate, potentially heavy-weight, blocking operation comparing to just creation.
|
String |
toString() |
getAvailableFuture, getChannelInfos, getPriorityEventAvailableFuture, setChannelStateWriterclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitand, isApproximatelyAvailable, isAvailable, orpublic UnionInputGate(IndexedInputGate... inputGates)
public int getNumberOfInputChannels()
getNumberOfInputChannels 在类中 InputGatepublic InputChannel getChannel(int channelIndex)
InputGategetChannel 在类中 InputGatepublic boolean isFinished()
isFinished 在接口中 PullingAsyncDataInput<BufferOrEvent>isFinished 在类中 InputGatepublic PullingAsyncDataInput.EndOfDataStatus hasReceivedEndOfData()
PullingAsyncDataInputMoreover it tells us the reason why there is no more data incoming. If any of the upstream
subtasks finished because of the stop-with-savepoint --no-drain, we should not drain the
input. See also StopMode.
public 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 void resumeConsumption(InputChannelInfo channelInfo) throws IOException
resumeConsumption 在类中 InputGateIOExceptionpublic void acknowledgeAllRecordsProcessed(InputChannelInfo channelInfo) throws IOException
acknowledgeAllRecordsProcessed 在类中 InputGateIOExceptionpublic void setup()
InputGatepublic CompletableFuture<Void> getStateConsumedFuture()
getStateConsumedFuture 在类中 InputGatepublic void requestPartitions()
throws IOException
requestPartitions 在类中 InputGateIOExceptionpublic void close()
throws IOException
IOExceptionpublic void finishReadRecoveredState()
throws IOException
finishReadRecoveredState 在类中 InputGateIOExceptionCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.