Class DefaultSerializer
java.lang.Object
com.linkedin.venice.serialization.DefaultSerializer
- All Implemented Interfaces:
VeniceKafkaSerializer<byte[]>,Closeable,AutoCloseable
Default Kafka VeniceKafkaSerializer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close this serializer.voidConfigure this class.byte[]deserialize(String topic, byte[] bytes) Create an object from an array of bytesbyte[]Construct an array of bytes from the given object
-
Constructor Details
-
DefaultSerializer
public DefaultSerializer()
-
-
Method Details
-
close
public void close()Description copied from interface:VeniceKafkaSerializerClose this serializer. This method has to be idempotent if the serializer is used in KafkaProducer because it might be called multiple times.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceVeniceKafkaSerializer<byte[]>
-
configure
Description copied from interface:VeniceKafkaSerializerConfigure this class.- Specified by:
configurein interfaceVeniceKafkaSerializer<byte[]>- Parameters:
configMap- configs in key/value pairsisKey- whether is for key or value
-
serialize
Description copied from interface:VeniceKafkaSerializerConstruct an array of bytes from the given object- Specified by:
serializein interfaceVeniceKafkaSerializer<byte[]>- Parameters:
topic- Topic to which the object belongs.bytes- The object- Returns:
- The bytes taken from the object
-
deserialize
Description copied from interface:VeniceKafkaSerializerCreate an object from an array of bytes- Specified by:
deserializein interfaceVeniceKafkaSerializer<byte[]>- Parameters:
topic- Topic to which the array of bytes belongs.bytes- An array of bytes with the objects data- Returns:
- A java object serialzed from the bytes
-