]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rgw/rgw_lc.h
import 15.2.5
[ceph.git] / ceph / src / rgw / rgw_lc.h
index 57f02a63e81f61f5046b2ddf015d812a93e1628b..60f3863fc837e942b03a89398e16cb576714b29e 100644 (file)
@@ -467,12 +467,18 @@ public:
     const DoutPrefixProvider *dpp;
     CephContext *cct;
     RGWLC *lc;
-    ceph::mutex lock = ceph::make_mutex("LCWorker");
-    ceph::condition_variable cond;
+    int ix;
+    std::mutex lock;
+    std::condition_variable cond;
     WorkPool* workpool{nullptr};
 
   public:
-    LCWorker(const DoutPrefixProvider* _dpp, CephContext *_cct, RGWLC *_lc);
+
+    using lock_guard = std::lock_guard<std::mutex>;
+    using unique_lock = std::unique_lock<std::mutex>;
+
+    LCWorker(const DoutPrefixProvider* dpp, CephContext *_cct, RGWLC *_lc,
+            int ix);
     RGWLC* get_lc() { return lc; }
     void *entry() override;
     void stop();
@@ -482,6 +488,7 @@ public:
 
     friend class RGWRados;
     friend class RGWLC;
+    friend class WorkQ;
   }; /* LCWorker */
 
   friend class RGWRados;
@@ -494,13 +501,18 @@ public:
   void initialize(CephContext *_cct, rgw::sal::RGWRadosStore *_store);
   void finalize();
 
-  int process(LCWorker* worker);
-  int process(int index, int max_secs, LCWorker* worker);
-  bool if_already_run_today(time_t& start_date);
-  int list_lc_progress(const string& marker, uint32_t max_entries, map<string, int> *progress_map);
+  int process(LCWorker* worker, bool once);
+  int process(int index, int max_secs, LCWorker* worker, bool once);
+  bool if_already_run_today(time_t start_date);
+  bool expired_session(time_t started);
+  time_t thread_stop_at();
+  int list_lc_progress(string& marker, uint32_t max_entries,
+                      vector<cls_rgw_lc_entry>&, int& index);
   int bucket_lc_prepare(int index, LCWorker* worker);
-  int bucket_lc_process(string& shard_id, LCWorker* worker);
-  int bucket_lc_post(int index, int max_lock_sec, pair<string, int >& entry, int& result, LCWorker* worker);
+  int bucket_lc_process(string& shard_id, LCWorker* worker, time_t stop_at,
+                       bool once);
+  int bucket_lc_post(int index, int max_lock_sec,
+                    cls_rgw_lc_entry& entry, int& result, LCWorker* worker);
   bool going_down();
   void start_processor();
   void stop_processor();
@@ -518,7 +530,7 @@ public:
 
   int handle_multipart_expiration(RGWRados::Bucket *target,
                                  const multimap<string, lc_op>& prefix_map,
-                                 LCWorker* worker);
+                                 LCWorker* worker, time_t stop_at, bool once);
 };
 
 namespace rgw::lc {
@@ -533,6 +545,14 @@ std::string s3_expiration_header(
   const ceph::real_time& mtime,
   const std::map<std::string, buffer::list>& bucket_attrs);
 
+bool s3_multipart_abort_header(
+  DoutPrefixProvider* dpp,
+  const rgw_obj_key& obj_key,
+  const ceph::real_time& mtime,
+  const std::map<std::string, buffer::list>& bucket_attrs,
+  ceph::real_time& abort_date,
+  std::string& rule_id);
+
 } // namespace rgw::lc
 
 #endif