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 Constructor Description CheckpointMetadataOutputStream()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
close()
This method should close the stream, if has not been closed before.abstract CompletedCheckpointStorageLocation
closeAndFinalizeCheckpoint()
Closes the stream after all metadata was written and finalizes the checkpoint location.-
Methods inherited from class java.io.OutputStream
nullOutputStream, write, write, write
-
-
-
-
Method Detail
-
closeAndFinalizeCheckpoint
public abstract CompletedCheckpointStorageLocation closeAndFinalizeCheckpoint() throws IOException
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
public abstract void close() throws IOException
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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classorg.apache.flink.core.fs.FSDataOutputStream
- Throws:
IOException
- Thrown, if the stream cannot be closed.
-
-