rkhachatryan commented on a change in pull request #18387:
URL: https://github.com/apache/flink/pull/18387#discussion_r786945819



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/state/PartitionableListState.java
##########
@@ -45,23 +47,25 @@
     private final ArrayListSerializer<S> internalListCopySerializer;
 
     PartitionableListState(RegisteredOperatorStateBackendMetaInfo<S> 
stateMetaInfo) {
-        this(stateMetaInfo, new ArrayList<S>());
+        this(stateMetaInfo, new ArrayList<>(), 
stateMetaInfo.getPartitionStateSerializer());
+    }
+
+    // constructor for deep copy.
+    private PartitionableListState(PartitionableListState<S> toCopy) {
+        this(
+                toCopy.stateMetaInfo.deepCopy(),
+                toCopy.internalListCopySerializer.copy(toCopy.internalList),
+                
toCopy.stateMetaInfo.getPartitionStateSerializer().duplicate());

Review comment:
       Looking at the `stateMetaInfo.deepCopy`, I see that 
`RegisteredOperatorStateBackendMetaInfo` already deep-copies the serializer. 
And then this copy is used in constructor currently in `master`.
   
   The added test passes with the current (`master`) production code.
   
   So it seems to me the change is not necessary.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to