In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail what is the use of the EMetaBlob class for you. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
EMetaBlob is used to record the Log of CDir and CDentry
The EMetaBlob class description:
Class EMetaBlob: public LogEvent {
}
Methods of the EMetaBlob class:
EMetaBlob::add_dir_context (dir, mode) adds dir and its parent directory to the EMetaBlob class
| | _ _ check whether the current lump_map collection already contains dir |
| | _ _ return directly |
| | _ _ traverse from the dir directory to the root directory in turn |
| | _ _ get CInode (diri) and CDentry (parent) of dir |
| | _ _ if mode = = TO_AUTH_SUBTREE_ROOT |
| | _ _ if dir is subtree_root and already belongs to auth |
| | _ _ exits traversal |
| | _ _ if dir belongs to subtree_root but not auth |
| | _ _ insert the maybe array (CDentry list) into the beginning of the parents array |
| | _ _ if diri has already passed journal |
| | _ _ exits traversal |
| | _ _ Rudiri-> last_journaled > = last_subtree_map indicates that the inode has been written to the log since last subtree map. |
| | _ maybenot=true |
| | _ _ if it is already a root directory (parent is empty) |
| | _ _ exits traversal |
| | _ maybenot==true |
| | _ _ insert parent into maybe array |
| | _ maybenot==false |
| | _ _ insert parent into parents array |
| | _ _ dir=parent- > get_dir () progresses to the root directory from the current dir |
| | _ _ insert maybe array to the beginning of parents array |
| | _ _ traverse the parents array |
| | _ _ add_dentry () adds members of the parents array to the EMetaBlob class |
EMetaBlob::update_segment (ls) updates inotablev and sessionmapv of LogSegment
| | _ _ if inotablev is not empty |
| | _ ls- > inotablev=inotablev |
| | _ _ if sessionmapv is not empty |
| | _ ls- > sessionmapv=sessionmapv |
EMetaBlob::fullbit::update_inode (mds, in)
| | _ _ initialize EMedaBlob class objects with data from CInode class objects |
EMetaBlob::get_inodes (inodes)
| | _ _ traverse the lump_map collection |
| | _ _ get the dirfrag inode number of each member in the lump_map combination |
| | _ _ insert inode number into inodes array |
| | _ _ get dirlump information from lump_map |
| | _ _ traverses the fullbit in dirlump |
| | _ _ insert the inode number corresponding to fullbit in dirlump into the inodes array |
| | _ _ traverses the remotebit in dirlump |
| | _ _ insert the inode number of remotebit into inodes array |
EMetaBlob::get_dentries (dentries)
| | _ _ traverse the lump_map collection |
| | _ _ get dirlump information from lump_map |
| | _ _ get the full_dentry/remote_dentry/null_dentry information from the dirlump structure |
| | _ _ traverse the full_dentry array |
| | _ _ insert the dn (dentry name) of the member in the full_dentry array into the dentries array |
| | _ _ traverse the remote_dentry array |
| | _ _ insert the dn (dentry name) of the member in the remote_dentry array into the dentries array |
| | _ _ traverse the null_dentry array |
| | _ _ insert the dn (dentry name) of the member in the null_dentry array into the dentries array |
EMetaBlob::get_paths (paths) gets all the absolute directory information from the dirlump structure
| | _ _ if lump _ map is empty and roots is not empty |
| | _ _ insert "/" into paths array |
| | _ _ traverse the lump_map collection |
| | _ _ get the full_dentry/remote_dentry/null_dentry array |
| | _ _ traverse the full_dentry array |
| | _ _ insert the dentry name from the member of the full_dentry array into the children array, namely: children.push _ back (dentry) |
| | _ _ update the ino_locations array, that is, ino_locations [(* iter)-> inode.ino] = Location (dir_ino, dentry) |
| | _ _ traverse the remote_dentry array |
| | _ _ insert the dentry name from the member of the remote_dentry array into the children array, namely: children.push _ back (dentry) |
| | _ _ traverse the null_dentry array |
| | _ _ insert the dentry name from the member of the null_dentry array into the children array, namely: children.push _ back (dentry) |
| | _ _ traverse the lump_map collection |
| | _ _ get the full_dentry/remote_dentry/null_dentry array |
| | _ _ traverse the full_dentry array |
| | _ _ if the corresponding node is not found in the children array, the node is a leaf node |
| | _ _ insert the inode and dentry information of the node into the leaf_locations array, that is, leaf_locations.push_back (Location (dir_ino, dentry)) |
| | _ _ traverse the remote_dentry array |
| | _ _ insert the inode and dentry information of the node into the leaf_locations array, that is, leaf_locations.push_back (Location (dir_ino, dentry)) |
| | _ _ traverse the null_dentry array |
| | _ _ insert the inode and dentry information of the node into the leaf_locations array, that is, leaf_locations.push_back (Location (dir_ino, dentry)) |
| | _ _ traverse the leaf_locations array |
| | _ _ get the inode number and the corresponding path |
| | _ _ traverse the ino_locations array to find the inode number. If the search is successful |
| | _ _ add the corresponding path value in the ino_locations array to the front of the path, that is, the path directory information at the next level that constitutes the current path |
| | _ _ inode number is updated to the inode number corresponding to ino_locations |
| | _ _ insert the path value into the paths array |
EMetaBlob::replay (mds, logseg, slaveup)
| | _ _ traverse the roots array |
| | _ _ get CInode information from MDCache, that is, mds- > mdcache- > get_inode () |
| | _ _ if there is no CInode information in MDCache |
| | _ _ create a new CInode class object |
| | _ _ EMetaBlob::fullbit::update_inode () updates CInode information with fullbit information |
| | _ _ if the roots member is dirty |
| | _ _ set CInode to dirty |
| | _ _ renamed _ dirino is not empty |
| | _ _ get CInode information from MDCache, that is, mds- > mdcache- > get_inode (renamed_dirino) |
| | _ _ traverse the lump_order array |
| | _ _ get dirlump information from lump_map array |
| | nnull of _ _ dirlump is not empty |
| | _ _ number of updated nnull, that is, nnull + = lump.nnull |
| | _ _ traverse the lump_order array |
| | _ _ get dirlump information from lump_map array |
| | _ _ get the CDir information corresponding to dirfrag from MDCache, namely: mds- > mdcache- > get_force_dirfrag () |
| | _ _ if CDir is empty |
| | _ _ get the CInode information corresponding to the CDir from MDCache, namely: mds- > mdcache- > get_inode () |
| | _ _ if CInode is empty |
| | _ _ if the CInode number corresponding to CDir is within the range of MDSDIR |
| | _ _ create a CInode from MDCache, that is: mds- > mdcache- > create_system_inode () |
| | _ _ clear the AUTH identity of the newly created CInode, that is, diri- > state_clear (STATE_AUTH) |
| | _ _ if the CInode number corresponding to CDir is not within the range of MDSDIR |
| | _ assert (0) |
| | _ _ get CDir information based on CInode, that is, diri- > get_or_open_dirfrag () |
| | _ _ if the number of CInode is ROOT or MDSDIR |
| | _ _ adjust the auth of subtree, that is, mds- > mdcache- > adjust_subtree_auth () |
| | _ _ set the version/fnode information of CDir |
| | _ _ if dirlump is is_importing () |
| | _ _ set the CDir STATE_AUTH flag and clear the STATE_COMPLETE flag |
| | _ _ if dirlump is is_dirty () |
| | _ CDir::_mark_dirty () |
| | _ _ if dir- > fnode.rstat! = dir- > fnode.accounted_rstat indicates that there is dirty nestinfo |
| | _ mds- > locker- > mark_updated_scatterlock () |
| | _ logseg- > dirty_dirfrag_nest.push_back (dir- > inode- > item_dirty_dirfrag_nest) |
| | _ _ if dir- > fnode.fragstat! = dir- > fnode.accounted_fragstat indicates that there is dirty fragstat |
| | _ mds- > locker- > mark_updated_scatterlock () |
| | _ logseg- > dirty_dirfrag_dir.push_back (dir- > inode- > item_dirty_dirfrag_nest) |
| | _ _ if lump is is_dirty_dft () |
| | _ _ set the status of dir to DIRTYDFT, that is, dir- > state_set (STATE_DIRTYDFT) |
| | _ mds- > locker- > mark_updated_scatterlock () |
| | _ logseg- > dirty_dirfrag_dirfragtree.push_back (dir- > inode- > item_dirty_dirfrag_nest) |
| | _ _ if lump is is_new () |
| | _ _ sets dir to be new, that is, dir- > mark_new () |
| | _ _ if lump is is_complete () |
| | _ _ sets dir to be complete, that is, dir- > mark_complete () |
| | _ _ parse the dfull/dremote/dnull information from lump, that is, lump._decode_bits () |
| | _ _ traverse the full_dentry array |
| | _ _ get the CDentry object corresponding to dnlast, that is, dir- > lookup_exact_snap (dn, dnlast) |
| | _ _ if CDentry object is empty |
| | _ _ add an empty dentry to dir, that is: dir- > add_null_dentry () |
| | _ _ set the version information of full_dentry based on the dentry version information of dentry |
| | _ _ if CDentry object is not empty |
| | _ _ set the version information of full_dentry based on the dentry version information of dentry |
| | _ _ set the first of dentry to the dnfirst of full_entry |
| | _ _ if lump is is_importing () |
| | _ _ set the status of dentry to AUTH, that is, dn- > state_set (STATE_AUTH) |
| | _ _ get the CInode information of dnlast from MDCache, that is: mds- > mdcache- > get_inode (ino, dnlast) |
| | _ _ if CInode information is empty |
| | _ _ create a new CInode class object |
| | _ _ initialize a new CInode class object with full_dentry information, that is, p-> update_inode (mds, in) |
| | _ _ add a new CInode to the MDCache, that is, mds- > mdcache- > add_inode (in) |
| | _ _ if the linkage of dentry is not empty |
| | _ _ if linkage of dentry is primary |
| | _ _ put dir into the unlinked array that should be deleted |
| | _ _ removes the correspondence between dir and dentry, that is, dir- > unlink_inode (dn) |
| | _ _ if CInode is in unlinked array |
| | _ _ insert CInode into linked array |
| | _ _ set the primary link inode of dir, that is, dir- > link_primary_inode (dn, in) |
| | _ _ if CInode information is not empty |
| | _ _ sets the first value of CInode, that is, in- > first = p-> dnfirst |
| | _ _ initialize a new CInode class object with full_dentry information, that is, p-> update_inode (mds, in) |
| | _ _ if the linkage of dentry is not CInode and CInode has parent dentry |
| | _ _ put the parent dir of CInode into the unlinked array |
| | _ _ removes the correspondence between CInode and its parent dir, that is, in- > get_parent_dir ()-> unlink_inode (in- > get_parent_dn ()) |
| | _ _ if the linkage of dentry is not CInode |
| | _ _ if the linkage of dentry is not empty |
| | _ _ if linkage of dentry is primary |
| | _ _ put dir into the unlinked array that should be deleted |
| | _ _ removes the correspondence between dir and dentry, that is, dir- > unlink_inode (dn) |
| | _ _ if CInode is in unlinked array |
| | _ _ insert CInode into linked array |
| | _ _ set the primary link inode of dir, that is, dir- > link_primary_inode (dn, in) |
| | _ if full _ dentry is is_dirty () |
| | _ _ set CInode to dirty, that is, in- > _ mark_dirty (logseg) |
| | _ if full _ dentry is is_dirty_parent () |
| | _ _ set CInode to dirty parent, that is, in- > _ mark_dirty_parent () |
| | _ _ if dentry is is_auth () |
| | _ _ set the status of CInode to AUTH, that is, in- > state_set (STATE_AUTH) |
| | _ _ traverse the remote dentry array |
| | _ _ get the CDentry object corresponding to dnlast, that is, dir- > lookup_exact_snap (dn, dnlast) |
| | _ _ if CDentry object is empty |
| | _ _ add a new remote dentry to dir, that is: dir- > add_remote_dentry () |
| | _ _ set the version information of remote_dentry based on the dentry version information of dentry |
| | _ _ if CDentry object is not empty |
| | _ _ if the linkage of dentry is not empty |
| | _ _ if linkage of dentry is primary |
| | _ _ insert dir into unlinked array |
| | _ _ disassociate dir from dentry, that is, dir- > unlink_inode (dn) |
| | _ _ add remote inode to dir, that is: dir- > link_remote_inode () |
| | _ _ set the version information of remote_dentry based on the dentry version information of dentry |
| | _ _ set the first of dentry to the first of remote_dentry |
| | _ _ if lump is is_importing () |
| | _ _ set the status of dentry to AUTH, that is, dn- > state_set (STATE_AUTH) |
| | _ _ traverse the null_dentry array |
| | _ _ get the CDentry object corresponding to dnlast, that is, dir- > lookup_exact_snap (dn, dnlast) |
| | _ _ if CDentry object is empty |
| | _ _ add a new remote dentry to dir, that is: dir- > add_remote_dentry () |
| | _ _ set the version information of remote_dentry based on the dentry version information of dentry |
| | _ _ if CDentry object is not empty |
| | _ _ set the first of dentry to the first of null_dentry |
| | _ _ if the linkage of dentry is not empty |
| | _ _ insert dir into unlinked array |
| | _ _ disassociate dir from dentry, that is, dir- > unlink_inode (dn) |
| | _ _ set the version information of null_dentry based on the dentry version information |
| | _ _ if lump is is_importing () |
| | _ _ set the status of dentry to AUTH, that is, dn- > state_set (STATE_AUTH) |
| | _ _ renamed _ dirino is not empty |
| | _ _ renamed _ diri is not empty |
| | _ _ set olddir to unlined [renamed _ diri] |
| | _ _ renamed _ diri is empty |
| | _ _ get renamed_diri from MDCache, that is, mds- > mdcache- > get_inode (renamed_dirino) |
| | _ _ if olddir is not empty |
| | _ _ get all the leaf nodes from the dirfragtree of renamed_diri, that is, renamed_diri- > dirfragtree.get_leaves () |
| | _ _ traverses leaf nodes |
| | _ _ find the corresponding CDir information based on the leaf node |
| | _ _ if CDir is not authenticated |
| | _ _ insert the CInode corresponding to CDir into the olddirs of slaveup, that is, slaveup- > olddirs.insert (dir- > inode) |
| | _ _ if CDir is authenticated |
| | _ _ set the status of dir to AUTH, that is, dir- > state_set (STATE_AUTH) |
| | _ _ update the subtree information in MDCache, that is, mds- > mdcache- > adjust_subtree_after_rename () |
| | _ _ get the CDir information of olddir's subtree_root from MDCache |
| | _ _ if subtree _ root is not authenticated |
| | _ _ if slaveup is not empty |
| | _ _ insert the CInode corresponding to olddir into the olddirs of slaveup, that is, slaveup- > olddirs.insert (dir- > inode) |
| | _ _ if slaveup is empty |
| | _ _ update the subtree information of MDCache, that is, mds- > mdcache- > try_trim_non_auth_subtree () |
| | _ _ if renamed _ diri is certified |
| | _ _ traverse the renamed_dir_frags array |
| | _ _ get the CDir information of its dirfrag from the CInode of renamed_diri, namely: reanmed_diri- > get_dirfrag () |
| | _ _ if CDir information exists |
| | _ _ traverses the next
| | _ _ create a new CDir object, namely: renamed_diri- > get_or_open_dirfrag () |
| | _ _ clear the AUTH of the newly created CDir, that is, dir- > state_clear (STATE_AUTH) |
| | _ _ adjust the subtree information in MDCache, that is, mds- > mdcache- > adjust_subtree_auth () |
| | _ _ delete renamed_diri from unlinked array |
| | _ _ traverse the unlined array |
| | _ _ adjust the subtree information in MDCache, that is, mds- > mdcache- > adjust_subtree_after_rename () |
| | _ _ if unlinked array is not empty |
| | _ _ traverse the linked array |
| | _ _ Delete a member of the linked array from the unlinked array |
| | _ _ traverse the unlinked array |
| | _ _ if slaveup is not empty |
| | _ _ insert unlinked information into the unlinked array of slaveup, that is, slaveup- > unlinked.insert () |
| | _ _ if slaveup is empty |
| | _ _ update MDCache, that is, mds- > mdcache- > remove_inode_recursive () |
| | _ _ traverse the table_tids array (traversing table client) |
| | _ _ get the MDSTableClient class object, that is, mds- > get_table_client () |
| | _ _ execute the got_journaled_agree () function of client, that is, client- > got_journaled_agree () |
| | _ _ opened _ ino is not empty |
| | _ _ get the CInode corresponding to opened_ino from MDCache, that is, mds- > mdcache- > get_inode () |
| | _ _ insert the item_open_file of CInode into the open_files array of logseg, namely: logseg- > open_files.push_back () |
| | _ _ if inotablev is not empty |
| | _ _ if the inotable version number of mds is less than inotablev |
| | _ _ if _ ino is not empty |
| | _ _ reassign inode number, that is, mds- > inotable- > replay_alloc_id () |
| | _ _ if preloaded _ inos is not empty |
| | _ _ reassign inode number, that is, mds- > inotable- > replay_alloc_id () |
| | _ _ if sessionmapv is not empty |
| | _ if the sessionmap version number of mds + 2 > = sessionmapv |
| | _ _ get session information based on client_name, that is, mds- > sessionmap.get_session () |
| | _ _ if session is not empty |
| | _ _ re-execute the session of dirty, that is, mds- > sessionmap.replay_dirty_session () |
| | _ _ if session is empty |
| | _ _ execute advance version, namely: mds- > sessionmap.replay_advance_version () |
| | _ _ traverse the truncate_start array |
| | _ _ get the corresponding CInode information from MDCache, namely: mds- > mdcache- > get_inode () |
| | _ _ execute add recovered truncate in MDCache, namely: mds- > mdcache- > add_recovered_truncate () |
| | _ _ traverse the truncate_finish array |
| | _ _ get the corresponding LogSegment from MDLog, that is, mds- > mdlog- > get_segment () |
| | _ _ get the corresponding CInode information from MDCache, namely: mds- > mdcache- > get_inode () |
| | _ _ execute remove recovered truncate in MDCache, namely: mds- > mdcache- > remove_recovered_truncate () |
| | _ _ traverse the destroyed_inodes array |
| | _ _ get the corresponding CInode information from MDCache, namely: mds- > mdcache- > get_inode () |
| | _ _ delete the corresponding CInode in MDCache, that is, mds- > mdcache- > remove_inode () |
| | _ _ traverse the client_reqs array |
| | _ _ get the corresponding Session class object from sessionmap, that is, mds- > sessionmap.get_session () |
| | _ _ add completed request to the Session object, that is, session- > add_completed_request () |
| | _ _ if client _ reqs array contains the session of trim |
| | _ _ execute trim completed request in Session object, that is, session- > trim_completed_request () |
| | _ _ traverse the client_flushes array |
| | _ _ get the corresponding Session class object from sessionmap, that is, mds- > sessionmap.get_session () |
| | _ _ add completed request to the Session object, that is, session- > add_completed_request () |
| | _ _ if client _ reqs array contains the session of trim |
| | _ _ execute trim completed request in Session object, that is, session- > trim_completed_request () |
| | _ _ update LogSegment information, that is, update_segment (logseg) |
This is the end of this article on "what is the use of EMetaBlob classes?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.