Github user StefanRRichter commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5578#discussion_r171179946
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/state/TaskLocalStateStoreImpl.java
 ---
    @@ -90,6 +92,9 @@
        @GuardedBy("lock")
        private boolean disposed;
     
    +   /** Whether to discard the useless state when retrieve local checkpoint 
state. */
    +   private boolean retrieveWithDiscard = true;
    --- End diff --
    
    Then there are two better options in my opinion, because the flag is pure 
boilerplate:
    
    - Change the test to check what we are doing now, because that is what 
happens in the real use-case.
    - Maybe even better: split the method `retrieveLocalState` further: one 
method for pruning, one package-private method that does all the pure 
retrieval, logging, and `null` transformation. In the old `retrieveLocalState`, 
do the cleanup first, then the pure retrieval/logging. Call the package private 
method in the test.
    
    Maybe the test should then also just do both?


---

Reply via email to