Class AvroDatumFactory<T>
- java.lang.Object
-
- org.apache.beam.sdk.extensions.avro.io.AvroDatumFactory<T>
-
- All Implemented Interfaces:
java.io.Serializable,AvroSink.DatumWriterFactory<T>,AvroSource.DatumReaderFactory<T>
- Direct Known Subclasses:
AvroDatumFactory.GenericDatumFactory,AvroDatumFactory.ReflectDatumFactory,AvroDatumFactory.SpecificDatumFactory
public abstract class AvroDatumFactory<T> extends java.lang.Object implements AvroSource.DatumReaderFactory<T>, AvroSink.DatumWriterFactory<T>
CreateDatumReaderandDatumWriterfor given schemas.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAvroDatumFactory.GenericDatumFactorySpecializedAvroDatumFactoryforGenericRecord.static classAvroDatumFactory.ReflectDatumFactory<T>SpecializedAvroDatumFactoryfor java classes transforming to avro through reflection.static classAvroDatumFactory.SpecificDatumFactory<T>SpecializedAvroDatumFactoryforSpecificRecord.
-
Constructor Summary
Constructors Constructor Description AvroDatumFactory(java.lang.Class<T> type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(@Nullable java.lang.Object other)static AvroDatumFactory<org.apache.avro.generic.GenericRecord>generic()Returns anAvroDatumFactoryinstance for GenericRecord.java.lang.Class<T>getType()Returns the type for the datum factory.inthashCode()static <T> AvroDatumFactory<T>of(java.lang.Class<T> type)Returns anAvroDatumFactoryinstance for the provided element type.static <T> AvroDatumFactory<T>of(java.lang.Class<T> type, boolean useReflectApi)Returns anAvroDatumFactoryinstance for the provided element type respecting Avro's Reflect* or Specific* suite for encoding and decoding.static <T> AvroDatumFactory<T>reflect(java.lang.Class<T> type)Returns anAvroDatumFactoryinstance for the provided element type respecting Avro's Reflect* suite for encoding and decoding.static <T> AvroDatumFactory<T>specific(java.lang.Class<T> type)Returns anAvroDatumFactoryinstance for the provided element type respecting Avro's Specific* suite for encoding and decoding.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.beam.sdk.extensions.avro.io.AvroSink.DatumWriterFactory
apply
-
Methods inherited from interface org.apache.beam.sdk.extensions.avro.io.AvroSource.DatumReaderFactory
apply
-
-
-
-
Field Detail
-
type
protected final java.lang.Class<T> type
-
-
Constructor Detail
-
AvroDatumFactory
public AvroDatumFactory(java.lang.Class<T> type)
-
-
Method Detail
-
generic
public static AvroDatumFactory<org.apache.avro.generic.GenericRecord> generic()
Returns anAvroDatumFactoryinstance for GenericRecord.
-
specific
public static <T> AvroDatumFactory<T> specific(java.lang.Class<T> type)
Returns anAvroDatumFactoryinstance for the provided element type respecting Avro's Specific* suite for encoding and decoding.
-
reflect
public static <T> AvroDatumFactory<T> reflect(java.lang.Class<T> type)
Returns anAvroDatumFactoryinstance for the provided element type respecting Avro's Reflect* suite for encoding and decoding.
-
of
public static <T> AvroDatumFactory<T> of(java.lang.Class<T> type)
Returns anAvroDatumFactoryinstance for the provided element type.
-
of
public static <T> AvroDatumFactory<T> of(java.lang.Class<T> type, boolean useReflectApi)
Returns anAvroDatumFactoryinstance for the provided element type respecting Avro's Reflect* or Specific* suite for encoding and decoding.
-
getType
public java.lang.Class<T> getType()
Returns the type for the datum factory.
-
equals
public boolean equals(@Nullable java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-