@Internal public class CheckpointBarrierTracker extends CheckpointBarrierHandler
CheckpointBarrierTracker
keeps track of what checkpoint barriers have been received
from which input channels. Once it has observed all checkpoint barriers for a checkpoint ID, it
notifies its listener of a completed checkpoint.
Unlike the SingleCheckpointBarrierHandler
, the BarrierTracker does not block the input
channels that have sent barriers, so it cannot be used to gain "exactly-once" processing
guarantees. It can, however, be used to gain "at least once" processing guarantees.
NOTE: This implementation strictly assumes that newer checkpoints have higher checkpoint IDs.
Constructor and Description |
---|
CheckpointBarrierTracker(int totalNumberOfInputChannels,
CheckpointableTask toNotifyOnCheckpoint,
Clock clock,
boolean enableCheckpointAfterTasksFinished) |
Modifier and Type | Method and Description |
---|---|
long |
getLatestCheckpointId() |
boolean |
isCheckpointPending() |
void |
processBarrier(CheckpointBarrier receivedBarrier,
InputChannelInfo channelInfo,
boolean isRpcTriggered) |
void |
processBarrierAnnouncement(CheckpointBarrier announcedBarrier,
int sequenceNumber,
InputChannelInfo channelInfo) |
void |
processCancellationBarrier(CancelCheckpointMarker cancelBarrier,
InputChannelInfo channelInfo) |
void |
processEndOfPartition(InputChannelInfo channelInfo) |
addProcessedBytes, close, getAlignmentDurationNanos, getAllBarriersReceivedFuture, getCheckpointStartDelayNanos, getClock, markAlignmentEnd, markAlignmentEnd, markAlignmentStart, markAlignmentStartAndEnd, notifyAbort, notifyAbortOnCancellationBarrier, notifyCheckpoint, resetAlignment
public CheckpointBarrierTracker(int totalNumberOfInputChannels, CheckpointableTask toNotifyOnCheckpoint, Clock clock, boolean enableCheckpointAfterTasksFinished)
public void processBarrier(CheckpointBarrier receivedBarrier, InputChannelInfo channelInfo, boolean isRpcTriggered) throws IOException
processBarrier
in class CheckpointBarrierHandler
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 boolean isCheckpointPending()
isCheckpointPending
in class CheckpointBarrierHandler
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.