Myasuka commented on a change in pull request #11491: 
[FLINK-16513][checkpointing] Unaligned checkpoints: checkpoint metadata
URL: https://github.com/apache/flink/pull/11491#discussion_r397374878
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/StateAssignmentOperation.java
 ##########
 @@ -302,88 +326,63 @@ private void reDistributeKeyedStates(
                                subManagedKeyedState = 
operatorState.getState(subTaskIndex).getManagedKeyedState().asList();
                                subRawKeyedState = 
operatorState.getState(subTaskIndex).getRawKeyedState().asList();
                        } else {
-                               subManagedKeyedState = Collections.emptyList();
-                               subRawKeyedState = Collections.emptyList();
+                               subManagedKeyedState = emptyList();
+                               subRawKeyedState = emptyList();
                        }
                } else {
                        subManagedKeyedState = 
getManagedKeyedStateHandles(operatorState, 
keyGroupPartitions.get(subTaskIndex));
                        subRawKeyedState = 
getRawKeyedStateHandles(operatorState, keyGroupPartitions.get(subTaskIndex));
                }
 
                if (subManagedKeyedState.isEmpty() && 
subRawKeyedState.isEmpty()) {
-                       return new Tuple2<>(Collections.emptyList(), 
Collections.emptyList());
+                       return new Tuple2<>(emptyList(), emptyList());
                } else {
                        return new Tuple2<>(subManagedKeyedState, 
subRawKeyedState);
                }
        }
 
-       public static void reDistributePartitionableStates(
-                       List<OperatorState> oldOperatorStates,
-                       int newParallelism,
-                       List<OperatorID> newOperatorIDs,
-                       Map<OperatorInstanceID, List<OperatorStateHandle>> 
newManagedOperatorStates,
-                       Map<OperatorInstanceID, List<OperatorStateHandle>> 
newRawOperatorStates) {
+       public static <T extends StateObject> Map<OperatorInstanceID, List<T>>  
reDistributePartitionableStates(
+               List<OperatorState> oldOperatorStates,
+               int newParallelism,
+               List<OperatorID> newOperatorIDs,
+               Function<OperatorSubtaskState, StateObjectCollection<T>> 
extracthandle,
 
 Review comment:
   ```suggestion
                Function<OperatorSubtaskState, StateObjectCollection<T>> 
extractHandle,
   ```

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


With regards,
Apache Git Services

Reply via email to