public abstract static class AvroIO.Sink<ElementT> extends java.lang.Object implements FileIO.Sink<ElementT>
AvroIO.sink(java.lang.Class<ElementT>) and AvroIO.sinkViaGenericRecords(org.apache.avro.Schema, org.apache.beam.sdk.extensions.avro.io.AvroIO.RecordFormatter<ElementT>).| Constructor and Description | 
|---|
Sink()  | 
| Modifier and Type | Method and 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. 
 | 
AvroIO.Sink<ElementT> | 
withCodec(CodecFactory codec)
Specifies to use the given  
CodecFactory for each generated file. | 
AvroIO.Sink<ElementT> | 
withDatumWriterFactory(AvroSink.DatumWriterFactory<ElementT> datumWriterFactory)
Sets a custom  
AvroSource.DatumReaderFactory for writing. | 
AvroIO.Sink<ElementT> | 
withMetadata(java.util.Map<java.lang.String,java.lang.Object> metadata)
Specifies to put the given metadata into each generated file. 
 | 
void | 
write(ElementT element)
Appends a single element to the file. 
 | 
public AvroIO.Sink<ElementT> withMetadata(java.util.Map<java.lang.String,java.lang.Object> metadata)
public AvroIO.Sink<ElementT> withCodec(CodecFactory codec)
CodecFactory for each generated file. By default, CodecFactory.snappyCodec().public AvroIO.Sink<ElementT> withDatumWriterFactory(AvroSink.DatumWriterFactory<ElementT> datumWriterFactory)
AvroSource.DatumReaderFactory for writing.public void open(java.nio.channels.WritableByteChannel channel)
          throws java.io.IOException
FileIO.SinkFileIO.Sink
 instance.open in interface FileIO.Sink<ElementT>java.io.IOExceptionpublic void write(ElementT element) throws java.io.IOException
FileIO.Sinkwrite in interface FileIO.Sink<ElementT>java.io.IOExceptionpublic void flush()
           throws java.io.IOException
FileIO.Sinkflush in interface FileIO.Sink<ElementT>java.io.IOException