In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you what is the use of RGW S3 GC class, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
The main function of the RGW S3 GC class is to provide the functionality of the garbage collector. Used to delete objects asynchronously.
1. RGW S3 GC core class diagram
2. RGW S3 GC core data class diagram
Third, RGW S3 GC mainly deals with function parsing.
1. RGWGC initialization operation.
RGWGC::initialize ()
| | _ _ sets cct and store class objects |
| | _ _ get the maximum number of gc objects from the configuration file, that is, rgw_gc_max_objs |
| | _ _ generate an obj_names array based on the maximum number of objects in gc and initialize the array as gc.0-rgw_gc_max_objs |
2. RGWGC terminates the operation.
RGWGC::finalize ()
| | _ _ delete obj_names array |
3. Add chain.
RGWGC::add_chain ()
| | _ cls_rgw_gc_set_entry () |
| | _ rgw_cls_gc_set_entry () |
| | _ gc_update_entry () |
| | _ gc_omap_get () |
| | _ _ cls_cxx_map_get_val () uses the name key to get the saved cls_rgw_gc_obj_info information (CEPH_OSD_OP_OMAPGETVALSBYKEYS) in the Ceph cluster |
| | _ _ get_time_key () gets time key |
| | _ gc_omap_remove () |
| | _ _ cls_cxx_map_remove_key () deletes the value of the specified time key (CEPH_OSD_OMAPRMKEYS) |
| | _ gc_omap_set () |
| | _ _ cls_cxx_map_set_val () sets the cls_rgw_gc_obj_info information to the Ceph cluster (CEPH_OSD_OP_OMAPSETVALS) with the name key |
| | _ _ get_time_key () gets time key |
| | _ _ gc_omap_set () uses time as key and sets cls_rgw_gc_obj_info information to Ceph cluster (CEPH_OSD_OP_OMAPSETVALS) |
4. Send chain.
RGWGC::send_chain ()
| | _ RGWGC::add_chain () |
| | _ RGWGC::tag_index () |
| | _ RGWRados::gc_operate () |
5. Update chain.
RGWGC::defer_chain ()
| | _ cls_rgw_gc_defer_entry () |
| | _ rgw_cls_gc_defer_entry () |
| | _ gc_defer_entry () |
| | _ _ gc_omap_get () uses the name key to get the cls_rgw_gc_obj_info information |
| | _ _ gc_update_entry () updates the cls_rgw_gc_obj_info information in the Ceph cluster with name and time as key with cls_rgw_gc_obj_info and updated expiration_secs as parameters |
| | _ RGWGC::tag_index () |
| | _ RGWRados::gc_operate () |
6. Delete chain.
RGWGC::remove ()
| | _ cls_rgw_gc_remove () |
| | _ rgw_cls_gc_remove () |
| | _ gc_remove () |
| | _ _ gc_omap_get () uses the name key to get the cls_rgw_gc_obj_info information |
| | _ _ get_time_key () gets time key |
| | _ _ gc_omap_remove () deletes the cls_rgw_gc_obj_info information with time as key |
| | _ _ gc_omap_remove () deletes the cls_rgw_gc_obj_info information with the name key |
| | _ RGWRados::gc_operate () |
7. List chain.
RGWGC::list ()
| | _ cls_rgw_gc_list () |
| | _ rgw_cls_gc_list () |
| | _ gc_list_entries () |
| | _ gc_iterate_entries () |
| | _ _ prepend_index_prefix () gets the key with time as the key |
| | _ _ cls_cxx_map_get_vals () gets all the cls_rgw_gc_obj_info information with time as the key |
| | _ _ gc_record_decode () parses to get cls_rgw_gc_obj_info information |
| | _ _ gc_list_cb () inserts the resulting cls_rgw_gc_obj_info information into the list |
8. Deal with chain.
RGWGC::process ()
| | _ _ cls_rgw_gc_list () gets all the cls_rgw_gc_obj_info information corresponding to obj_ namespace [I] |
| | _ _ traverses all cls_rgw_obj in cls_rgw_gc_obj_info information, and calls cls_refcount_put () |
| | _ cls_rc_refcount_put () |
| | _ _ read_refcount () gets the reference count corresponding to the object |
| | _ _ obj_refcount::refs.erase () reduces the reference count of objects |
| | _ _ if the reference count is zero, cls_cxx_remove () is called to delete objects from the Ceph cluster (CEPH_OSD_OP_DELETE) |
| | _ _ if the reference count is non-zero, call set_refcount () to update the reference count of the object |
9. RGWGC handles the thread main function.
RGWGC::GCWorker::entry ()
| | _ RGWGC::process () |
The above is all the content of the article "what is the use of RGW S3 GC classes?" 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.