/**
* Lives in the driver to receive heartbeats from executors..
*/
private[spark] class HeartbeatReceiver(sc: SparkContext, clock: Clock)
extends SparkListener with ThreadSafeRpcEndpoint with Logging {
def this(sc: SparkContext) {
this(sc, new SystemClock)
}
sc.addSparkListener(this) ...
2 回答
添加 @Taras Matyashovskyy 答案 .
You can Use SparkListener and intercept SparkListener (Executor) events .
以下是可用的监听器事件列表 .
Example : HeartBeatReceiver.scala
请查看适合您的removed reason(我还没试过)
作为选项,您可以尝试使用
SparkListener
功能 . 因此,您可以创建自己的类并实现SparkListener
接口以挂钩到可以自我解释的可用事件 . 然后,您需要将该自定义侦听器添加到SparkContext
.有2种选择:
SparkContext.addSparkListener(<your custom listener>)
Via
spark.extraListeners
property,更多信息在这里http://spark.apache.org/docs/latest/configuration.html#available-properties