@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 |
---|---|
protected void |
beginNewAlignment(long checkpointId,
int channelIndex) |
void |
checkpointSizeLimitExceeded(long maxBufferedBytes) |
long |
getAlignmentDurationNanos() |
long |
getLatestCheckpointId() |
boolean |
isBlocked(int channelIndex)
Checks whether the channel with the given index is blocked.
|
protected void |
onBarrier(int channelIndex)
Blocks the given channel index, from which a barrier has been received.
|
boolean |
processBarrier(CheckpointBarrier receivedBarrier,
int channelIndex,
long bufferedBytes) |
boolean |
processCancellationBarrier(CancelCheckpointMarker cancelBarrier) |
boolean |
processEndOfPartition() |
void |
releaseBlocksAndResetBarriers() |
String |
toString() |
notifyAbort, notifyAbortOnCancellationBarrier, notifyCheckpoint
public void releaseBlocksAndResetBarriers()
releaseBlocksAndResetBarriers
in class CheckpointBarrierHandler
public boolean isBlocked(int channelIndex)
CheckpointBarrierHandler
isBlocked
in class CheckpointBarrierHandler
channelIndex
- The channel index to check.public boolean processBarrier(CheckpointBarrier receivedBarrier, int channelIndex, long bufferedBytes) throws Exception
processBarrier
in class CheckpointBarrierHandler
Exception
protected void beginNewAlignment(long checkpointId, int channelIndex) throws IOException
IOException
protected void onBarrier(int channelIndex) throws IOException
channelIndex
- The channel index to block.IOException
public boolean processCancellationBarrier(CancelCheckpointMarker cancelBarrier) throws Exception
processCancellationBarrier
in class CheckpointBarrierHandler
Exception
public boolean processEndOfPartition() throws Exception
processEndOfPartition
in class CheckpointBarrierHandler
Exception
public long getLatestCheckpointId()
getLatestCheckpointId
in class CheckpointBarrierHandler
public long getAlignmentDurationNanos()
getAlignmentDurationNanos
in class CheckpointBarrierHandler
public void checkpointSizeLimitExceeded(long maxBufferedBytes) throws Exception
checkpointSizeLimitExceeded
in class CheckpointBarrierHandler
Exception
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.