public abstract class CheckpointBarrierHandler extends Object implements Closeable
CheckpointBarrierHandler
reacts to checkpoint barrier arriving from the input
channels. Different implementations may either simply track barriers, or block certain inputs on
barriers.Constructor and Description |
---|
CheckpointBarrierHandler(CheckpointableTask toNotifyOnCheckpoint,
Clock clock,
boolean enableCheckpointAfterTasksFinished) |
Modifier and Type | Method and Description |
---|---|
void |
addProcessedBytes(int bytes) |
void |
close() |
long |
getAlignmentDurationNanos() |
CompletableFuture<Void> |
getAllBarriersReceivedFuture(long checkpointId) |
long |
getCheckpointStartDelayNanos() |
protected Clock |
getClock() |
abstract long |
getLatestCheckpointId() |
protected abstract boolean |
isCheckpointPending() |
protected void |
markAlignmentEnd() |
protected void |
markAlignmentEnd(long alignmentDuration) |
protected void |
markAlignmentStart(long checkpointId,
long checkpointCreationTimestamp) |
protected void |
markAlignmentStartAndEnd(long checkpointId,
long checkpointCreationTimestamp) |
protected void |
notifyAbort(long checkpointId,
CheckpointException cause) |
protected void |
notifyAbortOnCancellationBarrier(long checkpointId) |
protected void |
notifyCheckpoint(CheckpointBarrier checkpointBarrier) |
abstract void |
processBarrier(CheckpointBarrier receivedBarrier,
InputChannelInfo channelInfo,
boolean isRpcTriggered) |
abstract void |
processBarrierAnnouncement(CheckpointBarrier announcedBarrier,
int sequenceNumber,
InputChannelInfo channelInfo) |
abstract void |
processCancellationBarrier(CancelCheckpointMarker cancelBarrier,
InputChannelInfo channelInfo) |
abstract void |
processEndOfPartition(InputChannelInfo channelInfo) |
protected void |
resetAlignment() |
public CheckpointBarrierHandler(CheckpointableTask toNotifyOnCheckpoint, Clock clock, boolean enableCheckpointAfterTasksFinished)
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public abstract void processBarrier(CheckpointBarrier receivedBarrier, InputChannelInfo channelInfo, boolean isRpcTriggered) throws IOException
IOException
public abstract void processBarrierAnnouncement(CheckpointBarrier announcedBarrier, int sequenceNumber, InputChannelInfo channelInfo) throws IOException
IOException
public abstract void processCancellationBarrier(CancelCheckpointMarker cancelBarrier, InputChannelInfo channelInfo) throws IOException
IOException
public abstract void processEndOfPartition(InputChannelInfo channelInfo) throws IOException
IOException
public abstract long getLatestCheckpointId()
public long getAlignmentDurationNanos()
public long getCheckpointStartDelayNanos()
public CompletableFuture<Void> getAllBarriersReceivedFuture(long checkpointId)
protected void notifyCheckpoint(CheckpointBarrier checkpointBarrier) throws IOException
IOException
protected void notifyAbortOnCancellationBarrier(long checkpointId) throws IOException
IOException
protected void notifyAbort(long checkpointId, CheckpointException cause) throws IOException
IOException
protected void markAlignmentStartAndEnd(long checkpointId, long checkpointCreationTimestamp)
protected void markAlignmentStart(long checkpointId, long checkpointCreationTimestamp)
protected void markAlignmentEnd()
protected void markAlignmentEnd(long alignmentDuration)
protected void resetAlignment()
protected abstract boolean isCheckpointPending()
public void addProcessedBytes(int bytes)
protected final Clock getClock()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.