@Internal public class CheckpointBarrierAligner extends CheckpointBarrierHandler
CheckpointBarrierAligner
keep tracks of received CheckpointBarrier
on given
channels and controls the alignment, by deciding which channels should be blocked and when to
release blocked channels.Modifier and Type | Method and Description |
---|---|
void |
abortPendingCheckpoint(long checkpointId,
CheckpointException exception) |
protected void |
beginNewAlignment(long checkpointId,
InputChannelInfo channelInfo,
long checkpointTimestamp) |
long |
getAlignmentDurationNanos() |
long |
getLatestCheckpointId() |
int |
getNumClosedChannels() |
boolean |
isBlocked(InputChannelInfo channelInfo)
Checks whether the channel with the given index is blocked.
|
protected boolean |
isCheckpointPending() |
protected void |
onBarrier(InputChannelInfo channelInfo)
Blocks the given channel index, from which a barrier has been received.
|
void |
processBarrier(CheckpointBarrier receivedBarrier,
InputChannelInfo channelInfo) |
void |
processCancellationBarrier(CancelCheckpointMarker cancelBarrier) |
void |
processEndOfPartition() |
void |
releaseBlocksAndResetBarriers() |
String |
toString() |
close, executeInTaskThread, getAllBarriersReceivedFuture, getBufferReceivedListener, getCheckpointStartDelayNanos, hasInflightData, markCheckpointStart, notifyAbort, notifyAbortOnCancellationBarrier, notifyCheckpoint
public void abortPendingCheckpoint(long checkpointId, CheckpointException exception) throws IOException
abortPendingCheckpoint
in class CheckpointBarrierHandler
IOException
public void releaseBlocksAndResetBarriers() throws IOException
releaseBlocksAndResetBarriers
in class CheckpointBarrierHandler
IOException
public boolean isBlocked(InputChannelInfo channelInfo)
CheckpointBarrierHandler
isBlocked
in class CheckpointBarrierHandler
channelInfo
- The channel index to check.public void processBarrier(CheckpointBarrier receivedBarrier, InputChannelInfo channelInfo) throws Exception
processBarrier
in class CheckpointBarrierHandler
Exception
protected void beginNewAlignment(long checkpointId, InputChannelInfo channelInfo, long checkpointTimestamp) throws IOException
IOException
protected void onBarrier(InputChannelInfo channelInfo) throws IOException
channelInfo
- The channel to block.IOException
public void processCancellationBarrier(CancelCheckpointMarker cancelBarrier) throws Exception
processCancellationBarrier
in class CheckpointBarrierHandler
Exception
public void processEndOfPartition() throws Exception
processEndOfPartition
in class CheckpointBarrierHandler
Exception
public long getLatestCheckpointId()
getLatestCheckpointId
in class CheckpointBarrierHandler
public long getAlignmentDurationNanos()
getAlignmentDurationNanos
in class CheckpointBarrierHandler
protected boolean isCheckpointPending()
isCheckpointPending
in class CheckpointBarrierHandler
@VisibleForTesting public int getNumClosedChannels()
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.