Class MutableIOMetrics

java.lang.Object
org.apache.flink.runtime.executiongraph.IOMetrics
org.apache.flink.runtime.rest.handler.util.MutableIOMetrics
All Implemented Interfaces:
Serializable

public class MutableIOMetrics extends IOMetrics
This class is a mutable version of the IOMetrics class that allows adding up IO-related metrics.

For finished jobs these metrics are stored in the ExecutionGraph as another IOMetrics. For running jobs these metrics are retrieved using the MetricFetcher.

This class provides a common interface to handle both cases, reducing complexity in various handlers (like the JobVertexDetailsHandler).

See Also:
  • Constructor Details

    • MutableIOMetrics

      public MutableIOMetrics()
  • Method Details

    • isNumBytesInComplete

      public boolean isNumBytesInComplete()
    • isNumBytesOutComplete

      public boolean isNumBytesOutComplete()
    • isNumRecordsInComplete

      public boolean isNumRecordsInComplete()
    • isNumRecordsOutComplete

      public boolean isNumRecordsOutComplete()
    • addIOMetrics

      public void addIOMetrics(AccessExecution attempt, @Nullable MetricFetcher fetcher, String jobID, String taskID)
      Adds the IO metrics for the given attempt to this object. If the AccessExecution is in a terminal state the contained IOMetrics object is added. Otherwise the given MetricFetcher is used to retrieve the required metrics.
      Parameters:
      attempt - Attempt whose IO metrics should be added
      fetcher - MetricFetcher to retrieve metrics for running jobs
      jobID - JobID to which the attempt belongs
      taskID - TaskID to which the attempt belongs