public abstract static class AvroIO.Sink<ElementT>
extends java.lang.Object
implements org.apache.beam.sdk.io.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() |
void |
open(java.nio.channels.WritableByteChannel channel) |
AvroIO.Sink<ElementT> |
withCodec(org.apache.avro.file.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) |
public AvroIO.Sink<ElementT> withMetadata(java.util.Map<java.lang.String,java.lang.Object> metadata)
public AvroIO.Sink<ElementT> withCodec(org.apache.avro.file.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
open
in interface org.apache.beam.sdk.io.FileIO.Sink<ElementT>
java.io.IOException
public void write(ElementT element) throws java.io.IOException
write
in interface org.apache.beam.sdk.io.FileIO.Sink<ElementT>
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface org.apache.beam.sdk.io.FileIO.Sink<ElementT>
java.io.IOException