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 protected
DataWriter(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 ofFieldMetrics
that this MetricsAwareDatumWriter keeps track of.void
setSchema(org.apache.avro.Schema schema)
void
write(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:
setSchema
in interfaceorg.apache.avro.io.DatumWriter<T>
-
write
public void write(T datum, org.apache.avro.io.Encoder out) throws java.io.IOException
- Specified by:
write
in 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:MetricsAwareDatumWriter
Returns a stream ofFieldMetrics
that this MetricsAwareDatumWriter keeps track of.- Specified by:
metrics
in interfaceMetricsAwareDatumWriter<T>
-
-