Class StringSerializer
java.lang.Object
com.linkedin.venice.serialization.StringSerializer
- All Implemented Interfaces:
VeniceKafkaSerializer<String>,Closeable,AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close this serializer.voidConfigure this class.deserialize(String topic, byte[] byteArray) Create an object from an array of bytesbyte[]Construct an array of bytes from the given object
-
Constructor Details
-
StringSerializer
public StringSerializer()
-
-
Method Details
-
deserialize
Description copied from interface:VeniceKafkaSerializerCreate an object from an array of bytes- Specified by:
deserializein interfaceVeniceKafkaSerializer<String>- Parameters:
topic- Topic to which the array of bytes belongs.byteArray- An array of bytes with the objects data- Returns:
- A java object serialzed from the bytes
-
close
public 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- Specified by:
closein interfaceVeniceKafkaSerializer<String>
-
configure
Configure this class.- Specified by:
configurein interfaceVeniceKafkaSerializer<String>- 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<String>- Parameters:
topic- Topic to which the object belongs.string- The object- Returns:
- The bytes taken from the object
-