You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Tzu-Li (Gordon) Tai (JIRA)" <ji...@apache.org> on 2018/03/02 12:04:00 UTC
[jira] [Comment Edited] (FLINK-8836) Duplicating a KryoSerializer
does not duplicate registered default serializers
[ https://issues.apache.org/jira/browse/FLINK-8836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16383515#comment-16383515 ]
Tzu-Li (Gordon) Tai edited comment on FLINK-8836 at 3/2/18 12:03 PM:
---------------------------------------------------------------------
[~StephanEwen]
All built-in Kryo default serializers, AFAIK, are stateless. However, users can also register their own serializer implementations via the {{ExecutionConfig}}, making them potentially stateful. The {{KryoSerializer}} recognizes these user registrations and adds them to the Kryo object.
was (Author: tzulitai):
[~StephanEwen]
All built-in Kryo default serializers, AFAIK, are stateless. However, users can also register their own serializer implementations via the `ExecutionConfig`, making them potentially stateful. The \{{KryoSerializer}} recognizes these user registrations and adds them to the Kryo object.
> Duplicating a KryoSerializer does not duplicate registered default serializers
> ------------------------------------------------------------------------------
>
> Key: FLINK-8836
> URL: https://issues.apache.org/jira/browse/FLINK-8836
> Project: Flink
> Issue Type: Bug
> Components: Type Serialization System
> Reporter: Tzu-Li (Gordon) Tai
> Priority: Critical
>
> The {{duplicate()}} method of the {{KryoSerializer}} is as following:
> {code:java}
> public KryoSerializer<T> duplicate() {
> return new KryoSerializer<>(this);
> }
> protected KryoSerializer(KryoSerializer<T> toCopy) {
> defaultSerializers = toCopy.defaultSerializers;
> defaultSerializerClasses = toCopy.defaultSerializerClasses;
> kryoRegistrations = toCopy.kryoRegistrations;
> ...
> }
> {code}
> Shortly put, when duplicating a {{KryoSerializer}}, the {{defaultSerializers}} serializer instances are directly provided to the new {{KryoSerializer}} instance.
> This causes the fact that those default serializers are shared across two different {{KryoSerializer}} instances, and therefore not a correct duplicate.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)