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

StateStoreCoordinatorRef — RPC Endpoint Reference to StateStoreCoordinator

StateStoreCoordinatorRef — RPC Endpoint Reference to StateStoreCoordinator

StateStoreCoordinatorRef is used to (let the tasks on Spark executors to) send messages to the StateStoreCoordinator (that lives on the driver).

StateStoreCoordinatorRef is given the RpcEndpointRef to the StateStoreCoordinator RPC endpoint when created.

StateStoreCoordinatorRef is created through StateStoreCoordinatorRef helper object when requested to create one for the driver (when StreamingQueryManager is created) or an executor (when StateStore helper object is requested for the RPC endpoint reference to StateStoreCoordinator for Executors).

Table 1. StateStoreCoordinatorRef’s Methods and Underlying RPC Messages
Method Description

deactivateInstances

Requests the RpcEndpointRef to send a DeactivateInstances synchronous message with the given runId and waits for a true / false response

Used exclusively when StreamingQueryManager is requested to handle termination of a streaming query (when StreamExecution is requested to run a streaming query and the query has finished (running streaming batches)).

getLocation

Requests the RpcEndpointRef to send a GetLocation synchronous message with the given StateStoreProviderId and waits for the location

Used when:

reportActiveInstance

Requests the RpcEndpointRef to send a ReportActiveInstance one-way asynchronous (fire-and-forget) message with the given StateStoreProviderId, host and executorId

Used exclusively when StateStore helper object is requested for reportActiveStoreInstance (when StateStore helper object is requested to find the StateStore by StateStoreProviderId)

stop

Requests the RpcEndpointRef to send a StopCoordinator synchronous message

Used exclusively for unit testing

verifyIfInstanceActive

Requests the RpcEndpointRef to send a VerifyIfInstanceActive synchronous message with the given StateStoreProviderId and executorId, and waits for a true / false response

Used exclusively when StateStore helper object is requested for verifyIfStoreInstanceActive (when requested to doMaintenance from a running MaintenanceTask daemon thread)

Creating StateStoreCoordinatorRef to StateStoreCoordinator RPC Endpoint for Driver — forDriver Factory Method

forDriver…​FIXME

Note
forDriver is used exclusively when StreamingQueryManager is created.

Creating StateStoreCoordinatorRef to StateStoreCoordinator RPC Endpoint for Executor — forExecutor Factory Method

forExecutor…​FIXME

Note
forExecutor is used exclusively when StateStore helper object is requested for the RPC endpoint reference to StateStoreCoordinator for Executors.
赞(0) 打赏
未经允许不得转载:spark技术分享 » StateStoreCoordinatorRef — RPC Endpoint Reference to StateStoreCoordinator
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

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

支付宝扫一扫打赏

微信扫一扫打赏