@Internal public interface BucketWriter<IN,BucketID>
writers
.Modifier and Type | Interface and Description |
---|---|
static interface |
BucketWriter.PendingFile
This represents the file that can not write any data to.
|
Modifier and Type | Method and Description |
---|---|
boolean |
cleanupInProgressFileRecoverable(InProgressFileWriter.InProgressFileRecoverable inProgressFileRecoverable)
Frees up any resources that were previously occupied in order to be able to recover from a
(potential) failure.
|
WriterProperties |
getProperties() |
InProgressFileWriter<IN,BucketID> |
openNewInProgressFile(BucketID bucketID,
Path path,
long creationTime)
Used to create a new
InProgressFileWriter . |
BucketWriter.PendingFile |
recoverPendingFile(InProgressFileWriter.PendingFileRecoverable pendingFileRecoverable)
Recovers a pending file for finalizing and committing.
|
InProgressFileWriter<IN,BucketID> |
resumeInProgressFileFrom(BucketID bucketID,
InProgressFileWriter.InProgressFileRecoverable inProgressFileSnapshot,
long creationTime)
Used to resume a
InProgressFileWriter from a InProgressFileWriter.InProgressFileRecoverable . |
InProgressFileWriter<IN,BucketID> openNewInProgressFile(BucketID bucketID, Path path, long creationTime) throws IOException
InProgressFileWriter
.bucketID
- the id of the bucket this writer is writing to.path
- the path this writer will write to.creationTime
- the creation time of the file.InProgressFileWriter
IOException
- Thrown if creating a writer fails.InProgressFileWriter<IN,BucketID> resumeInProgressFileFrom(BucketID bucketID, InProgressFileWriter.InProgressFileRecoverable inProgressFileSnapshot, long creationTime) throws IOException
InProgressFileWriter
from a InProgressFileWriter.InProgressFileRecoverable
.bucketID
- the id of the bucket this writer is writing to.inProgressFileSnapshot
- the state of the part file.creationTime
- the creation time of the file.InProgressFileWriter
IOException
- Thrown if resuming a writer fails.WriterProperties getProperties()
BucketWriter
BucketWriter.PendingFile recoverPendingFile(InProgressFileWriter.PendingFileRecoverable pendingFileRecoverable) throws IOException
pendingFileRecoverable
- The handle with the recovery information.IOException
- Thrown if recovering a pending file fails.boolean cleanupInProgressFileRecoverable(InProgressFileWriter.InProgressFileRecoverable inProgressFileRecoverable) throws IOException
NOTE: This operation should not throw an exception, but return false if the cleanup did not happen for any reason.
inProgressFileRecoverable
- the InProgressFileWriter.InProgressFileRecoverable
whose state we want to clean-up.true
if the resources were successfully freed, false
otherwise (e.g.
the file to be deleted was not there for any reason - already deleted or never created).IOException
- if an I/O error occursCopyright © 2014–2021 The Apache Software Foundation. All rights reserved.