RESUME_RECOVERABLE
- return type of #persist()public abstract class CommitterFromPersistRecoverableFsDataOutputStream<RESUME_RECOVERABLE extends RecoverableWriter.ResumeRecoverable> extends RecoverableFsDataOutputStream
RecoverableFsDataOutputStream
with fixed implementation of closeForCommit()
that
is based on using persist()
to ensure durability and creates the RecoverableFsDataOutputStream.Committer
from the corresponding RecoverableWriter.ResumeRecoverable
.RecoverableFsDataOutputStream.Committer
Constructor and Description |
---|
CommitterFromPersistRecoverableFsDataOutputStream() |
Modifier and Type | Method and Description |
---|---|
RecoverableFsDataOutputStream.Committer |
closeForCommit()
Closes the stream, ensuring persistence of all data (similar to
FSDataOutputStream.sync() ). |
protected abstract RecoverableFsDataOutputStream.Committer |
createCommitterFromResumeRecoverable(RESUME_RECOVERABLE recoverable) |
abstract RESUME_RECOVERABLE |
persist()
Ensures all data so far is persistent (similar to
FSDataOutputStream.sync() ) and returns a handle to
recover the stream at the current position. |
close
flush, getPos, sync
write, write, write
public CommitterFromPersistRecoverableFsDataOutputStream()
public abstract RESUME_RECOVERABLE persist() throws IOException
RecoverableFsDataOutputStream
FSDataOutputStream.sync()
) and returns a handle to
recover the stream at the current position.persist
in class RecoverableFsDataOutputStream
IOException
RecoverableFsDataOutputStream.persist()
protected abstract RecoverableFsDataOutputStream.Committer createCommitterFromResumeRecoverable(RESUME_RECOVERABLE recoverable)
recoverable
- a resume recoverable to create the committer from. Typically the parameter
is the return value of persist()
.RecoverableFsDataOutputStream.closeForCommit()
public final RecoverableFsDataOutputStream.Committer closeForCommit() throws IOException
RecoverableFsDataOutputStream
FSDataOutputStream.sync()
). This
returns a Committer that can be used to publish (make visible) the file that the stream was
writing to.closeForCommit
in class RecoverableFsDataOutputStream
IOException
RecoverableFsDataOutputStream.closeForCommit()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.