class RGWMetadataHandlerPut_BucketInstance : public RGWMetadataHandlerPut_SObj
{
CephContext *cct;
+ optional_yield y;
RGWBucketInstanceMetadataHandler *bihandler;
RGWBucketInstanceMetadataObject *obj;
public:
RGWMetadataObject *_obj, RGWObjVersionTracker& objv_tracker,
optional_yield y,
RGWMDLogSyncType type, bool from_remote_zone) : RGWMetadataHandlerPut_SObj(_handler, _op, entry, _obj, objv_tracker, y, type, from_remote_zone),
- cct(_cct), bihandler(_handler) {
+ cct(_cct), y(y), bihandler(_handler) {
obj = static_cast<RGWBucketInstanceMetadataObject *>(_obj);
auto& bci = obj->get_bci();
auto lc_it = bci.attrs.find(RGW_ATTR_LC);
if (lc_it != bci.attrs.end()) {
ldpp_dout(dpp, 20) << "set lc config for " << bci.info.bucket.name << dendl;
- ret = lc->set_bucket_config(bucket.get(), bci.attrs, nullptr);
+ ret = lc->set_bucket_config(dpp, y, bucket.get(), bci.attrs, nullptr);
if (ret < 0) {
ldpp_dout(dpp, 0) << __func__ << " failed to set lc config for "
<< bci.info.bucket.name
} else {
ldpp_dout(dpp, 20) << "remove lc config for " << bci.info.bucket.name << dendl;
- ret = lc->remove_bucket_config(bucket.get(), bci.attrs, false /* cannot merge attrs */);
+ ret = lc->remove_bucket_config(dpp, y, bucket.get(), bci.attrs, false /* cannot merge attrs */);
if (ret < 0) {
ldpp_dout(dpp, 0) << __func__ << " failed to remove lc config for "
<< bci.info.bucket.name
return -EIO;
}
- int ret = lc->set_bucket_config(params.bucket,
+ int ret = lc->set_bucket_config(dpp, null_yield, params.bucket,
params.bucket_attrs,
¶ms.config);
if (ret < 0) {
if (get_attrs().count(RGW_ATTR_LC)) {
constexpr bool merge_attrs = false; // don't update xattrs, we're deleting
(void) store->getRados()->get_lc()->remove_bucket_config(
- this, get_attrs(), merge_attrs);
+ dpp, y, this, get_attrs(), merge_attrs);
}
// remove bucket-topic mapping
return lock.lock_exclusive(ioctx, oid);
}
-int RadosLifecycle::get_entry(const std::string& oid, const std::string& marker,
+int RadosLifecycle::get_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, const std::string& marker,
std::unique_ptr<LCEntry>* entry)
{
cls_rgw_lc_entry cls_entry;
if (ret)
return ret;
- LCEntry* e;
- e = new StoreLCEntry(cls_entry.bucket, cls_entry.start_time, cls_entry.status);
- if (!e)
- return -ENOMEM;
-
- entry->reset(e);
+ *entry = std::make_unique<StoreLCEntry>(cls_entry.bucket, cls_entry.start_time, cls_entry.status);
return 0;
}
-int RadosLifecycle::get_next_entry(const std::string& oid, const std::string& marker,
+int RadosLifecycle::get_next_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, const std::string& marker,
std::unique_ptr<LCEntry>* entry)
{
cls_rgw_lc_entry cls_entry;
if (ret)
return ret;
- LCEntry* e;
- e = new StoreLCEntry(cls_entry.bucket, cls_entry.start_time, cls_entry.status);
- if (!e)
- return -ENOMEM;
-
- entry->reset(e);
+ *entry = std::make_unique<StoreLCEntry>(cls_entry.bucket, cls_entry.start_time, cls_entry.status);
return 0;
}
-int RadosLifecycle::set_entry(const std::string& oid, LCEntry& entry)
+int RadosLifecycle::set_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, LCEntry& entry)
{
cls_rgw_lc_entry cls_entry;
return cls_rgw_lc_set_entry(*store->getRados()->get_lc_pool_ctx(), oid, cls_entry);
}
-int RadosLifecycle::list_entries(const std::string& oid, const std::string& marker,
- uint32_t max_entries, std::vector<std::unique_ptr<LCEntry>>& entries)
+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)
{
entries.clear();
return ret;
}
-int RadosLifecycle::rm_entry(const std::string& oid, LCEntry& entry)
+int RadosLifecycle::rm_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, LCEntry& entry)
{
cls_rgw_lc_entry cls_entry;
return cls_rgw_lc_rm_entry(*store->getRados()->get_lc_pool_ctx(), oid, cls_entry);
}
-int RadosLifecycle::get_head(const std::string& oid, std::unique_ptr<LCHead>* head)
+int RadosLifecycle::get_head(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, std::unique_ptr<LCHead>* head)
{
cls_rgw_lc_obj_head cls_head;
int ret = cls_rgw_lc_get_head(*store->getRados()->get_lc_pool_ctx(), oid, cls_head);
if (ret)
return ret;
- LCHead* h;
- h = new StoreLCHead(cls_head.start_date, cls_head.shard_rollover_date, cls_head.marker);
- if (!h)
- return -ENOMEM;
-
- head->reset(h);
+ *head = std::make_unique<StoreLCHead>(cls_head.start_date, cls_head.shard_rollover_date, cls_head.marker);
return 0;
}
-int RadosLifecycle::put_head(const std::string& oid, LCHead& head)
+int RadosLifecycle::put_head(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, LCHead& head)
{
cls_rgw_lc_obj_head cls_head;
RadosLifecycle(RadosStore* _st) : store(_st) {}
using StoreLifecycle::get_entry;
- virtual int get_entry(const std::string& oid, const std::string& marker, std::unique_ptr<LCEntry>* entry) override;
- virtual int get_next_entry(const std::string& oid, const std::string& marker, std::unique_ptr<LCEntry>* entry) override;
- virtual int set_entry(const std::string& oid, LCEntry& entry) override;
- virtual int list_entries(const std::string& oid, const std::string& marker,
+ virtual int get_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, const std::string& marker,
+ std::unique_ptr<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;
+ virtual int set_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, 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;
- virtual int rm_entry(const std::string& oid, LCEntry& entry) override;
- virtual int get_head(const std::string& oid, std::unique_ptr<LCHead>* head) override;
- virtual int put_head(const std::string& oid, LCHead& head) override;
+ virtual int rm_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, 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 std::unique_ptr<LCSerializer> get_serializer(const std::string& lock_name,
const std::string& oid,
const std::string& cookie) override;
/* XXXX are we SURE the only way result could == ENOENT is when
* there is no such bucket? It is currently the value returned
* from bucket_lc_process(...) */
- ret = sal_lc->rm_entry(obj_names[index], entry);
+ ret = sal_lc->rm_entry(this, null_yield, obj_names[index], entry);
if (ret < 0) {
ldpp_dout(this, 0) << "RGWLC::bucket_lc_post() failed to remove entry "
<< obj_names[index] << dendl;
entry.set_status(lc_complete);
}
- ret = sal_lc->set_entry(obj_names[index], entry);
+ ret = sal_lc->set_entry(this, null_yield, obj_names[index], entry);
if (ret < 0) {
ldpp_dout(this, 0) << "RGWLC::bucket_lc_post() failed to set entry on "
<< obj_names[index] << dendl;
progress_map.clear();
for(; index < max_objs; index++, marker="") {
vector<std::unique_ptr<rgw::sal::Lifecycle::LCEntry>> entries;
- int ret = sal_lc->list_entries(obj_names[index], marker, max_entries, entries);
+ int ret = sal_lc->list_entries(this, null_yield, obj_names[index],
+ marker, max_entries, entries);
if (ret < 0) {
if (ret == -ENOENT) {
ldpp_dout(this, 10) << __func__ << "() ignoring unfound lc object="
std::unique_lock<rgw::sal::LCSerializer> lock(
*(serializer.get()), std::adopt_lock);
- ret = sal_lc->get_entry(obj_names[index], bucket_entry_marker, &entry);
+ ret = sal_lc->get_entry(this, null_yield, obj_names[index],
+ bucket_entry_marker, &entry);
if (ret >= 0) {
if (entry->get_status() == lc_processing) {
if (expired_session(entry->get_start_time())) {
<< dendl;
entry->set_status(lc_processing);
- ret = sal_lc->set_entry(obj_names[index], *entry);
+ ret = sal_lc->set_entry(this, null_yield, obj_names[index], *entry);
if (ret < 0) {
ldpp_dout(this, 0) << "RGWLC::process_bucket() failed to set obj entry "
<< obj_names[index] << entry->get_bucket() << entry->get_status()
int ret{0};
std::unique_ptr<rgw::sal::Lifecycle::LCEntry> next_entry;
- ret = sal_lc->get_next_entry(lc_shard, entry.get_bucket(), &next_entry);
+ ret = sal_lc->get_next_entry(this, null_yield, lc_shard,
+ entry.get_bucket(), &next_entry);
if (ret < 0) {
ldpp_dout(this, 0) << "RGWLC::process() failed to get obj entry "
<< lc_shard << dendl;
head.set_marker(next_entry->get_bucket());
head.set_start_date(start_date);
- ret = sal_lc->put_head(lc_shard, head);
+ ret = sal_lc->put_head(this, null_yield, lc_shard, head);
if (ret < 0) {
ldpp_dout(this, 0) << "RGWLC::process() failed to put head "
<< lc_shard
<< lc_shard << " worker=" << worker_ix
<< dendl;
head.set_shard_rollover_date(ceph_clock_now());
- ret = sal_lc->put_head(lc_shard, head);
+ ret = sal_lc->put_head(this, null_yield, lc_shard, head);
if (ret < 0) {
ldpp_dout(this, 0) << "RGWLC::process() failed to put head "
<< lc_shard
utime_t now = ceph_clock_now();
/* preamble: find an inital bucket/marker */
- ret = sal_lc->get_head(lc_shard, &head);
+ ret = sal_lc->get_head(this, null_yield, lc_shard, &head);
if (ret < 0) {
ldpp_dout(this, 0) << "RGWLC::process() failed to get obj head "
<< lc_shard << ", ret=" << ret << dendl;
<< dendl;
vector<std::unique_ptr<rgw::sal::Lifecycle::LCEntry>> entries;
- int ret = sal_lc->list_entries(lc_shard, head->get_marker(), 1, entries);
+ int ret = sal_lc->list_entries(this, null_yield, lc_shard,
+ head->get_marker(), 1, entries);
if (ret < 0) {
ldpp_dout(this, 0) << "RGWLC::process() sal_lc->list_entries(lc_shard, head.marker, 1, "
<< "entries) returned error ret==" << ret << dendl;
<< dendl;
/* fetches the entry pointed to by head.bucket */
- ret = sal_lc->get_entry(lc_shard, head->get_marker(), &entry);
+ ret = sal_lc->get_entry(this, null_yield, lc_shard,
+ head->get_marker(), &entry);
if (ret == -ENOENT) {
/* skip to next entry */
std::unique_ptr<rgw::sal::Lifecycle::LCEntry> tmp_entry = sal_lc->get_entry();
entry->set_status(lc_processing);
entry->set_start_time(now);
- ret = sal_lc->set_entry(lc_shard, *entry);
+ ret = sal_lc->set_entry(this, null_yield, lc_shard, *entry);
if (ret < 0) {
ldpp_dout(this, 0) << "RGWLC::process() failed to set obj entry "
<< lc_shard << entry->get_bucket() << entry->get_status() << dendl;
/* XXXX are we SURE the only way result could == ENOENT is when
* there is no such bucket? It is currently the value returned
* from bucket_lc_process(...) */
- ret = sal_lc->rm_entry(lc_shard, *entry);
+ ret = sal_lc->rm_entry(this, null_yield, lc_shard, *entry);
if (ret < 0) {
ldpp_dout(this, 0) << "RGWLC::process() failed to remove entry "
<< lc_shard << " (nonfatal)"
} else {
entry->set_status(lc_complete);
}
- ret = sal_lc->set_entry(lc_shard, *entry);
+ ret = sal_lc->set_entry(this, null_yield, lc_shard, *entry);
if (ret < 0) {
ldpp_dout(this, 0) << "RGWLC::process() failed to set entry on lc_shard="
<< lc_shard << " entry=" << entry
return ret;
}
-int RGWLC::set_bucket_config(rgw::sal::Bucket* bucket,
- const rgw::sal::Attrs& bucket_attrs,
- RGWLifecycleConfiguration *config)
+int RGWLC::set_bucket_config(const DoutPrefixProvider* dpp, optional_yield y,
+ rgw::sal::Bucket* bucket,
+ const rgw::sal::Attrs& bucket_attrs,
+ RGWLifecycleConfiguration *config)
{
int ret{0};
rgw::sal::Attrs attrs = bucket_attrs;
config->encode(lc_bl);
attrs[RGW_ATTR_LC] = std::move(lc_bl);
- ret =
- bucket->merge_and_store_attrs(this, attrs, null_yield);
+ ret = bucket->merge_and_store_attrs(dpp, attrs, y);
if (ret < 0) {
return ret;
}
rgw_bucket& b = bucket->get_key();
- ret = guard_lc_modify(this, driver, sal_lc.get(), b, cookie,
+ ret = guard_lc_modify(dpp, driver, sal_lc.get(), b, cookie,
[&](rgw::sal::Lifecycle* sal_lc, const string& oid,
rgw::sal::Lifecycle::LCEntry& entry) {
- return sal_lc->set_entry(oid, entry);
+ return sal_lc->set_entry(dpp, y, oid, entry);
});
return ret;
}
-int RGWLC::remove_bucket_config(rgw::sal::Bucket* bucket,
+int RGWLC::remove_bucket_config(const DoutPrefixProvider* dpp, optional_yield y,
+ rgw::sal::Bucket* bucket,
const rgw::sal::Attrs& bucket_attrs,
bool merge_attrs)
{
if (merge_attrs) {
attrs.erase(RGW_ATTR_LC);
- ret = bucket->merge_and_store_attrs(this, attrs, null_yield);
+ ret = bucket->merge_and_store_attrs(dpp, attrs, y);
if (ret < 0) {
- ldpp_dout(this, 0) << "RGWLC::RGWDeleteLC() failed to set attrs on bucket="
+ ldpp_dout(dpp, 0) << "RGWLC::RGWDeleteLC() failed to set attrs on bucket="
<< b.name << " returned err=" << ret << dendl;
return ret;
}
}
- ret = guard_lc_modify(this, driver, sal_lc.get(), b, cookie,
+ ret = guard_lc_modify(dpp, driver, sal_lc.get(), b, cookie,
[&](rgw::sal::Lifecycle* sal_lc, const string& oid,
rgw::sal::Lifecycle::LCEntry& entry) {
- return sal_lc->rm_entry(oid, entry);
+ return sal_lc->rm_entry(dpp, y, oid, entry);
});
return ret;
// 2. entry doesn't exist, which usually happens when reshard has happened prior to update and next LC process has already dropped the update
// 3. entry exists matching the current bucket id which was after a reshard (needs to be updated to the marker)
// We are not dropping the old marker here as that would be caught by the next LC process update
- int ret = sal_lc->get_entry(lc_oid, bucket_lc_key, &entry);
+ int ret = sal_lc->get_entry(dpp, null_yield, lc_oid, bucket_lc_key, &entry);
if (ret == 0) {
ldpp_dout(dpp, 5) << "Entry already exists, nothing to do" << dendl;
return ret; // entry is already existing correctly set to marker
ret = guard_lc_modify(dpp,
driver, sal_lc, bucket->get_key(), cookie,
- [&lc_oid](rgw::sal::Lifecycle* slc,
+ [dpp, &lc_oid](rgw::sal::Lifecycle* slc,
const string& oid,
rgw::sal::Lifecycle::LCEntry& entry) {
- return slc->set_entry(lc_oid, entry);
+ return slc->set_entry(dpp, null_yield, lc_oid, entry);
});
}
bool going_down();
void start_processor();
void stop_processor();
- int set_bucket_config(rgw::sal::Bucket* bucket,
+ int set_bucket_config(const DoutPrefixProvider* dpp, optional_yield y,
+ rgw::sal::Bucket* bucket,
const rgw::sal::Attrs& bucket_attrs,
RGWLifecycleConfiguration *config);
- int remove_bucket_config(rgw::sal::Bucket* bucket,
+ int remove_bucket_config(const DoutPrefixProvider* dpp, optional_yield y,
+ rgw::sal::Bucket* bucket,
const rgw::sal::Attrs& bucket_attrs,
bool merge_attrs = true);
return;
}
- op_ret = driver->get_rgwlc()->set_bucket_config(s->bucket.get(), s->bucket_attrs, &new_config);
+ op_ret = driver->get_rgwlc()->set_bucket_config(this, y, s->bucket.get(),
+ s->bucket_attrs, &new_config);
if (op_ret < 0) {
return;
}
return;
}
- op_ret = driver->get_rgwlc()->remove_bucket_config(s->bucket.get(), s->bucket_attrs);
+ op_ret = driver->get_rgwlc()->remove_bucket_config(this, y, s->bucket.get(),
+ s->bucket_attrs);
if (op_ret < 0) {
return;
}
/** Get an empty entry */
virtual std::unique_ptr<LCEntry> get_entry() = 0;
/** Get an entry matching the given marker */
- virtual int get_entry(const std::string& oid, const std::string& marker, std::unique_ptr<LCEntry>* entry) = 0;
+ virtual int get_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, const std::string& marker,
+ std::unique_ptr<LCEntry>* entry) = 0;
/** Get the entry following the given marker */
- virtual int get_next_entry(const std::string& oid, const std::string& marker, std::unique_ptr<LCEntry>* entry) = 0;
+ virtual int get_next_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, const std::string& marker,
+ std::unique_ptr<LCEntry>* entry) = 0;
/** Store a modified entry in then backing store */
- virtual int set_entry(const std::string& oid, LCEntry& entry) = 0;
+ virtual int set_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, LCEntry& entry) = 0;
/** List all known entries */
- virtual int list_entries(const std::string& oid, const std::string& marker,
+ 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) = 0;
/** Remove an entry from the backing store */
- virtual int rm_entry(const std::string& oid, LCEntry& entry) = 0;
+ virtual int rm_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, LCEntry& entry) = 0;
/** Get a head */
- virtual int get_head(const std::string& oid, std::unique_ptr<LCHead>* head) = 0;
+ virtual int get_head(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, std::unique_ptr<LCHead>* head) = 0;
/** Store a modified head to the backing store */
- virtual int put_head(const std::string& oid, LCHead& head) = 0;
+ virtual int put_head(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, LCHead& head) = 0;
/** Get a serializer for lifecycle */
virtual std::unique_ptr<LCSerializer> get_serializer(const std::string& lock_name,
return std::make_unique<DBLifecycle>(this);
}
- int DBLifecycle::get_entry(const std::string& oid, const std::string& marker,
- std::unique_ptr<LCEntry>* entry)
+ int DBLifecycle::get_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, const std::string& marker,
+ std::unique_ptr<LCEntry>* entry)
{
return store->getDB()->get_entry(oid, marker, entry);
}
- int DBLifecycle::get_next_entry(const std::string& oid, const std::string& marker,
+ int DBLifecycle::get_next_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, const std::string& marker,
std::unique_ptr<LCEntry>* entry)
{
return store->getDB()->get_next_entry(oid, marker, entry);
}
- int DBLifecycle::set_entry(const std::string& oid, LCEntry& entry)
+ int DBLifecycle::set_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, LCEntry& entry)
{
return store->getDB()->set_entry(oid, entry);
}
- int DBLifecycle::list_entries(const std::string& oid, const std::string& marker,
+ int DBLifecycle::list_entries(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, const std::string& marker,
uint32_t max_entries, vector<std::unique_ptr<LCEntry>>& entries)
{
return store->getDB()->list_entries(oid, marker, max_entries, entries);
}
- int DBLifecycle::rm_entry(const std::string& oid, LCEntry& entry)
+ int DBLifecycle::rm_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, LCEntry& entry)
{
return store->getDB()->rm_entry(oid, entry);
}
- int DBLifecycle::get_head(const std::string& oid, std::unique_ptr<LCHead>* head)
+ int DBLifecycle::get_head(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, std::unique_ptr<LCHead>* head)
{
return store->getDB()->get_head(oid, head);
}
- int DBLifecycle::put_head(const std::string& oid, LCHead& head)
+ int DBLifecycle::put_head(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, LCHead& head)
{
return store->getDB()->put_head(oid, head);
}
DBLifecycle(DBStore* _st) : store(_st) {}
using StoreLifecycle::get_entry;
- virtual int get_entry(const std::string& oid, const std::string& marker, std::unique_ptr<LCEntry>* entry) override;
- virtual int get_next_entry(const std::string& oid, const std::string& marker, std::unique_ptr<LCEntry>* entry) override;
- virtual int set_entry(const std::string& oid, LCEntry& entry) override;
- virtual int list_entries(const std::string& oid, const std::string& marker,
+ virtual int get_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, const std::string& marker,
+ std::unique_ptr<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;
+ virtual int set_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, 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;
- virtual int rm_entry(const std::string& oid, LCEntry& entry) override;
- virtual int get_head(const std::string& oid, std::unique_ptr<LCHead>* head) override;
- virtual int put_head(const std::string& oid, LCHead& head) override;
+ virtual int rm_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, 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 std::unique_ptr<LCSerializer> get_serializer(const std::string& lock_name,
const std::string& oid,
const std::string& cookie) override;
return std::make_unique<FilterLCEntry>(std::move(e));
}
-int FilterLifecycle::get_entry(const std::string& oid, const std::string& marker,
+int FilterLifecycle::get_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, const std::string& marker,
std::unique_ptr<LCEntry>* entry)
{
std::unique_ptr<LCEntry> ne;
- int ret;
-
- ret = next->get_entry(oid, marker, &ne);
+ int ret = next->get_entry(dpp, y, oid, marker, &ne);
if (ret < 0)
return ret;
- LCEntry* e = new FilterLCEntry(std::move(ne));
- entry->reset(e);
-
+ *entry = std::make_unique<FilterLCEntry>(std::move(ne));
return 0;
}
-int FilterLifecycle::get_next_entry(const std::string& oid, const std::string& marker,
+int FilterLifecycle::get_next_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, const std::string& marker,
std::unique_ptr<LCEntry>* entry)
{
std::unique_ptr<LCEntry> ne;
- int ret;
-
- ret = next->get_next_entry(oid, marker, &ne);
+ int ret = next->get_next_entry(dpp, y, oid, marker, &ne);
if (ret < 0)
return ret;
- LCEntry* e = new FilterLCEntry(std::move(ne));
- entry->reset(e);
-
+ *entry = std::make_unique<FilterLCEntry>(std::move(ne));
return 0;
}
-int FilterLifecycle::set_entry(const std::string& oid, LCEntry& entry)
+int FilterLifecycle::set_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, LCEntry& entry)
{
- return next->set_entry(oid, entry);
+ return next->set_entry(dpp, y, oid, entry);
}
-int FilterLifecycle::list_entries(const std::string& oid, const std::string& marker,
+int FilterLifecycle::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)
{
std::vector<std::unique_ptr<LCEntry>> ne;
- int ret;
-
- ret = next->list_entries(oid, marker, max_entries, ne);
+ int ret = next->list_entries(dpp, y, oid, marker, max_entries, ne);
if (ret < 0)
return ret;
return 0;
}
-int FilterLifecycle::rm_entry(const std::string& oid, LCEntry& entry)
+int FilterLifecycle::rm_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, LCEntry& entry)
{
- return next->rm_entry(oid, entry);
+ return next->rm_entry(dpp, y, oid, entry);
}
-int FilterLifecycle::get_head(const std::string& oid, std::unique_ptr<LCHead>* head)
+int FilterLifecycle::get_head(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, std::unique_ptr<LCHead>* head)
{
std::unique_ptr<LCHead> nh;
- int ret;
-
- ret = next->get_head(oid, &nh);
+ int ret = next->get_head(dpp, y, oid, &nh);
if (ret < 0)
return ret;
- LCHead* h = new FilterLCHead(std::move(nh));
- head->reset(h);
-
+ *head = std::make_unique<FilterLCHead>(std::move(nh));
return 0;
}
-int FilterLifecycle::put_head(const std::string& oid, LCHead& head)
+int FilterLifecycle::put_head(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, LCHead& head)
{
- return next->put_head(oid, *(dynamic_cast<FilterLCHead&>(head).next.get()));
+ return next->put_head(dpp, y, oid, *(dynamic_cast<FilterLCHead&>(head).next.get()));
}
std::unique_ptr<LCSerializer> FilterLifecycle::get_serializer(
virtual ~FilterLifecycle() = default;
virtual std::unique_ptr<LCEntry> get_entry() override;
- virtual int get_entry(const std::string& oid, const std::string& marker,
+ virtual int get_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, const std::string& marker,
std::unique_ptr<LCEntry>* entry) override;
- virtual int get_next_entry(const std::string& oid, const std::string& marker,
+ 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;
- virtual int set_entry(const std::string& oid, LCEntry& entry) override;
- virtual int list_entries(const std::string& oid, const std::string& marker,
+ virtual int set_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, 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;
- virtual int rm_entry(const std::string& oid, LCEntry& entry) override;
- virtual int get_head(const std::string& oid, std::unique_ptr<LCHead>* head) override;
- virtual int put_head(const std::string& oid, LCHead& head) override;
+ virtual int rm_entry(const DoutPrefixProvider* dpp, optional_yield y,
+ const std::string& oid, 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 std::unique_ptr<LCSerializer> get_serializer(const std::string& lock_name,
const std::string& oid,
const std::string& cookie) override;