SparkListenerInterface¶
SparkListenerInterface is an abstraction of event listeners (that SparkListenerBus notifies about scheduling events).
SparkListenerInterface is a way to intercept scheduling events from the Spark Scheduler that are emitted over the course of execution of a Spark application.
SparkListenerInterface is used heavily to manage communication between internal components in the distributed environment for a Spark application (e.g. web UI, event persistence for History Server, dynamic allocation of executors, keeping track of executors).
SparkListenerInterface can be registered in a Spark application using SparkContext.addSparkListener method or spark.extraListeners configuration property.
Tip
Enable INFO logging level for org.apache.spark.SparkContext logger to see what and when custom Spark listeners are registered.
onApplicationEnd¶
Used when:
SparkListenerBusis requested to post a SparkListenerApplicationEnd event
onApplicationStart¶
Used when:
SparkListenerBusis requested to post a SparkListenerApplicationStart event
onBlockManagerAdded¶
Used when:
SparkListenerBusis requested to post a SparkListenerBlockManagerAdded event
onBlockManagerRemoved¶
Used when:
SparkListenerBusis requested to post a SparkListenerBlockManagerRemoved event
onBlockUpdated¶
Used when:
SparkListenerBusis requested to post a SparkListenerBlockUpdated event
onEnvironmentUpdate¶
Used when:
SparkListenerBusis requested to post a SparkListenerEnvironmentUpdate event
onExecutorAdded¶
Used when:
SparkListenerBusis requested to post a SparkListenerExecutorAdded event
onExecutorBlacklisted¶
Used when:
SparkListenerBusis requested to post a SparkListenerExecutorBlacklisted event
onExecutorBlacklistedForStage¶
onExecutorBlacklistedForStage(
executorBlacklistedForStage: SparkListenerExecutorBlacklistedForStage): Unit
Used when:
SparkListenerBusis requested to post a SparkListenerExecutorBlacklistedForStage event
onExecutorMetricsUpdate¶
Used when:
SparkListenerBusis requested to post a SparkListenerExecutorMetricsUpdate event
onExecutorRemoved¶
Used when:
SparkListenerBusis requested to post a SparkListenerExecutorRemoved event
onExecutorUnblacklisted¶
Used when:
SparkListenerBusis requested to post a SparkListenerExecutorUnblacklisted event
onJobEnd¶
Used when:
SparkListenerBusis requested to post a SparkListenerJobEnd event
onJobStart¶
Used when:
SparkListenerBusis requested to post a SparkListenerJobStart event
onNodeBlacklisted¶
Used when:
SparkListenerBusis requested to post a SparkListenerNodeBlacklisted event
onNodeBlacklistedForStage¶
Used when:
SparkListenerBusis requested to post a SparkListenerNodeBlacklistedForStage event
onNodeUnblacklisted¶
Used when:
SparkListenerBusis requested to post a SparkListenerNodeUnblacklisted event
onOtherEvent¶
Used when:
SparkListenerBusis requested to post a custom SparkListenerEvent
onSpeculativeTaskSubmitted¶
Used when:
SparkListenerBusis requested to post a SparkListenerSpeculativeTaskSubmitted event
onStageCompleted¶
Used when:
SparkListenerBusis requested to post a SparkListenerStageCompleted event
onStageExecutorMetrics¶
Used when:
SparkListenerBusis requested to post a SparkListenerStageExecutorMetrics event
onStageSubmitted¶
Used when:
SparkListenerBusis requested to post a SparkListenerStageSubmitted event
onTaskEnd¶
Used when:
SparkListenerBusis requested to post a SparkListenerTaskEnd event
onTaskGettingResult¶
Used when:
SparkListenerBusis requested to post a SparkListenerTaskGettingResult event
onTaskStart¶
Used when:
SparkListenerBusis requested to post a SparkListenerTaskStart event
onUnpersistRDD¶
Used when:
SparkListenerBusis requested to post a SparkListenerUnpersistRDD event
Implementations¶
- EventFilterBuilder
- SparkFirehoseListener
- SparkListener