User:Ronak Ghadiya/Apache Ambari

'''

Apache Server
Ambari server consists of API handler which is also called coordinator. Coordinator receives the request, it generates request id and attach to the request. A corresponding APIs are invoked to implement the steps needed to fulfill the request.

Coordinator communicates with the Dependency Tracker to check for dependencies to be handled for the request. Dependency tracker gives prerequisite components and their required states for completion of request to coordinator. Coordinator saves these details in DB. Coordinator then passes this information to the Stage Planner component. Stage Planner produces the staged sequences of operations to be performed at each node of the affected components. It uses the Manifest Generator to define the task roles for each node in each stage.

Coordinator will pass this ordered list of task to Action Manager along with request Id. Action Manager will update the state of each node component in FSM, which will show the progress of operation. FSM is also responsible to check for invalid event flow and generating failure message.

Action Manager generates Action id for each operation and adds it to the plan. Action manager picks actions from the plan and adds to queue for each affected nodes for each stage. When stage is complete it will pick actions from next stage. It also start timer for scheduled actions.

Heartbeat handler receives the responses of actions and passes them to Action manager which in turn inform FSM about the change of states. Once all nodes completed their given tasks, action is considered completed. Once all actions are completed, A Stage is considered completed and next stage is begun to execute. Completion of action is also recorded in Database.

Apache Agent
Ambari Agent communicates with Ambari server through heartbeat messages only. Every commands received from server are appended to the action queue. Action executioner picks the action from the queue and selects appropriate component to perform that action. Generated action responses are queued in message queue which is sent to server in next heartbeat.