int RGWAsyncGetBucketInstanceInfo::_send_request()
{
RGWObjectCtx obj_ctx(store);
- int r = store->get_bucket_instance_info(obj_ctx, bucket, *bucket_info, NULL, NULL);
+ int r = store->get_bucket_instance_from_oid(obj_ctx, oid, *bucket_info, NULL, NULL);
if (r < 0) {
ldout(store->ctx(), 0) << "ERROR: failed to get bucket instance info for "
- << bucket << dendl;
+ << oid << dendl;
return r;
}
class RGWAsyncGetBucketInstanceInfo : public RGWAsyncRadosRequest {
RGWRados *store;
- rgw_bucket bucket;
+ const std::string oid;
RGWBucketInfo *bucket_info;
protected:
int _send_request() override;
public:
RGWAsyncGetBucketInstanceInfo(RGWCoroutine *caller, RGWAioCompletionNotifier *cn,
- RGWRados *_store, const rgw_bucket& bucket,
+ RGWRados *_store, const std::string& oid,
RGWBucketInfo *_bucket_info)
: RGWAsyncRadosRequest(caller, cn), store(_store),
- bucket(bucket), bucket_info(_bucket_info) {}
+ oid(oid), bucket_info(_bucket_info) {}
};
class RGWGetBucketInstanceInfoCR : public RGWSimpleCoroutine {
RGWAsyncRadosProcessor *async_rados;
RGWRados *store;
- rgw_bucket bucket;
+ const std::string oid;
RGWBucketInfo *bucket_info;
- RGWAsyncGetBucketInstanceInfo *req;
+ RGWAsyncGetBucketInstanceInfo *req{nullptr};
public:
+ // metadata key constructor
+ RGWGetBucketInstanceInfoCR(RGWAsyncRadosProcessor *_async_rados, RGWRados *_store,
+ const std::string& meta_key, RGWBucketInfo *_bucket_info)
+ : RGWSimpleCoroutine(_store->ctx()), async_rados(_async_rados), store(_store),
+ oid(RGW_BUCKET_INSTANCE_MD_PREFIX + meta_key),
+ bucket_info(_bucket_info) {}
+ // rgw_bucket constructor
RGWGetBucketInstanceInfoCR(RGWAsyncRadosProcessor *_async_rados, RGWRados *_store,
const rgw_bucket& bucket, RGWBucketInfo *_bucket_info)
: RGWSimpleCoroutine(_store->ctx()), async_rados(_async_rados), store(_store),
- bucket(bucket), bucket_info(_bucket_info), req(NULL) {}
+ oid(RGW_BUCKET_INSTANCE_MD_PREFIX + bucket.get_key(':')),
+ bucket_info(_bucket_info) {}
~RGWGetBucketInstanceInfoCR() override {
request_cleanup();
}
}
int send_request() override {
- req = new RGWAsyncGetBucketInstanceInfo(this, stack->create_completion_notifier(), store, bucket, bucket_info);
+ req = new RGWAsyncGetBucketInstanceInfo(this, stack->create_completion_notifier(), store, oid, bucket_info);
async_rados->queue(req);
return 0;
}