public class RenamingAtomicFsDataOutputStream extends AtomicFsDataOutputStream
Constructor and Description |
---|
RenamingAtomicFsDataOutputStream(org.apache.flink.core.fs.FileSystem fs,
org.apache.flink.core.fs.Path targetFile,
org.apache.flink.core.fs.Path tempFile) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this stream.
|
boolean |
closeAndCommit()
Closes the stream, ensuring persistence of all data (similar to
FSDataOutputStream.sync() ). |
void |
flush() |
long |
getPos() |
void |
sync() |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
write
public RenamingAtomicFsDataOutputStream(org.apache.flink.core.fs.FileSystem fs, org.apache.flink.core.fs.Path targetFile, org.apache.flink.core.fs.Path tempFile) throws IOException
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class org.apache.flink.core.fs.FSDataOutputStream
IOException
public void sync() throws IOException
sync
in class org.apache.flink.core.fs.FSDataOutputStream
IOException
public long getPos() throws IOException
getPos
in class org.apache.flink.core.fs.FSDataOutputStream
IOException
public boolean closeAndCommit() throws IOException
AtomicFsDataOutputStream
FSDataOutputStream.sync()
). And commits
the file, publish (make visible) the file that the stream was writing to.closeAndCommit
in class AtomicFsDataOutputStream
IOException
public void close() throws IOException
AtomicFsDataOutputStream
In order to persist all previously written data, one needs to call the AtomicFsDataOutputStream.closeAndCommit()
method.
close
in interface Closeable
close
in interface AutoCloseable
close
in class AtomicFsDataOutputStream
IOException
- Thrown if an error occurred during closing.Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.