|
19 | 19 | package org.apache.flink.runtime.checkpoint;
|
20 | 20 |
|
21 | 21 | import org.apache.flink.runtime.checkpoint.JobInitializationMetrics.SumMaxDuration;
|
| 22 | +import org.apache.flink.runtime.executiongraph.Execution; |
22 | 23 | import org.apache.flink.runtime.executiongraph.ExecutionAttemptID;
|
23 | 24 |
|
24 | 25 | import org.slf4j.Logger;
|
@@ -46,6 +47,17 @@ class JobInitializationMetricsBuilder {
|
46 | 47 | private Optional<CheckpointProperties> checkpointProperties = Optional.empty();
|
47 | 48 | private Optional<String> externalPath = Optional.empty();
|
48 | 49 |
|
| 50 | + /** |
| 51 | + * The {@code JobInitializationMetricsBuilder} handles the initialization metrics for deployed |
| 52 | + * {@link Execution Executions}. Building the final {@link JobInitializationMetrics} will be |
| 53 | + * only possible if all the subtasks reported their {@link SubTaskInitializationMetrics} back. |
| 54 | + * |
| 55 | + * @param toInitialize The {@link ExecutionAttemptID} of the subtasks that are about to be |
| 56 | + * deployed. |
| 57 | + * @param startTs The time the initialization was started. |
| 58 | + * @see #isComplete() |
| 59 | + * @see #reportInitializationMetrics(ExecutionAttemptID, SubTaskInitializationMetrics) |
| 60 | + */ |
49 | 61 | JobInitializationMetricsBuilder(Set<ExecutionAttemptID> toInitialize, long startTs) {
|
50 | 62 | this.toInitialize = new HashSet<>(toInitialize);
|
51 | 63 | this.startTs = startTs;
|
@@ -119,6 +131,10 @@ private static void aggregateMetrics(
|
119 | 131 | }
|
120 | 132 | }
|
121 | 133 |
|
| 134 | + /** |
| 135 | + * Reports the {@link SubTaskInitializationMetrics} for a currently deployed subtask based on |
| 136 | + * the provided {@link ExecutionAttemptID}. |
| 137 | + */ |
122 | 138 | public void reportInitializationMetrics(
|
123 | 139 | ExecutionAttemptID executionAttemptId,
|
124 | 140 | SubTaskInitializationMetrics initializationMetrics) {
|
|
0 commit comments