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(AbstractInvokable toNotifyOnCheckpoint) |
Modifier and Type | Method and Description |
---|---|
protected void |
abortPendingCheckpoint(long checkpointId,
CheckpointException exception) |
void |
close() |
protected <E extends Exception> |
executeInTaskThread(ThrowingRunnable<E> runnable,
String descriptionFormat,
Object... descriptionArgs) |
long |
getAlignmentDurationNanos() |
CompletableFuture<Void> |
getAllBarriersReceivedFuture(long checkpointId) |
Optional<BufferReceivedListener> |
getBufferReceivedListener() |
long |
getCheckpointStartDelayNanos() |
abstract long |
getLatestCheckpointId() |
boolean |
hasInflightData(long checkpointId,
InputChannelInfo channelInfo)
Returns true if there is in-flight data in the buffers for the given channel and checkpoint.
|
boolean |
isBlocked(InputChannelInfo channelInfo)
Checks whether the channel with the given index is blocked.
|
protected abstract boolean |
isCheckpointPending() |
protected void |
markCheckpointStart(long checkpointCreationTimestamp) |
protected void |
notifyAbort(long checkpointId,
CheckpointException cause) |
protected void |
notifyAbortOnCancellationBarrier(long checkpointId) |
protected void |
notifyCheckpoint(CheckpointBarrier checkpointBarrier,
long alignmentDurationNanos) |
abstract void |
processBarrier(CheckpointBarrier receivedBarrier,
InputChannelInfo channelInfo) |
abstract void |
processCancellationBarrier(CancelCheckpointMarker cancelBarrier) |
abstract void |
processEndOfPartition() |
void |
releaseBlocksAndResetBarriers() |
public CheckpointBarrierHandler(AbstractInvokable toNotifyOnCheckpoint)
public void releaseBlocksAndResetBarriers() throws IOException
IOException
public boolean isBlocked(InputChannelInfo channelInfo)
channelInfo
- The channel index to check.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public abstract void processBarrier(CheckpointBarrier receivedBarrier, InputChannelInfo channelInfo) throws Exception
Exception
public abstract void processCancellationBarrier(CancelCheckpointMarker cancelBarrier) throws Exception
Exception
public abstract void processEndOfPartition() throws Exception
Exception
public abstract long getLatestCheckpointId()
public long getAlignmentDurationNanos()
public long getCheckpointStartDelayNanos()
public Optional<BufferReceivedListener> getBufferReceivedListener()
public boolean hasInflightData(long checkpointId, InputChannelInfo channelInfo)
public CompletableFuture<Void> getAllBarriersReceivedFuture(long checkpointId)
protected void notifyCheckpoint(CheckpointBarrier checkpointBarrier, long alignmentDurationNanos) throws IOException
IOException
protected void notifyAbortOnCancellationBarrier(long checkpointId) throws IOException
IOException
protected void notifyAbort(long checkpointId, CheckpointException cause) throws IOException
IOException
protected void markCheckpointStart(long checkpointCreationTimestamp)
protected <E extends Exception> void executeInTaskThread(ThrowingRunnable<E> runnable, String descriptionFormat, Object... descriptionArgs) throws E extends Exception
E extends Exception
protected abstract boolean isCheckpointPending()
protected void abortPendingCheckpoint(long checkpointId, CheckpointException exception) throws IOException
IOException
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.