General Concept Of The Apche Hadoop Is That An Application Submission Client Submits An Application To The YARN the Resource Manager. The client communicates with the resourcemanager using the ApplicationClientProtocol to first acquires a new ApplicationId.
if its require via ApplicationClientProtocol # getNewApplication and after that submits the Application to be run via ApplicationClientProtocol # submit Application. As one of the part of ApplicationClientProtocol # submitApplication call, the cliets provides sufficient information to ResourceManager to launch the made application first container thats mean ApplicationMaster. You need to provide information like as the details about the local files and jar files that needs to be available for your application to run your application, the actual command that needs to be execute. Any Unix environment settings. Effectively, you have to describe the Unix process that needs to be launched for your Applicationmaster.
The YARN ResourceManager launch the ApplicationMaster on an allocated container. The ApplicationMaster is expected to communicate with the ResourceManager using the ApplicationMasterProtocol. Firstly explain the ApplicationMaster needs to register first apole itself with the ResourceManager. To complete the task which assigned to it, the ApplicationMaster can then request for that applied task and receives containers via ApplicationMasterProtocol allocate. After a container is allocated to it, the ApplicationMaster communicates with the NodeManager using ContainerManager and startContainer to a launch the container for its task. As part of launching this container, the ApplicationMaster has to specify the ContainerLaunchContext which is similar to the ApplicationSubmissionContext and has been launched information such as command line specification and environment etc. Once the task is completed, the ApplicationMaster has to signal the ResourceManager its completion via the ApplicationMasterProtocol and finishApplicationMaster.

