StefanRRichter commented on a change in pull request #7009: [FLINK-10712] 
Support to restore state when using RestartPipelinedRegionStrategy
URL: https://github.com/apache/flink/pull/7009#discussion_r236283793
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/StateAssignmentOperation.java
 ##########
 @@ -105,13 +106,70 @@ public boolean assignStates() throws Exception {
                                continue;
                        }
 
-                       assignAttemptState(task.getValue(), operatorStates);
+                       Set<Integer> executionVertexIndices = new HashSet<>();
+                       for (ExecutionVertex executionVertex : 
task.getValue().getTaskVertices()) {
+                               
executionVertexIndices.add(executionVertex.getParallelSubtaskIndex());
+                       }
+                       assignAttemptState(task.getValue(), operatorStates, 
executionVertexIndices);
+               }
+
+               return true;
+       }
+
+       /**
+        * Assign states to given execution vertices.
+        */
+       public boolean assignStates(List<ExecutionVertex> executionVertices) 
throws Exception {
 
 Review comment:
   There is a lot of duplicated code between this method and the orginal 
`assignStates()`. I am sure that this is not required and if we rethink this a 
bit the old method should just be able to call the new one. Duplicating most of 
the code is not very maintainable. I suggest to rething what we gibe to the 
state assignent operation in constructor or as parameter to this method and 
unify it. From a quick look I am very sure this is easily possible.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to