rkhachatryan commented on a change in pull request #13040: URL: https://github.com/apache/flink/pull/13040#discussion_r492167969
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CompletedCheckpoint.java ########## @@ -210,6 +221,21 @@ public void registerSharedStatesAfterRestored(SharedStateRegistry sharedStateReg // Discard and Dispose // ------------------------------------------------------------------------ + /** + * Asynchronously call a discard on the ioExecutor + * (FixedThreadPool of configurable size of default 4*CPU cores) + * and count the number of checkpoints that are waiting to clean. + */ + void asyncDiscardCheckpointAndCountCheckpoint(ThrowingConsumer<CompletedCheckpoint, Exception> discardCallback, Executor executor){ + cleanCallback.accept(() -> { + try { + discardCallback.accept(this); Review comment: Sure, we shouldn't break the encapsulation of `CompletedCheckpoint`, but we could extract these conditions into public methods (`boolean shouldDiscardOnXxx()`) which would be used by ZooKeeperStore. If you think it doesn't worth it I'm also fine with the current approach. ---------------------------------------------------------------- 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