Myasuka commented on a change in pull request #9602: [FLINK-13856][checkpoint] 
Reduce the delete file api when the checkpo…
URL: https://github.com/apache/flink/pull/9602#discussion_r354480441
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CompletedCheckpoint.java
 ##########
 @@ -281,6 +285,34 @@ private void doDiscard() throws Exception {
                }
        }
 
+       private Set<KeyedStateHandle> getIncrementKeyedStates() {
+               Set<KeyedStateHandle> incrementKeyedState = new 
HashSet<>(operatorStates.size());
+
+               //reference SavepointV2Serializer.serializeKeyedStateHandle
+               operatorStates.values().forEach(operatorState -> {
+                       operatorState.getStates().forEach(operatorSubtaskState 
-> {
+                               if (operatorSubtaskState != null && 
operatorSubtaskState.getManagedKeyedState() != null) {
+                                       for (KeyedStateHandle managedKeyedState 
: operatorSubtaskState.getManagedKeyedState()) {
+                                               if (managedKeyedState 
instanceof IncrementalRemoteKeyedStateHandle) {
+                                                       
incrementKeyedState.add(managedKeyedState);
+                                               }
+                                       }
+                               }
+
+                               if (operatorSubtaskState != null && 
operatorSubtaskState.getRawKeyedState() != null) {
+                                       for (KeyedStateHandle rawKeyedState : 
operatorSubtaskState.getRawKeyedState()) {
+                                               if (rawKeyedState instanceof 
IncrementalRemoteKeyedStateHandle) {
 
 Review comment:
   raw keyed state handle cannot be a `IncrementalRemoteKeyedStateHandle`

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to