Avro, mail # user - General-Purpose Serialization and Deserialization for Avro-Generated SpecificRecords
General-Purpose Serialization and Deserialization for Avro-Generated SpecificRecords
Gary Steelman 2014-02-19, 00:22
Here's my use case: I've got a bunch of different Java objects generated from Avro schema files. So the class definition headers look something like this: public class MyObject extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord. I've got many other types than MyObject too. I need to write a method which can serialize (from MyObject or another class to byte) and deserialize (from byte to MyObject or another class) in memory (not writing to disk).
I couldn't figure out how to write one method to handle it for SpecificRecord, so I tired serializing/deserializing these things as GenericRecord instead: