/** * register a class * * @param kryo * @param s name of a class - might not exist * @param handled Set of classes already handles */ protected void doRegistration(final Kryo kryo, final Class pC) { if (kryo != null) { kryo.register(pC); // also register arrays of that class Class arrayType = Array.newInstance(pC, 0).getClass(); kryo.register(arrayType); } }
/** * do the real work of registering all classes * * @param kryo */ @Override public void registerClasses(@Nonnull Kryo kryo) { kryo.register(Object[].class); kryo.register(scala.Tuple2[].class); doRegistration(kryo, "scala.collection.mutable.WrappedArray$ofRef"); doRegistration(kryo, "com.nielsen.perfengg.SparkD"); // and many more similar nines }