[ 
https://issues.apache.org/jira/browse/FLINK-6764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16031166#comment-16031166
 ] 

ASF GitHub Bot commented on FLINK-6764:
---------------------------------------

Github user StefanRRichter commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4026#discussion_r119357811
  
    --- Diff: 
flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java
 ---
    @@ -795,13 +782,15 @@ public PojoSerializerConfigSnapshot(
                        this.nonRegisteredSubclassesToSerializerConfigSnapshots 
=
                                        
Preconditions.checkNotNull(nonRegisteredSubclassesToSerializerConfigSnapshots);
     
    -                   this.ignoreTypeSerializerSerialization = 
ignoreTypeSerializerSerialization;
    +                   this.excludeSerializers = excludeSerializers;
                }
     
                @Override
                public void write(DataOutputView out) throws IOException {
                        super.write(out);
     
    +                   out.writeBoolean(excludeSerializers);
    +
                        // --- write fields and their serializers, in order
     
                        out.writeInt(fieldToSerializerConfigSnapshot.size());
    --- End diff --
    
    What I just noticed is that this is almost 3x duplicated code. I suggest to 
create a private method that writes `Map<Class<?>, Tuple2<TypeSerializer<?>, 
TypeSerializerConfigSnapshot>>` and call it 3 times.


> Deduplicate stateless TypeSerializers when serializing composite 
> TypeSerializers
> --------------------------------------------------------------------------------
>
>                 Key: FLINK-6764
>                 URL: https://issues.apache.org/jira/browse/FLINK-6764
>             Project: Flink
>          Issue Type: Improvement
>          Components: Type Serialization System
>    Affects Versions: 1.3.0, 1.4.0
>            Reporter: Till Rohrmann
>            Assignee: Tzu-Li (Gordon) Tai
>
> Composite type serializer, such as the {{PojoSerializer}}, could be improved 
> by deduplicating stateless {{TypeSerializer}} when being serialized. This 
> would decrease their serialization size.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to