Class SingleCheckpointBarrierHandler
- java.lang.Object
-
- org.apache.flink.streaming.runtime.io.checkpointing.CheckpointBarrierHandler
-
- org.apache.flink.streaming.runtime.io.checkpointing.SingleCheckpointBarrierHandler
-
- All Implemented Interfaces:
Closeable,AutoCloseable
@Internal @NotThreadSafe public class SingleCheckpointBarrierHandler extends CheckpointBarrierHandler
SingleCheckpointBarrierHandleris used for triggering checkpoint while reading the first barrier and keeping track of the number of received barriers and consumed barriers. It can handle/track just single checkpoint at a time. The behaviour when to actually trigger the checkpoint and what theCheckpointableInputshould do is controlled byBarrierHandlerState.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SingleCheckpointBarrierHandleraligned(String taskName, CheckpointableTask toNotifyOnCheckpoint, org.apache.flink.util.clock.Clock clock, int numOpenChannels, BarrierAlignmentUtil.DelayableTimer registerTimer, boolean enableCheckpointAfterTasksFinished, CheckpointableInput... inputs)static SingleCheckpointBarrierHandleralternating(String taskName, CheckpointableTask toNotifyOnCheckpoint, SubtaskCheckpointCoordinator checkpointCoordinator, org.apache.flink.util.clock.Clock clock, int numOpenChannels, BarrierAlignmentUtil.DelayableTimer registerTimer, boolean enableCheckpointAfterTasksFinished, CheckpointableInput... inputs)voidclose()static SingleCheckpointBarrierHandlercreateUnalignedCheckpointBarrierHandler(SubtaskCheckpointCoordinator checkpointCoordinator, String taskName, CheckpointableTask toNotifyOnCheckpoint, org.apache.flink.util.clock.Clock clock, boolean enableCheckpointsAfterTasksFinish, CheckpointableInput... inputs)CompletableFuture<Void>getAllBarriersReceivedFuture(long checkpointId)longgetLatestCheckpointId()protected booleanisCheckpointPending()protected voidmarkCheckpointAlignedAndTransformState(InputChannelInfo alignedChannel, CheckpointBarrier barrier, org.apache.flink.util.function.FunctionWithException<org.apache.flink.streaming.runtime.io.checkpointing.BarrierHandlerState,org.apache.flink.streaming.runtime.io.checkpointing.BarrierHandlerState,Exception> stateTransformer)voidprocessBarrier(CheckpointBarrier barrier, InputChannelInfo channelInfo, boolean isRpcTriggered)voidprocessBarrierAnnouncement(CheckpointBarrier announcedBarrier, int sequenceNumber, InputChannelInfo channelInfo)voidprocessCancellationBarrier(CancelCheckpointMarker cancelBarrier, InputChannelInfo channelInfo)voidprocessEndOfPartition(InputChannelInfo channelInfo)StringtoString()static SingleCheckpointBarrierHandlerunaligned(String taskName, CheckpointableTask toNotifyOnCheckpoint, SubtaskCheckpointCoordinator checkpointCoordinator, org.apache.flink.util.clock.Clock clock, int numOpenChannels, BarrierAlignmentUtil.DelayableTimer registerTimer, boolean enableCheckpointAfterTasksFinished, CheckpointableInput... inputs)-
Methods inherited from class org.apache.flink.streaming.runtime.io.checkpointing.CheckpointBarrierHandler
addProcessedBytes, getAlignmentDurationNanos, getCheckpointStartDelayNanos, getClock, markAlignmentEnd, markAlignmentEnd, markAlignmentStart, markAlignmentStartAndEnd, notifyAbort, notifyAbortOnCancellationBarrier, notifyCheckpoint, resetAlignment
-
-
-
-
Method Detail
-
createUnalignedCheckpointBarrierHandler
@VisibleForTesting public static SingleCheckpointBarrierHandler createUnalignedCheckpointBarrierHandler(SubtaskCheckpointCoordinator checkpointCoordinator, String taskName, CheckpointableTask toNotifyOnCheckpoint, org.apache.flink.util.clock.Clock clock, boolean enableCheckpointsAfterTasksFinish, CheckpointableInput... inputs)
-
unaligned
public static SingleCheckpointBarrierHandler unaligned(String taskName, CheckpointableTask toNotifyOnCheckpoint, SubtaskCheckpointCoordinator checkpointCoordinator, org.apache.flink.util.clock.Clock clock, int numOpenChannels, BarrierAlignmentUtil.DelayableTimer registerTimer, boolean enableCheckpointAfterTasksFinished, CheckpointableInput... inputs)
-
aligned
public static SingleCheckpointBarrierHandler aligned(String taskName, CheckpointableTask toNotifyOnCheckpoint, org.apache.flink.util.clock.Clock clock, int numOpenChannels, BarrierAlignmentUtil.DelayableTimer registerTimer, boolean enableCheckpointAfterTasksFinished, CheckpointableInput... inputs)
-
alternating
public static SingleCheckpointBarrierHandler alternating(String taskName, CheckpointableTask toNotifyOnCheckpoint, SubtaskCheckpointCoordinator checkpointCoordinator, org.apache.flink.util.clock.Clock clock, int numOpenChannels, BarrierAlignmentUtil.DelayableTimer registerTimer, boolean enableCheckpointAfterTasksFinished, CheckpointableInput... inputs)
-
processBarrier
public void processBarrier(CheckpointBarrier barrier, InputChannelInfo channelInfo, boolean isRpcTriggered) throws IOException
- Specified by:
processBarrierin classCheckpointBarrierHandler- Throws:
IOException
-
markCheckpointAlignedAndTransformState
protected void markCheckpointAlignedAndTransformState(InputChannelInfo alignedChannel, CheckpointBarrier barrier, org.apache.flink.util.function.FunctionWithException<org.apache.flink.streaming.runtime.io.checkpointing.BarrierHandlerState,org.apache.flink.streaming.runtime.io.checkpointing.BarrierHandlerState,Exception> stateTransformer) throws IOException
- 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
public void processEndOfPartition(InputChannelInfo channelInfo) throws IOException
- Specified by:
processEndOfPartitionin classCheckpointBarrierHandler- Throws:
IOException
-
getLatestCheckpointId
public long getLatestCheckpointId()
- Specified by:
getLatestCheckpointIdin classCheckpointBarrierHandler
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classCheckpointBarrierHandler- Throws:
IOException
-
isCheckpointPending
protected boolean isCheckpointPending()
- Specified by:
isCheckpointPendingin classCheckpointBarrierHandler
-
getAllBarriersReceivedFuture
public CompletableFuture<Void> getAllBarriersReceivedFuture(long checkpointId)
- Overrides:
getAllBarriersReceivedFuturein classCheckpointBarrierHandler
-
-