Search in sources :

Example 1 with CheckpointBarrierHandler

use of org.apache.flink.streaming.runtime.io.checkpointing.CheckpointBarrierHandler in project flink by apache.

the class StreamTask method triggerUnfinishedChannelsCheckpoint.

private boolean triggerUnfinishedChannelsCheckpoint(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions) throws Exception {
    Optional<CheckpointBarrierHandler> checkpointBarrierHandler = getCheckpointBarrierHandler();
    checkState(checkpointBarrierHandler.isPresent(), "CheckpointBarrier should exist for tasks with network inputs.");
    CheckpointBarrier barrier = new CheckpointBarrier(checkpointMetaData.getCheckpointId(), checkpointMetaData.getTimestamp(), checkpointOptions);
    for (IndexedInputGate inputGate : getEnvironment().getAllInputGates()) {
        if (!inputGate.isFinished()) {
            for (InputChannelInfo channelInfo : inputGate.getUnfinishedChannels()) {
                checkpointBarrierHandler.get().processBarrier(barrier, channelInfo, true);
            }
        }
    }
    return true;
}
Also used : CheckpointBarrier(org.apache.flink.runtime.io.network.api.CheckpointBarrier) InputChannelInfo(org.apache.flink.runtime.checkpoint.channel.InputChannelInfo) CheckpointBarrierHandler(org.apache.flink.streaming.runtime.io.checkpointing.CheckpointBarrierHandler) IndexedInputGate(org.apache.flink.runtime.io.network.partition.consumer.IndexedInputGate)

Aggregations

InputChannelInfo (org.apache.flink.runtime.checkpoint.channel.InputChannelInfo)1 CheckpointBarrier (org.apache.flink.runtime.io.network.api.CheckpointBarrier)1 IndexedInputGate (org.apache.flink.runtime.io.network.partition.consumer.IndexedInputGate)1 CheckpointBarrierHandler (org.apache.flink.streaming.runtime.io.checkpointing.CheckpointBarrierHandler)1