Yarn in order to implement multiple state machine objects, control ResourceManager intermediate Rmappimpl, Rmapp-attemptimpl, Rmcontainerimpl and Rmnodeimpl, Jobimpl, Taskimpl and Taskattemptimpl in Applicationimpl, Containerimpl, and Localizedresource,mrappmaster in NodeManager.
To make it easier for users to see the state changes and related events for these state machines. Yarn provides a state machine visualization tool. The detailed operation procedure is as follows.
Step 1 Convert the state machine to a file in the Graphviz (. GV) format. run the compile command under the source root folder such as the following:
MVN compile-pvisualize
after this step. The RESOURCEMANAGER.GV, NODEMANAGER.GV, and MAPREDUCE.GV files in the three Graphviz format are generated in the local folder. NODEMANAGER.GV files in the Localizedresource state machine part of the contents such as the following:
Subgraph Cluster_localizedresource {label= "Localizedresource" "localizedresource.failed" [label = FAILED]; " Localizedresource.downloading "[label = downloading]; " Localizedresource.downloading "," localizedresource.downloading "[Label =" Request,\nrelease "]; " Localizedresource.downloading "," localizedresource.failed "[Label =" localization_failed "]; " Localizedresource.downloading "," localizedresource.localized "[Label =" localized "]; " Localizedresource.init "[label = INIT]; " Localizedresource.init "," localizedresource.downloading "[Label =" REQUEST "]; " localizedresource.localized "[label = localized]; " Localizedresource.localized "," localizedresource.localized "[Label =" Request,\nrelease "];}
Step 2 Use the related commands in the visual package Graphviz to generate the state machine diagram, the shell command details such as the following:
Dot-tpng NODEMANAGER.GV > Nodemanager.png
assuming that the Graphviz package has not been installed, install the package before you operate the procedure, cent OS installation commands such as the following:
sudo yum install Graphviz
Open Nodemanager.png. For example with what is seen (for ease of presentation. Split into two graphs):
Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.
The visualization of yarn state machine