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
The
CheckpointBarrierTracker 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
ConstructorsConstructorDescriptionCheckpointBarrierTracker(int totalNumberOfInputChannels, CheckpointableTask toNotifyOnCheckpoint, org.apache.flink.util.clock.Clock clock, boolean enableCheckpointAfterTasksFinished) -
Method Summary
Modifier and TypeMethodDescriptionlongbooleanvoidprocessBarrier(CheckpointBarrier receivedBarrier, InputChannelInfo channelInfo, boolean isRpcTriggered) voidprocessBarrierAnnouncement(CheckpointBarrier announcedBarrier, int sequenceNumber, InputChannelInfo channelInfo) voidprocessCancellationBarrier(CancelCheckpointMarker cancelBarrier, InputChannelInfo channelInfo) voidprocessEndOfPartition(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 Details
-
CheckpointBarrierTracker
public CheckpointBarrierTracker(int totalNumberOfInputChannels, CheckpointableTask toNotifyOnCheckpoint, org.apache.flink.util.clock.Clock clock, boolean enableCheckpointAfterTasksFinished)
-
-
Method Details
-
processBarrier
public void processBarrier(CheckpointBarrier receivedBarrier, InputChannelInfo channelInfo, boolean isRpcTriggered) throws IOException - Specified by:
processBarrierin classCheckpointBarrierHandler- Throws:
IOException
-
processBarrierAnnouncement
public void processBarrierAnnouncement(CheckpointBarrier announcedBarrier, int sequenceNumber, InputChannelInfo channelInfo) throws IOException - Specified by:
processBarrierAnnouncementin classCheckpointBarrierHandler- Throws:
IOException
-
processCancellationBarrier
public void processCancellationBarrier(CancelCheckpointMarker cancelBarrier, InputChannelInfo channelInfo) throws IOException - Specified by:
processCancellationBarrierin classCheckpointBarrierHandler- Throws:
IOException
-
processEndOfPartition
- Specified by:
processEndOfPartitionin classCheckpointBarrierHandler- Throws:
IOException
-
getLatestCheckpointId
public long getLatestCheckpointId()- Specified by:
getLatestCheckpointIdin classCheckpointBarrierHandler
-
isCheckpointPending
public boolean isCheckpointPending()- Specified by:
isCheckpointPendingin classCheckpointBarrierHandler
-