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>
TheBucketuses theInProgressFileWriterto write element to a part file.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceInProgressFileWriter.InProgressFileRecoverableA handle can be used to recover in-progress file..static interfaceInProgressFileWriter.PendingFileRecoverableThe 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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description InProgressFileWriter.PendingFileRecoverablecloseForCommit()Closes the writer and gets theInProgressFileWriter.PendingFileRecoverableof the written compacting file.voiddispose()Dispose the part file.InProgressFileWriter.InProgressFileRecoverablepersist()default voidwrite(IN element)Write an element to the compacting file.voidwrite(IN element, long currentTime)Write an element to the part file.-
Methods inherited from interface org.apache.flink.streaming.api.functions.sink.filesystem.PartFileInfo
getBucketId, getCreationTime, getLastUpdateTime, getSize
-
-
-
-
Method Detail
-
write
void write(IN element, long currentTime) throws IOException
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
InProgressFileWriter.InProgressFileRecoverable persist() throws IOException
- Returns:
- The state of the current part file.
- Throws:
IOException- Thrown if persisting the part file fails.
-
closeForCommit
InProgressFileWriter.PendingFileRecoverable closeForCommit() throws IOException
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
default void write(IN element) throws IOException
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.
-
-