Package org.apache.beam.sdk.io
Interface FileIO.Sink<ElementT>
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AvroIO.Sink,ParquetIO.Sink,TextIO.Sink,TFRecordIO.Sink,ThriftIO.Sink,XmlIO.Sink
- Enclosing class:
FileIO
Specifies how to write elements to individual files in
FileIO.write() and FileIO.writeDynamic(). A new instance of FileIO.Sink is created for every file being written.-
Method Summary
Modifier and TypeMethodDescriptionvoidflush()Flushes the buffered state (if any) before the channel is closed.voidopen(WritableByteChannel channel) Initializes writing to the given channel.voidAppends a single element to the file.
-
Method Details
-
open
Initializes writing to the given channel. Will be invoked once on a givenFileIO.Sinkinstance.- Throws:
IOException
-
write
Appends a single element to the file. May be invoked zero or more times.- Throws:
IOException
-
flush
Flushes the buffered state (if any) before the channel is closed. Does not need to close the channel. Will be invoked once.- Throws:
IOException
-