aljoscha commented on a change in pull request #14740:
URL: https://github.com/apache/flink/pull/14740#discussion_r567923261



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java
##########
@@ -223,16 +214,25 @@
     private boolean isTriggering = false;
 
     private final CheckpointRequestDecider requestDecider;
+
+    private final CheckpointBriefCalculator checkpointBriefCalculator;
+
+    private final ExecutionAttemptMappingProvider attemptMappingProvider;
+
     private final LinkedHashMap<ExecutionAttemptID, ExecutionVertex> 
cachedTasksById;
 
+    /**
+     * Temporary flag to allow checkpoints after tasks finished. This is 
disabled for regular jobs
+     * to keep the current behavior but we want to allow it in tests. This 
should be removed once
+     * all parts of the stack support checkpoints after some tasks finished.
+     */
+    private boolean allowCheckpointsAfterTasksFinished;

Review comment:
       This flag seems to not even be used anywhere, so far?

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java
##########
@@ -183,26 +167,48 @@ public CheckpointStatsSnapshot createSnapshot() {
     /**
      * Creates a new pending checkpoint tracker.
      *
+     * @param tasksToAck Tasks to acknowledge in this checkpoint.
      * @param checkpointId ID of the checkpoint.
      * @param triggerTimestamp Trigger timestamp of the checkpoint.
      * @param props The checkpoint properties.
      * @return Tracker for statistics gathering.
      */
     PendingCheckpointStats reportPendingCheckpoint(
-            long checkpointId, long triggerTimestamp, CheckpointProperties 
props) {
+            List<ExecutionVertex> tasksToAck,
+            List<ExecutionVertex> finishedTasks,
+            long checkpointId,
+            long triggerTimestamp,
+            CheckpointProperties props) {
 
         ConcurrentHashMap<JobVertexID, TaskStateStats> taskStateStats =
-                createEmptyTaskStateStatsMap();
+                createEmptyTaskStateStatsMap(tasksToAck, finishedTasks);
 
         PendingCheckpointStats pending =
                 new PendingCheckpointStats(
                         checkpointId,
                         triggerTimestamp,
                         props,
-                        totalSubtaskCount,
+                        tasksToAck.size() + finishedTasks.size(),
                         taskStateStats,
                         new PendingCheckpointStatsCallback());
 
+        long now = System.currentTimeMillis();

Review comment:
       I think it would be better to put this into a separate private method, 
something like `reportFinishedTasks(pending, finishedTasks)`.

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointBriefComputerContext.java
##########
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.checkpoint;
+
+import org.apache.flink.runtime.concurrent.ScheduledExecutor;
+
+/** Provides the context for {@link CheckpointBriefComputer} to compute the 
brief of checkpoints. */
+public interface CheckpointBriefComputerContext {
+
+    /**
+     * Acquires the main thread executor for this job.
+     *
+     * @return The main thread executor.
+     */
+    ScheduledExecutor getMainExecutor();

Review comment:
       This should be just `getExecutor()`, because we don't care what type it 
is. Or `getJobMasterMainThreadExecutor()` to keep it consistent with 
`ExecutionGraph`.
   
   I tend to prefer the first because it's shorter. 😅




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