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

What are the operations related to rgw bucket in ceph

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

Share

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

This article mainly introduces what are the related operations of rgw bucket in ceph. It is very detailed and has a certain reference value. Friends who are interested must read it!

First, list bucket.

1. Read the bucket information processing flow.

RGWListBucket::execute ()

| | _ RGWRados::Bucket::List::list_objects () |

| | _ RGWRados::cls_bucket_list () |

| | _ RGWRados::open_bucket_index () |

| | _ CLSRGWIssueBucketList::issue_op () |

| | _ issue_bucket_list_op () |

| | _ librados::IoCtxImpl::aio_operate () op is rgw.bucket_list |

| | _ cls_rgw.cc::rgw_bucket_list () |

| | _ _ cls_rgw.cc::read_bucket_header () reads the header information of struct rgw_bucket_dir |

| | _ _ cls_rgw.cc::get_obj_vals () reads the entry information of struct rgw_bucket_dir |

| | _ _ convert the read struct rgw_bucket_dir information into RGWObjEnt structure |

| | _ _ check the validity of the read RGWObjEnt structure |

The data structure that actually stores the bucket information in the ceph cluster is struct rgw_bucket_dir, which is as follows:

Struct rgw_bucket_dir {

Struct rgw_bucket_dir_header header; saves the header information of bucket dir

Std::map m; saves the corresponding relationship between the name of the file or child bucket in the bucket and the entry

}

2. The read bucket information is returned to the caller.

RGWListBucket_ObjStore_S3::send_response ()

Splice the HTTP response header and return the read List information RGWObjEnt to the caller in the Contents tag

Second, stat bucket.

1. Read the bucket stat information processing flow.

RGWStatBucket::execute ()

| | _ RGWRados::update_containers_stats () |

| | _ RGWRados::cls_bucket_head () |

| | _ _ traverse the read bucket head information and update the count/size/size_rounded information from bucket head |

2. The read bucket stat information is returned to the caller.

RGWStatBucket_ObjStore_S3::send_response ()

Third, create bucket.

1. Create the processing flow of bucket.

RGWCreateBucket::execute ()

| | _ _ rgw_make_bucket_entry_name () creates bucket_entry_name=tenant_name + bucket_name |

| | _ _ RGWRados::get_bucket_info () gets the bucket info information of the specified user |

| | _ _ RGWRados::create_bucket () creates a bucket |

| | _ _ RGWRados::select_bucket_placement () determines the name of bucket.data_pool and bucket.index_pool |

| | _ RGWRados::init_bucket_index () |

| | _ CLSRGWIssueBucketIndexInit::issue_op () |

| | _ issue_bucket_index_init_op () |

| | _ rgw_bucket_init_index () |

| | _ write_bucket_header () |

| | _ _ cls_cxx_map_write_header () sets the header information of bucket |

| | _ RGWRados::put_linked_bucket_info () |

| | _ RGWRados::put_bucket_instance_info () |

| | _ get_bucket_instance_entry () |

| | _ _ rgw_bucket_instance_store_info () updates bucket instance information |

| | _ RGWRados::put_bucket_entrypoint_info () |

| | _ rgw_make_bucket_entry_name () |

| | _ _ rgw_bucket_store_info () updates bucket metadata information |

| | _ _ rgw_link_bucket () creates a link to bucket |

| | _ rgw_get_bucket_obj () |

| | _ RGWRados::cls_user_add_bucket () |

| | _ RGWRados::cls_user_update_buckets () |

| | _ cls_user_set_buckets () |

| | _ cls_user.cc::cls_user_set_buckets_info () |

| | _ _ read_header () reads the header structure of bucket |

| | _ get_key_by_bucket_name () |

| | _ _ get_existing_bucket_entry () reads the entry specified in bucket |

| | _ _ apply_entry_stats () updates the stats of entry |

| | _ _ write_entry () rewrites the entry specified in bucket |

| | _ _ add_header_stats () updates the stat structure of bucket's header |

| | _ _ cls_cxx_map_write_header () updates the header structure of bucket |

| | _ RGWRados::put_bucket_entrypoint_info () |

| | _ rgw_make_bucket_entry_name () |

| | _ _ rgw_bucket_store_info () updates bucket metadata |

2. Create a return handler for bucket.

RGWCreateBucket_ObjStore_S3::send_response ()

4. Delete bucket.

1. Delete the bucket processing flow.

RGWDeleteBucket::execute ()

| | _ rgw_bucket_sync_user_stats () |

| | _ rgw_get_buckets_obj () |

| | _ RGWRados::cls_user_sync_bucket_stats () |

| | _ _ cls_bucket_head () reads the header information of bucket |

| | _ _ count the stats information of all users' buckets and save it to the cls_user_bucket_entry structure |

| | _ RGWRados::cls_user_update_buckets () |

| | _ cls_user_set_buckets () |

| | _ _ cls_user_set_buckets_info () updates bucket header and entry information |

| | _ RGWRados::delete_bucket () |

| | _ rgw_bucket_delete_bucket_obj () |

| | _ _ librados::meta_mgr- > remove_entry () deletes bucket metadata information |

| | _ rgw_bucket_instance_remove_entry () |

| | _ _ librados::meta_mgr- > remove_entry () deletes bucket instance metadata information |

| | _ rgw_unlink_bucket () |

| | _ RGWRados::cls_user_remove_bucket () |

| | _ cls_user_remove_bucket () |

| | _ cls_user_remove_bucket () |

| | _ read_header () |

| | _ get_key_by_bucket_name () |

| | _ get_existing_bucket_entry () |

| | _ remove_entry () |

| | _ cls_cxx_map_remove_key () |

| | _ RGWRados::get_bucket_entrypoint_info () |

| | _ RGWRados::put_bucket_entrypoint_info () |

| | _ rgw_make_bucket_entry_name () |

| | _ _ rgw_bucket_store_info () updates bucket metadata information |

2. Delete the return handler of bucket.

RGWDeleteBucket_ObjStore_S3::send_reponse ()

5. Bucket metadata.

1 、 RGWBucketMetadataHandler .

This class is responsible for the get/put/delete operation of bucket metadata. The core data structure of bucket metadata is struct RGWBucketEntryPoint.

Struct RGWBucketEntryPoint {

Rgw_bucket bucket

Rgw_user owner

Ceph::real_time creation_time

Bool linked

Bool has_bucket_info

RGWBucketInfo old_bucket_info

}

The RGWBucketMetadataHandler class is also responsible for traversing the methods of all object names in bucket: list_keys_init () / list_keys_next () / list_keys_complete (). Where all object names in bucket are described by struct RGWObjEnt structure.

2 、 RGWBucketInstanceMetadataHandler .

This class is responsible for the get/put/delete operation of bucket instance metadata. When performing the put operation to update the bucket info, first get the location of the bucket location, then update the bucket info information according to the obtained bucket location, and finally call the RGWRados::init_bucket_index () function to create the header information of the bucket.

The RGWBucketMetadataHandler class is also responsible for traversing the methods of all object names in bucket: list_keys_init () / list_keys_next () / list_keys_complete (). Where all object names in bucket are described by struct RGWObjEnt structure.

The above is all the contents of the article "what are the rgw bucket-related operations in ceph?" Thank you for reading! Hope to share the content to help you, more related 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