diff options
author | Casey Bodley <cbodley@users.noreply.github.com> | 2024-09-09 20:02:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-09 20:02:38 +0200 |
commit | ce2c7d57a2cee71e5d47c6004c4f624ae53a88f5 (patch) | |
tree | 297219800f43ff67074df6788dc0a427dcd96942 /src/rgw/driver/rados | |
parent | Merge pull request #59297 from ivoalmeida/carbon-datatable-performance (diff) | |
parent | rgw/sal: LCHead and LCEntry don't need abstraction (diff) | |
download | ceph-ce2c7d57a2cee71e5d47c6004c4f624ae53a88f5.tar.xz ceph-ce2c7d57a2cee71e5d47c6004c4f624ae53a88f5.zip |
Merge pull request #58603 from cbodley/wip-rgw-sal-concrete-lc
rgw/sal: LCHead and LCEntry don't need abstraction
Reviewed-by: Matt Benjamin <mbenjamin@redhat.com>
Reviewed-by: Daniel Gryniewicz <dang@redhat.com>
Diffstat (limited to 'src/rgw/driver/rados')
-rw-r--r-- | src/rgw/driver/rados/rgw_rados.cc | 7 | ||||
-rw-r--r-- | src/rgw/driver/rados/rgw_rados.h | 3 | ||||
-rw-r--r-- | src/rgw/driver/rados/rgw_sal_rados.cc | 47 | ||||
-rw-r--r-- | src/rgw/driver/rados/rgw_sal_rados.h | 17 |
4 files changed, 34 insertions, 40 deletions
diff --git a/src/rgw/driver/rados/rgw_rados.cc b/src/rgw/driver/rados/rgw_rados.cc index 14186893dab..a967030f622 100644 --- a/src/rgw/driver/rados/rgw_rados.cc +++ b/src/rgw/driver/rados/rgw_rados.cc @@ -9397,13 +9397,6 @@ int RGWRados::process_gc(bool expired_only, optional_yield y) return gc->process(expired_only, y); } -int RGWRados::list_lc_progress(string& marker, uint32_t max_entries, - vector<std::unique_ptr<rgw::sal::Lifecycle::LCEntry>>& progress_map, - int& index) -{ - return lc->list_lc_progress(marker, max_entries, progress_map, index); -} - int RGWRados::process_lc(const std::unique_ptr<rgw::sal::Bucket>& optional_bucket) { RGWLC lc; diff --git a/src/rgw/driver/rados/rgw_rados.h b/src/rgw/driver/rados/rgw_rados.h index 2ca9ee708e2..9d520c12a1e 100644 --- a/src/rgw/driver/rados/rgw_rados.h +++ b/src/rgw/driver/rados/rgw_rados.h @@ -1573,9 +1573,6 @@ public: int defer_gc(const DoutPrefixProvider *dpp, RGWObjectCtx* ctx, RGWBucketInfo& bucket_info, const rgw_obj& obj, optional_yield y); int process_lc(const std::unique_ptr<rgw::sal::Bucket>& optional_bucket); - int list_lc_progress(std::string& marker, uint32_t max_entries, - std::vector<std::unique_ptr<rgw::sal::Lifecycle::LCEntry>>& progress_map, - int& index); int bucket_check_index(const DoutPrefixProvider *dpp, RGWBucketInfo& bucket_info, std::map<RGWObjCategory, RGWStorageStats> *existing_stats, diff --git a/src/rgw/driver/rados/rgw_sal_rados.cc b/src/rgw/driver/rados/rgw_sal_rados.cc index 5cfc0d87ddf..e3b435d2839 100644 --- a/src/rgw/driver/rados/rgw_sal_rados.cc +++ b/src/rgw/driver/rados/rgw_sal_rados.cc @@ -3727,7 +3727,7 @@ int LCRadosSerializer::try_lock(const DoutPrefixProvider *dpp, utime_t dur, opti int RadosLifecycle::get_entry(const DoutPrefixProvider* dpp, optional_yield y, const std::string& oid, const std::string& marker, - std::unique_ptr<LCEntry>* entry) + LCEntry& entry) { librados::ObjectReadOperation op; bufferlist bl; @@ -3745,13 +3745,15 @@ int RadosLifecycle::get_entry(const DoutPrefixProvider* dpp, optional_yield y, return ret; } - *entry = std::make_unique<StoreLCEntry>(cls_entry.bucket, cls_entry.start_time, cls_entry.status); + entry.bucket = std::move(cls_entry.bucket); + entry.start_time = cls_entry.start_time; + entry.status = cls_entry.status; return 0; } int RadosLifecycle::get_next_entry(const DoutPrefixProvider* dpp, optional_yield y, const std::string& oid, const std::string& marker, - std::unique_ptr<LCEntry>* entry) + LCEntry& entry) { librados::ObjectReadOperation op; bufferlist bl; @@ -3769,18 +3771,20 @@ int RadosLifecycle::get_next_entry(const DoutPrefixProvider* dpp, optional_yield return ret; } - *entry = std::make_unique<StoreLCEntry>(cls_entry.bucket, cls_entry.start_time, cls_entry.status); + entry.bucket = std::move(cls_entry.bucket); + entry.start_time = cls_entry.start_time; + entry.status = cls_entry.status; return 0; } int RadosLifecycle::set_entry(const DoutPrefixProvider* dpp, optional_yield y, - const std::string& oid, LCEntry& entry) + const std::string& oid, const LCEntry& entry) { cls_rgw_lc_entry cls_entry; - cls_entry.bucket = entry.get_bucket(); - cls_entry.start_time = entry.get_start_time(); - cls_entry.status = entry.get_status(); + cls_entry.bucket = entry.bucket; + cls_entry.start_time = entry.start_time; + cls_entry.status = entry.status; librados::ObjectWriteOperation op; cls_rgw_lc_set_entry(op, cls_entry); @@ -3791,7 +3795,7 @@ int RadosLifecycle::set_entry(const DoutPrefixProvider* dpp, optional_yield y, int RadosLifecycle::list_entries(const DoutPrefixProvider* dpp, optional_yield y, const std::string& oid, const std::string& marker, - uint32_t max_entries, std::vector<std::unique_ptr<LCEntry>>& entries) + uint32_t max_entries, std::vector<LCEntry>& entries) { entries.clear(); @@ -3812,20 +3816,19 @@ int RadosLifecycle::list_entries(const DoutPrefixProvider* dpp, optional_yield y } for (auto& entry : cls_entries) { - entries.push_back(std::make_unique<StoreLCEntry>(entry.bucket, oid, - entry.start_time, entry.status)); + entries.push_back(LCEntry{entry.bucket, entry.start_time, entry.status}); } return ret; } int RadosLifecycle::rm_entry(const DoutPrefixProvider* dpp, optional_yield y, - const std::string& oid, LCEntry& entry) + const std::string& oid, const LCEntry& entry) { cls_rgw_lc_entry cls_entry; - cls_entry.bucket = entry.get_bucket(); - cls_entry.start_time = entry.get_start_time(); - cls_entry.status = entry.get_status(); + cls_entry.bucket = entry.bucket; + cls_entry.start_time = entry.start_time; + cls_entry.status = entry.status; librados::ObjectWriteOperation op; cls_rgw_lc_rm_entry(op, cls_entry); @@ -3835,7 +3838,7 @@ int RadosLifecycle::rm_entry(const DoutPrefixProvider* dpp, optional_yield y, } int RadosLifecycle::get_head(const DoutPrefixProvider* dpp, optional_yield y, - const std::string& oid, std::unique_ptr<LCHead>* head) + const std::string& oid, LCHead& head) { librados::ObjectReadOperation op; bufferlist bl; @@ -3853,18 +3856,20 @@ int RadosLifecycle::get_head(const DoutPrefixProvider* dpp, optional_yield y, return ret; } - *head = std::make_unique<StoreLCHead>(cls_head.start_date, cls_head.shard_rollover_date, cls_head.marker); + head.start_date = cls_head.start_date; + head.shard_rollover_date = cls_head.shard_rollover_date; + head.marker = std::move(cls_head.marker); return 0; } int RadosLifecycle::put_head(const DoutPrefixProvider* dpp, optional_yield y, - const std::string& oid, LCHead& head) + const std::string& oid, const LCHead& head) { cls_rgw_lc_obj_head cls_head; - cls_head.marker = head.get_marker(); - cls_head.start_date = head.get_start_date(); - cls_head.shard_rollover_date = head.get_shard_rollover_date(); + cls_head.marker = head.marker; + cls_head.start_date = head.start_date; + cls_head.shard_rollover_date = head.shard_rollover_date; librados::ObjectWriteOperation op; cls_rgw_lc_put_head(op, cls_head); diff --git a/src/rgw/driver/rados/rgw_sal_rados.h b/src/rgw/driver/rados/rgw_sal_rados.h index 705b665d46d..d359f733ab3 100644 --- a/src/rgw/driver/rados/rgw_sal_rados.h +++ b/src/rgw/driver/rados/rgw_sal_rados.h @@ -877,31 +877,30 @@ public: } }; -class RadosLifecycle : public StoreLifecycle { +class RadosLifecycle : public Lifecycle { RadosStore* store; public: RadosLifecycle(RadosStore* _st) : store(_st) {} - using StoreLifecycle::get_entry; virtual int get_entry(const DoutPrefixProvider* dpp, optional_yield y, const std::string& oid, const std::string& marker, - std::unique_ptr<LCEntry>* entry) override; + LCEntry& entry) override; virtual int get_next_entry(const DoutPrefixProvider* dpp, optional_yield y, const std::string& oid, const std::string& marker, - std::unique_ptr<LCEntry>* entry) override; + LCEntry& entry) override; virtual int set_entry(const DoutPrefixProvider* dpp, optional_yield y, - const std::string& oid, LCEntry& entry) override; + const std::string& oid, const LCEntry& entry) override; virtual int list_entries(const DoutPrefixProvider* dpp, optional_yield y, const std::string& oid, const std::string& marker, uint32_t max_entries, - std::vector<std::unique_ptr<LCEntry>>& entries) override; + std::vector<LCEntry>& entries) override; virtual int rm_entry(const DoutPrefixProvider* dpp, optional_yield y, - const std::string& oid, LCEntry& entry) override; + const std::string& oid, const LCEntry& entry) override; virtual int get_head(const DoutPrefixProvider* dpp, optional_yield y, - const std::string& oid, std::unique_ptr<LCHead>* head) override; - virtual int put_head(const DoutPrefixProvider* dpp, optional_yield y, const std::string& oid, LCHead& head) override; + virtual int put_head(const DoutPrefixProvider* dpp, optional_yield y, + const std::string& oid, const LCHead& head) override; virtual std::unique_ptr<LCSerializer> get_serializer(const std::string& lock_name, const std::string& oid, const std::string& cookie) override; |