Github user StefanRRichter commented on a diff in the pull request: https://github.com/apache/flink/pull/5910#discussion_r184304664 --- Diff: flink-core/src/main/java/org/apache/flink/util/InstantiationUtil.java --- @@ -221,6 +226,52 @@ protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFo } } + /** + * A mapping between the full path of a deprecated serializer and its equivalent. + * These mappings are hardcoded and fixed. + * + * <p>IMPORTANT: mappings can be removed after 1 release as there will be a "migration path". + * As an example, a serializer is removed in 1.5-SNAPSHOT, then the mapping should be added for 1.5, + * and it can be removed in 1.6, as the path would be Flink-{< 1.5} -> Flink-1.5 -> Flink-{>= 1.6}. + */ + private enum MigrationUtil { + + // To add a new mapping just pick a name and add an entry as the following: + + GENERIC_DATA_ARRAY_SERIALIZER( + "org.apache.avro.generic.GenericData$Array", + ObjectStreamClass.lookup(KryoRegistrationSerializerConfigSnapshot.DummyRegisteredClass.class)), + HASH_MAP_SERIALIZER( + "org.apache.flink.runtime.state.HashMapSerializer", + ObjectStreamClass.lookup(MapSerializer.class)); // added in 1.5 + + /** An internal unmoddifiable map containing the mappings between deprecated and new serialzers. */ + private static final Map<String, ObjectStreamClass> equivalenceMap = Collections.unmodifiableMap(initMap()); + + /** The full name of the class of the old serializer. */ + private final String oldSerializer; + + /** The serialization descriptor of the class of the new serializer. */ + private final ObjectStreamClass newSerializer; --- End diff -- Here I suggest to add `StreamClass` to the name.
---