Hadoop state Transition Graph generation

Source: Internet
Author: User

Event-driven and state-shifted, to a large extent, to ensure the smooth advancement of large-scale systems. State transitions have the following benefits:

    1. A state transition diagram can be generated. When discussing a function, you can discuss the diagram directly.
    2. A state transfer diagram, through the lock, producer/consumer mode, etc., can ensure that a point in time only one state transfer, and thus ensure the correctness of the state
    3. In the UT (unit test), you just need to test each transfer path.

Hadoop also employs this approach, such as the state transfer of MapReduce, the management of resources and tasks in NM and RM.

Build method

The state transition diagram inside Hadoop can be generated through a program. Method: Use class Visualizestatemachine to specify three parameters at run time: the name of the diagram, the class that contains the event transfer (separated by "," between classes), the generated file name (. gv format), as

$ hadoop org.apache.hadoop.yarn.state.VisualizeStateMachine TaskStateChange org.apache.hadoop.mapreduce.v2.app.job.impl.TaskImpl TaskImpl.gv

The resulting diagram is as follows

All Hadoop state transition graph generation Methods MVN command generation

Reference MAPREDUCE-2930

$mvn-Pvisualize compile$dot-Tpng NodeManager.> NodeManager.-Tpng ResourceManager.> ResourceManager.-Tpng MapReduce.> MapReduce.png;
Generated by Visualizestatemachine

There are roughly three types of state transitions used in Hadoop: MapReduce, NodeManager, ResourceManager, and the script to generate these three classes of transfer graphs

MapReduce related

Hadoop org. Apache. Hadoop. Yarn. State. VisualizestatemachineMapReduce org. Apache. Hadoop. MapReduce. V2. App. Job. Impl. Jobimpl, org. Apache. Hadoop. MapReduce. V2. App. Job. Impl. Taskimpl, org. Apache. Hadoop. MapReduce. V2. App. Job. Impl. TaskattemptimplMapreduce. GV

NodeManager related

Hadoop org. Apache. Hadoop. Yarn. State. VisualizestatemachineNodeManager org. Apache. Hadoop. Yarn. Server. NodeManager. Containermanager. Application. Applicationimpl, org. Apache. Hadoop. Yarn. Server. NodeManager. Containermanager. Container. Containerimpl, org. Apache. Hadoop. Yarn. Server. NodeManager. Containermanager. Localizer. LocalizedresourceNodeManager. GV

ResourceManager related

Hadoop org. Apache. Hadoop. Yarn. State. VisualizestatemachineResourceManager org. Apache. Hadoop. Yarn. Server. ResourceManager. Rmapp. Attempt. Rmappattemptimpl, org. Apache. Hadoop. Yarn. Server. ResourceManager. Rmapp. Rmappimpl, org. Apache. Hadoop. Yarn. Server. ResourceManager. Rmcontainer. Rmcontainerimpl, org. Apache. Hadoop. Yarn. Server. ResourceManager. Rmnode. RmnodeimplResourceManager. GV

Hadoop state Transition Graph generation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.