Package org.apache.flink.runtime.state
Class CheckpointMetadataOutputStream
java.lang.Object
java.io.OutputStream
org.apache.flink.core.fs.FSDataOutputStream
org.apache.flink.runtime.state.CheckpointMetadataOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
- Direct Known Subclasses:
FsCheckpointMetadataOutputStream
public abstract class CheckpointMetadataOutputStream
extends org.apache.flink.core.fs.FSDataOutputStream
An output stream for checkpoint metadata.
This stream is similar to the CheckpointStateOutputStream, but for metadata files
rather thancdata files.
This stream always creates a file, regardless of the amount of data written.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclose()This method should close the stream, if has not been closed before.abstract CompletedCheckpointStorageLocationCloses the stream after all metadata was written and finalizes the checkpoint location.Methods inherited from class org.apache.flink.core.fs.FSDataOutputStream
flush, getPos, syncMethods inherited from class java.io.OutputStream
nullOutputStream, write, write, write
-
Constructor Details
-
CheckpointMetadataOutputStream
public CheckpointMetadataOutputStream()
-
-
Method Details
-
closeAndFinalizeCheckpoint
Closes the stream after all metadata was written and finalizes the checkpoint location.- Returns:
- An object representing a finalized checkpoint storage location.
- Throws:
IOException- Thrown, if the stream cannot be closed or the finalization fails.
-
close
This 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
closeAndFinalizeCheckpoint().- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classorg.apache.flink.core.fs.FSDataOutputStream- Throws:
IOException- Thrown, if the stream cannot be closed.
-