Class CheckpointBarrierHandler
- java.lang.Object
-
- org.apache.flink.streaming.runtime.io.checkpointing.CheckpointBarrierHandler
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
CheckpointBarrierTracker,SingleCheckpointBarrierHandler
public abstract class CheckpointBarrierHandler extends Object implements Closeable
TheCheckpointBarrierHandlerreacts to checkpoint barrier arriving from the input channels. Different implementations may either simply track barriers, or block certain inputs on barriers.
-
-
Constructor Summary
Constructors Constructor Description CheckpointBarrierHandler(CheckpointableTask toNotifyOnCheckpoint, org.apache.flink.util.clock.Clock clock, boolean enableCheckpointAfterTasksFinished)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddProcessedBytes(int bytes)voidclose()longgetAlignmentDurationNanos()CompletableFuture<Void>getAllBarriersReceivedFuture(long checkpointId)longgetCheckpointStartDelayNanos()protected org.apache.flink.util.clock.ClockgetClock()abstract longgetLatestCheckpointId()protected abstract booleanisCheckpointPending()protected voidmarkAlignmentEnd()protected voidmarkAlignmentEnd(long alignmentDuration)protected voidmarkAlignmentStart(long checkpointId, long checkpointCreationTimestamp)protected voidmarkAlignmentStartAndEnd(long checkpointId, long checkpointCreationTimestamp)protected voidnotifyAbort(long checkpointId, CheckpointException cause)protected voidnotifyAbortOnCancellationBarrier(long checkpointId)protected voidnotifyCheckpoint(CheckpointBarrier checkpointBarrier)abstract voidprocessBarrier(CheckpointBarrier receivedBarrier, InputChannelInfo channelInfo, boolean isRpcTriggered)abstract voidprocessBarrierAnnouncement(CheckpointBarrier announcedBarrier, int sequenceNumber, InputChannelInfo channelInfo)abstract voidprocessCancellationBarrier(CancelCheckpointMarker cancelBarrier, InputChannelInfo channelInfo)abstract voidprocessEndOfPartition(InputChannelInfo channelInfo)protected voidresetAlignment()
-
-
-
Constructor Detail
-
CheckpointBarrierHandler
public CheckpointBarrierHandler(CheckpointableTask toNotifyOnCheckpoint, org.apache.flink.util.clock.Clock clock, boolean enableCheckpointAfterTasksFinished)
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
processBarrier
public abstract void processBarrier(CheckpointBarrier receivedBarrier, InputChannelInfo channelInfo, boolean isRpcTriggered) throws IOException
- Throws:
IOException
-
processBarrierAnnouncement
public abstract void processBarrierAnnouncement(CheckpointBarrier announcedBarrier, int sequenceNumber, InputChannelInfo channelInfo) throws IOException
- Throws:
IOException
-
processCancellationBarrier
public abstract void processCancellationBarrier(CancelCheckpointMarker cancelBarrier, InputChannelInfo channelInfo) throws IOException
- Throws:
IOException
-
processEndOfPartition
public abstract void processEndOfPartition(InputChannelInfo channelInfo) throws IOException
- Throws:
IOException
-
getLatestCheckpointId
public abstract long getLatestCheckpointId()
-
getAlignmentDurationNanos
public long getAlignmentDurationNanos()
-
getCheckpointStartDelayNanos
public long getCheckpointStartDelayNanos()
-
getAllBarriersReceivedFuture
public CompletableFuture<Void> getAllBarriersReceivedFuture(long checkpointId)
-
notifyCheckpoint
protected void notifyCheckpoint(CheckpointBarrier checkpointBarrier) throws IOException
- Throws:
IOException
-
notifyAbortOnCancellationBarrier
protected void notifyAbortOnCancellationBarrier(long checkpointId) throws IOException- Throws:
IOException
-
notifyAbort
protected void notifyAbort(long checkpointId, CheckpointException cause) throws IOException- Throws:
IOException
-
markAlignmentStartAndEnd
protected void markAlignmentStartAndEnd(long checkpointId, long checkpointCreationTimestamp)
-
markAlignmentStart
protected void markAlignmentStart(long checkpointId, long checkpointCreationTimestamp)
-
markAlignmentEnd
protected void markAlignmentEnd()
-
markAlignmentEnd
protected void markAlignmentEnd(long alignmentDuration)
-
resetAlignment
protected void resetAlignment()
-
isCheckpointPending
protected abstract boolean isCheckpointPending()
-
addProcessedBytes
public void addProcessedBytes(int bytes)
-
getClock
protected final org.apache.flink.util.clock.Clock getClock()
-
-