DG-Wangtao commented on a change in pull request #13045:
URL: https://github.com/apache/flink/pull/13045#discussion_r464343342



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointRequestDecider.java
##########
@@ -146,15 +151,11 @@
 
        private Optional<CheckpointTriggerRequest> onTooEarly(long 
nextTriggerDelayMillis) {
                CheckpointTriggerRequest first = queuedRequests.first();
-               if (first.isForce()) {
-                       return Optional.of(queuedRequests.pollFirst());
-               } else if (first.isPeriodic) {
+               if (first.isPeriodic) {

Review comment:
       Yes, I will remove all `if` from this function.  The 
conditions-returnValue map of function `chooseRequestToExecute` would be like 
this:
   
   |  isForce  | isPeriodic | too eraly | return value of 
`chooseRequestToExecute` | 
   |  ----  | ----  | ---- | ---- |
   | true  | true | true | pollFirst |
   | true  | true | false | pollFirst |
   | true  | false | true | pollFirst | 
   | true  | false | false | pollFirst | 
   | false  | true | true  | empty,  and call 
`queuedRequests.pollFirst().completeExceptionally` | 
   | false  | true | false  | pollFirst | 
   | false  | false | true  | pollFirst | 
   | false  | false | false | pollFirst| 




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