Package io.strmprivacy.driver.serializer
Class AvroSerializer
- java.lang.Object
-
- io.strmprivacy.driver.serializer.AvroSerializer
-
- All Implemented Interfaces:
EventSerializer
public class AvroSerializer extends java.lang.Object implements EventSerializer
-
-
Constructor Summary
Constructors Constructor Description AvroSerializer(org.apache.avro.Schema writerSchema)construct an instance with a reader and a writer schema
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]serialize(java.lang.Object event)serialize a GenericRecord or something compatible (like DemoUserV1 in the tests)voidtearDown()
-
-
-
Method Detail
-
serialize
public byte[] serialize(java.lang.Object event) throws java.lang.IllegalStateException, java.io.IOExceptionserialize a GenericRecord or something compatible (like DemoUserV1 in the tests)- Specified by:
serializein interfaceEventSerializer- Parameters:
event- the avro record- Returns:
- a bytes representation of the record contents.
- Throws:
java.lang.IllegalStateException- problem with the Avro serialization.java.io.IOException
-
tearDown
public void tearDown()
-
-