Class FileCommitter
- java.lang.Object
-
- org.apache.flink.connector.file.sink.committer.FileCommitter
-
- All Implemented Interfaces:
AutoCloseable
,Committer<FileSinkCommittable>
@Internal public class FileCommitter extends Object implements Committer<FileSinkCommittable>
Committer implementation forFileSink
.This committer is responsible for taking staged part-files, i.e. part-files in "pending" state, created by the
FileWriter
and commit them, or put them in "finished" state and ready to be consumed by downstream applications or systems.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.api.connector.sink2.Committer
Committer.CommitRequest<CommT>
-
-
Constructor Summary
Constructors Constructor Description FileCommitter(BucketWriter<?,?> bucketWriter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
commit(Collection<Committer.CommitRequest<FileSinkCommittable>> requests)
Commit the given list ofCommitter
.
-
-
-
Constructor Detail
-
FileCommitter
public FileCommitter(BucketWriter<?,?> bucketWriter)
-
-
Method Detail
-
commit
public void commit(Collection<Committer.CommitRequest<FileSinkCommittable>> requests) throws IOException, InterruptedException
Description copied from interface:Committer
Commit the given list ofCommitter
.- Specified by:
commit
in interfaceCommitter<FileSinkCommittable>
- Parameters:
requests
- A list of commit requests staged by the sink writer.- Throws:
IOException
- for reasons that may yield a complete restart of the job.InterruptedException
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
-