@Internal @NotThreadSafe public class SingleCheckpointBarrierHandler extends CheckpointBarrierHandler
SingleCheckpointBarrierHandler
is 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 the CheckpointableInput
should do is controlled by BarrierHandlerState
.Modifier and Type | Method and Description |
---|---|
static SingleCheckpointBarrierHandler |
aligned(String taskName,
CheckpointableTask toNotifyOnCheckpoint,
Clock clock,
int numOpenChannels,
BarrierAlignmentUtil.DelayableTimer registerTimer,
boolean enableCheckpointAfterTasksFinished,
CheckpointableInput... inputs) |
static SingleCheckpointBarrierHandler |
alternating(String taskName,
CheckpointableTask toNotifyOnCheckpoint,
SubtaskCheckpointCoordinator checkpointCoordinator,
Clock clock,
int numOpenChannels,
BarrierAlignmentUtil.DelayableTimer registerTimer,
boolean enableCheckpointAfterTasksFinished,
CheckpointableInput... inputs) |
void |
close() |
static SingleCheckpointBarrierHandler |
createUnalignedCheckpointBarrierHandler(SubtaskCheckpointCoordinator checkpointCoordinator,
String taskName,
CheckpointableTask toNotifyOnCheckpoint,
Clock clock,
boolean enableCheckpointsAfterTasksFinish,
CheckpointableInput... inputs) |
CompletableFuture<Void> |
getAllBarriersReceivedFuture(long checkpointId) |
long |
getLatestCheckpointId() |
protected boolean |
isCheckpointPending() |
protected void |
markCheckpointAlignedAndTransformState(InputChannelInfo alignedChannel,
CheckpointBarrier barrier,
FunctionWithException<org.apache.flink.streaming.runtime.io.checkpointing.BarrierHandlerState,org.apache.flink.streaming.runtime.io.checkpointing.BarrierHandlerState,Exception> stateTransformer) |
void |
processBarrier(CheckpointBarrier barrier,
InputChannelInfo channelInfo,
boolean isRpcTriggered) |
void |
processBarrierAnnouncement(CheckpointBarrier announcedBarrier,
int sequenceNumber,
InputChannelInfo channelInfo) |
void |
processCancellationBarrier(CancelCheckpointMarker cancelBarrier,
InputChannelInfo channelInfo) |
void |
processEndOfPartition(InputChannelInfo channelInfo) |
String |
toString() |
static SingleCheckpointBarrierHandler |
unaligned(String taskName,
CheckpointableTask toNotifyOnCheckpoint,
SubtaskCheckpointCoordinator checkpointCoordinator,
Clock clock,
int numOpenChannels,
BarrierAlignmentUtil.DelayableTimer registerTimer,
boolean enableCheckpointAfterTasksFinished,
CheckpointableInput... inputs) |
addProcessedBytes, getAlignmentDurationNanos, getCheckpointStartDelayNanos, getClock, markAlignmentEnd, markAlignmentEnd, markAlignmentStart, markAlignmentStartAndEnd, notifyAbort, notifyAbortOnCancellationBarrier, notifyCheckpoint, resetAlignment
@VisibleForTesting public static SingleCheckpointBarrierHandler createUnalignedCheckpointBarrierHandler(SubtaskCheckpointCoordinator checkpointCoordinator, String taskName, CheckpointableTask toNotifyOnCheckpoint, Clock clock, boolean enableCheckpointsAfterTasksFinish, CheckpointableInput... inputs)
public static SingleCheckpointBarrierHandler unaligned(String taskName, CheckpointableTask toNotifyOnCheckpoint, SubtaskCheckpointCoordinator checkpointCoordinator, Clock clock, int numOpenChannels, BarrierAlignmentUtil.DelayableTimer registerTimer, boolean enableCheckpointAfterTasksFinished, CheckpointableInput... inputs)
public static SingleCheckpointBarrierHandler aligned(String taskName, CheckpointableTask toNotifyOnCheckpoint, Clock clock, int numOpenChannels, BarrierAlignmentUtil.DelayableTimer registerTimer, boolean enableCheckpointAfterTasksFinished, CheckpointableInput... inputs)
public static SingleCheckpointBarrierHandler alternating(String taskName, CheckpointableTask toNotifyOnCheckpoint, SubtaskCheckpointCoordinator checkpointCoordinator, Clock clock, int numOpenChannels, BarrierAlignmentUtil.DelayableTimer registerTimer, boolean enableCheckpointAfterTasksFinished, CheckpointableInput... inputs)
public void processBarrier(CheckpointBarrier barrier, InputChannelInfo channelInfo, boolean isRpcTriggered) throws IOException
processBarrier
in class CheckpointBarrierHandler
IOException
protected void markCheckpointAlignedAndTransformState(InputChannelInfo alignedChannel, CheckpointBarrier barrier, FunctionWithException<org.apache.flink.streaming.runtime.io.checkpointing.BarrierHandlerState,org.apache.flink.streaming.runtime.io.checkpointing.BarrierHandlerState,Exception> stateTransformer) throws IOException
IOException
public void processBarrierAnnouncement(CheckpointBarrier announcedBarrier, int sequenceNumber, InputChannelInfo channelInfo) throws IOException
processBarrierAnnouncement
in class CheckpointBarrierHandler
IOException
public void processCancellationBarrier(CancelCheckpointMarker cancelBarrier, InputChannelInfo channelInfo) throws IOException
processCancellationBarrier
in class CheckpointBarrierHandler
IOException
public void processEndOfPartition(InputChannelInfo channelInfo) throws IOException
processEndOfPartition
in class CheckpointBarrierHandler
IOException
public long getLatestCheckpointId()
getLatestCheckpointId
in class CheckpointBarrierHandler
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class CheckpointBarrierHandler
IOException
protected boolean isCheckpointPending()
isCheckpointPending
in class CheckpointBarrierHandler
public CompletableFuture<Void> getAllBarriersReceivedFuture(long checkpointId)
getAllBarriersReceivedFuture
in class CheckpointBarrierHandler
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.