Interface VeniceKafkaSerializer<T>
- Type Parameters:
T- The type of the object that is mapped by this serializer
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
ChunkedKeySuffixSerializer,ChunkedValueManifestSerializer,DefaultSerializer,InternalAvroSpecificSerializer,KafkaKeySerializer,KafkaValueSerializer,OptimizedKafkaValueSerializer,StringSerializer,VeniceAvroKafkaSerializer
Map objects to byte arrays and back again
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close this serializer.voidConfigure this class.deserialize(String topic, byte[] bytes) Create an object from an array of bytesbyte[]Construct an array of bytes from the given object
-
Method Details
-
close
void close()Close 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
-
configure
Configure this class.- Parameters:
configMap- configs in key/value pairsisKey- whether is for key or value
-
serialize
Construct an array of bytes from the given object- Parameters:
topic- Topic to which the object belongs.object- The object- Returns:
- The bytes taken from the object
-
deserialize
Create an object from an array of bytes- 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
-