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

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

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

    https://github.com/apache/flink/pull/3305#discussion_r100967108
  
    --- Diff: 
flink-core/src/main/java/org/apache/flink/migration/util/MigrationInstantiationUtil.java
 ---
    @@ -47,9 +47,16 @@ public ClassLoaderObjectInputStream(InputStream in, 
ClassLoader classLoader) thr
     
                        // the flink package may be at position 0 (regular 
class) or position 2 (array)
                        final int flinkPackagePos;
    -                   if ((flinkPackagePos = 
className.indexOf(FLINK_BASE_PACKAGE)) == 0 ||
    -                                   (flinkPackagePos == 2 && 
className.startsWith(ARRAY_PREFIX)))
    -                   {
    +                   if 
(className.contains("org.apache.flink.runtime.state.ArrayListSerializer")) {
    --- End diff --
    
    The code here is a little tricky. I think we should use a Map to record all 
modified classes and their corresponding backups.


> Use list types when ListStateDescriptor extends StateDescriptor
> ---------------------------------------------------------------
>
>                 Key: FLINK-5790
>                 URL: https://issues.apache.org/jira/browse/FLINK-5790
>             Project: Flink
>          Issue Type: Improvement
>            Reporter: Xiaogang Shi
>            Assignee: Xiaogang Shi
>
> Flink keeps the state serializer in {{StateDescriptor}}, but it's the 
> serializer of list elements  that is put in {{ListStateDescriptor}}. The 
> implementation is a little confusing. Some backends need to construct the 
> state serializer with the element serializer by themselves.
> We should use an {{ArrayListSerializer}}, which is composed of the serializer 
> of the element, in the {{ListStateDescriptor}}. It helps the backend to avoid 
> constructing the state serializer.
> If a backend needs customized serialization of the state (e.g. 
> {{RocksDBStateBackend}}), it still can obtain the element serializer from the 
> {{ArrayListSerializer}}.



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

Reply via email to