当前位置:网站首页>Applicationclientprotocol of yarn source code
Applicationclientprotocol of yarn source code
2022-06-24 03:07:00 【reisende】
Introduction
yarn adopt Protocol Protocol layer to communicate interface layer and core logic layer .
ApplicationClientProtocol The agreement is responsible for Client and ResourceManager Interaction logic of . The main functions are submit/abort jobs( Submit / Terminate task ) and get information from applications( Get application information ) as well as get cluster metrics( Get cluster indicators ). This article will focus on the main functions
summary
ApplicaitionBaseProtocol
This agreement inherits ApplicaitionBaseProtocol Interface , This is because access to application information , Get container information , management Delegation token( Delegate flag ) These functions can be reused by other protocols , So we extracted a base Interface
Put aside what the parent interface does ,ApplicationClientProtocol There are only a few functions left
getNewApplication Get a new one ApplicaitonId, And get the RM The maximum resources currently available for allocation
submitApplication Formally submit an application , You need to include the details of the application , for example queue,resource,containerLaunchContext etc.
forceKillApplication Force to kill an application
getClusterMetrics Get cluster indicators
getClusterNodes Get the cluster node report
Three realizations
The three implementations are located in three layers
ApplicationClientProtocolPBClientImpl, At interface layer , Directly be client Interface calls are provided to the user
ClientRMService, At the core logic layer , from RM Realization , Contains all the core interaction logic
ClientRMProtocols, be located Poxy Agent interaction layer , Used to expose the calling interface to the interface layer
Submit the overall task flow
client Request
client call getNewApplication Method
rmClient It is actually a protocol interface , stay serviceStart Is initialized in
Request to the proxy layer
Through here ClientRMProxy( all RM The relevant protocol objects will be obtained from the proxy ) Created a protocol Proxy object , It encapsulates the protocol related information and all related RPC operation
This Proxy The object is actually the one mentioned above ApplicationClientProtocolPBClientImpl example , So the call actually goes to ApplicationClientProtocolPBClientImpl#getNewApplication
This proxy The object is really from RPC Class created RPC Agent , Then the request is forwarded through the proxy layer , The request will be given to RM On the deployed machine
RM Accept the request
Now , The request has arrived ClientRMService#getNewApplication
Distribute ID
RM A new ApplicationId. Based on the current cluster timestamp and an incremental Counter As Id
Get resource information
And then through YarnScheduler Get resource information
The request was finally given to ClusterNodeTracker#getMaxAllowedAllocation
You can see , It's direct here clone 了 configuredMaxAllocation Variable , This variable will be YarnScheduler Constantly refreshing .
stay CapacityScheduler#initScheduler in , The maximum resource is set for the first time when initializing the scheduler
stay CapacityScheduler#reinitialize in , When scheduler ( Whether it's fifo still fair) After accepting a new task and allocating resources, the maximum resource parameter will be refreshed
Finally, the result will be returned
client Submit tasks
client Submit the task after completing a series of parameter settings
The logic of request passing is the same as before , So let's talk about the processing logic directly
RM Accept the request
ClientRMService#submitApplication
User permission check
Check whether the application already exists
Prevent duplicate creation of concurrent requests
Check the container Token Is it overdue
Setup queue
from RMAppMaster Accept task processing
Then the task is submitted
边栏推荐
- How to install an application publisher
- Prompt error when Jekyll runs cannot load such file -- webrick (LoadError)
- Process kill problem
- UI automation based on Selenium
- IOS development - multithreading - thread safety (3)
- The cost of on-site development of software talent outsourcing is higher than that of software project outsourcing. Why
- [hot] with a budget of only 100 yuan, how to build a 1-year web site on Tencent cloud??
- How to query trademark registration? Where should I check?
- How to set up a cloud desktop server? Is there a charge for cloud desktop server setup?
- More than 10 million Android users installed a fraud app and doubled the number of blackmail attacks in the UK | global network security hotspot
猜你喜欢

2022-2028 global high tibial osteotomy plate industry research and trend analysis report

2022-2028 global anti counterfeiting label industry research and trend analysis report

2022-2028 global medical coating materials industry research and trend analysis report

2022-2028 global tungsten copper alloy industry research and trend analysis report

2022-2028 global pilot night vision goggle industry research and trend analysis report

2022-2028 global cancer biopsy instrument and kit industry research and trend analysis report

2022-2028 global third-party data platform industry research and trend analysis report
![[51nod] 2653 section XOR](/img/2d/cb4bf4e14939ce432cac6d35b6a41b.jpg)
[51nod] 2653 section XOR

UI automation based on Selenium

2022-2028 global medical modified polypropylene industry research and trend analysis report
随机推荐
Where is the cloud game server? Can individuals rent cloud game servers?
Is your posture correct—— A detailed discussion on horizontal sub database and sub table
2022-2028 global indoor pressure monitor and environmental monitor industry research and trend analysis report
How does easydss handle the problem that the sharing page cannot be opened due to cache problems?
2022-2028 Global Industry Survey and trend analysis report on portable pressure monitors for wards
What are the security guarantees for cloud desktop servers? What are the cloud desktop server platforms?
File access methods on Fortress server how to log in to the server
[summary of interview questions] zj5
Why do cloud desktops use rack servers? Why choose cloud desktop?
What is the meaning of scdo? Is it comparable to bGH
Is the IP of the fortress machine the IP of the server? How to deploy the fortress machine
golang with script
Tencent dongzhiqiang: network security construction needs to change from product driven to service driven
What is the difference between cloud desktop cloud terminal and server? What are the advantages of cloud desktop?
PHP verify mailbox format
How to install an application publisher
2022-2028 global aircraft audio control panel system industry research and trend analysis report
What does cloud desktop mean? What are the characteristics of cloud desktop?
Easynvr shows that the channel is online but cannot be played. Troubleshooting (non video streaming)
Cloud call: one line of code is directly connected to wechat open interface capability