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

Example Analysis of RGW S3 User

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article is about the sample analysis of RGW S3 User. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

1. Class diagram used by RGW S3 User.

Cls_user_header and cls_user_bucket_entry see the buckets information owned by the user from the user's point of view, and these two objects (where cls_user_bucket_entry appears as an array) need to be stored in the ceph cluster. These two class objects are usually required to create / delete / update a user buckets.

The RGwUserBuckets class is the buckets-related information seen by RGW User. In fact, the RGWBucketEnt and cls_user_bucket_entry classes are basically the same.

The figure above shows the class diagram of bucket, where the two objects, rgw_bucket_dir_header and rgw_bucket_dir_entry, (rgw_bucket_dir_entry appears as an array) are saved to the ceph cluster. You need to use the above classes when reading and writing buckets.

The figure above describes the main classes of the RGW User class and their diagrams. The core class is RGWUser, which represents a RGW user. The RGWUID and RGWUserInfo classes of the above classes need to be saved to the Ceph cluster.

Second, the main function processing flow of RGW User.

1. Synchronize the usage information of all buckets of the specified user

Rgw_user_sync_all_stats ()

| | _ _ rgw_read_user_buckets () reads all the buckets information of the specified user and saves it to the RGWUserBuckets object |

| _ _ rgw_bucket_sync_user_stats () synchronizes the usage information of all the buckets of the specified user. The cls_user_bucket_entry object is actually updated, and after the update, the cls_user_bukcet_entry object is written to the ceph cluster

| | _ _ RGWRados::complete_sysnc_user_stats () completes the operation for the operation that is not completed synchronously, and finally updates the cls_user_header object synchronously and writes the object to the ceph cluster |

2. Write the specified user information to the ceph cluster

Rgw_store_user_info ()

| | _ _ check whether the access_key in the RGWUserInfo is valid (obtain the RGWUserInfo information through access_key, and then compare whether the obtained RGWUserInfo information is consistent with the RGWUserInfo information passed in the parameter) |

| | _ _ generate RGWUID object and initialize it with RGWUserInfo.user_id |

| | _ _ write RGWUID and RGWUserInfo information to user metadata pool with RGWUserInfo.user_id as key |

| | _ _ write RGWUID information to user email pool with RGWUserInfo.user_email as key |

| | _ _ write RGWUID information to user keys pool with RGWUserInfo::RGWAccessKey.id as key |

3. Read RGWUserInfo information through user index information

Rgw_get_user_info_from_index ()

| | _ _ rgw_get_system_obj () gets the RGWUID object through the index of the specified user |

| | _ _ rgw_get_info_by_uid () gets RGWUserInfo information from RGWUID.user_id information |

| | _ _ update RGW User Info Cache uinfo_cache |

4. Read the RGWUserInfo information through the user's uid information

Rgw_get_user_info_by_uid ()

| | _ _ rgw_get_system_obj () uses uid as key to get RGWUID object and RGWUserInfo object (the pool used is user uid pool) |

5. Read the RGWUserInfo information through the user's email information

Rgw_get_user_info_by_email ()

| | _ _ rgw_get_user_info_from_index () gets the RGWUserInfo object by taking the user's email as the key |

6. Read the RGWUserInfo information through the user's accesskey information

Rgw_get_user_info_by_access_key ()

| | _ _ rgw_get_user_info_from_index () gets the RGWUserInfo object by taking the user's access key as the key |

7. Read the user's attribute information through the user's uid information

Rgw_get_user_attrs_by_uid ()

| | _ RGWRados::SystemObject::Read.stat () |

| | _ RGWRados::stat_system_obj () |

| | _ RGWRados::get_system_obj_state () |

| | _ RGWRados::get_system_obj_state_impl () |

| _ _ RGWRados::raw_obj_stat () reads the attribute information of the specified object and removes it with user.rgw. Attribute value at the beginning

8. Delete the user access key index

Rgw_remove_key_index ()

| | _ RGWRados::delete_system_obj () |

9. Delete the user uid index

Rgw_remove_uid_index ()

| | _ rgw_get_user_info_by_uid () |

| | _ _ RGWRados::meta_mgr::remove_entry () deletes the metadata information of user |

10. Delete the user email index

Rgw_remove_email_index ()

| | _ RGWRados::delete_system_obj () |

11. Delete users

Rgw_delete_user ()

| | _ _ rgw_read_user_buckets () reads the bucket list information owned by the specified user uid |

| | _ _ rgw_remove_key_index () deletes the RGWUseInfo information indexed by access key |

| | _ _ RGWRados::delete_system_obj () deletes the RGWUserInfo information indexed by email |

| | _ _ RGWRados::delete_system_obj () deletes uid.bucket object |

| | _ _ RGWRados::meta_mgr.remove_entry () deletes the user's metadata information |

Thank you for reading! This is the end of this article on "sample Analysis of RGW S3 User". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

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