@Internal @ThreadSafe public class ChannelStateWriterImpl extends Object implements ChannelStateWriter
ChannelStateWriter implemented using CheckpointStateOutputStreams. Internally, it
has by default
Thread-safety: this class is thread-safe when used with a thread-safe executor (e.g. default ChannelStateWriteRequestExecutorImpl.
ChannelStateWriter.ChannelStateWriteResult, ChannelStateWriter.NoOpChannelStateWriterNO_OP, SEQUENCE_NUMBER_RESTORED, SEQUENCE_NUMBER_UNKNOWN| 构造器和说明 |
|---|
ChannelStateWriterImpl(String taskName,
int subtaskIndex,
CheckpointStorageWorkerView streamFactoryResolver)
|
| 限定符和类型 | 方法和说明 |
|---|---|
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,
org.apache.flink.util.CloseableIterator<Buffer> iterator)
Add in-flight buffers from the
InputChannel. |
void |
addOutputData(long checkpointId,
ResultSubpartitionInfo info,
int startSeqNum,
Buffer... data)
Add in-flight buffers from the
ResultSubpartition. |
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 after
ChannelStateWriter.start(long, CheckpointOptions) once. |
void |
open() |
void |
start(long checkpointId,
CheckpointOptions checkpointOptions)
Initiate write of channel state for the given checkpoint id.
|
public ChannelStateWriterImpl(String taskName, int subtaskIndex, CheckpointStorageWorkerView streamFactoryResolver)
public void start(long checkpointId,
CheckpointOptions checkpointOptions)
ChannelStateWriterstart 在接口中 ChannelStateWriterpublic void addInputData(long checkpointId,
InputChannelInfo info,
int startSeqNum,
org.apache.flink.util.CloseableIterator<Buffer> iterator)
ChannelStateWriterInputChannel. Must be
called after ChannelStateWriter.start(long, org.apache.flink.runtime.checkpoint.CheckpointOptions) (long)} and before ChannelStateWriter.finishInput(long). Buffers are
recycled after they are written or exception occurs.addInputData 在接口中 ChannelStateWriterstartSeqNum - sequence number of the 1st passed buffer. It is intended to use for
incremental snapshots. If no data is passed it is ignored.iterator - zero or more data buffers ordered by their sequence numbersChannelStateWriter.SEQUENCE_NUMBER_RESTORED,
ChannelStateWriter.SEQUENCE_NUMBER_UNKNOWNpublic void addOutputData(long checkpointId,
ResultSubpartitionInfo info,
int startSeqNum,
Buffer... data)
ChannelStateWriterResultSubpartition. Must be
called after ChannelStateWriter.start(long, org.apache.flink.runtime.checkpoint.CheckpointOptions) and before ChannelStateWriter.finishOutput(long). Buffers are recycled
after they are written or exception occurs.addOutputData 在接口中 ChannelStateWriterstartSeqNum - 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 numbersChannelStateWriter.SEQUENCE_NUMBER_RESTORED,
ChannelStateWriter.SEQUENCE_NUMBER_UNKNOWNpublic void finishInput(long checkpointId)
ChannelStateWriterChannelStateWriter.start(long, CheckpointOptions) and all of the input data of the given checkpoint added.
When both ChannelStateWriter.finishInput(long) and ChannelStateWriter.finishOutput(long) were called the results can be
(eventually) obtained using ChannelStateWriter.getAndRemoveWriteResult(long)finishInput 在接口中 ChannelStateWriterpublic void finishOutput(long checkpointId)
ChannelStateWriterChannelStateWriter.start(long, CheckpointOptions) and all of the output data of the given checkpoint added.
When both ChannelStateWriter.finishInput(long) and ChannelStateWriter.finishOutput(long) were called the results can be
(eventually) obtained using ChannelStateWriter.getAndRemoveWriteResult(long)finishOutput 在接口中 ChannelStateWriterpublic void abort(long checkpointId,
Throwable cause,
boolean cleanup)
ChannelStateWriterabort 在接口中 ChannelStateWritercleanup - true if ChannelStateWriter.getAndRemoveWriteResult(long) is not supposed to be called
afterwards.public ChannelStateWriter.ChannelStateWriteResult getAndRemoveWriteResult(long checkpointId)
ChannelStateWriterChannelStateWriter.start(long, CheckpointOptions) once.getAndRemoveWriteResult 在接口中 ChannelStateWriterpublic void open()
public void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.