Class CheckpointBarrierTracker
- java.lang.Object
-
- org.apache.flink.streaming.runtime.io.checkpointing.CheckpointBarrierHandler
-
- org.apache.flink.streaming.runtime.io.checkpointing.CheckpointBarrierTracker
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
@Internal public class CheckpointBarrierTracker extends CheckpointBarrierHandler
TheCheckpointBarrierTracker
keeps track of what checkpoint barriers have been received from which input channels. Once it has observed all checkpoint barriers for a checkpoint ID, it notifies its listener of a completed checkpoint.Unlike the
SingleCheckpointBarrierHandler
, the BarrierTracker does not block the input channels that have sent barriers, so it cannot be used to gain "exactly-once" processing guarantees. It can, however, be used to gain "at least once" processing guarantees.NOTE: This implementation strictly assumes that newer checkpoints have higher checkpoint IDs.
-
-
Constructor Summary
Constructors Constructor Description CheckpointBarrierTracker(int totalNumberOfInputChannels, CheckpointableTask toNotifyOnCheckpoint, org.apache.flink.util.clock.Clock clock, boolean enableCheckpointAfterTasksFinished)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getLatestCheckpointId()
boolean
isCheckpointPending()
void
processBarrier(CheckpointBarrier receivedBarrier, InputChannelInfo channelInfo, boolean isRpcTriggered)
void
processBarrierAnnouncement(CheckpointBarrier announcedBarrier, int sequenceNumber, InputChannelInfo channelInfo)
void
processCancellationBarrier(CancelCheckpointMarker cancelBarrier, InputChannelInfo channelInfo)
void
processEndOfPartition(InputChannelInfo channelInfo)
-
Methods inherited from class org.apache.flink.streaming.runtime.io.checkpointing.CheckpointBarrierHandler
addProcessedBytes, close, getAlignmentDurationNanos, getAllBarriersReceivedFuture, getCheckpointStartDelayNanos, getClock, markAlignmentEnd, markAlignmentEnd, markAlignmentStart, markAlignmentStartAndEnd, notifyAbort, notifyAbortOnCancellationBarrier, notifyCheckpoint, resetAlignment
-
-
-
-
Constructor Detail
-
CheckpointBarrierTracker
public CheckpointBarrierTracker(int totalNumberOfInputChannels, CheckpointableTask toNotifyOnCheckpoint, org.apache.flink.util.clock.Clock clock, boolean enableCheckpointAfterTasksFinished)
-
-
Method Detail
-
processBarrier
public void processBarrier(CheckpointBarrier receivedBarrier, InputChannelInfo channelInfo, boolean isRpcTriggered) throws IOException
- Specified by:
processBarrier
in classCheckpointBarrierHandler
- Throws:
IOException
-
processBarrierAnnouncement
public void processBarrierAnnouncement(CheckpointBarrier announcedBarrier, int sequenceNumber, InputChannelInfo channelInfo) throws IOException
- Specified by:
processBarrierAnnouncement
in classCheckpointBarrierHandler
- Throws:
IOException
-
processCancellationBarrier
public void processCancellationBarrier(CancelCheckpointMarker cancelBarrier, InputChannelInfo channelInfo) throws IOException
- Specified by:
processCancellationBarrier
in classCheckpointBarrierHandler
- Throws:
IOException
-
processEndOfPartition
public void processEndOfPartition(InputChannelInfo channelInfo) throws IOException
- Specified by:
processEndOfPartition
in classCheckpointBarrierHandler
- Throws:
IOException
-
getLatestCheckpointId
public long getLatestCheckpointId()
- Specified by:
getLatestCheckpointId
in classCheckpointBarrierHandler
-
isCheckpointPending
public boolean isCheckpointPending()
- Specified by:
isCheckpointPending
in classCheckpointBarrierHandler
-
-