资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

Mutation相关类有哪些

这篇文章给大家分享的是有关Mutation相关类有哪些的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。

在椒江等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供网站设计制作、成都网站设计 网站设计制作定制网站开发,公司网站建设,企业网站建设,成都品牌网站建设,全网整合营销推广,外贸网站建设,椒江网站建设费用合理。

MutationImpl类说明:

struct MutationImpl {
     metareqid_t           reqid;
     __u32                     attempt;
     LogSegment          *ls;                    提交的log片段
     utime_t                   mds_stamp;     mds本地时间戳
     utime_t                   op_stamp;        客户端提供的时间戳
     mds_rank_t            slave_to_mds;     若slave_to_mds>0则说明此Mutation是slave发起的
     set pins;          mds cache pins
     set         stickydirs;            
     map remote_auth_pins;     远端的auth pins
     set auth_pins;                                         本地的auth pins
     list projected_inodes;
     list projected_fnodes;
     list updated_locks;
     list dirty_cow_inodes;
     list> dirty_cow_dentries;
};

MutationImpl类方法:

MutationImpl::get_client()

|__若reqid.name.is_client()不为空

     |__说明请求是从client发出的,返回client信息,即:client_t(reqid.name.num())

|__返回-1

MutationImpl::apply()

|__遍历并清空projected_inodes数组且每个数组成员执行pop_and_dirty_projected_inode(ls)函数

|__遍历并清空projected_fnodes数组且每个数组成员执行pop_and_dirty_projected_fnode(ls)函数

|__遍历dirty_cow_inodes数组

     |__数组中每个成员执行_mark_dirty(ls)

|__遍历dirty_cow_dentries数组

     |__数组中每个成员执行_mark_dirty(ls)

|__遍历updated_locks数组

     |__数组中每个成员执行mark_dirty()

MutationImpl::cleanup()

|__遍历auth_pins数组

     |__数组中每个成员执行auth_unpin()

|__清空auth_pins数组

|__遍历pins数组

     |__数组中每个成员执行put()

|__清空pins数组

MDRequestImpl主要记录来自client的请求、slave的请求以及内部的操作internal_op。

struct MDRequestImpl: public MutationImpl, public TrackedOp {
   Session *session;                    记录session信息
   elist::item item_session_request;    请求项
   MClientRequest *client_request;            客户端请求
   vector dn[2];                保存两套dentry
   CInode *in[2];                    保存两套inode
   CDentry *straydn;                    记录stray的dentry
   snapid_t snapid;                    记录snap ID信息
   indoeno_t alloc_ino, used_prealloc_ino;        分配的inode号
   interval_set prealloc_inos;        预分配的inode号
   int snap_caps;                    snap capability
   int getattr_caps;                    执行getattr的权限
   bool did_early_reply;                    
   bool o_trunc;                        请求是一个O_TRUNC事件
   bool has_completed;                    请求已经完成
   bufferlist reply_extra_bl;                在回复中包含的额外的内容
   map cap_releases;        
   MMDSSlaveRequest *slave_request;            slave的请求
   int internal_op;                    内部操作
   Context *internal_op_finish;                内部操作的回调函数
   void *internal_op_private;                内部操作的私有对象
   int retry;                        记录rety的次数
   bool waited_for_osdmap;                是否需要等待更新的osmap
   struct More {
     int slave_error;
     set slaves;                发起slave请求的集合
     set waiting_on_slave;            等待slavereq reply的peer
     set witnessed;    
     CInode *rename_inode;                保存freeze的inode信息
     bool is_freeze_authpin;                保存是否执行了freeze authpin操作
     bool is_remote_frozen_authpin;            保存是否执行了remote frozen authpin操作
     bool is_ambiguous_auth;                保存是否执行了ambiguous auth操作
   }_more;
 };

MDRequestImpl类方法:
MDRequestImpl::~MDRequestImpl()
|__若client_request不为空
  |__执行client_request->put()方法,尝试释放client_request
|__若slave_request不为空
  |__执行slave_request->put()方法,尝试释放slave_request
|__删除_more类对象

MDRequestImpl::freeze_auth_pin(inode)
|__设置_more中的rename_inode为inode
|__设置_more中的is_freeze_authpin为true
|__调用auth_pin(inode)
|__执行inode的freeze_auth_pin()

MDRequestImpl::unfreeze_auth_pin(clear_inode)
|__从_more中的rename_inode得到freeze的inode
|__若inode当前是is_frozen_auth_pin()
  |__执行inode的unfreeze_auth_pin()来解除freeze
|__若inode当前不是is_frozen_auth_pin()
  |__执行inode的unfreeze_inode()
|__设置_more中的is_freeze_autpin为false
|__若clear_inode==true
  |__设置_more中的rename_inode为null

MDRequestImpl::set_remote_frozen_auth_pin(inode)
|__设置_more中的rename_inode为inode
|__设置_more中的is_remote_frozen_authpin为true

MDRequestImpl::set_ambiguous_auth(inode)
|__执行inode的set_ambiguous_auth()函数
|__设置_more中的rename_inode为inode
|__设置_more中的is_ambiguous_auth为true

MDRequestImpl::clear_ambiguous_auth()
|__从_more中的rename_inode得到ambiguous的inode
|__执行inode的clear_ambiguous_auth()函数
|__设置_more中的is_ambiguous_auth为false

MDRequestImpl::can_auth_pin(object)
|__若object能auth pin或者object在auth_pin或remote auth pin中或者_more中的is_freeze_authpin为true或者_more中的rename_inode==object
  |__返回true
|__返回false

MDRequestImpl::drop_local_auth_pins()
|__若_more不为空
  |__调用unfreeze_auth_pin(true)来清除freeze的auth pin
|__调用MutationImpl::drop_local_auth_pins()    来清除本地的auth pins 

MDRequestImpl::set_filepath(fp)
|__设置_more中的filepath2为fp

MDRequestImpl::set_filepath3(fp)
|__设置_more中的filepath3为fp

MDRequestImpl::get_filepath()
|__若client_request不为空
  |__返回client_request->get_filepath()
|__返回_more中的filepath2

MDRequestImpl::get_filepath3()
|__若client_request不为空
  |__返回client_request->get_filepath3()
|__返回_more中的filepath3
 

感谢各位的阅读!关于“Mutation相关类有哪些”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!


分享题目:Mutation相关类有哪些
URL链接:http://cdkjz.cn/article/iigdpp.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220