qinjunjerry commented on a change in pull request #13309:
URL: https://github.com/apache/flink/pull/13309#discussion_r483214542



##########
File path: 
flink-libraries/flink-state-processing-api/src/main/java/org/apache/flink/state/api/WritableSavepoint.java
##########
@@ -90,38 +93,37 @@ public final void write(String path) {
 
                List<OperatorState> existingOperators = 
metadata.getExistingOperators();
 
-               DataSet<OperatorState> finalOperatorStates = 
unionOperatorStates(newOperatorStates, existingOperators);
-
-               finalOperatorStates
-                       .reduceGroup(new 
MergeOperatorStates(metadata.getMasterStates()))
-                       .name("reduce(OperatorState)")
-                       .output(new SavepointOutputFormat(savepointPath))
-                       .name(path);
-       }
-
-       private DataSet<OperatorState> 
unionOperatorStates(DataSet<OperatorState> newOperatorStates, 
List<OperatorState> existingOperators) {
                DataSet<OperatorState> finalOperatorStates;
                if (existingOperators.isEmpty()) {
                        finalOperatorStates = newOperatorStates;
                } else {
-                       DataSet<OperatorState> wrappedCollection = 
newOperatorStates
-                               .getExecutionEnvironment()
+                       DataSet<OperatorState> existingOperatorStates = 
newOperatorStates.getExecutionEnvironment()
                                .fromCollection(existingOperators);
 
-                       finalOperatorStates = 
newOperatorStates.union(wrappedCollection);
+                       existingOperatorStates
+                               .flatMap(new StatePathExtractor())

Review comment:
       I misunderstood. It is for `.flatMap(new StatePathExtractor())`, not 
file copy.




----------------------------------------------------------------
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.

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


Reply via email to