Class ChannelStateWriter.NoOpChannelStateWriter
- java.lang.Object
-
- org.apache.flink.runtime.checkpoint.channel.ChannelStateWriter.NoOpChannelStateWriter
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ChannelStateWriter
- Enclosing interface:
- ChannelStateWriter
public static class ChannelStateWriter.NoOpChannelStateWriter extends Object implements ChannelStateWriter
No-op implementation ofChannelStateWriter
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.checkpoint.channel.ChannelStateWriter
ChannelStateWriter.ChannelStateWriteResult, ChannelStateWriter.NoOpChannelStateWriter
-
-
Field Summary
-
Fields inherited from interface org.apache.flink.runtime.checkpoint.channel.ChannelStateWriter
NO_OP, SEQUENCE_NUMBER_RESTORED, SEQUENCE_NUMBER_UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description NoOpChannelStateWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abort(long checkpointId, Throwable cause, boolean cleanup)
Aborts the checkpoint and fails pending result for this checkpoint.void
addInputData(long checkpointId, InputChannelInfo info, int startSeqNum, CloseableIterator<Buffer> data)
Add in-flight buffers from theInputChannel
.void
addOutputData(long checkpointId, ResultSubpartitionInfo info, int startSeqNum, Buffer... data)
Add in-flight buffers from theResultSubpartition
.void
addOutputDataFuture(long checkpointId, ResultSubpartitionInfo info, int startSeqNum, CompletableFuture<List<Buffer>> data)
Add in-flight bufferFuture from theResultSubpartition
.void
close()
void
finishInput(long checkpointId)
Finalize write of channel state data for the given checkpoint id.void
finishOutput(long checkpointId)
Finalize write of channel state data for the given checkpoint id.ChannelStateWriter.ChannelStateWriteResult
getAndRemoveWriteResult(long checkpointId)
Must be called afterChannelStateWriter.start(long, CheckpointOptions)
once.void
start(long checkpointId, CheckpointOptions checkpointOptions)
Initiate write of channel state for the given checkpoint id.
-
-
-
Method Detail
-
start
public void start(long checkpointId, CheckpointOptions checkpointOptions)
Description copied from interface:ChannelStateWriter
Initiate write of channel state for the given checkpoint id.- Specified by:
start
in interfaceChannelStateWriter
-
addInputData
public void addInputData(long checkpointId, InputChannelInfo info, int startSeqNum, CloseableIterator<Buffer> data)
Description copied from interface:ChannelStateWriter
Add in-flight buffers from theInputChannel
. Must be called afterChannelStateWriter.start(long,CheckpointOptions)
and beforeChannelStateWriter.finishInput(long)
. Buffers are recycled after they are written or exception occurs.- Specified by:
addInputData
in interfaceChannelStateWriter
startSeqNum
- sequence number of the 1st passed buffer. It is intended to use for incremental snapshots. If no data is passed it is ignored.data
- zero or more data buffers ordered by their sequence numbers- See Also:
ChannelStateWriter.SEQUENCE_NUMBER_RESTORED
,ChannelStateWriter.SEQUENCE_NUMBER_UNKNOWN
-
addOutputData
public void addOutputData(long checkpointId, ResultSubpartitionInfo info, int startSeqNum, Buffer... data)
Description copied from interface:ChannelStateWriter
Add in-flight buffers from theResultSubpartition
. Must be called afterChannelStateWriter.start(long, org.apache.flink.runtime.checkpoint.CheckpointOptions)
and beforeChannelStateWriter.finishOutput(long)
. Buffers are recycled after they are written or exception occurs.- Specified by:
addOutputData
in interfaceChannelStateWriter
startSeqNum
- sequence number of the 1st passed buffer. It is intended to use for incremental snapshots. If no data is passed it is ignored.data
- zero or more data buffers ordered by their sequence numbers- See Also:
ChannelStateWriter.SEQUENCE_NUMBER_RESTORED
,ChannelStateWriter.SEQUENCE_NUMBER_UNKNOWN
-
addOutputDataFuture
public void addOutputDataFuture(long checkpointId, ResultSubpartitionInfo info, int startSeqNum, CompletableFuture<List<Buffer>> data)
Description copied from interface:ChannelStateWriter
Add in-flight bufferFuture from theResultSubpartition
. Must be called afterChannelStateWriter.start(long, org.apache.flink.runtime.checkpoint.CheckpointOptions)
and beforeChannelStateWriter.finishOutput(long)
. Buffers are recycled after they are written or exception occurs.The method will be called when the unaligned checkpoint is enabled and received an aligned barrier.
- Specified by:
addOutputDataFuture
in interfaceChannelStateWriter
-
finishInput
public void finishInput(long checkpointId)
Description copied from interface:ChannelStateWriter
Finalize write of channel state data for the given checkpoint id. Must be called afterChannelStateWriter.start(long, CheckpointOptions)
and all of the input data of the given checkpoint added. When bothChannelStateWriter.finishInput(long)
andChannelStateWriter.finishOutput(long)
were called the results can be (eventually) obtained usingChannelStateWriter.getAndRemoveWriteResult(long)
- Specified by:
finishInput
in interfaceChannelStateWriter
-
finishOutput
public void finishOutput(long checkpointId)
Description copied from interface:ChannelStateWriter
Finalize write of channel state data for the given checkpoint id. Must be called afterChannelStateWriter.start(long, CheckpointOptions)
and all of the output data of the given checkpoint added. When bothChannelStateWriter.finishInput(long)
andChannelStateWriter.finishOutput(long)
were called the results can be (eventually) obtained usingChannelStateWriter.getAndRemoveWriteResult(long)
- Specified by:
finishOutput
in interfaceChannelStateWriter
-
abort
public void abort(long checkpointId, Throwable cause, boolean cleanup)
Description copied from interface:ChannelStateWriter
Aborts the checkpoint and fails pending result for this checkpoint.- Specified by:
abort
in interfaceChannelStateWriter
cleanup
- true ifChannelStateWriter.getAndRemoveWriteResult(long)
is not supposed to be called afterwards.
-
getAndRemoveWriteResult
public ChannelStateWriter.ChannelStateWriteResult getAndRemoveWriteResult(long checkpointId)
Description copied from interface:ChannelStateWriter
Must be called afterChannelStateWriter.start(long, CheckpointOptions)
once.- Specified by:
getAndRemoveWriteResult
in interfaceChannelStateWriter
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-