Class CheckpointStateOutputStream

    • Constructor Detail

      • CheckpointStateOutputStream

        public CheckpointStateOutputStream()
    • Method Detail

      • closeAndGetHandle

        @Nullable
        public abstract StreamStateHandle closeAndGetHandle()
                                                     throws IOException
        Closes the stream and gets a state handle that can create an input stream producing the data written to this stream.

        This 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 close() method removes the target resource when called.

        Returns:
        A state handle that can create an input stream producing the data written to this stream.
        Throws:
        IOException - Thrown, if the stream cannot be closed.
      • 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 closeAndGetHandle().

        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in class FSDataOutputStream
        Throws:
        IOException - Thrown, if the stream cannot be closed.