@PublicEvolving public abstract class RecoverableFsDataOutputStream extends FSDataOutputStream
Modifier and Type | Class and Description |
---|---|
static interface |
RecoverableFsDataOutputStream.Committer
A committer can publish the file of a stream that was closed.
|
Constructor and Description |
---|
RecoverableFsDataOutputStream() |
Modifier and Type | Method and Description |
---|---|
abstract void |
close()
Closes this stream.
|
abstract RecoverableFsDataOutputStream.Committer |
closeForCommit()
Closes the stream, ensuring persistence of all data (similar to
FSDataOutputStream.sync() ). |
abstract RecoverableWriter.ResumeRecoverable |
persist()
Ensures all data so far is persistent (similar to
FSDataOutputStream.sync() ) and returns a handle to
recover the stream at the current position. |
flush, getPos, sync
write, write, write
public abstract RecoverableWriter.ResumeRecoverable persist() throws IOException
FSDataOutputStream.sync()
) and returns a handle to
recover the stream at the current position.IOException
public abstract RecoverableFsDataOutputStream.Committer closeForCommit() throws IOException
FSDataOutputStream.sync()
). This
returns a Committer that can be used to publish (make visible) the file that the stream was
writing to.IOException
public abstract void close() throws IOException
In order to persist all previously written data, one needs to call the closeForCommit()
method and call RecoverableFsDataOutputStream.Committer.commit()
on the returned committer
object.
close
in interface Closeable
close
in interface AutoCloseable
close
in class FSDataOutputStream
IOException
- Thrown if an error occurred during closing.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.