TaskMetrics is a collection of metrics tracked during execution of a Task.
TaskMetrics uses accumulators to represent the metrics and offers "increment" methods to increment them.
|
Note
|
The local values of the accumulators for a task (as accumulated while the task runs) are sent from the executor to the driver when the task completes (and DAGScheduler re-creates TaskMetrics).
|
| Property | Name | Type | Description |
|---|---|---|---|
|
|
Used in memoryBytesSpilled, incMemoryBytesSpilled |
|
|
|
Used in updatedBlockStatuses, recording updated |
| Name | Description |
|---|---|
Internal accumulators indexed by their names. Used when NOTE: |
|
Collection of internal AccumulatorV2 objects. Used when…FIXME NOTE: |
|
Collection of external AccumulatorV2 objects. Used when NOTE: |
fromAccumulators(accums: Seq[AccumulatorV2[_, _]]): TaskMetricsfromAccumulators creates a new TaskMetrics and registers accums as internal and external task metrics (using nameToAccums internal registry).
Internally, fromAccumulators creates a new TaskMetrics. It then splits accums into internal and external task metrics collections (using nameToAccums internal registry).
For every internal task metrics, fromAccumulators finds the metrics in nameToAccums internal registry (of the new TaskMetrics instance), copies metadata, and merges state.
In the end, fromAccumulators adds the external accumulators to the new TaskMetrics instance.
|
Note
|
fromAccumulators is used exclusively when DAGScheduler gets notified that a task has finished (and re-creates TaskMetrics).
|
incMemoryBytesSpilled(v: Long): UnitincMemoryBytesSpilled adds v to _memoryBytesSpilled task metrics.
|
Note
|
|
incUpdatedBlockStatuses(v: (BlockId, BlockStatus)): UnitincUpdatedBlockStatuses adds v in _updatedBlockStatuses internal registry.
|
Note
|
incUpdatedBlockStatuses is used exclusively when BlockManager does addUpdatedBlockStatusToTaskMetrics.
|
register(sc: SparkContext): Unitregister registers the internal accumulators (from nameToAccums internal registry) with countFailedValues enabled (true).
|
Note
|
register is used exclusively when Stage is requested for its new attempt.
|