I have a class that implements a custom Kryo serializer by implementing the read() and write() methods from com.esotericsoftware.kryo.Seriali
Create your own KryoRegistrator with this custom serializer registered:
package com.acme
class MyRegistrator extends KryoRegistrator {
override def registerClasses(kryo: Kryo) {
kryo.register(classOf[A], new CustomASerializer())
}
}
Then, set spark.kryo.registrator to your registrator's fully-qualified name, e.g. com.acme.MyRegistrator:
val conf = new SparkConf()
conf.set("spark.kryo.registrator", "com.acme.KryoRegistrator")