[ https://issues.apache.org/jira/browse/FLINK-8841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16453672#comment-16453672 ]
ASF GitHub Bot commented on FLINK-8841: --------------------------------------- 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. > Duplicate MapSerializer and HashMapSerializer. > ---------------------------------------------- > > Key: FLINK-8841 > URL: https://issues.apache.org/jira/browse/FLINK-8841 > Project: Flink > Issue Type: Bug > Components: State Backends, Checkpointing, Type Serialization System > Affects Versions: 1.5.0 > Reporter: Kostas Kloudas > Assignee: Kostas Kloudas > Priority: Major > Fix For: 1.5.0 > > > Currently there are two class MapSerializer and HashMapSerializer whose code > is the same with the only difference being that one includes elements of type > Map and the other HashMap. > In addition, these two were merged on the same commit. > I would like to remove the HashMapSerializer. I already created a branch > without the HashMapSerialzer and nothing seems to be failing on Travis. The > reasons why I hesitate to do it, is because I am not sure if this may create > problems with Backwards Compatibility. > [~xiaogang.sxg] could you elaborate a bit on why they were both added and if > there is any danger in removing the HashMapSerializer? > Also [~StephanEwen] and [~stefanrichte...@gmail.com] it is worth having a > look and if you are ok, I can remove the redundant serializer. -- This message was sent by Atlassian JIRA (v7.6.3#76005)