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

Wencong Liu edited comment on FLINK-5336 at 7/20/23 4:13 AM:
-------------------------------------------------------------

Hi all, I have checked all the classes that utilize the *Path* class. I found 
that there're still some classes are de/serializing the *Path* through 
*IOReadableWritable* interface.
 # {*}FileSourceSplitSerializer{*}: It de/serializes the *Path* during the 
process of de/serializing FileSourceSplit.
 # {*}TestManagedSinkCommittableSerializer{*}: It de/serializes the Path during 
the process of de/serializing TestManagedCommittable.
 # {*}TestManagedFileSourceSplitSerializer{*}: It de/serializes the Path during 
the process of de/serializing TestManagedIterableSourceSplit.

For 1, the Path needs to be serialized to save checkpoint data in source.

For 2/3, the IT case in flink-table-common depends on the Path 
de/serialization. [~qingyue] 


was (Author: JIRAUSER281639):
Hi all, I have checked all the classes that utilize the *Path* class. I found 
that there're still some classes are de/serializing the *Path* through 
*IOReadableWritable* interface.
 # {*}FileSourceSplitSerializer{*}: It de/serializes the *Path* during the 
process of de/serializing FileSourceSplit.
 # {*}TestManagedSinkCommittableSerializer{*}: It de/serializes the Path during 
the process of de/serializing TestManagedCommittable.
 # {*}TestManagedFileSourceSplitSerializer{*}: It de/serializes the Path during 
the process of de/serializing TestManagedIterableSourceSplit.

For 1, the Path needs to be serialized to save checkpoint data in source.

For 2/3, the IT case in flink-table-common depends on the Path 
de/serialization. [~qingyue] 

In summary, I think the Path class should still need to implement the 
*IOReadableWritable* interface to support de/serialization. WDYT? 

> Make Path immutable
> -------------------
>
>                 Key: FLINK-5336
>                 URL: https://issues.apache.org/jira/browse/FLINK-5336
>             Project: Flink
>          Issue Type: Sub-task
>          Components: API / DataSet
>            Reporter: Stephan Ewen
>            Priority: Major
>             Fix For: 2.0.0
>
>
> The {{Path}} class is currently mutable to support the {{IOReadableWritable}} 
> serialization. Since that serialization is not used any more, I suggest to 
> drop that interface from Path and make the Path's URI final.
> Being immutable, we can store configures paths properly without the chance of 
> them being mutated as side effects.
> Many parts of the code make the assumption that the Path is immutable, being 
> susceptible to subtle errors.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to