ceph中LogSegment類有什么用

這篇文章主要為大家展示了“ceph中LogSegment類有什么用”,內(nèi)容簡(jiǎn)而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“ceph中LogSegment類有什么用”這篇文章吧。

10年積累的網(wǎng)站制作、做網(wǎng)站經(jīng)驗(yàn),可以快速應(yīng)對(duì)客戶對(duì)網(wǎng)站的新想法和需求。提供各種問(wèn)題對(duì)應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識(shí)你,你也不認(rèn)識(shí)我。但先網(wǎng)站策劃后付款的網(wǎng)站建設(shè)流程,更有云和免費(fèi)網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。

LogSegment類說(shuō)明:

class LogSegment {

     const log_segment_seq_t seq;          記錄LogSegment序號(hào)

     uint64_t offset, end;                            記錄偏移位置和結(jié)束位置

     int num_events;                                   記錄event的數(shù)量

     elist<CDir*> dirty_dirfrags, new_dirfrags;          記錄有變化的CDir結(jié)構(gòu)

     elist<CDentry*> dirty_dentries;                         記錄有變化的CDentry結(jié)構(gòu)

     elist<CInode*> dirty_inodes;                              記錄有變化的CInode

     elist<CInode*> dirty_parent_inodes, dirty_dirfrag_dir, dirty_dirfrag_nest, dirty_dirfrag_dirfragtree

     elist<CInode*> open_files;

     ...

};

LogSegment用來(lái)記錄實(shí)際變化的CDir/CDentry/CInode的信息,LogSegment是整個(gè)MDLog最底層的數(shù)據(jù)結(jié)構(gòu)

LogSegment類的方法:

LogSegment::try_to_expire(mds, gather_bld, op_prio)

|__遍歷new_dirfrags/dirty_dirfrags數(shù)組

     |__將數(shù)組中的內(nèi)容插入到commit數(shù)組

|__遍歷dirty_dentries數(shù)組

     |__將數(shù)組中成員的CDentry::get_dir()插入到commit數(shù)組

|__遍歷dirty_inodes數(shù)組

     |__將數(shù)組中成員的CInode::get_parent_dn()::get_dir()插入到commit數(shù)組

|__遍歷commit數(shù)組

     |__若commit數(shù)組成員can_auth_pin()

          |__CDir::commit()                              提交針對(duì)CDir的修改

     |__若commit數(shù)組成員!can_auth_pin()

          |__CDir::add_waiter(CDir::WAIT_UNFREEZE)          添加到等待隊(duì)列中

|__遍歷uncommitted_masters數(shù)組

     |__mds->mdcache->wait_for_uncommitted_master()          等待客戶端回復(fù)commit

|__遍歷uncommitted_fragments數(shù)組

     |__mds->mdcache->wait_for_uncommitted_fragment()          等待未收到commit的fragment

|__遍歷dirty_dirfrag_dir數(shù)組

     |__mds->locker->scatter_nudge()                                   等待dirlock flush

|__遍歷dirty_dirfrag_dirfragtree數(shù)組

     |__mds->locker->scatter_nudge()                                   等待dirfragtreelock flush

|__遍歷dirty_dirfrag_nest數(shù)組

     |__mds->locker->scatter_nudge()                                   等待nest flush

|__遍歷open_files數(shù)組

     |__數(shù)組中的CInode是授權(quán)的并且有訪問(wèn)權(quán)限的

          |__若LogEvent為空

               |__創(chuàng)建一個(gè)新的EOpen類對(duì)象

               |__mds->mdlog->start_entry(EOpen)          將新的EOpen類對(duì)象寫(xiě)入到mdlog

          |__le->add_clean_inode()                         將inode添加到LogEvent的clean inode數(shù)組中

          |__ls->open_files.push_back()                            插入到LogSegment的open_files數(shù)組

     |__數(shù)組中的CInode是授權(quán)的但沒(méi)有訪問(wèn)權(quán)限

          |__in->item_open_file.remove_myself()               從item_open_file數(shù)組中刪除此CInode

     |__若le不為空

          |__mds->mdlog->submit_entry(le)                    提交LogEvent到MDLog中

|__遍歷dirty_parent_inodes數(shù)組

     |__若數(shù)組中元素can_auth_pin()

          |__CInode::store_backtrace()

     |__若數(shù)組中元素不能can_auth_pin()

          |__CInode::add_waiter(CInode::WAIT_UNFREEZE)          等待unfreeze

|__遍歷slave_updates數(shù)組

     |__更新MDSlaveUpdate::waiter = gather_bld.new_sub()          等待slave update

|__檢查inotablev是否大于mds->inotable->get_committed_version()

     |__mds->inotable->save()                                                       保存inotable

|__檢查sessionmapv是否大于mds->sessionmap.get_committed()

     |__mds->sessionmap.save()                                                       保存sessionmap

|__mds->sessionmap.save_if_dirty()                                                保存sessionmap

|__遍歷pending_commit_tids數(shù)組

     |__從數(shù)組中得到MDSTableClient類對(duì)象

     |__MDSTableClient::wait_for_ack()                                        等待未應(yīng)答的commit

|__遍歷tablev數(shù)組

     |__從數(shù)組中得到MDSTableServer類對(duì)象

     |__若tablev數(shù)組中的version值大于MDSTableServer::get_committed_version()

          |__MDSTableServer::save()                                                  保存MDSTableServer

|__遍歷truncating_inodes數(shù)組

     |__CInode::add_waiter(CInode::WAIT_TRUNC)                         等待TRUNC

|__mds->mdlog->flush()                                                                 刷新mdlog

以上是“ceph中LogSegment類有什么用”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!

當(dāng)前標(biāo)題:ceph中LogSegment類有什么用
文章來(lái)源:http://muchs.cn/article36/ihicpg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站制作、網(wǎng)站設(shè)計(jì)公司企業(yè)建站網(wǎng)站改版、Google小程序開(kāi)發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設(shè)公司