Class OSSRecoverableFsDataOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.flink.core.fs.FSDataOutputStream
-
- org.apache.flink.core.fs.RecoverableFsDataOutputStream
-
- org.apache.flink.fs.osshadoop.writer.OSSRecoverableFsDataOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
@PublicEvolving @NotThreadSafe public class OSSRecoverableFsDataOutputStream extends org.apache.flink.core.fs.RecoverableFsDataOutputStreamA 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 Summary
Constructors Constructor Description OSSRecoverableFsDataOutputStream(long ossUploadPartSize, org.apache.flink.util.function.FunctionWithException<File,org.apache.flink.core.fs.RefCountedFileWithStream,IOException> cachedFileCreator, OSSRecoverableMultipartUpload upload, long sizeBeforeCurrentPart)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()org.apache.flink.core.fs.RecoverableFsDataOutputStream.CommittercloseForCommit()voidflush()longgetPos()org.apache.flink.core.fs.RecoverableWriter.ResumeRecoverablepersist()voidsync()voidwrite(byte[] b, int off, int len)voidwrite(int b)-
Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
-
-
-
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:
persistin classorg.apache.flink.core.fs.RecoverableFsDataOutputStream- Throws:
IOException
-
closeForCommit
public org.apache.flink.core.fs.RecoverableFsDataOutputStream.Committer closeForCommit() throws IOException- Specified by:
closeForCommitin classorg.apache.flink.core.fs.RecoverableFsDataOutputStream- Throws:
IOException
-
getPos
public long getPos() throws IOException- Specified by:
getPosin classorg.apache.flink.core.fs.FSDataOutputStream- Throws:
IOException
-
write
public void write(int b) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Specified by:
flushin classorg.apache.flink.core.fs.FSDataOutputStream- Throws:
IOException
-
sync
public void sync() throws IOException- Specified by:
syncin classorg.apache.flink.core.fs.FSDataOutputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classorg.apache.flink.core.fs.RecoverableFsDataOutputStream- Throws:
IOException
-
-