ESubtreeMap類說明:
class ESubtreeMap: public LogEvent {
EMetaBlob metablob;
map<dirfrag_t, vector<dirfrag_t>> subtrees;
set<dirfrag_t> ambiguous_subtrees;
uint64_t expire_pos;
uint64_t event_seq;
}:
ESubtreeMap類方法:
ESubtreeMap::replay(mds)
|__若expire_pos有效且大於當前MDLog中journaler的expire pos
|__設置MDLog的journaler expire pos值,即:mds->mdlog->journaler->set_expire_pos(expire_pos)
|__若MDCache是subtrees
|__遍歷subtrees
|__從MDCache中獲得subtree_root對應的CDir
|__檢查subtree root對應的CDir是不是subtree
|__遍歷subtree_root下面的全部dirfrags
|__在MDCache中執行get_force_dirfrag操做,即:mds->mdcache->get_force_dirfrag()
|__在MDCache中獲得subtree_root的subtree bound,即:mds->mdcache->get_subtree_bound()
|__遍歷subtree_root下面的全部dirfrags
|__從subtree bound數組中刪除dirfrags
|__若ambiguous_subtrees數組中包含subtree_root
|__檢查MDCache中是否在ambiguous中包含subtree_root,即:mds->mdcache->have_ambiguous_import()
|__若ambiguous_subtrees數組中不包含subtree_root
|__檢查MDCache中是否在ambiguous中包含subtree_root,即:mds->mdcache->have_ambiguous_import()
|__從MDCache中獲得subtrees,即:mds->mdcache->list_subtrees()
|__遍歷MDCache中的subtrees
|__檢查MDCache着那個的subtrees是否在ESubtreeMap類的subtrees集合中
|__執行EMetaBlob::replay操做
|__遍歷subtrees數組
|__從MDCache中獲得subtree_root對應的CDir
|__檢查subtree_root是否在ambiguous_subtrees數組中
|__在MDCache中添加ambiguous信息,即:mds->mdcache->add_ambiguous_import()
|__在MDCache中調整subtree auth,即:mds->mdcache->adjust_bounded_subtree_auth()
|__subtree_root再也不ambiguous_subtrees數組中
|__在MDCache中調整subtree auth,即:mds->mdcache->adjust_bounded_subtree_auth()
|__在MDCache中執行recalc auth bits,即:mds->mdcache->recalc_auth_bits()數組