Class FsCheckpointMetadataOutputStream
java.lang.Object
java.io.OutputStream
org.apache.flink.core.fs.FSDataOutputStream
org.apache.flink.runtime.state.CheckpointMetadataOutputStream
org.apache.flink.runtime.state.filesystem.FsCheckpointMetadataOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
A
CheckpointMetadataOutputStream that writes a specified file and directory, and returns
a FsCompletedCheckpointStorageLocation upon closing.-
Constructor Summary
ConstructorsConstructorDescriptionFsCheckpointMetadataOutputStream(org.apache.flink.core.fs.FileSystem fileSystem, org.apache.flink.core.fs.Path metadataFilePath, org.apache.flink.core.fs.Path exclusiveCheckpointDir) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()This method should close the stream, if has not been closed before.Closes the stream after all metadata was written and finalizes the checkpoint location.voidflush()longgetPos()booleanisClosed()voidsync()final voidwrite(byte[] b, int off, int len) final voidwrite(int b) Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
Constructor Details
-
FsCheckpointMetadataOutputStream
public FsCheckpointMetadataOutputStream(org.apache.flink.core.fs.FileSystem fileSystem, org.apache.flink.core.fs.Path metadataFilePath, org.apache.flink.core.fs.Path exclusiveCheckpointDir) throws IOException - Throws:
IOException
-
-
Method Details
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
getPos
- Specified by:
getPosin classorg.apache.flink.core.fs.FSDataOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Specified by:
flushin classorg.apache.flink.core.fs.FSDataOutputStream- Throws:
IOException
-
sync
- Specified by:
syncin classorg.apache.flink.core.fs.FSDataOutputStream- Throws:
IOException
-
isClosed
public boolean isClosed() -
close
public void close()Description copied from class:CheckpointMetadataOutputStreamThis method should close the stream, if has not been closed before. If this method actually closes the stream, it should delete/release the resource behind the stream, such as the file that the stream writes to.The above implies that this method is intended to be the "unsuccessful close", such as when cancelling the stream writing, or when an exception occurs. Closing the stream for the successful case must go through
CheckpointMetadataOutputStream.closeAndFinalizeCheckpoint().- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classCheckpointMetadataOutputStream
-
closeAndFinalizeCheckpoint
Description copied from class:CheckpointMetadataOutputStreamCloses the stream after all metadata was written and finalizes the checkpoint location.- Specified by:
closeAndFinalizeCheckpointin classCheckpointMetadataOutputStream- Returns:
- An object representing a finalized checkpoint storage location.
- Throws:
IOException- Thrown, if the stream cannot be closed or the finalization fails.
-