@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,
org.apache.flink.runtime.jobgraph.tasks.AbstractInvokable toNotifyOnCheckpoint,
org.apache.flink.util.clock.Clock clock,
int numOpenChannels,
java.util.function.BiFunction<Callable<?>,java.time.Duration,org.apache.flink.streaming.runtime.io.checkpointing.CheckpointBarrierHandler.Cancellable> registerTimer,
org.apache.flink.runtime.io.network.partition.consumer.CheckpointableInput... inputs) |
static SingleCheckpointBarrierHandler |
alternating(String taskName,
org.apache.flink.runtime.jobgraph.tasks.AbstractInvokable toNotifyOnCheckpoint,
SubtaskCheckpointCoordinator checkpointCoordinator,
org.apache.flink.util.clock.Clock clock,
int numOpenChannels,
java.util.function.BiFunction<Callable<?>,java.time.Duration,org.apache.flink.streaming.runtime.io.checkpointing.CheckpointBarrierHandler.Cancellable> registerTimer,
org.apache.flink.runtime.io.network.partition.consumer.CheckpointableInput... inputs) |
void |
close() |
static SingleCheckpointBarrierHandler |
createUnalignedCheckpointBarrierHandler(SubtaskCheckpointCoordinator checkpointCoordinator,
String taskName,
org.apache.flink.runtime.jobgraph.tasks.AbstractInvokable toNotifyOnCheckpoint,
org.apache.flink.util.clock.Clock clock,
org.apache.flink.runtime.io.network.partition.consumer.CheckpointableInput... inputs) |
CompletableFuture<Void> |
getAllBarriersReceivedFuture(long checkpointId) |
long |
getLatestCheckpointId() |
protected boolean |
isCheckpointPending() |
void |
processBarrier(org.apache.flink.runtime.io.network.api.CheckpointBarrier barrier,
org.apache.flink.runtime.checkpoint.channel.InputChannelInfo channelInfo) |
void |
processBarrierAnnouncement(org.apache.flink.runtime.io.network.api.CheckpointBarrier announcedBarrier,
int sequenceNumber,
org.apache.flink.runtime.checkpoint.channel.InputChannelInfo channelInfo) |
void |
processCancellationBarrier(org.apache.flink.runtime.io.network.api.CancelCheckpointMarker cancelBarrier) |
void |
processEndOfPartition() |
String |
toString() |
static SingleCheckpointBarrierHandler |
unaligned(String taskName,
org.apache.flink.runtime.jobgraph.tasks.AbstractInvokable toNotifyOnCheckpoint,
SubtaskCheckpointCoordinator checkpointCoordinator,
org.apache.flink.util.clock.Clock clock,
int numOpenChannels,
java.util.function.BiFunction<Callable<?>,java.time.Duration,org.apache.flink.streaming.runtime.io.checkpointing.CheckpointBarrierHandler.Cancellable> registerTimer,
org.apache.flink.runtime.io.network.partition.consumer.CheckpointableInput... inputs) |
addProcessedBytes, getAlignmentDurationNanos, getCheckpointStartDelayNanos, getClock, markAlignmentEnd, markAlignmentEnd, markAlignmentStart, markAlignmentStartAndEnd, notifyAbort, notifyAbortOnCancellationBarrier, notifyCheckpoint, resetAlignment@VisibleForTesting public static SingleCheckpointBarrierHandler createUnalignedCheckpointBarrierHandler(SubtaskCheckpointCoordinator checkpointCoordinator, String taskName, org.apache.flink.runtime.jobgraph.tasks.AbstractInvokable toNotifyOnCheckpoint, org.apache.flink.util.clock.Clock clock, org.apache.flink.runtime.io.network.partition.consumer.CheckpointableInput... inputs)
public static SingleCheckpointBarrierHandler unaligned(String taskName, org.apache.flink.runtime.jobgraph.tasks.AbstractInvokable toNotifyOnCheckpoint, SubtaskCheckpointCoordinator checkpointCoordinator, org.apache.flink.util.clock.Clock clock, int numOpenChannels, java.util.function.BiFunction<Callable<?>,java.time.Duration,org.apache.flink.streaming.runtime.io.checkpointing.CheckpointBarrierHandler.Cancellable> registerTimer, org.apache.flink.runtime.io.network.partition.consumer.CheckpointableInput... inputs)
public static SingleCheckpointBarrierHandler aligned(String taskName, org.apache.flink.runtime.jobgraph.tasks.AbstractInvokable toNotifyOnCheckpoint, org.apache.flink.util.clock.Clock clock, int numOpenChannels, java.util.function.BiFunction<Callable<?>,java.time.Duration,org.apache.flink.streaming.runtime.io.checkpointing.CheckpointBarrierHandler.Cancellable> registerTimer, org.apache.flink.runtime.io.network.partition.consumer.CheckpointableInput... inputs)
public static SingleCheckpointBarrierHandler alternating(String taskName, org.apache.flink.runtime.jobgraph.tasks.AbstractInvokable toNotifyOnCheckpoint, SubtaskCheckpointCoordinator checkpointCoordinator, org.apache.flink.util.clock.Clock clock, int numOpenChannels, java.util.function.BiFunction<Callable<?>,java.time.Duration,org.apache.flink.streaming.runtime.io.checkpointing.CheckpointBarrierHandler.Cancellable> registerTimer, org.apache.flink.runtime.io.network.partition.consumer.CheckpointableInput... inputs)
public void processBarrier(org.apache.flink.runtime.io.network.api.CheckpointBarrier barrier,
org.apache.flink.runtime.checkpoint.channel.InputChannelInfo channelInfo)
throws IOException
processBarrier in class CheckpointBarrierHandlerIOExceptionpublic void processBarrierAnnouncement(org.apache.flink.runtime.io.network.api.CheckpointBarrier announcedBarrier,
int sequenceNumber,
org.apache.flink.runtime.checkpoint.channel.InputChannelInfo channelInfo)
throws IOException
processBarrierAnnouncement in class CheckpointBarrierHandlerIOExceptionpublic void processCancellationBarrier(org.apache.flink.runtime.io.network.api.CancelCheckpointMarker cancelBarrier)
throws IOException
processCancellationBarrier in class CheckpointBarrierHandlerIOExceptionpublic void processEndOfPartition()
throws IOException
processEndOfPartition in class CheckpointBarrierHandlerIOExceptionpublic long getLatestCheckpointId()
getLatestCheckpointId in class CheckpointBarrierHandlerpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class CheckpointBarrierHandlerIOExceptionprotected boolean isCheckpointPending()
isCheckpointPending in class CheckpointBarrierHandlerpublic CompletableFuture<Void> getAllBarriersReceivedFuture(long checkpointId)
getAllBarriersReceivedFuture in class CheckpointBarrierHandlerCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.