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

ExternalClusterManager — Pluggable Cluster Managers

ExternalClusterManager — Pluggable Cluster Managers

ExternalClusterManager is a contract for pluggable cluster managers. It returns a task scheduler and a backend scheduler that will be used by SparkContext to schedule tasks.

Note
The support for pluggable cluster managers was introduced in SPARK-13904 Add support for pluggable cluster manager.

External cluster managers are registered using the java.util.ServiceLoader mechanism (with service markers under META-INF/services directory). This allows auto-loading implementations of ExternalClusterManager interface.

Note
ExternalClusterManager is a private[spark] trait in org.apache.spark.scheduler package.
Note
The two implementations of the ExternalClusterManager contract in Spark 2.0 are YarnClusterManager and MesosClusterManager.

ExternalClusterManager Contract

canCreate Method

canCreate is a mechanism to match a ExternalClusterManager implementation to a given master URL.

createTaskScheduler Method

createTaskScheduler creates a TaskScheduler given a SparkContext and the input masterURL.

createSchedulerBackend Method

createSchedulerBackend creates a SchedulerBackend given a SparkContext, the input masterURL, and TaskScheduler.

Initializing Scheduling Components — initialize Method

initialize is called after the task scheduler and the backend scheduler were created and initialized separately.

Note
There is a cyclic dependency between a task scheduler and a backend scheduler that begs for this additional initialization step.
Note
TaskScheduler and SchedulerBackend (with DAGScheduler) are commonly referred to as scheduling components.
赞(0) 打赏
未经允许不得转载:spark技术分享 » ExternalClusterManager — Pluggable Cluster Managers
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

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

支付宝扫一扫打赏

微信扫一扫打赏