ExecutorsListener
is a SparkListener that tracks executors and their tasks in a Spark application for Stage Details page, Jobs tab and /allexecutors
REST endpoint.
Event Handler | Description |
---|---|
May create an entry for the driver in executorToTaskSummary registry |
|
May create an entry in executorToTaskSummary registry. It also makes sure that the number of entries for dead executors does not exceed spark.ui.retainedDeadExecutors and removes excess. Adds an entry to executorEvents registry and optionally removes the oldest if the number of entries exceeds spark.ui.timeline.executors.maximum. |
|
FIXME |
|
Marks an executor dead in executorToTaskSummary registry. Adds an entry to executorEvents registry and optionally removes the oldest if the number of entries exceeds spark.ui.timeline.executors.maximum. |
|
FIXME |
|
FIXME |
|
FIXME |
|
May create an entry for an executor in executorToTaskSummary registry. |
|
May create an entry for an executor in executorToTaskSummary registry. |
ExecutorsListener
requires a StorageStatusListener and SparkConf.
Registry | Description |
---|---|
The lookup table for Used to build a |
|
A collection of SparkListenerEvents. Used to build the event timeline in AllJobsPage and Details for Job pages. |
Caution
|
FIXME |
onApplicationStart(applicationStart: SparkListenerApplicationStart): Unit
Note
|
onApplicationStart is part of SparkListener contract to announce that a Spark application has been started.
|
onApplicationStart
takes driverLogs
property from the input applicationStart
(if defined) and finds the driver’s active StorageStatus (using the current StorageStatusListener). onApplicationStart
then uses the driver’s StorageStatus (if defined) to set executorLogs
.
ExecutorTaskSummary Attribute | SparkListenerApplicationStart Attribute |
---|---|
|
|
onExecutorAdded(executorAdded: SparkListenerExecutorAdded): Unit
Note
|
onExecutorAdded is part of SparkListener contract to announce that a new executor has been registered with the Spark application.
|
onExecutorAdded
finds the executor (using the input executorAdded
) in the internal executorToTaskSummary
registry and sets the attributes. If not found, onExecutorAdded
creates a new entry.
ExecutorTaskSummary Attribute | ExecutorInfo Attribute |
---|---|
|
|
|
|
|
|
onExecutorAdded
adds the input executorAdded
to executorEvents
collection. If the number of elements in executorEvents
collection is greater than spark.ui.timeline.executors.maximum configuration property, the first/oldest event is removed.
onExecutorAdded
removes the oldest dead executor from executorToTaskSummary
lookup table if their number is greater than spark.ui.retainedDeadExecutors.
onExecutorRemoved(executorRemoved: SparkListenerExecutorRemoved): Unit
Note
|
onExecutorRemoved is part of SparkListener contract to announce that an executor has been unregistered with the Spark application.
|
onExecutorRemoved
adds the input executorRemoved
to executorEvents
collection. It then removes the oldest event if the number of elements in executorEvents
collection is greater than spark.ui.timeline.executors.maximum configuration property.
The executor is marked as removed/inactive in executorToTaskSummary
lookup table.
onTaskStart(taskStart: SparkListenerTaskStart): Unit
Note
|
onTaskStart is part of SparkListener contract to announce that a task has been started.
|
onTaskStart
increments tasksActive
for the executor (using the input SparkListenerTaskStart
).
ExecutorTaskSummary Attribute | Description |
---|---|
|
Uses |
onTaskEnd(taskEnd: SparkListenerTaskEnd): Unit
Note
|
onTaskEnd is part of SparkListener contract to announce that a task has ended.
|
onTaskEnd
takes TaskInfo from the input taskEnd
(if available).
Depending on the reason for SparkListenerTaskEnd
onTaskEnd
does the following:
onTaskEnd
Behaviour per SparkListenerTaskEnd
Reason
SparkListenerTaskEnd Reason |
onTaskEnd Behaviour |
---|---|
|
Does nothing |
|
Increment |
anything |
Increment |
tasksActive
is decremented but only when the number of active tasks for the executor is greater than 0
.
onTaskEnd
Behaviour
ExecutorTaskSummary Attribute | Description |
---|---|
|
Decremented if greater than 0. |
|
Uses |
If the TaskMetrics
(in the input taskEnd
) is available, the metrics are added to the taskSummary
for the task’s executor.
Task Summary | Task Metric |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
activeStorageStatusList: Seq[StorageStatus]
activeStorageStatusList
requests StorageStatusListener for active BlockManagers (on executors).
Note
|
|