public class AvroConfluentCodec<T> extends Object implements Codec<T>
Modifier and Type | Field and Description |
---|---|
protected io.confluent.kafka.schemaregistry.client.SchemaRegistryClient |
client |
protected static int |
DEFAULT_IDENTITY_MAP_CAPACITY |
protected org.apache.avro.message.RawMessageEncoder<T> |
encoder |
protected static int |
ID_SIZE |
protected static byte |
MAGIC_BYTE |
protected Class<T> |
messageClass |
static String |
NAME |
protected org.apache.avro.Schema |
schema |
protected int |
schemaId |
protected String |
schemaName |
protected io.confluent.kafka.serializers.KafkaAvroSerializer |
serializer |
Constructor and Description |
---|
AvroConfluentCodec(Class<T> messageClass,
String schemaRegistryUrls)
Create an AvroConfluent codec
|
Modifier and Type | Method and Description |
---|---|
T |
decode(byte[] data)
Decodes the byte array returns an object.
|
byte[] |
encode(T object)
Encodes the object returns a byte array representation.
|
String |
getName()
Returns the codec name
|
public static final String NAME
protected static final byte MAGIC_BYTE
protected static final int ID_SIZE
protected static final int DEFAULT_IDENTITY_MAP_CAPACITY
protected final Class<T> messageClass
protected final org.apache.avro.Schema schema
protected final int schemaId
protected final String schemaName
protected final io.confluent.kafka.serializers.KafkaAvroSerializer serializer
protected final io.confluent.kafka.schemaregistry.client.SchemaRegistryClient client
public AvroConfluentCodec(Class<T> messageClass, String schemaRegistryUrls)
messageClass
- the class to encode and decodeschemaRegistryUrls
- a comma separated list of Confluent Schema Registry URLCopyright © 2019 Nuxeo. All rights reserved.