Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Sample code for Rados data operation parsed by source code of ceph RGW interface

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly shows you the "ceph RGW interface source code parsing Rados data operation sample code", the content is easy to understand, well-organized, hope to help you solve doubts, the following let Xiaobian lead you to study and learn "ceph RGW interface source code parsing Rados data operation sample code" this article.

RGW business process:

Http reqest-- > apache to FastCgi module

FastCgi module-- > radosgw is implemented through a socket request (not sure if there is another way)

Radosgw-- > ceph cluster is implemented through socket and calls rados API

1. Data structure

The basic data structure is defined in Rgw_common.h, and decode and encode serialization are implemented to facilitate access to rados.

/ / create data for the permission of the bucket

Struct RGWBucketInfo

{

Rgw_bucket bucket

String owner

Uint32_t flags

String region

Time_t creation_time

String placement_rule

Bool has_instance_obj

RGWObjVersionTracker objv_tracker; / * we don't need to serialize this, for runtime tracking * /

Obj_version ep_objv; / * entry point object version, for runtime tracking only * /

RGWQuotaInfo quota

}

/ / composition of bucket pool location storage

Struct rgw_bucket {

Std::string name

Std::string data_pool

Std::string data_extra_pool; / * if not set, then we should use data_pool instead * /

Std::string index_pool

Std::string marker

Std::string bucket_id

Std::string oid

}

/ / user UID profile

Struct RGWUserInfo

2. S3 metadata atomic operation

Atomic operations on metadata are defined in rgw_op.h, with RGWOp as the base class

Create the atomic class definition of the bucket: class RGWCreateBucket: public RGWOp

3. Metadata manipulation handle

Defined in Rgw_bucket.h

Class RGWUserBuckets

Implemented in Rgw_bucket.cc

Class RGWBucketInstanceMetadataHandler: public RGWMetadataHandler

Class RGWBucketMetadataHandler: public RGWMetadataHandler

4. Implementation of rados interface

RGWRados is defined in rgw_rados.h, and all the operation interfaces related to rados are implemented.

The above is the "ceph RGW interface source code parsing Rados data operation sample code" all the content of this article, thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report