You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Flink Jira Bot (Jira)" <ji...@apache.org> on 2022/01/02 22:39:00 UTC

[jira] [Updated] (FLINK-6363) Document precedence rules of Kryo serializer registrations

     [ https://issues.apache.org/jira/browse/FLINK-6363?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Flink Jira Bot updated FLINK-6363:
----------------------------------
      Labels: auto-deprioritized-major auto-deprioritized-minor auto-unassigned  (was: auto-deprioritized-major auto-unassigned stale-minor)
    Priority: Not a Priority  (was: Minor)

This issue was labeled "stale-minor" 7 days ago and has not received any updates so it is being deprioritized. If this ticket is actually Minor, please raise the priority and ask a committer to assign you the issue or revive the public discussion.


> Document precedence rules of Kryo serializer registrations
> ----------------------------------------------------------
>
>                 Key: FLINK-6363
>                 URL: https://issues.apache.org/jira/browse/FLINK-6363
>             Project: Flink
>          Issue Type: Improvement
>          Components: API / Type Serialization System, Documentation
>            Reporter: Tzu-Li (Gordon) Tai
>            Priority: Not a Priority
>              Labels: auto-deprioritized-major, auto-deprioritized-minor, auto-unassigned
>
> Currently, there is no documentation / Javadoc mentioning the precedence rules of Kryo registrations via the register methods in {{StreamExecutionEnvironment}} / {{ExecutionEnvironment}}.
> It is important for the user to be notified of the precedence because the {{KryoSerializer}} applies the configurations in a specific order that is not visible from the public API.
> For example:
> {code}
> env.addDefaultKryoSerializer(SomeClass.class, SerializerA.class);
> env.addDefaultKryoSerializer(SomeClass.class, new SerializerB());
> {code}
> from this API usage, it may seem as if {{SerializerA}} will be used as the default serializer for {{SomeClass}} (or the other way around, depends really on how the user perceives this).
> However, whatever the called order in this example, {{SerializerB}} will always be used because in the case of defining default serializers, due to the ordering that the internal {{KryoSerializer}} applies these configurations, defining default serializer by instance has a higher precedence than defining by class. Since the existence of this precedence is not due to Kryo's behaviour, but due to the applied ordering in {{KryoSerializer}}, users that are familiar with Kryo will be surprised by the unexpected results.
> These methods are also subject to the same issue:
> {code}
> env.registerType(SomeClass.class, SerializerA.class);
> env.registerTypeWithKryoSerializer(SomeClass.class, SerializerA.class);
> env.registerTypeWithKryoSerializer(SomeClass.class, new SerializerB());
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)