]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rgw/rgw_lc.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / rgw / rgw_lc.h
index 4238bbda83adff94eb7ca2efcb147c2abc0f4536..8f231af6b6148a75a75ebb1e1ff11370de90db0f 100644 (file)
 #include "common/iso_8601.h"
 #include "common/Thread.h"
 #include "rgw_common.h"
-#include "rgw_rados.h"
 #include "cls/rgw/cls_rgw_types.h"
 #include "rgw_tag.h"
 #include "rgw_sal.h"
+#include "rgw_rados.h"
 
 #include <atomic>
 #include <tuple>
@@ -184,9 +184,6 @@ class LCFilter
   bool has_multi_condition() const {
     if (obj_tags.count() > 1)
       return true;
-    else if (has_prefix() && has_tags())
-      return true;
-
     return false;
   }
 
@@ -465,6 +462,7 @@ WRITE_CLASS_ENCODER(RGWLifecycleConfiguration)
 class RGWLC : public DoutPrefixProvider {
   CephContext *cct;
   rgw::sal::RGWRadosStore *store;
+  std::unique_ptr<rgw::sal::Lifecycle> sal_lc;
   int max_objs{0};
   string *obj_names{nullptr};
   std::atomic<bool> down_flag = { false };
@@ -519,12 +517,12 @@ public:
   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);
+                      vector<rgw::sal::Lifecycle::LCEntry>&, int& index);
   int bucket_lc_prepare(int index, 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);
+                    rgw::sal::Lifecycle::LCEntry& entry, int& result, LCWorker* worker);
   bool going_down();
   void start_processor();
   void stop_processor();
@@ -534,20 +532,23 @@ public:
   int remove_bucket_config(RGWBucketInfo& bucket_info,
                            const map<string, bufferlist>& bucket_attrs);
 
-  CephContext *get_cct() const override { return store->ctx(); }
+  CephContext *get_cct() const override { return cct; }
+  rgw::sal::Lifecycle *get_lc() const { return sal_lc.get(); }
   unsigned get_subsys() const;
   std::ostream& gen_prefix(std::ostream& out) const;
 
   private:
 
-  int handle_multipart_expiration(RGWRados::Bucket *target,
+  int handle_multipart_expiration(rgw::sal::RGWBucket* target,
                                  const multimap<string, lc_op>& prefix_map,
                                  LCWorker* worker, time_t stop_at, bool once);
 };
 
 namespace rgw::lc {
 
-int fix_lc_shard_entry(rgw::sal::RGWRadosStore *store, const RGWBucketInfo& bucket_info,
+int fix_lc_shard_entry(rgw::sal::RGWRadosStore *store,
+                      rgw::sal::Lifecycle* sal_lc,
+                      const RGWBucketInfo& bucket_info,
                       const map<std::string,bufferlist>& battrs);
 
 std::string s3_expiration_header(