Skip to content

Commit 028bfba

Browse files
First attempt at Full Checkpoint information on the UI
1 parent 81f882b commit 028bfba

File tree

6 files changed

+46
-0
lines changed

6 files changed

+46
-0
lines changed

flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointProperties.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,16 @@ public boolean isSavepoint() {
182182
return checkpointType.isSavepoint();
183183
}
184184

185+
/**
186+
* Returns whether the checkpoint properties describe a full checkpoint.
187+
*
188+
* @return <code>true</code> if the properties describe a full checkpoint, <code>false</code>
189+
* otherwise.
190+
*/
191+
public boolean isFullCheckpoint() {
192+
return checkpointType.isFullCheckpoint();
193+
}
194+
185195
/**
186196
* Returns whether the checkpoint properties describe a synchronous savepoint/checkpoint.
187197
*

flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointType.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ public boolean isSavepoint() {
4646
return false;
4747
}
4848

49+
public boolean isFullCheckpoint() {
50+
return this == FULL_CHECKPOINT;
51+
}
52+
4953
public String getName() {
5054
return name;
5155
}

flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/SavepointType.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ public boolean isSavepoint() {
5454
return true;
5555
}
5656

57+
public boolean isFullCheckpoint() {
58+
return false;
59+
}
60+
5761
public boolean isSynchronous() {
5862
return postCheckpointAction != PostCheckpointAction.NONE;
5963
}

flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/SnapshotType.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public interface SnapshotType extends Serializable {
2525

2626
boolean isSavepoint();
2727

28+
boolean isFullCheckpoint();
29+
2830
String getName();
2931

3032
SharingFilesStrategy getSharingFilesStrategy();

flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/checkpoints/CheckpointStatistics.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ public class CheckpointStatistics implements ResponseBody {
8888

8989
public static final String FIELD_NAME_IS_SAVEPOINT = "is_savepoint";
9090

91+
public static final String FIELD_NAME_IS_FULL_CHECKPOINT = "is_full_checkpoint";
92+
9193
public static final String FIELD_NAME_SAVEPOINT_FORMAT = "savepointFormat";
9294

9395
public static final String FIELD_NAME_TRIGGER_TIMESTAMP = "trigger_timestamp";
@@ -129,6 +131,9 @@ public class CheckpointStatistics implements ResponseBody {
129131
@JsonProperty(FIELD_NAME_IS_SAVEPOINT)
130132
private final boolean savepoint;
131133

134+
@JsonProperty(FIELD_NAME_IS_FULL_CHECKPOINT)
135+
private final boolean fullCheckpoint;
136+
132137
@JsonProperty(FIELD_NAME_SAVEPOINT_FORMAT)
133138
@Nullable
134139
private final String savepointFormat;
@@ -175,6 +180,7 @@ private CheckpointStatistics(
175180
@JsonProperty(FIELD_NAME_ID) long id,
176181
@JsonProperty(FIELD_NAME_STATUS) CheckpointStatsStatus status,
177182
@JsonProperty(FIELD_NAME_IS_SAVEPOINT) boolean savepoint,
183+
@JsonProperty(FIELD_NAME_IS_FULL_CHECKPOINT) boolean fullCheckpoint,
178184
@JsonProperty(FIELD_NAME_SAVEPOINT_FORMAT) String savepointFormat,
179185
@JsonProperty(FIELD_NAME_TRIGGER_TIMESTAMP) long triggerTimestamp,
180186
@JsonProperty(FIELD_NAME_LATEST_ACK_TIMESTAMP) long latestAckTimestamp,
@@ -193,6 +199,7 @@ private CheckpointStatistics(
193199
this.id = id;
194200
this.status = Preconditions.checkNotNull(status);
195201
this.savepoint = savepoint;
202+
this.fullCheckpoint = fullCheckpoint;
196203
this.savepointFormat = savepointFormat;
197204
this.triggerTimestamp = triggerTimestamp;
198205
this.latestAckTimestamp = latestAckTimestamp;
@@ -220,6 +227,10 @@ public boolean isSavepoint() {
220227
return savepoint;
221228
}
222229

230+
public boolean isFullCheckpoint() {
231+
return fullCheckpoint;
232+
}
233+
223234
public long getTriggerTimestamp() {
224235
return triggerTimestamp;
225236
}
@@ -268,6 +279,7 @@ public boolean equals(Object o) {
268279
CheckpointStatistics that = (CheckpointStatistics) o;
269280
return id == that.id
270281
&& savepoint == that.savepoint
282+
&& fullCheckpoint == that.fullCheckpoint
271283
&& Objects.equals(savepointFormat, that.savepointFormat)
272284
&& triggerTimestamp == that.triggerTimestamp
273285
&& latestAckTimestamp == that.latestAckTimestamp
@@ -289,6 +301,7 @@ public int hashCode() {
289301
id,
290302
status,
291303
savepoint,
304+
fullCheckpoint,
292305
savepointFormat,
293306
triggerTimestamp,
294307
latestAckTimestamp,
@@ -352,6 +365,7 @@ public static CheckpointStatistics generateCheckpointStatistics(
352365
completedCheckpointStats.getCheckpointId(),
353366
completedCheckpointStats.getStatus(),
354367
snapshotType.isSavepoint(),
368+
snapshotType.isFullCheckpoint(),
355369
savepointFormat,
356370
completedCheckpointStats.getTriggerTimestamp(),
357371
completedCheckpointStats.getLatestAckTimestamp(),
@@ -377,6 +391,7 @@ public static CheckpointStatistics generateCheckpointStatistics(
377391
failedCheckpointStats.getCheckpointId(),
378392
failedCheckpointStats.getStatus(),
379393
failedCheckpointStats.getProperties().isSavepoint(),
394+
failedCheckpointStats.getProperties().isFullCheckpoint(),
380395
savepointFormat,
381396
failedCheckpointStats.getTriggerTimestamp(),
382397
failedCheckpointStats.getLatestAckTimestamp(),
@@ -402,6 +417,7 @@ public static CheckpointStatistics generateCheckpointStatistics(
402417
pendingCheckpointStats.getCheckpointId(),
403418
pendingCheckpointStats.getStatus(),
404419
pendingCheckpointStats.getProperties().isSavepoint(),
420+
pendingCheckpointStats.getProperties().isFullCheckpoint(),
405421
savepointFormat,
406422
pendingCheckpointStats.getTriggerTimestamp(),
407423
pendingCheckpointStats.getLatestAckTimestamp(),
@@ -474,6 +490,7 @@ public CompletedCheckpointStatistics(
474490
@JsonProperty(FIELD_NAME_ID) long id,
475491
@JsonProperty(FIELD_NAME_STATUS) CheckpointStatsStatus status,
476492
@JsonProperty(FIELD_NAME_IS_SAVEPOINT) boolean savepoint,
493+
@JsonProperty(FIELD_NAME_IS_FULL_CHECKPOINT) boolean fullCheckpoint,
477494
@JsonProperty(FIELD_NAME_SAVEPOINT_FORMAT) String savepointFormat,
478495
@JsonProperty(FIELD_NAME_TRIGGER_TIMESTAMP) long triggerTimestamp,
479496
@JsonProperty(FIELD_NAME_LATEST_ACK_TIMESTAMP) long latestAckTimestamp,
@@ -495,6 +512,7 @@ public CompletedCheckpointStatistics(
495512
id,
496513
status,
497514
savepoint,
515+
fullCheckpoint,
498516
savepointFormat,
499517
triggerTimestamp,
500518
latestAckTimestamp,
@@ -562,6 +580,7 @@ public FailedCheckpointStatistics(
562580
@JsonProperty(FIELD_NAME_ID) long id,
563581
@JsonProperty(FIELD_NAME_STATUS) CheckpointStatsStatus status,
564582
@JsonProperty(FIELD_NAME_IS_SAVEPOINT) boolean savepoint,
583+
@JsonProperty(FIELD_NAME_IS_FULL_CHECKPOINT) boolean fullCheckpoint,
565584
@JsonProperty(FIELD_NAME_SAVEPOINT_FORMAT) String savepointFormat,
566585
@JsonProperty(FIELD_NAME_TRIGGER_TIMESTAMP) long triggerTimestamp,
567586
@JsonProperty(FIELD_NAME_LATEST_ACK_TIMESTAMP) long latestAckTimestamp,
@@ -583,6 +602,7 @@ public FailedCheckpointStatistics(
583602
id,
584603
status,
585604
savepoint,
605+
fullCheckpoint,
586606
savepointFormat,
587607
triggerTimestamp,
588608
latestAckTimestamp,
@@ -640,6 +660,7 @@ public PendingCheckpointStatistics(
640660
@JsonProperty(FIELD_NAME_ID) long id,
641661
@JsonProperty(FIELD_NAME_STATUS) CheckpointStatsStatus status,
642662
@JsonProperty(FIELD_NAME_IS_SAVEPOINT) boolean savepoint,
663+
@JsonProperty(FIELD_NAME_IS_FULL_CHECKPOINT) boolean fullCheckpoint,
643664
@JsonProperty(FIELD_NAME_SAVEPOINT_FORMAT) String savepointFormat,
644665
@JsonProperty(FIELD_NAME_TRIGGER_TIMESTAMP) long triggerTimestamp,
645666
@JsonProperty(FIELD_NAME_LATEST_ACK_TIMESTAMP) long latestAckTimestamp,
@@ -659,6 +680,7 @@ public PendingCheckpointStatistics(
659680
id,
660681
status,
661682
savepoint,
683+
fullCheckpoint,
662684
savepointFormat,
663685
triggerTimestamp,
664686
latestAckTimestamp,

flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/checkpoints/CheckpointingStatisticsTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ protected CheckpointingStatistics getTestResponseInstance() throws Exception {
7878
1L,
7979
CheckpointStatsStatus.COMPLETED,
8080
false,
81+
false,
8182
null,
8283
42L,
8384
41L,
@@ -99,6 +100,7 @@ protected CheckpointingStatistics getTestResponseInstance() throws Exception {
99100
2L,
100101
CheckpointStatsStatus.COMPLETED,
101102
true,
103+
false,
102104
SavepointFormatType.CANONICAL.name(),
103105
11L,
104106
10L,
@@ -121,6 +123,7 @@ protected CheckpointingStatistics getTestResponseInstance() throws Exception {
121123
3L,
122124
CheckpointStatsStatus.FAILED,
123125
false,
126+
false,
124127
null,
125128
5L,
126129
10L,
@@ -145,6 +148,7 @@ protected CheckpointingStatistics getTestResponseInstance() throws Exception {
145148
5L,
146149
CheckpointStatsStatus.IN_PROGRESS,
147150
false,
151+
false,
148152
null,
149153
42L,
150154
41L,

0 commit comments

Comments
 (0)