T
- the type to be serializedpublic class RegistryAvroSerializationSchema<T> extends AvroSerializationSchema<T>
SerializationSchema.InitializationContext
Modifier and Type | Field and Description |
---|---|
protected SchemaCoder |
schemaCoder |
Constructor and Description |
---|
RegistryAvroSerializationSchema(Class<T> recordClazz,
org.apache.avro.Schema schema,
SchemaCoder.SchemaCoderProvider schemaCoderProvider)
Creates a Avro serialization schema.
|
RegistryAvroSerializationSchema(Class<T> recordClazz,
org.apache.avro.Schema schema,
SchemaCoder.SchemaCoderProvider schemaCoderProvider,
AvroFormatOptions.AvroEncoding encoding)
Creates a Avro serialization schema.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkAvroInitialized() |
boolean |
equals(Object o) |
static RegistryAvroSerializationSchema<org.apache.avro.generic.GenericRecord> |
forGeneric(org.apache.avro.Schema schema,
SchemaCoder.SchemaCoderProvider schemaCoderProvider) |
static RegistryAvroSerializationSchema<org.apache.avro.generic.GenericRecord> |
forGeneric(org.apache.avro.Schema schema,
SchemaCoder.SchemaCoderProvider schemaCoderProvider,
AvroFormatOptions.AvroEncoding encoding) |
static <T extends org.apache.avro.specific.SpecificRecord> |
forSpecific(Class<T> tClass,
SchemaCoder.SchemaCoderProvider schemaCoderProvider) |
static <T extends org.apache.avro.specific.SpecificRecord> |
forSpecific(Class<T> tClass,
SchemaCoder.SchemaCoderProvider schemaCoderProvider,
AvroFormatOptions.AvroEncoding encoding) |
int |
hashCode() |
byte[] |
serialize(T object)
Serializes the incoming element to a specified type.
|
forGeneric, forGeneric, forSpecific, forSpecific, getDatumWriter, getEncoder, getOutputStream, getSchema, open
protected SchemaCoder schemaCoder
public RegistryAvroSerializationSchema(Class<T> recordClazz, org.apache.avro.Schema schema, SchemaCoder.SchemaCoderProvider schemaCoderProvider)
recordClazz
- class to serialize. Should be either SpecificRecord
or GenericRecord
.schema
- writers's Avro schema. Should be provided if recordClazz is GenericRecord
schemaCoderProvider
- schema provider that allows instantiation of SchemaCoder
that will be used for schema writingpublic RegistryAvroSerializationSchema(Class<T> recordClazz, org.apache.avro.Schema schema, SchemaCoder.SchemaCoderProvider schemaCoderProvider, AvroFormatOptions.AvroEncoding encoding)
recordClazz
- class to serialize. Should be either SpecificRecord
or GenericRecord
.schema
- writers's Avro schema. Should be provided if recordClazz is GenericRecord
schemaCoderProvider
- schema provider that allows instantiation of SchemaCoder
that will be used for schema writingencoding
- Avro serialization approach to use.public static <T extends org.apache.avro.specific.SpecificRecord> RegistryAvroSerializationSchema<T> forSpecific(Class<T> tClass, SchemaCoder.SchemaCoderProvider schemaCoderProvider)
public static <T extends org.apache.avro.specific.SpecificRecord> RegistryAvroSerializationSchema<T> forSpecific(Class<T> tClass, SchemaCoder.SchemaCoderProvider schemaCoderProvider, AvroFormatOptions.AvroEncoding encoding)
public static RegistryAvroSerializationSchema<org.apache.avro.generic.GenericRecord> forGeneric(org.apache.avro.Schema schema, SchemaCoder.SchemaCoderProvider schemaCoderProvider)
public static RegistryAvroSerializationSchema<org.apache.avro.generic.GenericRecord> forGeneric(org.apache.avro.Schema schema, SchemaCoder.SchemaCoderProvider schemaCoderProvider, AvroFormatOptions.AvroEncoding encoding)
public byte[] serialize(T object)
SerializationSchema
serialize
in interface SerializationSchema<T>
serialize
in class AvroSerializationSchema<T>
object
- The incoming element to be serializedprotected void checkAvroInitialized()
checkAvroInitialized
in class AvroSerializationSchema<T>
public boolean equals(Object o)
equals
in class AvroSerializationSchema<T>
public int hashCode()
hashCode
in class AvroSerializationSchema<T>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.