onApplicationStart(applicationStart: SparkListenerApplicationStart): Unit
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.
Registries
| Registry | Description |
|---|---|
The lookup table for Used to build a |
|
A collection of SparkListenerEvents. Used to build the event timeline in All Jobs and Details for Job pages. |
onApplicationStart Method
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 Method
onExecutorAdded(executorAdded: SparkListenerExecutorAdded): Unit
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, 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 Method
onExecutorRemoved(executorRemoved: SparkListenerExecutorRemoved): Unit
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.
The executor is marked as removed/inactive in executorToTaskSummary lookup table.
onTaskStart Method
onTaskStart(taskStart: SparkListenerTaskStart): Unit
onTaskStart increments tasksActive for the executor (using the input SparkListenerTaskStart).
| ExecutorTaskSummary Attribute | Description |
|---|---|
|
Uses |
Intercepting Task End Events — onTaskEnd Callback
onTaskEnd(taskEnd: SparkListenerTaskEnd): Unit
onTaskEnd uses the 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 |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Settings
| Name | Default Value | Description |
|---|---|---|
|
The maximum number of entries in executorEvents registry. |