当前位置:网站首页>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
边栏推荐
- MySQL case deep excavation information_ Root causes of slow schema view query (Part 2)
- Grc: GRC interface is mixed with restful API
- Is your database "cloud native"?
- Precautions for VPN client on Tencent cloud
- What aspects does the intelligent identification system include? Is the technology of intelligent identification system mature now?
- Instructions for performance pressure test tool
- Cloud function pressure measurement based on wechat applet
- How to transfer files from the server connected to the fortress machine and how to access the server through the fortress machine
- 2022-2028 Global Industry Survey and trend analysis report on portable pressure monitors for wards
- Windowsvpn client is coveted by vulnerabilities, 53% of companies face supply chain attacks | global network security hotspot
猜你喜欢

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

2022-2028 global medical coating materials industry research and trend analysis report
![[51nod] 2102 or minus and](/img/68/0d966b0322ac1517dd2800234d386d.jpg)
[51nod] 2102 or minus and
![[51nod] 3047 displacement operation](/img/cb/9380337adbc09c54a5b984cab7d3b8.jpg)
[51nod] 3047 displacement operation
![[51nod] 3216 Awards](/img/94/fdb32434d1343040d711c76568b281.jpg)
[51nod] 3216 Awards

2022-2028 global genome editing mutation detection kit industry survey and trend analysis report

What is etcd and its application scenarios

2022-2028 global portable two-way radio equipment industry research and trend analysis report

Simple and beautiful weather code
随机推荐
How does easydss handle the problem that the sharing page cannot be opened due to cache problems?
How do I check the trademark registration number? Where do I need to check?
How to log in the remote server of Fortress machine working principle of Fortress machine
Tencent dongzhiqiang: network security construction needs to change from product driven to service driven
Cloud function pressure measurement based on wechat applet
Industry ranks first in blackmail attacks, hacker organizations attack Afghanistan and India | global network security hotspot
SAP retail characteristic profile I
Process kill problem
Disaster recovery series (V) -- database disaster recovery construction
Grpc: how to reasonably manage log configuration?
AI intelligent analysis is innovated again. In the future, the technical reserve of the security industry will become the top priority
What is etcd and its application scenarios
Introduce the comparison of various distributed configuration centers? Which distributed configuration center is better?
How to install the cloud desktop security server certificate? What can cloud desktops do?
Is AI face detection and face recognition a concept? What's the difference?
What is the difference between cloud desktop cloud terminal and server? What are the advantages of cloud desktop?
How to build a shopping website? What problems should be paid attention to in the construction of shopping websites?
Where is the cloud game server? Can individuals rent cloud game servers?
Tencent cloud CIF engineering efficiency summit ends perfectly
What is the role of the distributed configuration center? What are the advantages of a distributed configuration center?