@Override
    public byte[] toBytes(Object o) {
      GenericRecord record = (GenericRecord) o;
      try {
        return encodeAvroGenericRecord(schema, record);
      } catch (IOException e) {
        throw new SamzaException("Unable to serialize the record", e);
      }
    }
Avro SerDe that can be used to serialize or deserialize the avro {@link GenericRecord}.
samza-tools/src/main/java/org/apache/samza/tools/avro/AvroSerDeFactory.java