title: Map of Avro objects serialization with Kryo - Spark
body: <p>I have a question about specific avro serialization with kryo. Sorry if this question seems redundant but I didn't find a simple answer.</p>
  
  <p>I've configured Spark to run with Kryo and it works well : Avro generated classes are well serialized using a custom KryoRegistrator class. I use <code>twitter.chill-avro</code> package too.</p>
  
  <pre><code>class AvroClassRegistrator extends KryoRegistrator {
    override def registerClasses(kryo: Kryo) {
      kryo.register(classOf[MyAvroClass], AvroSerializer.SpecificRecordSerializer[MyAvroClass])
  }
  </code></pre>
  
  <p>Nevertheless, when I try to serialize a <code>Map[String, MyAvroClass]</code>, the only way to make the serialization work is to extends <code>MyAvroClass</code> with <code>java.io.Serializable</code>.</p>
  
  <p>Could somebody explain me what really happens, and tell me how to register this  <code>Map[..., AvroClass]</code> with kryo ?</p>
  
  <p>Thank you</p>