ExecutorsListener Spark Listener
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. |
|
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. |
|
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. |
updateExecutorBlacklist
Method
Caution
|
FIXME |
Intercepting Executor Was Blacklisted Events — onExecutorBlacklisted
Callback
Caution
|
FIXME |
Intercepting Executor Is No Longer Blacklisted Events — onExecutorUnblacklisted
Callback
Caution
|
FIXME |
Intercepting Node Was Blacklisted Events — onNodeBlacklisted
Callback
Caution
|
FIXME |
Intercepting Node Is No Longer Blacklisted Events — onNodeUnblacklisted
Callback
Caution
|
FIXME |
Intercepting Application Started Events — onApplicationStart
Callback
1 2 3 4 5 |
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 |
---|---|
|
|
Intercepting Executor Added Events — onExecutorAdded
Callback
1 2 3 4 5 |
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.
Intercepting Executor Removed Events — onExecutorRemoved
Callback
1 2 3 4 5 |
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.
Intercepting Task Started Events — onTaskStart
Callback
1 2 3 4 5 |
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 |
Intercepting Task End Events — onTaskEnd
Callback
1 2 3 4 5 |
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:
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
.
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 |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Finding Active BlockManagers — activeStorageStatusList
Method
1 2 3 4 5 |
activeStorageStatusList: Seq[StorageStatus] |
activeStorageStatusList
requests StorageStatusListener for active BlockManagers (on executors).
Note
|
|