IN - The type of input elements.BucketID - The type of ids for the buckets, as returned by the BucketAssigner.@Internal public class BulkBucketWriter<IN,BucketID> extends Object
BulkPartWriters.BucketWriter.PendingFile| Constructor and Description |
|---|
BulkBucketWriter(org.apache.flink.core.fs.RecoverableWriter recoverableWriter,
org.apache.flink.api.common.serialization.BulkWriter.Factory<IN> writerFactory) |
| 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> |
openNew(BucketID bucketId,
org.apache.flink.core.fs.RecoverableFsDataOutputStream stream,
org.apache.flink.core.fs.Path path,
long creationTime) |
InProgressFileWriter<IN,BucketID> |
openNewInProgressFile(BucketID bucketID,
org.apache.flink.core.fs.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> |
resumeFrom(BucketID bucketId,
org.apache.flink.core.fs.RecoverableFsDataOutputStream stream,
org.apache.flink.core.fs.RecoverableWriter.ResumeRecoverable resumable,
long creationTime) |
InProgressFileWriter<IN,BucketID> |
resumeInProgressFileFrom(BucketID bucketID,
InProgressFileWriter.InProgressFileRecoverable inProgressFileRecoverable,
long creationTime)
Used to resume a
InProgressFileWriter from a InProgressFileWriter.InProgressFileRecoverable. |
public BulkBucketWriter(org.apache.flink.core.fs.RecoverableWriter recoverableWriter,
org.apache.flink.api.common.serialization.BulkWriter.Factory<IN> writerFactory)
throws IOException
IOExceptionpublic InProgressFileWriter<IN,BucketID> resumeFrom(BucketID bucketId, org.apache.flink.core.fs.RecoverableFsDataOutputStream stream, org.apache.flink.core.fs.RecoverableWriter.ResumeRecoverable resumable, long creationTime) throws IOException
IOExceptionpublic InProgressFileWriter<IN,BucketID> openNew(BucketID bucketId, org.apache.flink.core.fs.RecoverableFsDataOutputStream stream, org.apache.flink.core.fs.Path path, long creationTime) throws IOException
IOExceptionpublic InProgressFileWriter<IN,BucketID> openNewInProgressFile(BucketID bucketID, org.apache.flink.core.fs.Path path, long creationTime) throws IOException
BucketWriterInProgressFileWriter.openNewInProgressFile in interface BucketWriter<IN,BucketID>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.InProgressFileWriterIOException - Thrown if creating a writer fails.public InProgressFileWriter<IN,BucketID> resumeInProgressFileFrom(BucketID bucketID, InProgressFileWriter.InProgressFileRecoverable inProgressFileRecoverable, long creationTime) throws IOException
BucketWriterInProgressFileWriter from a InProgressFileWriter.InProgressFileRecoverable.resumeInProgressFileFrom in interface BucketWriter<IN,BucketID>bucketID - the id of the bucket this writer is writing to.inProgressFileRecoverable - the state of the part file.creationTime - the creation time of the file.InProgressFileWriterIOException - Thrown if resuming a writer fails.public BucketWriter.PendingFile recoverPendingFile(InProgressFileWriter.PendingFileRecoverable pendingFileRecoverable) throws IOException
BucketWriterrecoverPendingFile in interface BucketWriter<IN,BucketID>pendingFileRecoverable - The handle with the recovery information.IOException - Thrown if recovering a pending file fails.public boolean cleanupInProgressFileRecoverable(InProgressFileWriter.InProgressFileRecoverable inProgressFileRecoverable) throws IOException
BucketWriterNOTE: This operation should not throw an exception, but return false if the cleanup did not happen for any reason.
cleanupInProgressFileRecoverable in interface BucketWriter<IN,BucketID>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 occurspublic WriterProperties getProperties()
getProperties in interface BucketWriter<IN,BucketID>BucketWriterCopyright © 2014–2021 The Apache Software Foundation. All rights reserved.