flink-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tzu-Li (Gordon) Tai (JIRA)" <j...@apache.org>
Subject [jira] [Created] (FLINK-6363) Document precedence rules of Kryo serializer registrations
Date Sun, 23 Apr 2017 09:59:04 GMT
Tzu-Li (Gordon) Tai created FLINK-6363:

             Summary: 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: Documentation, Type Serialization System
            Reporter: Tzu-Li (Gordon) Tai
            Assignee: Tzu-Li (Gordon) Tai

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:
env.addDefaultKryoSerializer(SomeClass.class, SerializerA.class);
env.addDefaultKryoSerializer(SomeClass.class, new SerializerB());

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 serializer instance has a higher precedence than defining
with serializer class.

These methods are also subject to the same issue:
env.registerType(SomeClass.class, SerializerA.class);
env.registerTypeWithKryoSerializer(SomeClass.class, SerializerA.class);
env.registerTypeWithKryoSerializer(SomeClass.class, new SerializerB());

This message was sent by Atlassian JIRA

View raw message