Class CheckpointedInputGate
- java.lang.Object
-
- org.apache.flink.streaming.runtime.io.checkpointing.CheckpointedInputGate
-
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.flink.runtime.io.AvailabilityProvider,org.apache.flink.runtime.io.PullingAsyncDataInput<org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent>
@Internal public class CheckpointedInputGate extends Object implements org.apache.flink.runtime.io.PullingAsyncDataInput<org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent>, Closeable
TheCheckpointedInputGateusesCheckpointBarrierHandlerto handle incomingCheckpointBarrierfrom theInputGate.
-
-
Constructor Summary
Constructors Constructor Description CheckpointedInputGate(org.apache.flink.runtime.io.network.partition.consumer.InputGate inputGate, CheckpointBarrierHandler barrierHandler, org.apache.flink.api.common.operators.MailboxExecutor mailboxExecutor)Creates a new checkpoint stream aligner.CheckpointedInputGate(org.apache.flink.runtime.io.network.partition.consumer.InputGate inputGate, CheckpointBarrierHandler barrierHandler, org.apache.flink.api.common.operators.MailboxExecutor mailboxExecutor, UpstreamRecoveryTracker upstreamRecoveryTracker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallChannelsRecovered()voidclose()Cleans up all internally held resources.CompletableFuture<Void>getAllBarriersReceivedFuture(long checkpointId)CompletableFuture<?>getAvailableFuture()org.apache.flink.runtime.io.network.partition.consumer.InputChannelgetChannel(int channelIndex)List<org.apache.flink.runtime.checkpoint.channel.InputChannelInfo>getChannelInfos()intgetNumberOfInputChannels()org.apache.flink.runtime.io.PullingAsyncDataInput.EndOfDataStatushasReceivedEndOfData()booleanisFinished()Optional<org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent>pollNext()StringtoString()
-
-
-
Constructor Detail
-
CheckpointedInputGate
public CheckpointedInputGate(org.apache.flink.runtime.io.network.partition.consumer.InputGate inputGate, CheckpointBarrierHandler barrierHandler, org.apache.flink.api.common.operators.MailboxExecutor mailboxExecutor)Creates a new checkpoint stream aligner.The aligner will allow only alignments that buffer up to the given number of bytes. When that number is exceeded, it will stop the alignment and notify the task that the checkpoint has been cancelled.
- Parameters:
inputGate- The input gate to draw the buffers and events from.barrierHandler- Handler that controls which channels are blocked.
-
CheckpointedInputGate
public CheckpointedInputGate(org.apache.flink.runtime.io.network.partition.consumer.InputGate inputGate, CheckpointBarrierHandler barrierHandler, org.apache.flink.api.common.operators.MailboxExecutor mailboxExecutor, UpstreamRecoveryTracker upstreamRecoveryTracker)
-
-
Method Detail
-
getAvailableFuture
public CompletableFuture<?> getAvailableFuture()
- Specified by:
getAvailableFuturein interfaceorg.apache.flink.runtime.io.AvailabilityProvider
-
pollNext
public Optional<org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent> pollNext() throws IOException, InterruptedException
- Specified by:
pollNextin interfaceorg.apache.flink.runtime.io.PullingAsyncDataInput<org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent>- Throws:
IOExceptionInterruptedException
-
getAllBarriersReceivedFuture
public CompletableFuture<Void> getAllBarriersReceivedFuture(long checkpointId)
-
isFinished
public boolean isFinished()
- Specified by:
isFinishedin interfaceorg.apache.flink.runtime.io.PullingAsyncDataInput<org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent>
-
hasReceivedEndOfData
public org.apache.flink.runtime.io.PullingAsyncDataInput.EndOfDataStatus hasReceivedEndOfData()
- Specified by:
hasReceivedEndOfDatain interfaceorg.apache.flink.runtime.io.PullingAsyncDataInput<org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent>
-
close
public void close() throws IOExceptionCleans up all internally held resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- Thrown if the cleanup of I/O resources failed.
-
getNumberOfInputChannels
public int getNumberOfInputChannels()
- Returns:
- number of underlying input channels.
-
getChannel
public org.apache.flink.runtime.io.network.partition.consumer.InputChannel getChannel(int channelIndex)
-
getChannelInfos
public List<org.apache.flink.runtime.checkpoint.channel.InputChannelInfo> getChannelInfos()
-
allChannelsRecovered
public boolean allChannelsRecovered()
-
-