Skip to content

Commit 032ca46

Browse files
committed
Aligns the check for checkpointing being enabled with how it's done for the other Checkpoint-related components
1 parent 5d14fb9 commit 032ca46

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/SchedulerBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public SchedulerBase(
225225

226226
final CheckpointStatsTracker checkpointStatsTracker =
227227
SchedulerUtils.createCheckpointStatsTrackerIfCheckpointingIsEnabled(
228-
jobGraph.getCheckpointingSettings(),
228+
jobGraph,
229229
() ->
230230
new DefaultCheckpointStatsTracker(
231231
jobMasterConfiguration.get(

flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/SchedulerUtils.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,10 @@
3333
import org.apache.flink.runtime.client.JobExecutionException;
3434
import org.apache.flink.runtime.executiongraph.DefaultExecutionGraphBuilder;
3535
import org.apache.flink.runtime.jobgraph.JobGraph;
36-
import org.apache.flink.runtime.jobgraph.tasks.JobCheckpointingSettings;
3736
import org.apache.flink.runtime.state.SharedStateRegistry;
3837

3938
import org.slf4j.Logger;
4039

41-
import javax.annotation.Nullable;
42-
4340
import java.util.concurrent.Executor;
4441
import java.util.function.Supplier;
4542

@@ -114,12 +111,9 @@ public static CheckpointIDCounter createCheckpointIDCounterIfCheckpointingIsEnab
114111
}
115112

116113
public static CheckpointStatsTracker createCheckpointStatsTrackerIfCheckpointingIsEnabled(
117-
@Nullable JobCheckpointingSettings checkpointingSettings,
114+
JobGraph checkpointingSettings,
118115
Supplier<CheckpointStatsTracker> checkpointStatsTrackerFactory) {
119-
if (checkpointingSettings != null
120-
&& checkpointingSettings
121-
.getCheckpointCoordinatorConfiguration()
122-
.isCheckpointingEnabled()) {
116+
if (DefaultExecutionGraphBuilder.isCheckpointingEnabled(checkpointingSettings)) {
123117
return checkpointStatsTrackerFactory.get();
124118
} else {
125119
return NoOpCheckpointStatsTracker.INSTANCE;

flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/AdaptiveScheduler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ public AdaptiveScheduler(
512512
jobGraph, checkpointRecoveryFactory);
513513
this.checkpointStatsTracker =
514514
SchedulerUtils.createCheckpointStatsTrackerIfCheckpointingIsEnabled(
515-
jobGraph.getCheckpointingSettings(),
515+
jobGraph,
516516
() ->
517517
checkpointStatsTrackerFactory.apply(
518518
jobManagerJobMetricGroup, createCheckpointStatsListener()));

flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/AdaptiveSchedulerTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
import org.apache.flink.runtime.scheduler.DefaultSchedulerTest;
9595
import org.apache.flink.runtime.scheduler.SchedulerBase;
9696
import org.apache.flink.runtime.scheduler.SchedulerNG;
97+
import org.apache.flink.runtime.scheduler.SchedulerTestingUtils;
9798
import org.apache.flink.runtime.scheduler.TestingPhysicalSlot;
9899
import org.apache.flink.runtime.scheduler.VertexParallelismInformation;
99100
import org.apache.flink.runtime.scheduler.VertexParallelismStore;
@@ -2228,6 +2229,7 @@ private AdaptiveScheduler createSchedulerThatReachesExecutingState(
22282229
.build(),
22292230
null))
22302231
.build();
2232+
SchedulerTestingUtils.enableCheckpointing(jobGraph);
22312233

22322234
// testing SlotPool instance that would allow for the scheduler to transition to Executing
22332235
// state

0 commit comments

Comments
 (0)