Package org.apache.iceberg.data.avro
Class DataWriter<T>
- java.lang.Object
-
- org.apache.iceberg.data.avro.DataWriter<T>
-
- All Implemented Interfaces:
org.apache.avro.io.DatumWriter<T>,MetricsAwareDatumWriter<T>
public class DataWriter<T> extends java.lang.Object implements MetricsAwareDatumWriter<T>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDataWriter(org.apache.avro.Schema schema)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <D> DataWriter<D>create(org.apache.avro.Schema schema)protected ValueWriter<?>createStructWriter(java.util.List<ValueWriter<?>> fields)java.util.stream.Stream<FieldMetrics>metrics()Returns a stream ofFieldMetricsthat this MetricsAwareDatumWriter keeps track of.voidsetSchema(org.apache.avro.Schema schema)voidwrite(T datum, org.apache.avro.io.Encoder out)
-
-
-
Method Detail
-
create
public static <D> DataWriter<D> create(org.apache.avro.Schema schema)
-
setSchema
public void setSchema(org.apache.avro.Schema schema)
- Specified by:
setSchemain interfaceorg.apache.avro.io.DatumWriter<T>
-
write
public void write(T datum, org.apache.avro.io.Encoder out) throws java.io.IOException
- Specified by:
writein interfaceorg.apache.avro.io.DatumWriter<T>- Throws:
java.io.IOException
-
createStructWriter
protected ValueWriter<?> createStructWriter(java.util.List<ValueWriter<?>> fields)
-
metrics
public java.util.stream.Stream<FieldMetrics> metrics()
Description copied from interface:MetricsAwareDatumWriterReturns a stream ofFieldMetricsthat this MetricsAwareDatumWriter keeps track of.- Specified by:
metricsin interfaceMetricsAwareDatumWriter<T>
-
-