Package org.apache.beam.sdk.io
Class TextIO.Sink
- java.lang.Object
-
- org.apache.beam.sdk.io.TextIO.Sink
-
- All Implemented Interfaces:
java.io.Serializable
,FileIO.Sink<java.lang.String>
- Enclosing class:
- TextIO
public abstract static class TextIO.Sink extends java.lang.Object implements FileIO.Sink<java.lang.String>
Implementation ofTextIO.sink()
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Sink()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
flush()
Flushes the buffered state (if any) before the channel is closed.void
open(java.nio.channels.WritableByteChannel channel)
Initializes writing to the given channel.TextIO.Sink
withFooter(java.lang.String footer)
TextIO.Sink
withHeader(java.lang.String header)
void
write(java.lang.String element)
Appends a single element to the file.
-
-
-
Method Detail
-
withHeader
public TextIO.Sink withHeader(java.lang.String header)
-
withFooter
public TextIO.Sink withFooter(java.lang.String footer)
-
open
public void open(java.nio.channels.WritableByteChannel channel) throws java.io.IOException
Description copied from interface:FileIO.Sink
Initializes writing to the given channel. Will be invoked once on a givenFileIO.Sink
instance.- Specified by:
open
in interfaceFileIO.Sink<java.lang.String>
- Throws:
java.io.IOException
-
write
public void write(java.lang.String element) throws java.io.IOException
Description copied from interface:FileIO.Sink
Appends a single element to the file. May be invoked zero or more times.- Specified by:
write
in interfaceFileIO.Sink<java.lang.String>
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
Description copied from interface:FileIO.Sink
Flushes the buffered state (if any) before the channel is closed. Does not need to close the channel. Will be invoked once.- Specified by:
flush
in interfaceFileIO.Sink<java.lang.String>
- Throws:
java.io.IOException
-
-