Interface InProgressFileWriter<IN,BucketID>
- All Superinterfaces:
CompactingFileWriter,PartFileInfo<BucketID>,RecordWiseCompactingFileWriter<IN>
- All Known Implementing Classes:
AbstractPartFileWriter,OutputStreamBasedPartFileWriter,RowWisePartWriter
@Internal
public interface InProgressFileWriter<IN,BucketID>
extends PartFileInfo<BucketID>, RecordWiseCompactingFileWriter<IN>
The
Bucket uses the InProgressFileWriter to write element to a part file.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA handle can be used to recover in-progress file..static interfaceThe handle can be used to recover pending file.Nested classes/interfaces inherited from interface org.apache.flink.streaming.api.functions.sink.filesystem.CompactingFileWriter
CompactingFileWriter.Type -
Method Summary
Modifier and TypeMethodDescriptionCloses the writer and gets theInProgressFileWriter.PendingFileRecoverableof the written compacting file.voiddispose()Dispose the part file.persist()default voidWrite an element to the compacting file.voidWrite an element to the part file.Methods inherited from interface org.apache.flink.streaming.api.functions.sink.filesystem.PartFileInfo
getBucketId, getCreationTime, getLastUpdateTime, getSize
-
Method Details
-
write
Write an element to the part file.- Parameters:
element- the element to be written.currentTime- the writing time.- Throws:
IOException- Thrown if writing the element fails.
-
persist
- Returns:
- The state of the current part file.
- Throws:
IOException- Thrown if persisting the part file fails.
-
closeForCommit
Description copied from interface:CompactingFileWriterCloses the writer and gets theInProgressFileWriter.PendingFileRecoverableof the written compacting file.- Specified by:
closeForCommitin interfaceCompactingFileWriter- Returns:
- The state of the pending part file.
Bucketuses this to commit the pending file. - Throws:
IOException- Thrown if an I/O error occurs.
-
dispose
void dispose()Dispose the part file. -
write
Description copied from interface:RecordWiseCompactingFileWriterWrite an element to the compacting file.- Specified by:
writein interfaceRecordWiseCompactingFileWriter<IN>- Parameters:
element- the element to be written.- Throws:
IOException- Thrown if writing the element fails.
-