Class CheckpointStatsTracker
- java.lang.Object
-
- org.apache.flink.runtime.checkpoint.CheckpointStatsTracker
-
public class CheckpointStatsTracker extends Object
Tracker for checkpoint statistics.This is tightly integrated with the
CheckpointCoordinatorin order to ease the gathering of fine-grained statistics.The tracked stats include summary counts, a detailed history of recent and in progress checkpoints as well as summaries about the size, duration and more of recent checkpoints.
Data is gathered via callbacks in the
CheckpointCoordinatorand related classes likePendingCheckpointandCompletedCheckpoint, which receive the raw stats data in the first place.The statistics are accessed via
createSnapshot()and exposed via both the web frontend and theMetricsystem.
-
-
Constructor Summary
Constructors Constructor Description CheckpointStatsTracker(int numRememberedCheckpoints, org.apache.flink.metrics.MetricGroup metricGroup, org.apache.flink.api.common.JobID jobID)Creates a new checkpoint stats tracker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CheckpointStatsSnapshotcreateSnapshot()Creates a new snapshot of the available stats.PendingCheckpointStatsgetPendingCheckpointStats(long checkpointId)voidreportFailedCheckpointsWithoutInProgress()Callback when a checkpoint failure without in progress checkpoint.voidreportIncompleteStats(long checkpointId, ExecutionAttemptID attemptId, CheckpointMetrics metrics)voidreportInitializationMetrics(SubTaskInitializationMetrics initializationMetrics)voidreportInitializationStartTs(long initializationStartTs)voidreportRestoredCheckpoint(long checkpointID, CheckpointProperties properties, String externalPath, long stateSize)CheckpointStatsTrackerupdateTotalNumberOfSubtasks(int totalNumberOfSubTasks)
-
-
-
Constructor Detail
-
CheckpointStatsTracker
public CheckpointStatsTracker(int numRememberedCheckpoints, org.apache.flink.metrics.MetricGroup metricGroup, org.apache.flink.api.common.JobID jobID)Creates a new checkpoint stats tracker.- Parameters:
numRememberedCheckpoints- Maximum number of checkpoints to remember, including in progress ones.metricGroup- Metric group for exposed metricsjobID- ID of the job being checkpointed
-
-
Method Detail
-
updateTotalNumberOfSubtasks
public CheckpointStatsTracker updateTotalNumberOfSubtasks(int totalNumberOfSubTasks)
-
createSnapshot
public CheckpointStatsSnapshot createSnapshot()
Creates a new snapshot of the available stats.- Returns:
- The latest statistics snapshot.
-
reportRestoredCheckpoint
public void reportRestoredCheckpoint(long checkpointID, CheckpointProperties properties, String externalPath, long stateSize)
-
reportFailedCheckpointsWithoutInProgress
public void reportFailedCheckpointsWithoutInProgress()
Callback when a checkpoint failure without in progress checkpoint. For example, it should be callback when triggering checkpoint failure before creating PendingCheckpoint.
-
getPendingCheckpointStats
public PendingCheckpointStats getPendingCheckpointStats(long checkpointId)
-
reportIncompleteStats
public void reportIncompleteStats(long checkpointId, ExecutionAttemptID attemptId, CheckpointMetrics metrics)
-
reportInitializationStartTs
public void reportInitializationStartTs(long initializationStartTs)
-
reportInitializationMetrics
public void reportInitializationMetrics(SubTaskInitializationMetrics initializationMetrics)
-
-