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

AMEndpoint — ApplicationMaster RPC Endpoint

AMEndpoint — ApplicationMaster RPC Endpoint

onStart Callback

When onStart is called, AMEndpoint communicates with the driver (the driver remote RPC Endpoint reference) by sending a one-way RegisterClusterManager message with a reference to itself.

After RegisterClusterManager has been sent (and received by YarnSchedulerEndpoint) the communication between the RPC endpoints of ApplicationMaster (YARN) and YarnSchedulerBackend (the Spark driver) is considered established.

RPC Messages

AddWebUIFilter

When AddWebUIFilter arrives, you should see the following INFO message in the logs:

It then passes the AddWebUIFilter message on to the driver’s scheduler backend (through YarnScheduler RPC Endpoint).

RequestExecutors

When RequestExecutors arrives, AMEndpoint requests YarnAllocator for executors given locality preferences.

If the requestedTotal number of executors is different than the current number, resetAllocatorInterval is executed.

In case when YarnAllocator is not available yet, you should see the following WARN message in the logs:

The response is false then.

resetAllocatorInterval

When RequestExecutors message arrives, it calls resetAllocatorInterval procedure.

resetAllocatorInterval requests allocatorLock monitor lock and sets the internal nextAllocationInterval attribute to be initialAllocationInterval internal attribute. It then wakes up all threads waiting on allocatorLock.

Note
A thread waits on a monitor by calling one of the Object.wait methods.
赞(0) 打赏
未经允许不得转载:spark技术分享 » AMEndpoint — ApplicationMaster RPC Endpoint
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

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

支付宝扫一扫打赏

微信扫一扫打赏