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 Details

    • CheckpointMetadataOutputStream

      public CheckpointMetadataOutputStream()
  • Method Details

    • 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 interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in class org.apache.flink.core.fs.FSDataOutputStream
      Throws:
      IOException - Thrown, if the stream cannot be closed.