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

LocalSchedulerBackend

LocalSchedulerBackend

LocalSchedulerBackend is a scheduler backend and a ExecutorBackend for Spark local run mode.

LocalSchedulerBackend acts as a “cluster manager” for local mode to offer resources on the single worker it manages, i.e. it calls TaskSchedulerImpl.resourceOffers(offers) with offers being a single-element collection with WorkerOffer.

Note
WorkerOffer represents a resource offer with CPU cores available on an executor.

When an executor sends task status updates (using ExecutorBackend.statusUpdate), they are passed along as StatusUpdate to LocalEndpoint.

LocalSchedulerBackend LocalEndpoint Executor task status updates.png
Figure 1. Task status updates flow in local mode

When LocalSchedulerBackend starts up, it registers a new RpcEndpoint called LocalSchedulerBackendEndpoint that is backed by LocalEndpoint. This is announced on LiveListenerBus as driver (using SparkListenerExecutorAdded message).

The application ids are in the format of local-[current time millis].

It communicates with LocalEndpoint using RPC messages.

The default parallelism is controlled using spark.default.parallelism property.

赞(0) 打赏
未经允许不得转载:spark技术分享 » LocalSchedulerBackend
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

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

支付宝扫一扫打赏

微信扫一扫打赏