Package org.nuxeo.runtime.codec
Class AvroRecordCodec<T extends Record>
java.lang.Object
org.nuxeo.runtime.codec.AvroRecordCodec<T>
- All Implemented Interfaces:
Codec<T>
Instead of having an Avro Record envelop that contains a data encoded in Avro, this structure is a flat Avro message
joining schemas of the Record and data.
This encoding can then be read by any Confluent Avro reader.
- Since:
- 11.4
-
Field Summary
Modifier and TypeFieldDescriptionprotected final io.confluent.kafka.schemaregistry.client.SchemaRegistryClient
protected final org.apache.avro.message.RawMessageEncoder<org.apache.avro.generic.GenericRecord>
protected final org.apache.avro.message.RawMessageDecoder<org.apache.avro.generic.GenericRecord>
protected final org.apache.avro.message.RawMessageEncoder<org.apache.avro.generic.GenericRecord>
protected final org.apache.avro.Schema
protected final int
static final String
static final String
static final String
static final String
static final String
protected final org.apache.avro.Schema
protected final int
protected final io.confluent.kafka.serializers.KafkaAvroSerializer
-
Constructor Summary
ConstructorDescriptionAvroRecordCodec
(String messageClassName, String schemaRegistryUrls) AvroRecordCodec
(org.apache.avro.Schema messageSchema, String schemaRegistryUrls) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.avro.Schema
addRecordFieldsToSchema
(org.apache.avro.Schema schema) protected org.apache.avro.generic.GenericRecord
createRecordFromMessage
(org.apache.avro.generic.GenericRecord message) decode
(byte[] data) Decodes the byte array returns an object.byte[]
Encodes the object returns a byte array representation.getName()
Returns the codec name
-
Field Details
-
NAME
- See Also:
-
RECORD_KEY
- See Also:
-
RECORD_WATERMARK
- See Also:
-
RECORD_TIMESTAMP
- See Also:
-
RECORD_FLAGS
- See Also:
-
schema
protected final org.apache.avro.Schema schema -
schemaId
protected final int schemaId -
messageSchema
protected final org.apache.avro.Schema messageSchema -
messageSchemaId
protected final int messageSchemaId -
messageDecoder
protected final org.apache.avro.message.RawMessageDecoder<org.apache.avro.generic.GenericRecord> messageDecoder -
messageEncoder
protected final org.apache.avro.message.RawMessageEncoder<org.apache.avro.generic.GenericRecord> messageEncoder -
serializer
protected final io.confluent.kafka.serializers.KafkaAvroSerializer serializer -
encoder
protected final org.apache.avro.message.RawMessageEncoder<org.apache.avro.generic.GenericRecord> encoder -
client
protected final io.confluent.kafka.schemaregistry.client.SchemaRegistryClient client
-
-
Constructor Details
-
AvroRecordCodec
-
AvroRecordCodec
public AvroRecordCodec(String messageClassName, String schemaRegistryUrls) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
-
Method Details
-
getName
Description copied from interface:Codec
Returns the codec name -
encode
Description copied from interface:Codec
Encodes the object returns a byte array representation. -
createRecordFromMessage
protected org.apache.avro.generic.GenericRecord createRecordFromMessage(org.apache.avro.generic.GenericRecord message) -
addRecordFieldsToSchema
protected org.apache.avro.Schema addRecordFieldsToSchema(org.apache.avro.Schema schema) -
decode
Description copied from interface:Codec
Decodes the byte array returns an object.
-