关注 spark技术分享,
撸spark源码 玩spark最佳实践

StreamingQueryListenerBus — Notification Bus for Streaming Events

StreamingQueryListenerBus — Notification Bus for Streaming Events

StreamingQueryListenerBus is an event bus (i.e. ListenerBus) to dispatch streaming events to StreamingQueryListener streaming event listeners.

StreamingQueryListenerBus is created when StreamingQueryManager is created (as the internal listenerBus).

StreamingQueryListenerBus.png
Figure 1. StreamingQueryListenerBus is Created Once In SparkSession

StreamingQueryListenerBus is also a SparkListener and registers itself with LiveListenerBus to intercept a QueryStartedEvent.

Table 1. StreamingQueryListenerBus’s Internal Registries and Counters
Name Description

activeQueryRunIds

Collection of active streaming queries by their runIds.

Used mainly when StreamingQueryListenerBus dispatches an event to listeners (for queries started in the same SparkSession).

Posting StreamingQueryListener Events to LiveListenerBus — post Method

post simply posts the input event straight to LiveListenerBus except QueryStartedEvent events.

For QueryStartedEvent events, post adds the query’s runId to activeQueryRunIds registry first before posting the event to LiveListenerBus followed by postToAll.

Note
post is used exclusively when StreamingQueryManager posts StreamingQueryListener event.

onOtherEvent Method

Caution
FIXME

doPostEvent Method

Caution
FIXME

postToAll Method

Caution
FIXME

Creating StreamingQueryListenerBus Instance

StreamingQueryListenerBus takes the following when created:

  • LiveListenerBus

StreamingQueryListenerBus registers itself with LiveListenerBus.

StreamingQueryListenerBus initializes the internal registries and counters.

赞(0) 打赏
未经允许不得转载:spark技术分享 » StreamingQueryListenerBus — Notification Bus for Streaming Events
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏