@Internal public class LocalRecoverableWriter extends Object implements RecoverableWriter
RecoverableWriter for the LocalFileSystem.RecoverableWriter.CommitRecoverable, RecoverableWriter.ResumeRecoverable| Constructor and Description |
|---|
LocalRecoverableWriter(LocalFileSystem fs) |
| Modifier and Type | Method and Description |
|---|---|
SimpleVersionedSerializer<RecoverableWriter.CommitRecoverable> |
getCommitRecoverableSerializer()
The serializer for the CommitRecoverable types created in this writer.
|
SimpleVersionedSerializer<RecoverableWriter.ResumeRecoverable> |
getResumeRecoverableSerializer()
The serializer for the ResumeRecoverable types created in this writer.
|
RecoverableFsDataOutputStream |
open(Path filePath)
Opens a new recoverable stream to write to the given path.
|
RecoverableFsDataOutputStream |
recover(RecoverableWriter.ResumeRecoverable recoverable)
Resumes a recoverable stream consistently at the point indicated by the given ResumeRecoverable.
|
RecoverableFsDataOutputStream.Committer |
recoverForCommit(RecoverableWriter.CommitRecoverable recoverable)
Recovers a recoverable stream consistently at the point indicated by the given CommitRecoverable
for finalizing and committing.
|
boolean |
supportsResume()
Checks whether the writer and its streams support resuming (appending to) files after
recovery (via the
RecoverableWriter.recover(ResumeRecoverable) method). |
public LocalRecoverableWriter(LocalFileSystem fs)
public RecoverableFsDataOutputStream open(Path filePath) throws IOException
RecoverableWriteropen in interface RecoverableWriterfilePath - The path of the file/object to write to.IOException - Thrown if the stream could not be opened/initialized.public RecoverableFsDataOutputStream recover(RecoverableWriter.ResumeRecoverable recoverable) throws IOException
RecoverableWriterThis method is optional and whether it is supported is indicated through the
RecoverableWriter.supportsResume() method.
recover in interface RecoverableWriterrecoverable - The opaque handle with the recovery information.IOException - Thrown, if resuming fails.public RecoverableFsDataOutputStream.Committer recoverForCommit(RecoverableWriter.CommitRecoverable recoverable) throws IOException
RecoverableWriterrecoverForCommit in interface RecoverableWriterrecoverable - The opaque handle with the recovery information.IOException - Thrown, if recovery fails.public SimpleVersionedSerializer<RecoverableWriter.CommitRecoverable> getCommitRecoverableSerializer()
RecoverableWritergetCommitRecoverableSerializer in interface RecoverableWriterpublic SimpleVersionedSerializer<RecoverableWriter.ResumeRecoverable> getResumeRecoverableSerializer()
RecoverableWritergetResumeRecoverableSerializer in interface RecoverableWriterpublic boolean supportsResume()
RecoverableWriterRecoverableWriter.recover(ResumeRecoverable) method).
If true, then this writer supports the RecoverableWriter.recover(ResumeRecoverable) method.
If false, then that method may not be supported and streams can only be recovered via
RecoverableWriter.recoverForCommit(CommitRecoverable).
supportsResume in interface RecoverableWriterCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.