Class OSSRecoverableFsDataOutputStream

  • All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable

    @PublicEvolving
    @NotThreadSafe
    public class OSSRecoverableFsDataOutputStream
    extends org.apache.flink.core.fs.RecoverableFsDataOutputStream
    A RecoverableFsDataOutputStream to OSS that is based on a recoverable multipart upload.

    This class is NOT thread-safe. Concurrent writes tho this stream result in corrupt or lost data.

    The close() method may be called concurrently when cancelling / shutting down. It will still ensure that local transient resources (like streams and temp files) are cleaned up, but will not touch data previously persisted in OSS.

    • Constructor Detail

      • OSSRecoverableFsDataOutputStream

        public OSSRecoverableFsDataOutputStream​(long ossUploadPartSize,
                                                org.apache.flink.util.function.FunctionWithException<File,​org.apache.flink.core.fs.RefCountedFileWithStream,​IOException> cachedFileCreator,
                                                OSSRecoverableMultipartUpload upload,
                                                long sizeBeforeCurrentPart)
                                         throws IOException
        Throws:
        IOException
    • Method Detail

      • persist

        public org.apache.flink.core.fs.RecoverableWriter.ResumeRecoverable persist()
                                                                             throws IOException
        Specified by:
        persist in class org.apache.flink.core.fs.RecoverableFsDataOutputStream
        Throws:
        IOException
      • closeForCommit

        public org.apache.flink.core.fs.RecoverableFsDataOutputStream.Committer closeForCommit()
                                                                                        throws IOException
        Specified by:
        closeForCommit in class org.apache.flink.core.fs.RecoverableFsDataOutputStream
        Throws:
        IOException
      • getPos

        public long getPos()
                    throws IOException
        Specified by:
        getPos in class org.apache.flink.core.fs.FSDataOutputStream
        Throws:
        IOException
      • flush

        public void flush()
                   throws IOException
        Specified by:
        flush in interface Flushable
        Specified by:
        flush in class org.apache.flink.core.fs.FSDataOutputStream
        Throws:
        IOException
      • sync

        public void sync()
                  throws IOException
        Specified by:
        sync in class org.apache.flink.core.fs.FSDataOutputStream
        Throws:
        IOException