public static Kryo createNewKryo() {
    KryoWithHooks kryo = new KryoWithHooks();

    // references was true by default in kryo4, so we need to set this here for unchanged behavior
    kryo.setReferences(true);
    // registrationRequired=false lets kryo users skip the kryo.register call for all serialized classes
    kryo.setRegistrationRequired(false);

    kryo.register(java.sql.Date.class, new SqlDateSerializer());
    kryo.register(java.sql.Timestamp.class, new TimestampSerializer());
    kryo.register(TimestampTZ.class, new TimestampTZSerializer());
    kryo.register(Path.class, new PathSerializer());
    kryo.register(Arrays.asList("").getClass(), new ArraysAsListSerializer());
    kryo.register(new java.util.ArrayList().subList(0,0).getClass(), new ArrayListSubListSerializer());
    kryo.register(CopyOnFirstWriteProperties.class, new CopyOnFirstWritePropertiesSerializer());
    kryo.register(MapWork.class, new MapWorkSerializer(kryo, MapWork.class));
    kryo.register(PartitionDesc.class, new PartitionDescSerializer(kryo, PartitionDesc.class));

    ((DefaultInstantiatorStrategy) kryo.getInstantiatorStrategy())
        .setFallbackInstantiatorStrategy(
            new StdInstantiatorStrategy());
    removeField(kryo, AbstractOperatorDesc.class, "colExprMap");
    removeField(kryo, AbstractOperatorDesc.class, "statistics");

    // This must be called after all the explicit register calls.
    return kryo.processHooks(kryoTypeHooks, globalHook);
  }
Provides general-purpose hooks for specific types, as well as a global hook.
ql/src/java/org/apache/hadoop/hive/ql/exec/SerializationUtilities.java