public class FileMergingCheckpointStateOutputStream extends FsCheckpointStreamFactory.FsCheckpointStateOutputStream
CheckpointStateOutputStream that writes into a segment of a file and returns a SegmentFileStateHandle upon closing. Multiple FileMergingCheckpointStateOutputStream
objects can reuse the same underlying file, so that the checkpoint files are merged.
Important: This implementation is NOT thread-safe. Multiple data streams multiplexing the same file should NOT write concurrently. Instead, it is expected that only after one data stream is closed, will other data streams reuse and write to the same underlying file.
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
FileMergingCheckpointStateOutputStream.FileMergingSnapshotManagerProxy
A proxy of the
FileMergingSnapshotManager that owns this FileMergingCheckpointStateOutputStream, with the interfaces for dealing with physical files. |
| 构造器和说明 |
|---|
FileMergingCheckpointStateOutputStream(int bufferSize,
FileMergingCheckpointStateOutputStream.FileMergingSnapshotManagerProxy fileMergingSnapshotManagerProxy) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
This method throws no exception if the close fails, but only logs the error.
|
SegmentFileStateHandle |
closeAndGetHandle()
Closes the stream and gets a state handle that can create an input stream producing the data
written to this stream.
|
void |
flush()
Flush buffers to file if their size is above
FsCheckpointStreamFactory.FsCheckpointStateOutputStream.localStateThreshold. |
void |
flushToFile() |
org.apache.flink.core.fs.Path |
getFilePath() |
long |
getPos() |
void |
sync() |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
isClosedwritepublic FileMergingCheckpointStateOutputStream(int bufferSize,
FileMergingCheckpointStateOutputStream.FileMergingSnapshotManagerProxy fileMergingSnapshotManagerProxy)
public long getPos()
throws IOException
public void write(int b)
throws IOException
public void write(byte[] b,
int off,
int len)
throws IOException
public void flush()
throws IOException
FsCheckpointStreamFactory.FsCheckpointStateOutputStream.localStateThreshold.flush 在接口中 Flushableflush 在类中 FsCheckpointStreamFactory.FsCheckpointStateOutputStreamIOExceptionpublic void sync()
throws IOException
@Nullable public SegmentFileStateHandle closeAndGetHandle() throws IOException
CheckpointStateOutputStreamThis closing must be called (also when the caller is not interested in the handle) to
successfully close the stream and retain the produced resource. In contrast, the CheckpointStateOutputStream.close() method removes the target resource when called.
closeAndGetHandle 在类中 FsCheckpointStreamFactory.FsCheckpointStateOutputStreamIOException - Thrown, if the stream cannot be closed.public void close()
FsCheckpointStreamFactory.FsCheckpointStateOutputStream.close().close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 FsCheckpointStreamFactory.FsCheckpointStateOutputStreampublic void flushToFile()
throws IOException
@VisibleForTesting @Nullable public org.apache.flink.core.fs.Path getFilePath()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.