@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.| 限定符和类型 | 方法和说明 |
|---|---|
static SingleCheckpointBarrierHandler |
aligned(String taskName,
org.apache.flink.runtime.jobgraph.tasks.CheckpointableTask toNotifyOnCheckpoint,
org.apache.flink.util.clock.Clock clock,
int numOpenChannels,
BarrierAlignmentUtil.DelayableTimer registerTimer,
boolean enableCheckpointAfterTasksFinished,
org.apache.flink.runtime.io.network.partition.consumer.CheckpointableInput... inputs) |
static SingleCheckpointBarrierHandler |
alternating(String taskName,
org.apache.flink.runtime.jobgraph.tasks.CheckpointableTask toNotifyOnCheckpoint,
SubtaskCheckpointCoordinator checkpointCoordinator,
org.apache.flink.util.clock.Clock clock,
int numOpenChannels,
BarrierAlignmentUtil.DelayableTimer registerTimer,
boolean enableCheckpointAfterTasksFinished,
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.CheckpointableTask toNotifyOnCheckpoint,
org.apache.flink.util.clock.Clock clock,
boolean enableCheckpointsAfterTasksFinish,
org.apache.flink.runtime.io.network.partition.consumer.CheckpointableInput... inputs) |
CompletableFuture<Void> |
getAllBarriersReceivedFuture(long checkpointId) |
long |
getLatestCheckpointId() |
protected boolean |
isCheckpointPending() |
protected void |
markCheckpointAlignedAndTransformState(org.apache.flink.runtime.checkpoint.channel.InputChannelInfo alignedChannel,
org.apache.flink.runtime.io.network.api.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) |
void |
processBarrier(org.apache.flink.runtime.io.network.api.CheckpointBarrier barrier,
org.apache.flink.runtime.checkpoint.channel.InputChannelInfo channelInfo,
boolean isRpcTriggered) |
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,
org.apache.flink.runtime.checkpoint.channel.InputChannelInfo channelInfo) |
void |
processEndOfPartition(org.apache.flink.runtime.checkpoint.channel.InputChannelInfo channelInfo) |
String |
toString() |
static SingleCheckpointBarrierHandler |
unaligned(String taskName,
org.apache.flink.runtime.jobgraph.tasks.CheckpointableTask toNotifyOnCheckpoint,
SubtaskCheckpointCoordinator checkpointCoordinator,
org.apache.flink.util.clock.Clock clock,
int numOpenChannels,
BarrierAlignmentUtil.DelayableTimer registerTimer,
boolean enableCheckpointAfterTasksFinished,
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.CheckpointableTask toNotifyOnCheckpoint, org.apache.flink.util.clock.Clock clock, boolean enableCheckpointsAfterTasksFinish, org.apache.flink.runtime.io.network.partition.consumer.CheckpointableInput... inputs)
public static SingleCheckpointBarrierHandler unaligned(String taskName, org.apache.flink.runtime.jobgraph.tasks.CheckpointableTask toNotifyOnCheckpoint, SubtaskCheckpointCoordinator checkpointCoordinator, org.apache.flink.util.clock.Clock clock, int numOpenChannels, BarrierAlignmentUtil.DelayableTimer registerTimer, boolean enableCheckpointAfterTasksFinished, org.apache.flink.runtime.io.network.partition.consumer.CheckpointableInput... inputs)
public static SingleCheckpointBarrierHandler aligned(String taskName, org.apache.flink.runtime.jobgraph.tasks.CheckpointableTask toNotifyOnCheckpoint, org.apache.flink.util.clock.Clock clock, int numOpenChannels, BarrierAlignmentUtil.DelayableTimer registerTimer, boolean enableCheckpointAfterTasksFinished, org.apache.flink.runtime.io.network.partition.consumer.CheckpointableInput... inputs)
public static SingleCheckpointBarrierHandler alternating(String taskName, org.apache.flink.runtime.jobgraph.tasks.CheckpointableTask toNotifyOnCheckpoint, SubtaskCheckpointCoordinator checkpointCoordinator, org.apache.flink.util.clock.Clock clock, int numOpenChannels, BarrierAlignmentUtil.DelayableTimer registerTimer, boolean enableCheckpointAfterTasksFinished, 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,
boolean isRpcTriggered)
throws IOException
processBarrier 在类中 CheckpointBarrierHandlerIOExceptionprotected void markCheckpointAlignedAndTransformState(org.apache.flink.runtime.checkpoint.channel.InputChannelInfo alignedChannel,
org.apache.flink.runtime.io.network.api.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
IOExceptionpublic void processBarrierAnnouncement(org.apache.flink.runtime.io.network.api.CheckpointBarrier announcedBarrier,
int sequenceNumber,
org.apache.flink.runtime.checkpoint.channel.InputChannelInfo channelInfo)
throws IOException
public void processCancellationBarrier(org.apache.flink.runtime.io.network.api.CancelCheckpointMarker cancelBarrier,
org.apache.flink.runtime.checkpoint.channel.InputChannelInfo channelInfo)
throws IOException
public void processEndOfPartition(org.apache.flink.runtime.checkpoint.channel.InputChannelInfo channelInfo)
throws IOException
processEndOfPartition 在类中 CheckpointBarrierHandlerIOExceptionpublic long getLatestCheckpointId()
public void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 CheckpointBarrierHandlerIOExceptionprotected boolean isCheckpointPending()
public CompletableFuture<Void> getAllBarriersReceivedFuture(long checkpointId)
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.