g_conf()->rgw_nfs_run_sync_thread;
const DoutPrefix dp(cct.get(), dout_subsys, "librgw: ");
- store = RGWStoreManager::get_storage(&dp, g_ceph_context,
+ store = StoreManager::get_storage(&dp, g_ceph_context,
"rados",
run_gc,
run_lc,
delete olog;
- RGWStoreManager::close_storage(store);
+ StoreManager::close_storage(store);
rgw_tools_cleanup();
rgw_shutdown_resolver();
return 0;
} /* RGWLib::stop() */
- int RGWLibIO::set_uid(rgw::sal::RGWStore *store, const rgw_user& uid)
+ int RGWLibIO::set_uid(rgw::sal::Store *store, const rgw_user& uid)
{
const DoutPrefix dp(store->ctx(), dout_subsys, "librgw: ");
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(uid);
+ std::unique_ptr<rgw::sal::User> user = store->get_user(uid);
/* object exists, but policy is broken */
int ret = user->load_by_id(&dp, null_yield);
if (ret < 0) {
return env->get(header, NULL);
}
-static int parse_grantee_str(const DoutPrefixProvider *dpp, rgw::sal::RGWStore* store, string& grantee_str,
+static int parse_grantee_str(const DoutPrefixProvider *dpp, rgw::sal::Store* store, string& grantee_str,
const struct s3_acl_header *perm, ACLGrant& grant)
{
string id_type, id_val_quoted;
string id_val = rgw_trim_quotes(id_val_quoted);
if (strcasecmp(id_type.c_str(), "emailAddress") == 0) {
- std::unique_ptr<rgw::sal::RGWUser> user;
+ std::unique_ptr<rgw::sal::User> user;
ret = store->get_user_by_email(dpp, id_val, null_yield, &user);
if (ret < 0)
return ret;
grant.set_canon(user->get_id(), user->get_display_name(), rgw_perm);
} else if (strcasecmp(id_type.c_str(), "id") == 0) {
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(rgw_user(id_val));
+ std::unique_ptr<rgw::sal::User> user = store->get_user(rgw_user(id_val));
ret = user->load_by_id(dpp, null_yield);
if (ret < 0)
return ret;
return 0;
}
-static int parse_acl_header(const DoutPrefixProvider *dpp, rgw::sal::RGWStore* store,
+static int parse_acl_header(const DoutPrefixProvider *dpp, rgw::sal::Store* store,
const RGWEnv *env, const struct s3_acl_header *perm,
std::list<ACLGrant>& _grants)
{
};
int RGWAccessControlPolicy_S3::create_from_headers(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
const RGWEnv *env, ACLOwner& _owner)
{
std::list<ACLGrant> grants;
can only be called on object that was parsed
*/
int RGWAccessControlPolicy_S3::rebuild(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore* store, ACLOwner *owner,
+ rgw::sal::Store* store, ACLOwner *owner,
RGWAccessControlPolicy& dest, std::string &err_msg)
{
if (!owner)
return -EPERM;
}
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(owner->get_id());
+ std::unique_ptr<rgw::sal::User> user = store->get_user(owner->get_id());
if (user->load_by_id(dpp, null_yield) < 0) {
ldout(cct, 10) << "owner info does not exist" << dendl;
err_msg = "Invalid id";
#include "rgw_acl.h"
class RGWUserCtl;
-namespace rgw { namespace sal { class RGWStore; } }
+namespace rgw { namespace sal { class Store; } }
class ACLPermission_S3 : public ACLPermission, public XMLObj
{
bool xml_end(const char *el) override;
void to_xml(ostream& out);
- int rebuild(const DoutPrefixProvider *dpp, rgw::sal::RGWStore* store, ACLOwner *owner,
+ int rebuild(const DoutPrefixProvider *dpp, rgw::sal::Store* store, ACLOwner *owner,
RGWAccessControlPolicy& dest, std::string &err_msg);
bool compare_group_name(string& id, ACLGroupTypeEnum group) override;
int ret = _acl.create_canned(owner, bucket_owner, canned_acl);
return ret;
}
- int create_from_headers(const DoutPrefixProvider *dpp, rgw::sal::RGWStore* store,
+ int create_from_headers(const DoutPrefixProvider *dpp, rgw::sal::Store* store,
const RGWEnv *env, ACLOwner& _owner);
};
static ACLGrant user_to_grant(const DoutPrefixProvider *dpp,
CephContext* const cct,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
const std::string& uid,
const uint32_t perm)
{
RGWUserInfo grant_user;
ACLGrant grant;
- std::unique_ptr<rgw::sal::RGWUser> user;
+ std::unique_ptr<rgw::sal::User> user;
user = store->get_user(rgw_user(uid));
if (user->load_by_id(dpp, null_yield) < 0) {
}
int RGWAccessControlPolicy_SWIFT::add_grants(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
const std::vector<std::string>& uids,
const uint32_t perm)
{
int RGWAccessControlPolicy_SWIFT::create(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
const rgw_user& id,
const std::string& name,
const char* read_list,
}
void RGWAccessControlPolicy_SWIFTAcct::add_grants(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
const std::vector<std::string>& uids,
const uint32_t perm)
{
grant.set_group(ACL_GROUP_ALL_USERS, perm);
acl.add_grant(&grant);
} else {
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(rgw_user(uid));
+ std::unique_ptr<rgw::sal::User> user = store->get_user(rgw_user(uid));
if (user->load_by_id(dpp, null_yield) < 0) {
ldout(cct, 10) << "grant user does not exist:" << uid << dendl;
}
bool RGWAccessControlPolicy_SWIFTAcct::create(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
const rgw_user& id,
const std::string& name,
const std::string& acl_str)
class RGWAccessControlPolicy_SWIFT : public RGWAccessControlPolicy
{
- int add_grants(const DoutPrefixProvider *dpp, rgw::sal::RGWStore* store,
+ int add_grants(const DoutPrefixProvider *dpp, rgw::sal::Store* store,
const std::vector<std::string>& uids,
uint32_t perm);
~RGWAccessControlPolicy_SWIFT() override = default;
int create(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
const rgw_user& id,
const std::string& name,
const char* read_list,
~RGWAccessControlPolicy_SWIFTAcct() override {}
void add_grants(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
const std::vector<std::string>& uids,
uint32_t perm);
bool create(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
const rgw_user& id,
const std::string& name,
const std::string& acl_str);
#define SECRET_KEY_LEN 40
#define PUBLIC_ID_LEN 20
-static rgw::sal::RGWStore *store = NULL;
+static rgw::sal::Store *store = NULL;
static const DoutPrefixProvider* dpp() {
struct GlobalPrefix : public DoutPrefixProvider {
}
class StoreDestructor {
- rgw::sal::RGWStore *store;
+ rgw::sal::Store *store;
public:
- explicit StoreDestructor(rgw::sal::RGWRadosStore *_s) : store(_s) {}
+ explicit StoreDestructor(rgw::sal::RadosStore *_s) : store(_s) {}
~StoreDestructor() {
- RGWStoreManager::close_storage(store);
+ StoreManager::close_storage(store);
rgw_http_client_cleanup();
}
};
-static int init_bucket(rgw::sal::RGWUser* user, const rgw_bucket& b,
- std::unique_ptr<rgw::sal::RGWBucket>* bucket)
+static int init_bucket(rgw::sal::User* user, const rgw_bucket& b,
+ std::unique_ptr<rgw::sal::Bucket>* bucket)
{
return store->get_bucket(dpp(), nullptr, b, bucket, null_yield);
}
-static int init_bucket(rgw::sal::RGWUser* user,
+static int init_bucket(rgw::sal::User* user,
const string& tenant_name,
const string& bucket_name,
const string& bucket_id,
- std::unique_ptr<rgw::sal::RGWBucket>* bucket)
+ std::unique_ptr<rgw::sal::Bucket>* bucket)
{
rgw_bucket b;
b.tenant = tenant_name;
}
}
-int set_bucket_quota(rgw::sal::RGWStore *store, OPT opt_cmd,
+int set_bucket_quota(rgw::sal::Store *store, OPT opt_cmd,
const string& tenant_name, const string& bucket_name,
int64_t max_size, int64_t max_objects,
bool have_max_size, bool have_max_objects)
{
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
int r = store->get_bucket(dpp(), nullptr, tenant_name, bucket_name, &bucket, null_yield);
if (r < 0) {
cerr << "could not get bucket info for bucket=" << bucket_name << ": " << cpp_strerror(-r) << std::endl;
return 0;
}
-int check_min_obj_stripe_size(rgw::sal::RGWStore *store, rgw::sal::RGWObject* obj, uint64_t min_stripe_size, bool *need_rewrite)
+int check_min_obj_stripe_size(rgw::sal::Store *store, rgw::sal::Object* obj, uint64_t min_stripe_size, bool *need_rewrite)
{
RGWObjectCtx obj_ctx(store);
int ret = obj->get_obj_attrs(&obj_ctx, null_yield, dpp());
}
-int check_obj_locator_underscore(rgw::sal::RGWObject* obj, bool fix, bool remove_bad, Formatter *f) {
+int check_obj_locator_underscore(rgw::sal::Object* obj, bool fix, bool remove_bad, Formatter *f) {
f->open_object_section("object");
f->open_object_section("key");
f->dump_string("type", "head");
f->dump_string("locator", locator);
RGWObjectCtx obj_ctx(store);
- std::unique_ptr<rgw::sal::RGWObject::ReadOp> read_op = obj->get_read_op(&obj_ctx);
+ std::unique_ptr<rgw::sal::Object::ReadOp> read_op = obj->get_read_op(&obj_ctx);
int ret = read_op->prepare(null_yield, dpp());
bool needs_fixing = (ret == -ENOENT);
string status = (needs_fixing ? "needs_fixing" : "ok");
if ((needs_fixing || remove_bad) && fix) {
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->fix_head_obj_locator(obj->get_bucket()->get_info(), needs_fixing, remove_bad, obj->get_key());
+ ret = static_cast<rgw::sal::RadosStore*>(store)->getRados()->fix_head_obj_locator(obj->get_bucket()->get_info(), needs_fixing, remove_bad, obj->get_key());
if (ret < 0) {
cerr << "ERROR: fix_head_object_locator() returned ret=" << ret << std::endl;
goto done;
bool needs_fixing;
string status;
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->fix_tail_obj_locator(dpp(), bucket_info, key, fix, &needs_fixing, null_yield);
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->getRados()->fix_tail_obj_locator(dpp(), bucket_info, key, fix, &needs_fixing, null_yield);
if (ret < 0) {
cerr << "ERROR: fix_tail_object_locator_underscore() returned ret=" << ret << std::endl;
status = "failed";
return -EINVAL;
}
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
string bucket_id;
f->open_object_section("bucket");
vector<rgw_bucket_dir_entry> result;
string ns;
- rgw::sal::RGWBucket::ListParams params;
- rgw::sal::RGWBucket::ListResults results;
+ rgw::sal::Bucket::ListParams params;
+ rgw::sal::Bucket::ListResults results;
params.prefix = prefix;
params.delim = delim;
count += results.objs.size();
for (vector<rgw_bucket_dir_entry>::iterator iter = results.objs.begin(); iter != results.objs.end(); ++iter) {
- std::unique_ptr<rgw::sal::RGWObject> obj = bucket->get_object(iter->key);
+ std::unique_ptr<rgw::sal::Object> obj = bucket->get_object(iter->key);
if (obj->get_name()[0] == '_') {
ret = check_obj_locator_underscore(obj.get(), fix, remove_bad, f);
}
/// search for a matching zone/zonegroup id and return a connection if found
-static boost::optional<RGWRESTConn> get_remote_conn(rgw::sal::RGWRadosStore *store,
+static boost::optional<RGWRESTConn> get_remote_conn(rgw::sal::RadosStore *store,
const RGWZoneGroup& zonegroup,
const std::string& remote)
{
}
/// search each zonegroup for a connection
-static boost::optional<RGWRESTConn> get_remote_conn(rgw::sal::RGWRadosStore *store,
+static boost::optional<RGWRESTConn> get_remote_conn(rgw::sal::RadosStore *store,
const RGWPeriodMap& period_map,
const std::string& remote)
{
// read the current period
RGWPeriod current_period;
int ret = current_period.init(g_ceph_context,
- static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, realm.get_id(),
+ static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, realm.get_id(),
null_yield);
if (ret < 0) {
cerr << "Error initializing current period: "
boost::optional<RGWRESTConn> conn;
RGWRESTConn *remote_conn = nullptr;
if (!remote.empty()) {
- conn = get_remote_conn(static_cast<rgw::sal::RGWRadosStore*>(store), period.get_map(), remote);
+ conn = get_remote_conn(static_cast<rgw::sal::RadosStore*>(store), period.get_map(), remote);
if (!conn) {
cerr << "failed to find a zone or zonegroup for remote "
<< remote << std::endl;
Formatter *formatter, bool force)
{
RGWRealm realm(realm_id, realm_name);
- int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0 ) {
cerr << "Error initializing realm " << cpp_strerror(-ret) << std::endl;
return ret;
epoch = atoi(period_epoch.c_str());
}
RGWPeriod period(period_id, epoch);
- ret = period.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, realm.get_id(), null_yield);
+ ret = period.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, realm.get_id(), null_yield);
if (ret < 0) {
cerr << "period init failed: " << cpp_strerror(-ret) << std::endl;
return ret;
return 0;
}
-static int init_bucket_for_sync(rgw::sal::RGWUser* user,
+static int init_bucket_for_sync(rgw::sal::User* user,
const string& tenant, const string& bucket_name,
const string& bucket_id,
- std::unique_ptr<rgw::sal::RGWBucket>* bucket)
+ std::unique_ptr<rgw::sal::Bucket>* bucket)
{
int ret = init_bucket(user, tenant, bucket_name, bucket_id, bucket);
if (ret < 0) {
cerr << "request failed: " << cpp_strerror(-ret) << std::endl;
return ret;
}
- ret = period->init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield, false);
+ ret = period->init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield, false);
if (ret < 0) {
cerr << "faile to init period " << cpp_strerror(-ret) << std::endl;
return ret;
return 0;
}
-static int read_current_period_id(rgw::sal::RGWRadosStore* store, const std::string& realm_id,
+static int read_current_period_id(rgw::sal::RadosStore* store, const std::string& realm_id,
const std::string& realm_name,
std::string* period_id)
{
static void get_md_sync_status(list<string>& status)
{
- RGWMetaSyncStatusManager sync(static_cast<rgw::sal::RGWRadosStore*>(store), static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->rados->get_async_processor());
+ RGWMetaSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(store), static_cast<rgw::sal::RadosStore*>(store)->svc()->rados->get_async_processor());
int ret = sync.init();
if (ret < 0) {
push_ss(ss, status) << "incremental sync: " << num_inc << "/" << total_shards << " shards";
map<int, RGWMetadataLogInfo> master_shards_info;
- string master_period = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->get_current_period_id();
+ string master_period = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->get_current_period_id();
ret = sync.read_master_log_shards_info(master_period, &master_shards_info);
if (ret < 0) {
RGWZone *sz;
- if (!static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->find_zone(source_zone, &sz)) {
+ if (!static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone(source_zone, &sz)) {
push_ss(ss, status, tab) << string("zone not found");
flush_ss(ss, status);
return;
}
- if (!static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->zone_syncs_from(static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->get_zone(), *sz)) {
+ if (!static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->zone_syncs_from(static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->get_zone(), *sz)) {
push_ss(ss, status, tab) << string("not syncing from zone");
flush_ss(ss, status);
return;
}
- RGWDataSyncStatusManager sync(static_cast<rgw::sal::RGWRadosStore*>(store), static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->rados->get_async_processor(), source_zone, nullptr);
+ RGWDataSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(store), static_cast<rgw::sal::RadosStore*>(store)->svc()->rados->get_async_processor(), source_zone, nullptr);
int ret = sync.init();
if (ret < 0) {
{
const RGWRealm& realm = store->get_zone()->get_realm();
const RGWZoneGroup& zonegroup = store->get_zone()->get_zonegroup();
- const RGWZone& zone = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->get_zone();
+ const RGWZone& zone = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->get_zone();
int width = 15;
list<string> data_status;
- auto& zone_conn_map = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->get_zone_conn_map();
+ auto& zone_conn_map = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->get_zone_conn_map();
for (auto iter : zone_conn_map) {
const rgw_zone_id& source_id = iter.first;
string source_str = "source: ";
string s = source_str + source_id.id;
RGWZone *sz;
- if (static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->find_zone(source_id, &sz)) {
+ if (static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone(source_id, &sz)) {
s += string(" (") + sz->name + ")";
}
data_status.push_back(s);
return out << std::setw(h.w) << h.header << std::setw(1) << ' ';
}
-static int bucket_source_sync_status(rgw::sal::RGWRadosStore *store, const RGWZone& zone,
+static int bucket_source_sync_status(rgw::sal::RadosStore *store, const RGWZone& zone,
const RGWZone& source, RGWRESTConn *conn,
const RGWBucketInfo& bucket_info,
rgw_sync_bucket_pipe pipe,
return -EINVAL;
}
- std::unique_ptr<rgw::sal::RGWBucket> source_bucket;
+ std::unique_ptr<rgw::sal::Bucket> source_bucket;
int r = init_bucket(nullptr, *pipe.source.bucket, &source_bucket);
if (r < 0) {
lderr(store->ctx()) << "failed to read source bucket info: " << cpp_strerror(r) << dendl;
{
for (auto& zone_id : zones) {
for (auto& b : buckets) {
- std::unique_ptr<rgw::sal::RGWBucket> hint_bucket;
+ std::unique_ptr<rgw::sal::Bucket> hint_bucket;
int ret = init_bucket(nullptr, b, &hint_bucket);
if (ret < 0) {
ldpp_dout(dpp(), 20) << "could not init bucket info for hint bucket=" << b << " ... skipping" << dendl;
rgw_zone_id result;
RGWZone *zone;
- if (static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->find_zone(s, &zone)) {
+ if (static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone(s, &zone)) {
return rgw_zone_id(s);
}
- if (static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->find_zone_id_by_name(s, &result)) {
+ if (static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone_id_by_name(s, &result)) {
return result;
}
return rgw_zone_id(s);
{
rgw_zone_id zone_id = opt_target_zone.value_or(store->get_zone()->get_id());
- auto zone_policy_handler = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->get_sync_policy_handler(zone_id);
+ auto zone_policy_handler = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->get_sync_policy_handler(zone_id);
RGWBucketSyncPolicyHandlerRef bucket_handler;
auto handler = zone_policy_handler;
if (eff_bucket) {
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
int ret = init_bucket(nullptr, *eff_bucket, &bucket);
if (ret < 0 && ret != -ENOENT) {
}
if (ret >= 0) {
- rgw::sal::RGWAttrs attrs = bucket->get_attrs();
+ rgw::sal::Attrs attrs = bucket->get_attrs();
bucket_handler.reset(handler->alloc_child(bucket->get_info(), std::move(attrs)));
} else {
cerr << "WARNING: bucket not found, simulating result" << std::endl;
return 0;
}
-static int bucket_sync_info(rgw::sal::RGWRadosStore *store, const RGWBucketInfo& info,
+static int bucket_sync_info(rgw::sal::RadosStore *store, const RGWBucketInfo& info,
std::ostream& out)
{
const RGWRealm& realm = store->get_zone()->get_realm();
out << indented{width, "zone"} << zone.id << " (" << zone.name << ")\n";
out << indented{width, "bucket"} << info.bucket << "\n\n";
- if (!static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->bucket->bucket_imports_data(info.bucket, null_yield, dpp())) {
+ if (!static_cast<rgw::sal::RadosStore*>(store)->ctl()->bucket->bucket_imports_data(info.bucket, null_yield, dpp())) {
out << "Sync is disabled for bucket " << info.bucket.name << '\n';
return 0;
}
return 0;
}
-static int bucket_sync_status(rgw::sal::RGWRadosStore *store, const RGWBucketInfo& info,
+static int bucket_sync_status(rgw::sal::RadosStore *store, const RGWBucketInfo& info,
const rgw_zone_id& source_zone_id,
std::optional<rgw_bucket>& opt_source_bucket,
std::ostream& out)
{
const RGWRealm& realm = store->get_zone()->get_realm();
const RGWZoneGroup& zonegroup = store->get_zone()->get_zonegroup();
- const RGWZone& zone = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->get_zone();
+ const RGWZone& zone = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->get_zone();
constexpr int width = 15;
out << indented{width, "realm"} << realm.get_id() << " (" << realm.get_name() << ")\n";
out << indented{width, "zone"} << zone.id << " (" << zone.name << ")\n";
out << indented{width, "bucket"} << info.bucket << "\n\n";
- if (!static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->bucket->bucket_imports_data(info.bucket, null_yield, dpp())) {
+ if (!static_cast<rgw::sal::RadosStore*>(store)->ctl()->bucket->bucket_imports_data(info.bucket, null_yield, dpp())) {
out << "Sync is disabled for bucket " << info.bucket.name << " or bucket has no sync sources" << std::endl;
return 0;
}
auto sources = handler->get_all_sources();
- auto& zone_conn_map = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->get_zone_conn_map();
+ auto& zone_conn_map = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->get_zone_conn_map();
set<rgw_zone_id> zone_ids;
if (!source_zone_id.empty()) {
static int check_pool_support_omap(const rgw_pool& pool)
{
librados::IoCtx io_ctx;
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->get_rados_handle()->ioctx_create(pool.to_str().c_str(), io_ctx);
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->getRados()->get_rados_handle()->ioctx_create(pool.to_str().c_str(), io_ctx);
if (ret < 0) {
// the pool may not exist at this moment, we have no way to check if it supports omap.
return 0;
return 0;
}
-int check_reshard_bucket_params(rgw::sal::RGWRadosStore *store,
+int check_reshard_bucket_params(rgw::sal::RadosStore *store,
const string& bucket_name,
const string& tenant,
const string& bucket_id,
bool num_shards_specified,
int num_shards,
int yes_i_really_mean_it,
- std::unique_ptr<rgw::sal::RGWBucket>* bucket)
+ std::unique_ptr<rgw::sal::Bucket>* bucket)
{
if (bucket_name.empty()) {
cerr << "ERROR: bucket not specified" << std::endl;
return -EINVAL;
}
- if (num_shards > (int)static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->get_max_bucket_shards()) {
- cerr << "ERROR: num_shards too high, max value: " << static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->get_max_bucket_shards() << std::endl;
+ if (num_shards > (int)static_cast<rgw::sal::RadosStore*>(store)->getRados()->get_max_bucket_shards()) {
+ cerr << "ERROR: num_shards too high, max value: " << static_cast<rgw::sal::RadosStore*>(store)->getRados()->get_max_bucket_shards() << std::endl;
return -EINVAL;
}
shard_id);
// call cls_log_trim() until it returns -ENODATA
for (;;) {
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->cls->timelog.trim(oid, {}, {}, {}, marker, nullptr,
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->cls->timelog.trim(oid, {}, {}, {}, marker, nullptr,
null_yield);
if (ret == -ENODATA) {
return 0;
// unreachable
}
-const string& get_tier_type(rgw::sal::RGWRadosStore *store) {
+const string& get_tier_type(rgw::sal::RadosStore *store) {
return store->svc()->zone->get_zone().tier_type;
}
RGWZoneGroup zonegroup;
std::optional<rgw_bucket> b;
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
rgw_sync_policy_info *policy{nullptr};
b(_bucket) {}
int init() {
- int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return ret;
return;
}
zone_id.emplace();
- if (!static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->find_zone_id_by_name(*zone_name, &(*zone_id))) {
+ if (!static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone_id_by_name(*zone_name, &(*zone_id))) {
cerr << "WARNING: cannot find source zone id for name=" << *zone_name << std::endl;
zone_id = rgw_zone_id(*zone_name);
}
ids.emplace();
for (auto& name : *names) {
rgw_zone_id zid;
- if (!static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->find_zone_id_by_name(name, &zid)) {
+ if (!static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone_id_by_name(name, &zid)) {
cerr << "WARNING: cannot find source zone id for name=" << name << std::endl;
zid = rgw_zone_id(name);
}
auto zone_id = *(static_cast<const rgw_zone_id *>(pval));
string zone_name;
RGWZone *zone;
- if (static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->find_zone(zone_id, &zone)) {
+ if (static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone(zone_id, &zone)) {
zone_name = zone->name;
} else {
cerr << "WARNING: cannot find zone name for id=" << zone_id << std::endl;
common_init_finish(g_ceph_context);
rgw_user user_id_arg;
- std::unique_ptr<rgw::sal::RGWUser> user;
+ std::unique_ptr<rgw::sal::User> user;
string tenant;
string user_ns;
rgw_user new_user_id;
int commit = false;
int staging = false;
int key_type = KEY_TYPE_UNDEFINED;
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
uint32_t perm_mask = 0;
RGWUserInfo info;
OPT opt_cmd = OPT::NO_CMD;
bool need_cache = readonly_ops_list.find(opt_cmd) == readonly_ops_list.end();
if (raw_storage_op) {
- store = RGWStoreManager::get_raw_storage(dpp(), g_ceph_context, "rados");
+ store = StoreManager::get_raw_storage(dpp(), g_ceph_context, "rados");
} else {
- store = RGWStoreManager::get_storage(dpp(), g_ceph_context, "rados", false, false, false,
+ store = StoreManager::get_storage(dpp(), g_ceph_context, "rados", false, false, false,
false, false,
need_cache && g_conf()->rgw_cache_enabled);
}
if (tenant.empty()) {
tenant = user->get_tenant();
} else {
- if (rgw::sal::RGWUser::empty(user) && opt_cmd != OPT::ROLE_CREATE
+ if (rgw::sal::User::empty(user) && opt_cmd != OPT::ROLE_CREATE
&& opt_cmd != OPT::ROLE_DELETE
&& opt_cmd != OPT::ROLE_GET
&& opt_cmd != OPT::ROLE_MODIFY
}
if (!source_zone_name.empty()) {
- if (!static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->find_zone_id_by_name(source_zone_name, &source_zone)) {
+ if (!static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone_id_by_name(source_zone_name, &source_zone)) {
cerr << "WARNING: cannot find source zone id for name=" << source_zone_name << std::endl;
source_zone = source_zone_name;
}
oath_init();
- StoreDestructor store_destructor(static_cast<rgw::sal::RGWRadosStore*>(store));
+ StoreDestructor store_destructor(static_cast<rgw::sal::RadosStore*>(store));
if (raw_storage_op) {
switch (opt_cmd) {
return EINVAL;
}
RGWPeriod period(period_id);
- int ret = period.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = period.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "period.init failed: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
if (staging) {
RGWRealm realm(realm_id, realm_name);
- int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0 ) {
cerr << "Error initializing realm " << cpp_strerror(-ret) << std::endl;
return -ret;
epoch = 1;
}
RGWPeriod period(period_id, epoch);
- int ret = period.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, realm_id,
+ int ret = period.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, realm_id,
null_yield, realm_name);
if (ret < 0) {
cerr << "period init failed: " << cpp_strerror(-ret) << std::endl;
break;
case OPT::PERIOD_GET_CURRENT:
{
- int ret = read_current_period_id(static_cast<rgw::sal::RGWRadosStore*>(store), realm_id, realm_name, &period_id);
+ int ret = read_current_period_id(static_cast<rgw::sal::RadosStore*>(store), realm_id, realm_name, &period_id);
if (ret < 0) {
return -ret;
}
case OPT::PERIOD_LIST:
{
list<string> periods;
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->list_periods(periods);
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->list_periods(periods);
if (ret < 0) {
cerr << "failed to list periods: " << cpp_strerror(-ret) << std::endl;
return -ret;
if (url.empty()) {
// load current period for endpoints
RGWRealm realm(realm_id, realm_name);
- int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "failed to init realm: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
RGWPeriod current_period(realm.get_current_period());
- ret = current_period.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ ret = current_period.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "failed to init current period: " << cpp_strerror(-ret) << std::endl;
return -ret;
// use realm master zone as remote
remote = current_period.get_master_zone().id;
}
- conn = get_remote_conn(static_cast<rgw::sal::RGWRadosStore*>(store), current_period.get_map(), remote);
+ conn = get_remote_conn(static_cast<rgw::sal::RadosStore*>(store), current_period.get_map(), remote);
if (!conn) {
cerr << "failed to find a zone or zonegroup for remote "
<< remote << std::endl;
case OPT::GLOBAL_QUOTA_DISABLE:
{
if (realm_id.empty()) {
- RGWRealm realm(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj);
+ RGWRealm realm(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj);
if (!realm_name.empty()) {
// look up realm_id for the given realm_name
int ret = realm.read_id(realm_name, realm_id, null_yield);
}
RGWPeriodConfig period_config;
- int ret = period_config.read(static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, realm_id, null_yield);
+ int ret = period_config.read(static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, realm_id, null_yield);
if (ret < 0 && ret != -ENOENT) {
cerr << "ERROR: failed to read period config: "
<< cpp_strerror(-ret) << std::endl;
if (opt_cmd != OPT::GLOBAL_QUOTA_GET) {
// write the modified period config
- ret = period_config.write(static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, realm_id, null_yield);
+ ret = period_config.write(static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, realm_id, null_yield);
if (ret < 0) {
cerr << "ERROR: failed to write period config: "
<< cpp_strerror(-ret) << std::endl;
return EINVAL;
}
- RGWRealm realm(realm_name, g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj);
+ RGWRealm realm(realm_name, g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj);
int ret = realm.create(dpp(), null_yield);
if (ret < 0) {
cerr << "ERROR: couldn't create realm " << realm_name << ": " << cpp_strerror(-ret) << std::endl;
cerr << "missing realm name or id" << std::endl;
return EINVAL;
}
- int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "realm.init failed: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT::REALM_GET:
{
RGWRealm realm(realm_id, realm_name);
- int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
if (ret == -ENOENT && realm_name.empty() && realm_id.empty()) {
cerr << "missing realm name or id, or default realm not found" << std::endl;
break;
case OPT::REALM_GET_DEFAULT:
{
- RGWRealm realm(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj);
+ RGWRealm realm(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj);
string default_id;
int ret = realm.read_default_id(default_id, null_yield);
if (ret == -ENOENT) {
break;
case OPT::REALM_LIST:
{
- RGWRealm realm(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj);
+ RGWRealm realm(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj);
string default_id;
int ret = realm.read_default_id(default_id, null_yield);
if (ret < 0 && ret != -ENOENT) {
cerr << "could not determine default realm: " << cpp_strerror(-ret) << std::endl;
}
list<string> realms;
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->list_realms(realms);
+ ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->list_realms(realms);
if (ret < 0) {
cerr << "failed to list realms: " << cpp_strerror(-ret) << std::endl;
return -ret;
break;
case OPT::REALM_LIST_PERIODS:
{
- int ret = read_current_period_id(static_cast<rgw::sal::RGWRadosStore*>(store), realm_id, realm_name, &period_id);
+ int ret = read_current_period_id(static_cast<rgw::sal::RadosStore*>(store), realm_id, realm_name, &period_id);
if (ret < 0) {
return -ret;
}
list<string> periods;
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->list_periods(period_id, periods, null_yield);
+ ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->list_periods(period_id, periods, null_yield);
if (ret < 0) {
cerr << "list periods failed: " << cpp_strerror(-ret) << std::endl;
return -ret;
cerr << "missing realm name or id" << std::endl;
return EINVAL;
}
- int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "realm.init failed: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
RGWRealm realm(realm_id, realm_name);
bool new_realm = false;
- int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0 && ret != -ENOENT) {
cerr << "failed to init realm: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT::REALM_DEFAULT:
{
RGWRealm realm(realm_id, realm_name);
- int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "failed to init realm: " << cpp_strerror(-ret) << std::endl;
return -ret;
return -ret;
}
RGWRealm realm;
- realm.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield, false);
+ realm.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield, false);
try {
decode_json_obj(realm, &p);
} catch (const JSONDecoder::err& e) {
}
RGWZoneGroup zonegroup(zonegroup_id,zonegroup_name);
- int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "failed to initialize zonegroup " << zonegroup_name << " id " << zonegroup_id << " :"
<< cpp_strerror(-ret) << std::endl;
return -ret;
}
RGWZoneParams zone(zone_id, zone_name);
- ret = zone.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ ret = zone.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "unable to initialize zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
endpoints, ptier_type,
psync_from_all, sync_from, sync_from_rm,
predirect_zone, bucket_index_max_shards,
- static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sync_modules->get_manager(),
+ static_cast<rgw::sal::RadosStore*>(store)->svc()->sync_modules->get_manager(),
null_yield);
if (ret < 0) {
cerr << "failed to add zone " << zone_name << " to zonegroup " << zonegroup.get_name() << ": "
return EINVAL;
}
RGWRealm realm(realm_id, realm_name);
- int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "failed to init realm: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
- RGWZoneGroup zonegroup(zonegroup_name, is_master, g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, realm.get_id(), endpoints);
+ RGWZoneGroup zonegroup(zonegroup_name, is_master, g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, realm.get_id(), endpoints);
zonegroup.api_name = (api_name.empty() ? zonegroup_name : api_name);
ret = zonegroup.create(dpp(), null_yield);
if (ret < 0) {
}
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return -ret;
return EINVAL;
}
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj,
+ int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj,
null_yield);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
case OPT::ZONEGROUP_GET:
{
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT::ZONEGROUP_LIST:
{
RGWZoneGroup zonegroup;
- int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj,
+ int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj,
null_yield, false);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
}
list<string> zonegroups;
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->list_zonegroups(zonegroups);
+ ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->list_zonegroups(zonegroups);
if (ret < 0) {
cerr << "failed to list zonegroups: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT::ZONEGROUP_MODIFY:
{
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return -ret;
need_update = true;
} else if (!realm_name.empty()) {
// get realm id from name
- RGWRealm realm{g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj};
+ RGWRealm realm{g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj};
ret = realm.read_id(realm_name, zonegroup.realm_id, null_yield);
if (ret < 0) {
cerr << "failed to find realm by name " << realm_name << std::endl;
case OPT::ZONEGROUP_SET:
{
RGWRealm realm(realm_id, realm_name);
- int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
bool default_realm_not_exist = (ret == -ENOENT && realm_id.empty() && realm_name.empty());
if (ret < 0 && !default_realm_not_exist ) {
}
RGWZoneGroup zonegroup;
- ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj,
+ ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj,
null_yield, false);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
case OPT::ZONEGROUP_REMOVE:
{
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return -ret;
return EINVAL;
}
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT::ZONEGROUP_PLACEMENT_LIST:
{
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj,
+ int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj,
null_yield);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
}
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return -ret;
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
/* if the user didn't provide zonegroup info , create stand alone zone */
if (!zonegroup_id.empty() || !zonegroup_name.empty()) {
- ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "unable to initialize zonegroup " << zonegroup_name << ": " << cpp_strerror(-ret) << std::endl;
return -ret;
}
RGWZoneParams zone(zone_id, zone_name);
- ret = zone.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield, false);
+ ret = zone.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield, false);
if (ret < 0) {
cerr << "unable to initialize zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
psync_from_all,
sync_from, sync_from_rm,
predirect_zone, bucket_index_max_shards,
- static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sync_modules->get_manager(),
+ static_cast<rgw::sal::RadosStore*>(store)->svc()->sync_modules->get_manager(),
null_yield);
if (ret < 0) {
cerr << "failed to add zone " << zone_name << " to zonegroup " << zonegroup.get_name()
case OPT::ZONE_DEFAULT:
{
RGWZoneGroup zonegroup(zonegroup_id,zonegroup_name);
- int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "WARNING: failed to initialize zonegroup " << zonegroup_name << std::endl;
}
return EINVAL;
}
RGWZoneParams zone(zone_id, zone_name);
- ret = zone.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ ret = zone.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "unable to initialize zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
return EINVAL;
}
RGWZoneParams zone(zone_id, zone_name);
- int ret = zone.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = zone.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "unable to initialize zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
list<string> zonegroups;
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->list_zonegroups(zonegroups);
+ ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->list_zonegroups(zonegroups);
if (ret < 0) {
cerr << "failed to list zonegroups: " << cpp_strerror(-ret) << std::endl;
return -ret;
for (list<string>::iterator iter = zonegroups.begin(); iter != zonegroups.end(); ++iter) {
RGWZoneGroup zonegroup(string(), *iter);
- int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "WARNING: failed to initialize zonegroup " << zonegroup_name << std::endl;
continue;
case OPT::ZONE_GET:
{
RGWZoneParams zone(zone_id, zone_name);
- int ret = zone.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = zone.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "unable to initialize zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT::ZONE_SET:
{
RGWZoneParams zone(zone_name);
- int ret = zone.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield,
+ int ret = zone.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield,
false);
if (ret < 0) {
return -ret;
if(zone.realm_id.empty()) {
RGWRealm realm(realm_id, realm_name);
- int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0 && ret != -ENOENT) {
cerr << "failed to init realm: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT::ZONE_LIST:
{
list<string> zones;
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->list_zones(zones);
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->list_zones(zones);
if (ret < 0) {
cerr << "failed to list zones: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
RGWZoneParams zone;
- ret = zone.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield, false);
+ ret = zone.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield, false);
if (ret < 0) {
cerr << "failed to init zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT::ZONE_MODIFY:
{
RGWZoneParams zone(zone_id, zone_name);
- int ret = zone.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = zone.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "failed to init zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
need_zone_update = true;
} else if (!realm_name.empty()) {
// get realm id from name
- RGWRealm realm{g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj};
+ RGWRealm realm{g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj};
ret = realm.read_id(realm_name, zone.realm_id, null_yield);
if (ret < 0) {
cerr << "failed to find realm by name " << realm_name << std::endl;
}
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return -ret;
endpoints, ptier_type,
psync_from_all, sync_from, sync_from_rm,
predirect_zone, bucket_index_max_shards,
- static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sync_modules->get_manager(),
+ static_cast<rgw::sal::RadosStore*>(store)->svc()->sync_modules->get_manager(),
null_yield);
if (ret < 0) {
cerr << "failed to update zonegroup: " << cpp_strerror(-ret) << std::endl;
return EINVAL;
}
RGWZoneParams zone(zone_id,zone_name);
- int ret = zone.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = zone.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "unable to initialize zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
return -ret;
}
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "WARNING: failed to initialize zonegroup " << zonegroup_name << std::endl;
} else {
}
RGWZoneParams zone(zone_id, zone_name);
- int ret = zone.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = zone.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "failed to init zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
if (opt_cmd == OPT::ZONE_PLACEMENT_ADD ||
opt_cmd == OPT::ZONE_PLACEMENT_MODIFY) {
RGWZoneGroup zonegroup(zonegroup_id, zonegroup_name);
- ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ ret = zonegroup.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "failed to init zonegroup: " << cpp_strerror(-ret) << std::endl;
return -ret;
case OPT::ZONE_PLACEMENT_LIST:
{
RGWZoneParams zone(zone_id, zone_name);
- int ret = zone.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = zone.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "unable to initialize zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
RGWZoneParams zone(zone_id, zone_name);
- int ret = zone.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = zone.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "unable to initialize zone: " << cpp_strerror(-ret) << std::endl;
return -ret;
return EINVAL;
}
- if (!rgw::sal::RGWUser::empty(user)) {
+ if (!rgw::sal::User::empty(user)) {
user_op.set_user_id(user->get_id());
bucket_op.set_user_id(user->get_id());
}
if (!user_email.empty())
user_op.set_user_email(user_email);
- if (!rgw::sal::RGWUser::empty(user)) {
+ if (!rgw::sal::User::empty(user)) {
user_op.set_new_user_id(new_user_id);
}
// RGWUser to use for user operations
RGWUser ruser;
int ret = 0;
- if (!(rgw::sal::RGWUser::empty(user) && access_key.empty()) || !subuser.empty()) {
+ if (!(rgw::sal::User::empty(user) && access_key.empty()) || !subuser.empty()) {
ret = ruser.init(dpp(), store, user_op, null_yield);
if (ret < 0) {
cerr << "user.init failed: " << cpp_strerror(-ret) << std::endl;
switch (opt_cmd) {
case OPT::USER_INFO:
- if (rgw::sal::RGWUser::empty(user) && access_key.empty()) {
+ if (rgw::sal::User::empty(user) && access_key.empty()) {
cerr << "ERROR: --uid or --access-key required" << std::endl;
return EINVAL;
}
// load the period
RGWPeriod period(period_id);
- int ret = period.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = period.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "period init failed: " << cpp_strerror(-ret) << std::endl;
return -ret;
{
// read realm and staging period
RGWRealm realm(realm_id, realm_name);
- int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, null_yield);
+ int ret = realm.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, null_yield);
if (ret < 0) {
cerr << "Error initializing realm: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
RGWPeriod period(RGWPeriod::get_staging_id(realm.get_id()), 1);
- ret = period.init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, realm.get_id(), null_yield);
+ ret = period.init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, realm.get_id(), null_yield);
if (ret < 0) {
cerr << "period init failed: " << cpp_strerror(-ret) << std::endl;
return -ret;
bool truncated;
- if (!rgw::sal::RGWUser::empty(user)) {
+ if (!rgw::sal::User::empty(user)) {
user_ids.push_back(user->get_id().id);
ret =
RGWBucketAdminOp::limit_check(store, bucket_op, user_ids, f,
if (opt_cmd == OPT::BUCKETS_LIST) {
if (bucket_name.empty()) {
- if (!rgw::sal::RGWUser::empty(user)) {
+ if (!rgw::sal::User::empty(user)) {
if (!user_op.has_existing_user()) {
cerr << "ERROR: could not find user: " << user << std::endl;
return -ENOENT;
string delim;
string ns;
- rgw::sal::RGWBucket::ListParams params;
- rgw::sal::RGWBucket::ListResults results;
+ rgw::sal::Bucket::ListParams params;
+ rgw::sal::Bucket::ListResults results;
params.prefix = prefix;
params.delim = delim;
formatter->reset();
formatter->open_array_section("logs");
RGWAccessHandle h;
- int r = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->log_list_init(date, &h);
+ int r = static_cast<rgw::sal::RadosStore*>(store)->getRados()->log_list_init(date, &h);
if (r == -ENOENT) {
// no logs.
} else {
}
while (true) {
string name;
- int r = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->log_list_next(h, &name);
+ int r = static_cast<rgw::sal::RadosStore*>(store)->getRados()->log_list_next(h, &name);
if (r == -ENOENT)
break;
if (r < 0) {
if (opt_cmd == OPT::LOG_SHOW) {
RGWAccessHandle h;
- int r = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->log_show_init(oid, &h);
+ int r = static_cast<rgw::sal::RadosStore*>(store)->getRados()->log_show_init(oid, &h);
if (r < 0) {
cerr << "error opening log " << oid << ": " << cpp_strerror(-r) << std::endl;
return -r;
struct rgw_log_entry entry;
// peek at first entry to get bucket metadata
- r = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->log_show_next(h, &entry);
+ r = static_cast<rgw::sal::RadosStore*>(store)->getRados()->log_show_next(h, &entry);
if (r < 0) {
cerr << "error reading log " << oid << ": " << cpp_strerror(-r) << std::endl;
return -r;
formatter->flush(cout);
}
next:
- r = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->log_show_next(h, &entry);
+ r = static_cast<rgw::sal::RadosStore*>(store)->getRados()->log_show_next(h, &entry);
} while (r > 0);
if (r < 0) {
cout << std::endl;
}
if (opt_cmd == OPT::LOG_RM) {
- int r = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->log_remove(oid);
+ int r = static_cast<rgw::sal::RadosStore*>(store)->getRados()->log_remove(oid);
if (r < 0) {
cerr << "error removing log " << oid << ": " << cpp_strerror(-r) << std::endl;
return -r;
exit(1);
}
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->add_bucket_placement(pool, null_yield);
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->add_bucket_placement(pool, null_yield);
if (ret < 0)
cerr << "failed to add bucket placement: " << cpp_strerror(-ret) << std::endl;
}
exit(1);
}
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->remove_bucket_placement(pool, null_yield);
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->remove_bucket_placement(pool, null_yield);
if (ret < 0)
cerr << "failed to remove bucket placement: " << cpp_strerror(-ret) << std::endl;
}
if (opt_cmd == OPT::POOLS_LIST) {
set<rgw_pool> pools;
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->list_placement_set(pools, null_yield);
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->list_placement_set(pools, null_yield);
if (ret < 0) {
cerr << "could not list placement set: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
if (opt_cmd == OPT::USAGE_TRIM) {
- if (rgw::sal::RGWUser::empty(user) && bucket_name.empty() &&
+ if (rgw::sal::User::empty(user) && bucket_name.empty() &&
start_date.empty() && end_date.empty() && !yes_i_really_mean_it) {
cerr << "usage trim without user/date/bucket specified will remove *all* users data" << std::endl;
cerr << "do you really mean it? (requires --yes-i-really-mean-it)" << std::endl;
}
RGWOLHInfo olh;
rgw_obj obj(bucket->get_key(), object);
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->get_olh(bucket->get_info(), obj, &olh);
+ ret = static_cast<rgw::sal::RadosStore*>(store)->getRados()->get_olh(bucket->get_info(), obj, &olh);
if (ret < 0) {
cerr << "ERROR: failed reading olh: " << cpp_strerror(-ret) << std::endl;
return -ret;
bool is_truncated;
RGWObjectCtx rctx(store);
- std::unique_ptr<rgw::sal::RGWObject> obj = bucket->get_object(object);
+ std::unique_ptr<rgw::sal::Object> obj = bucket->get_object(object);
RGWObjState *state;
return -ret;
}
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->bucket_index_read_olh_log(dpp(), bucket->get_info(), *state, obj->get_obj(), 0, &log, &is_truncated);
+ ret = static_cast<rgw::sal::RadosStore*>(store)->getRados()->bucket_index_read_olh_log(dpp(), bucket->get_info(), *state, obj->get_obj(), 0, &log, &is_truncated);
if (ret < 0) {
cerr << "ERROR: failed reading olh: " << cpp_strerror(-ret) << std::endl;
return -ret;
rgw_cls_bi_entry entry;
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->bi_get(bucket->get_info(), obj, bi_index_type, &entry);
+ ret = static_cast<rgw::sal::RadosStore*>(store)->getRados()->bi_get(bucket->get_info(), obj, bi_index_type, &entry);
if (ret < 0) {
cerr << "ERROR: bi_get(): " << cpp_strerror(-ret) << std::endl;
return -ret;
rgw_obj obj(bucket->get_key(), key);
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->bi_put(dpp(), bucket->get_key(), obj, entry);
+ ret = static_cast<rgw::sal::RadosStore*>(store)->getRados()->bi_put(dpp(), bucket->get_key(), obj, entry);
if (ret < 0) {
cerr << "ERROR: bi_put(): " << cpp_strerror(-ret) << std::endl;
return -ret;
int i = (specified_shard_id ? shard_id : 0);
for (; i < max_shards; i++) {
- RGWRados::BucketShard bs(static_cast<rgw::sal::RGWRadosStore*>(store)->getRados());
+ RGWRados::BucketShard bs(static_cast<rgw::sal::RadosStore*>(store)->getRados());
int shard_id = (bucket->get_info().layout.current_index.layout.normal.num_shards > 0 ? i : -1);
int ret = bs.init(bucket->get_key(), shard_id, bucket->get_info().layout.current_index, nullptr /* no RGWBucketInfo */, dpp());
do {
entries.clear();
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->bi_list(bs, object, marker, max_entries, &entries, &is_truncated);
+ ret = static_cast<rgw::sal::RadosStore*>(store)->getRados()->bi_list(bs, object, marker, max_entries, &entries, &is_truncated);
if (ret < 0) {
cerr << "ERROR: bi_list(): " << cpp_strerror(-ret) << std::endl;
return -ret;
return -ret;
}
- std::unique_ptr<rgw::sal::RGWBucket> cur_bucket;
+ std::unique_ptr<rgw::sal::Bucket> cur_bucket;
ret = init_bucket(user.get(), tenant, bucket_name, string(), &cur_bucket);
if (ret < 0) {
cerr << "ERROR: could not init current bucket info for bucket_name=" << bucket_name << ": " << cpp_strerror(-ret) << std::endl;
return -ret;
}
- std::unique_ptr<rgw::sal::RGWObject> obj = bucket->get_object(object);
+ std::unique_ptr<rgw::sal::Object> obj = bucket->get_object(object);
obj->set_instance(object_version);
bool need_rewrite = true;
if (min_rewrite_stripe_size > 0) {
}
}
if (need_rewrite) {
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->rewrite_obj(bucket->get_info(), obj.get(), dpp(), null_yield);
+ ret = static_cast<rgw::sal::RadosStore*>(store)->getRados()->rewrite_obj(bucket->get_info(), obj.get(), dpp(), null_yield);
if (ret < 0) {
cerr << "ERROR: object rewrite returned: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
if (opt_cmd == OPT::OBJECTS_EXPIRE) {
- if (!static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->process_expire_objects(dpp())) {
+ if (!static_cast<rgw::sal::RadosStore*>(store)->getRados()->process_expire_objects(dpp())) {
cerr << "ERROR: process_expire_objects() processing returned error." << std::endl;
return 1;
}
RGWRados::ent_map_t result;
result.reserve(NUM_ENTRIES);
- int r = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->cls_bucket_list_ordered(
+ int r = static_cast<rgw::sal::RadosStore*>(store)->getRados()->cls_bucket_list_ordered(
dpp(), bucket->get_info(), RGW_NO_SHARD,
marker, empty_prefix, empty_delimiter,
NUM_ENTRIES, true, expansion_factor,
(end_epoch > 0 && end_epoch < (uint64_t)ut.sec())) {
formatter->dump_string("status", "Skipped");
} else {
- std::unique_ptr<rgw::sal::RGWObject> obj = bucket->get_object(key);
+ std::unique_ptr<rgw::sal::Object> obj = bucket->get_object(key);
bool need_rewrite = true;
if (min_rewrite_stripe_size > 0) {
if (!need_rewrite) {
formatter->dump_string("status", "Skipped");
} else {
- r = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->rewrite_obj(bucket->get_info(), obj.get(), dpp(), null_yield);
+ r = static_cast<rgw::sal::RadosStore*>(store)->getRados()->rewrite_obj(bucket->get_info(), obj.get(), dpp(), null_yield);
if (r == 0) {
formatter->dump_string("status", "Success");
} else {
}
if (opt_cmd == OPT::BUCKET_RESHARD) {
- int ret = check_reshard_bucket_params(static_cast<rgw::sal::RGWRadosStore*>(store),
+ int ret = check_reshard_bucket_params(static_cast<rgw::sal::RadosStore*>(store),
bucket_name,
tenant,
bucket_id,
return ret;
}
- RGWBucketReshard br(static_cast<rgw::sal::RGWRadosStore*>(store), bucket->get_info(), bucket->get_attrs(), nullptr /* no callback */);
+ RGWBucketReshard br(static_cast<rgw::sal::RadosStore*>(store), bucket->get_info(), bucket->get_attrs(), nullptr /* no callback */);
#define DEFAULT_RESHARD_MAX_ENTRIES 1000
if (max_entries < 1) {
}
if (opt_cmd == OPT::RESHARD_ADD) {
- int ret = check_reshard_bucket_params(static_cast<rgw::sal::RGWRadosStore*>(store),
+ int ret = check_reshard_bucket_params(static_cast<rgw::sal::RadosStore*>(store),
bucket_name,
tenant,
bucket_id,
int num_source_shards = (bucket->get_info().layout.current_index.layout.normal.num_shards > 0 ? bucket->get_info().layout.current_index.layout.normal.num_shards : 1);
- RGWReshard reshard(static_cast<rgw::sal::RGWRadosStore*>(store), dpp());
+ RGWReshard reshard(static_cast<rgw::sal::RadosStore*>(store), dpp());
cls_rgw_reshard_entry entry;
entry.time = real_clock::now();
entry.tenant = tenant;
int num_logshards =
store->ctx()->_conf.get_val<uint64_t>("rgw_reshard_num_logs");
- RGWReshard reshard(static_cast<rgw::sal::RGWRadosStore*>(store), dpp());
+ RGWReshard reshard(static_cast<rgw::sal::RadosStore*>(store), dpp());
formatter->open_array_section("reshard");
for (int i = 0; i < num_logshards; i++) {
return -ret;
}
- RGWBucketReshard br(static_cast<rgw::sal::RGWRadosStore*>(store), bucket->get_info(), bucket->get_attrs(), nullptr /* no callback */);
+ RGWBucketReshard br(static_cast<rgw::sal::RadosStore*>(store), bucket->get_info(), bucket->get_attrs(), nullptr /* no callback */);
list<cls_rgw_bucket_instance_entry> status;
int r = br.get_status(&status);
if (r < 0) {
}
if (opt_cmd == OPT::RESHARD_PROCESS) {
- RGWReshard reshard(static_cast<rgw::sal::RGWRadosStore*>(store), true, &cout);
+ RGWReshard reshard(static_cast<rgw::sal::RadosStore*>(store), true, &cout);
int ret = reshard.process_all_logshards(dpp());
if (ret < 0) {
if (bucket_initable) {
// we did not encounter an error, so let's work with the bucket
- RGWBucketReshard br(static_cast<rgw::sal::RGWRadosStore*>(store), bucket->get_info(), bucket->get_attrs(),
+ RGWBucketReshard br(static_cast<rgw::sal::RadosStore*>(store), bucket->get_info(), bucket->get_attrs(),
nullptr /* no callback */);
int ret = br.cancel();
if (ret < 0) {
}
}
- RGWReshard reshard(static_cast<rgw::sal::RGWRadosStore*>(store), dpp());
+ RGWReshard reshard(static_cast<rgw::sal::RadosStore*>(store), dpp());
cls_rgw_reshard_entry entry;
entry.tenant = tenant;
cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
- std::unique_ptr<rgw::sal::RGWObject> obj = bucket->get_object(object);
+ std::unique_ptr<rgw::sal::Object> obj = bucket->get_object(object);
obj->set_instance(object_version);
RGWObjectCtx obj_ctx(store);
do {
list<cls_rgw_gc_obj_info> result;
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->list_gc_objs(&index, marker, 1000, !include_all, result, &truncated, processing_queue);
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->getRados()->list_gc_objs(&index, marker, 1000, !include_all, result, &truncated, processing_queue);
if (ret < 0) {
cerr << "ERROR: failed to list objs: " << cpp_strerror(-ret) << std::endl;
return 1;
}
if (opt_cmd == OPT::GC_PROCESS) {
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->process_gc(!include_all);
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->getRados()->process_gc(!include_all);
if (ret < 0) {
cerr << "ERROR: gc processing returned error: " << cpp_strerror(-ret) << std::endl;
return 1;
max_entries = MAX_LC_LIST_ENTRIES;
}
do {
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->list_lc_progress(marker, max_entries,
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->getRados()->list_lc_progress(marker, max_entries,
bucket_lc_map, index);
if (ret < 0) {
cerr << "ERROR: failed to list objs: " << cpp_strerror(-ret)
}
if (opt_cmd == OPT::LC_PROCESS) {
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->process_lc();
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->getRados()->process_lc();
if (ret < 0) {
cerr << "ERROR: lc processing returned error: " << cpp_strerror(-ret) << std::endl;
return 1;
}
if (opt_cmd == OPT::USER_STATS) {
- if (rgw::sal::RGWUser::empty(user)) {
+ if (rgw::sal::User::empty(user)) {
cerr << "ERROR: uid not specified" << std::endl;
return EINVAL;
}
"so at most one of the two should be specified" << std::endl;
return EINVAL;
}
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->user->reset_stats(user->get_id(), null_yield);
+ ret = static_cast<rgw::sal::RadosStore*>(store)->ctl()->user->reset_stats(user->get_id(), null_yield);
if (ret < 0) {
cerr << "ERROR: could not reset user stats: " << cpp_strerror(-ret) <<
std::endl;
RGWStorageStats stats;
ceph::real_time last_stats_sync;
ceph::real_time last_stats_update;
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->user->read_stats(user->get_id(), &stats, null_yield,
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->ctl()->user->read_stats(user->get_id(), &stats, null_yield,
&last_stats_sync,
&last_stats_update);
if (ret < 0) {
}
if (opt_cmd == OPT::METADATA_GET) {
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->get(metadata_key, formatter.get(), null_yield, dpp());
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->ctl()->meta.mgr->get(metadata_key, formatter.get(), null_yield, dpp());
if (ret < 0) {
cerr << "ERROR: can't get key: " << cpp_strerror(-ret) << std::endl;
return -ret;
cerr << "ERROR: failed to read input: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->put(metadata_key, bl, null_yield, dpp(), RGWMDLogSyncType::APPLY_ALWAYS, false);
+ ret = static_cast<rgw::sal::RadosStore*>(store)->ctl()->meta.mgr->put(metadata_key, bl, null_yield, dpp(), RGWMDLogSyncType::APPLY_ALWAYS, false);
if (ret < 0) {
cerr << "ERROR: can't put key: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
if (opt_cmd == OPT::METADATA_RM) {
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->remove(metadata_key, null_yield, dpp());
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->ctl()->meta.mgr->remove(metadata_key, null_yield, dpp());
if (ret < 0) {
cerr << "ERROR: can't remove key: " << cpp_strerror(-ret) << std::endl;
return -ret;
int i = (specified_shard_id ? shard_id : 0);
if (period_id.empty()) {
- int ret = read_current_period_id(static_cast<rgw::sal::RGWRadosStore*>(store), realm_id, realm_name, &period_id);
+ int ret = read_current_period_id(static_cast<rgw::sal::RadosStore*>(store), realm_id, realm_name, &period_id);
if (ret < 0) {
return -ret;
}
std::cerr << "No --period given, using current period="
<< period_id << std::endl;
}
- RGWMetadataLog *meta_log = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->mdlog->get_log(period_id);
+ RGWMetadataLog *meta_log = static_cast<rgw::sal::RadosStore*>(store)->svc()->mdlog->get_log(period_id);
formatter->open_array_section("entries");
for (; i < g_ceph_context->_conf->rgw_md_log_max_shards; i++) {
for (list<cls_log_entry>::iterator iter = entries.begin(); iter != entries.end(); ++iter) {
cls_log_entry& entry = *iter;
- static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->dump_log_entry(entry, formatter.get());
+ static_cast<rgw::sal::RadosStore*>(store)->ctl()->meta.mgr->dump_log_entry(entry, formatter.get());
}
formatter->flush(cout);
} while (truncated);
int i = (specified_shard_id ? shard_id : 0);
if (period_id.empty()) {
- int ret = read_current_period_id(static_cast<rgw::sal::RGWRadosStore*>(store), realm_id, realm_name, &period_id);
+ int ret = read_current_period_id(static_cast<rgw::sal::RadosStore*>(store), realm_id, realm_name, &period_id);
if (ret < 0) {
return -ret;
}
std::cerr << "No --period given, using current period="
<< period_id << std::endl;
}
- RGWMetadataLog *meta_log = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->mdlog->get_log(period_id);
+ RGWMetadataLog *meta_log = static_cast<rgw::sal::RadosStore*>(store)->svc()->mdlog->get_log(period_id);
formatter->open_array_section("entries");
if (opt_cmd == OPT::MDLOG_AUTOTRIM) {
// need a full history for purging old mdlog periods
- static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->mdlog->init_oldest_log_period(null_yield, dpp());
+ static_cast<rgw::sal::RadosStore*>(store)->svc()->mdlog->init_oldest_log_period(null_yield, dpp());
RGWCoroutinesManager crs(store->ctx(), store->get_cr_registry());
RGWHTTPManager http(store->ctx(), crs.get_completion_mgr());
}
auto num_shards = g_conf()->rgw_md_log_max_shards;
- ret = crs.run(create_admin_meta_log_trim_cr(dpp(), static_cast<rgw::sal::RGWRadosStore*>(store), &http, num_shards));
+ ret = crs.run(create_admin_meta_log_trim_cr(dpp(), static_cast<rgw::sal::RadosStore*>(store), &http, num_shards));
if (ret < 0) {
cerr << "automated mdlog trim failed with " << cpp_strerror(ret) << std::endl;
return -ret;
std::cerr << "missing --period argument" << std::endl;
return EINVAL;
}
- RGWMetadataLog *meta_log = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->mdlog->get_log(period_id);
+ RGWMetadataLog *meta_log = static_cast<rgw::sal::RadosStore*>(store)->svc()->mdlog->get_log(period_id);
// trim until -ENODATA
do {
}
if (opt_cmd == OPT::METADATA_SYNC_STATUS) {
- RGWMetaSyncStatusManager sync(static_cast<rgw::sal::RGWRadosStore*>(store), static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->rados->get_async_processor());
+ RGWMetaSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(store), static_cast<rgw::sal::RadosStore*>(store)->svc()->rados->get_async_processor());
int ret = sync.init();
if (ret < 0) {
}
if (opt_cmd == OPT::METADATA_SYNC_INIT) {
- RGWMetaSyncStatusManager sync(static_cast<rgw::sal::RGWRadosStore*>(store), static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->rados->get_async_processor());
+ RGWMetaSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(store), static_cast<rgw::sal::RadosStore*>(store)->svc()->rados->get_async_processor());
int ret = sync.init();
if (ret < 0) {
if (opt_cmd == OPT::METADATA_SYNC_RUN) {
- RGWMetaSyncStatusManager sync(static_cast<rgw::sal::RGWRadosStore*>(store), static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->rados->get_async_processor());
+ RGWMetaSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(store), static_cast<rgw::sal::RadosStore*>(store)->svc()->rados->get_async_processor());
int ret = sync.init();
if (ret < 0) {
cerr << "ERROR: source zone not specified" << std::endl;
return EINVAL;
}
- RGWDataSyncStatusManager sync(static_cast<rgw::sal::RGWRadosStore*>(store), static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->rados->get_async_processor(), source_zone, nullptr);
+ RGWDataSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(store), static_cast<rgw::sal::RadosStore*>(store)->svc()->rados->get_async_processor(), source_zone, nullptr);
int ret = sync.init();
if (ret < 0) {
return EINVAL;
}
- RGWDataSyncStatusManager sync(static_cast<rgw::sal::RGWRadosStore*>(store), static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->rados->get_async_processor(), source_zone, nullptr);
+ RGWDataSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(store), static_cast<rgw::sal::RadosStore*>(store)->svc()->rados->get_async_processor(), source_zone, nullptr);
int ret = sync.init();
if (ret < 0) {
}
RGWSyncModuleInstanceRef sync_module;
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sync_modules->get_manager()->create_instance(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->get_zone().tier_type,
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->sync_modules->get_manager()->create_instance(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->get_zone().tier_type,
store->get_zone()->get_params().tier_config, &sync_module);
if (ret < 0) {
lderr(cct) << "ERROR: failed to init sync module instance, ret=" << ret << dendl;
return ret;
}
- RGWDataSyncStatusManager sync(static_cast<rgw::sal::RGWRadosStore*>(store), static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->rados->get_async_processor(), source_zone, nullptr, sync_module);
+ RGWDataSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(store), static_cast<rgw::sal::RadosStore*>(store)->svc()->rados->get_async_processor(), source_zone, nullptr, sync_module);
ret = sync.init();
if (ret < 0) {
auto opt_sb = opt_source_bucket;
if (opt_sb && opt_sb->bucket_id.empty()) {
string sbid;
- std::unique_ptr<rgw::sal::RGWBucket> sbuck;
+ std::unique_ptr<rgw::sal::Bucket> sbuck;
int ret = init_bucket_for_sync(user.get(), opt_sb->tenant, opt_sb->name, sbid, &sbuck);
if (ret < 0) {
return -ret;
opt_sb = sbuck->get_key();
}
- RGWBucketPipeSyncStatusManager sync(static_cast<rgw::sal::RGWRadosStore*>(store), source_zone, opt_sb, bucket->get_key());
+ RGWBucketPipeSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(store), source_zone, opt_sb, bucket->get_key());
ret = sync.init();
if (ret < 0) {
return -ret;
}
- if (!static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->bucket->bucket_imports_data(bucket->get_key(), null_yield, dpp())) {
+ if (!static_cast<rgw::sal::RadosStore*>(store)->ctl()->bucket->bucket_imports_data(bucket->get_key(), null_yield, dpp())) {
std::cout << "Sync is disabled for bucket " << bucket_name << std::endl;
return 0;
}
}
auto timeout_at = ceph::coarse_mono_clock::now() + opt_timeout_sec;
- ret = rgw_bucket_sync_checkpoint(dpp(), static_cast<rgw::sal::RGWRadosStore*>(store), *handler, bucket->get_info(),
+ ret = rgw_bucket_sync_checkpoint(dpp(), static_cast<rgw::sal::RadosStore*>(store), *handler, bucket->get_info(),
opt_source_zone, opt_source_bucket,
opt_retry_delay_ms, timeout_at);
if (ret < 0) {
if (ret < 0) {
return -ret;
}
- bucket_sync_info(static_cast<rgw::sal::RGWRadosStore*>(store), bucket->get_info(), std::cout);
+ bucket_sync_info(static_cast<rgw::sal::RadosStore*>(store), bucket->get_info(), std::cout);
}
if (opt_cmd == OPT::BUCKET_SYNC_STATUS) {
if (ret < 0) {
return -ret;
}
- bucket_sync_status(static_cast<rgw::sal::RGWRadosStore*>(store), bucket->get_info(), source_zone, opt_source_bucket, std::cout);
+ bucket_sync_status(static_cast<rgw::sal::RadosStore*>(store), bucket->get_info(), source_zone, opt_source_bucket, std::cout);
}
if (opt_cmd == OPT::BUCKET_SYNC_MARKERS) {
if (ret < 0) {
return -ret;
}
- RGWBucketPipeSyncStatusManager sync(static_cast<rgw::sal::RGWRadosStore*>(store), source_zone, opt_source_bucket, bucket->get_key());
+ RGWBucketPipeSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(store), source_zone, opt_source_bucket, bucket->get_key());
ret = sync.init();
if (ret < 0) {
if (ret < 0) {
return -ret;
}
- RGWBucketPipeSyncStatusManager sync(static_cast<rgw::sal::RGWRadosStore*>(store), source_zone, opt_source_bucket, bucket->get_key());
+ RGWBucketPipeSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(store), source_zone, opt_source_bucket, bucket->get_key());
ret = sync.init();
if (ret < 0) {
do {
list<rgw_bi_log_entry> entries;
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->bilog_rados->log_list(bucket->get_info(), shard_id, marker, max_entries - count, entries, &truncated);
+ ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->bilog_rados->log_list(bucket->get_info(), shard_id, marker, max_entries - count, entries, &truncated);
if (ret < 0) {
cerr << "ERROR: list_bi_log_entries(): " << cpp_strerror(-ret) << std::endl;
return -ret;
do {
list<cls_log_entry> entries;
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->cls->timelog.list(oid, {}, {}, max_entries - count, entries, marker, &marker, &truncated,
+ ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->cls->timelog.list(oid, {}, {}, max_entries - count, entries, marker, &marker, &truncated,
null_yield);
if (ret == -ENOENT) {
break;
}
}
- if (!rgw::sal::RGWUser::empty(user)) {
+ if (!rgw::sal::User::empty(user)) {
pipe->params.user = user->get_id();
} else if (pipe->params.user.empty()) {
auto owner = sync_policy_ctx.get_owner();
cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->bilog_rados->log_trim(bucket->get_info(), shard_id, start_marker, end_marker);
+ ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->bilog_rados->log_trim(bucket->get_info(), shard_id, start_marker, end_marker);
if (ret < 0) {
cerr << "ERROR: trim_bi_log_entries(): " << cpp_strerror(-ret) << std::endl;
return -ret;
return -ret;
}
map<int, string> markers;
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->bilog_rados->get_log_status(bucket->get_info(), shard_id,
+ ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->bilog_rados->get_log_status(bucket->get_info(), shard_id,
&markers, null_yield);
if (ret < 0) {
cerr << "ERROR: get_bi_log_status(): " << cpp_strerror(-ret) << std::endl;
rgw::BucketTrimConfig config;
configure_bucket_trim(store->ctx(), config);
- rgw::BucketTrimManager trim(static_cast<rgw::sal::RGWRadosStore*>(store), config);
+ rgw::BucketTrimManager trim(static_cast<rgw::sal::RadosStore*>(store), config);
ret = trim.init();
if (ret < 0) {
cerr << "trim manager init failed with " << cpp_strerror(ret) << std::endl;
}
}
- auto datalog_svc = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->datalog_rados;
+ auto datalog_svc = static_cast<rgw::sal::RadosStore*>(store)->svc()->datalog_rados;
RGWDataChangesLog::LogMarker log_marker;
do {
list<cls_log_entry> entries;
RGWDataChangesLogInfo info;
- static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->datalog_rados->get_info(i, &info);
+ static_cast<rgw::sal::RadosStore*>(store)->svc()->datalog_rados->get_info(i, &info);
::encode_json("info", info, formatter.get());
auto num_shards = g_conf()->rgw_data_log_num_shards;
std::vector<std::string> markers(num_shards);
- ret = crs.run(create_admin_data_log_trim_cr(static_cast<rgw::sal::RGWRadosStore*>(store), &http, num_shards, markers));
+ ret = crs.run(create_admin_data_log_trim_cr(static_cast<rgw::sal::RadosStore*>(store), &http, num_shards, markers));
if (ret < 0) {
cerr << "automated datalog trim failed with " << cpp_strerror(ret) << std::endl;
return -ret;
// loop until -ENODATA
do {
- auto datalog = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->datalog_rados;
+ auto datalog = static_cast<rgw::sal::RadosStore*>(store)->svc()->datalog_rados;
ret = datalog->trim_entries(shard_id, marker);
} while (ret == 0);
std::cerr << "log-type not specified." << std::endl;
return -EINVAL;
}
- auto datalog = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->datalog_rados;
+ auto datalog = static_cast<rgw::sal::RadosStore*>(store)->svc()->datalog_rados;
ret = datalog->change_format(*opt_log_type, null_yield);
if (ret < 0) {
cerr << "ERROR: change_format(): " << cpp_strerror(-ret) << std::endl;
}
if (opt_cmd == OPT::DATALOG_PRUNE) {
- auto datalog = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->datalog_rados;
+ auto datalog = static_cast<rgw::sal::RadosStore*>(store)->svc()->datalog_rados;
std::optional<uint64_t> through;
ret = datalog->trim_generations(through);
bool quota_op = (opt_cmd == OPT::QUOTA_SET || opt_cmd == OPT::QUOTA_ENABLE || opt_cmd == OPT::QUOTA_DISABLE);
if (quota_op) {
- if (bucket_name.empty() && rgw::sal::RGWUser::empty(user)) {
+ if (bucket_name.empty() && rgw::sal::User::empty(user)) {
cerr << "ERROR: bucket name or uid is required for quota operation" << std::endl;
return EINVAL;
}
}
set_bucket_quota(store, opt_cmd, tenant, bucket_name,
max_size, max_objects, have_max_size, have_max_objects);
- } else if (!rgw::sal::RGWUser::empty(user)) {
+ } else if (!rgw::sal::User::empty(user)) {
if (quota_scope == "bucket") {
return set_user_bucket_quota(opt_cmd, ruser, user_op, max_size, max_objects, have_max_size, have_max_objects);
} else if (quota_scope == "user") {
if (opt_cmd == OPT::MFA_CREATE) {
rados::cls::otp::otp_info_t config;
- if (rgw::sal::RGWUser::empty(user)) {
+ if (rgw::sal::User::empty(user)) {
cerr << "ERROR: user id was not provided (via --uid)" << std::endl;
return EINVAL;
}
}
real_time mtime = real_clock::now();
- string oid = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->cls->mfa.get_mfa_oid(user->get_id());
+ string oid = static_cast<rgw::sal::RadosStore*>(store)->svc()->cls->mfa.get_mfa_oid(user->get_id());
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->mutate(RGWSI_MetaBackend_OTP::get_meta_key(user->get_id()),
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->ctl()->meta.mgr->mutate(RGWSI_MetaBackend_OTP::get_meta_key(user->get_id()),
mtime, &objv_tracker,
null_yield, dpp(),
MDLOG_STATUS_WRITE,
[&] {
- return static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->cls->mfa.create_mfa(user->get_id(), config, &objv_tracker, mtime, null_yield);
+ return static_cast<rgw::sal::RadosStore*>(store)->svc()->cls->mfa.create_mfa(user->get_id(), config, &objv_tracker, mtime, null_yield);
});
if (ret < 0) {
cerr << "MFA creation failed, error: " << cpp_strerror(-ret) << std::endl;
}
if (opt_cmd == OPT::MFA_REMOVE) {
- if (rgw::sal::RGWUser::empty(user)) {
+ if (rgw::sal::User::empty(user)) {
cerr << "ERROR: user id was not provided (via --uid)" << std::endl;
return EINVAL;
}
real_time mtime = real_clock::now();
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->mutate(RGWSI_MetaBackend_OTP::get_meta_key(user->get_id()),
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->ctl()->meta.mgr->mutate(RGWSI_MetaBackend_OTP::get_meta_key(user->get_id()),
mtime, &objv_tracker,
null_yield, dpp(),
MDLOG_STATUS_WRITE,
[&] {
- return static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->cls->mfa.remove_mfa(user->get_id(), totp_serial, &objv_tracker, mtime, null_yield);
+ return static_cast<rgw::sal::RadosStore*>(store)->svc()->cls->mfa.remove_mfa(user->get_id(), totp_serial, &objv_tracker, mtime, null_yield);
});
if (ret < 0) {
cerr << "MFA removal failed, error: " << cpp_strerror(-ret) << std::endl;
}
if (opt_cmd == OPT::MFA_GET) {
- if (rgw::sal::RGWUser::empty(user)) {
+ if (rgw::sal::User::empty(user)) {
cerr << "ERROR: user id was not provided (via --uid)" << std::endl;
return EINVAL;
}
}
rados::cls::otp::otp_info_t result;
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->cls->mfa.get_mfa(user->get_id(), totp_serial, &result, null_yield);
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->cls->mfa.get_mfa(user->get_id(), totp_serial, &result, null_yield);
if (ret < 0) {
if (ret == -ENOENT || ret == -ENODATA) {
cerr << "MFA serial id not found" << std::endl;
}
if (opt_cmd == OPT::MFA_LIST) {
- if (rgw::sal::RGWUser::empty(user)) {
+ if (rgw::sal::User::empty(user)) {
cerr << "ERROR: user id was not provided (via --uid)" << std::endl;
return EINVAL;
}
list<rados::cls::otp::otp_info_t> result;
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->cls->mfa.list_mfa(user->get_id(), &result, null_yield);
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->cls->mfa.list_mfa(user->get_id(), &result, null_yield);
if (ret < 0) {
cerr << "MFA listing failed, error: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
if (opt_cmd == OPT::MFA_CHECK) {
- if (rgw::sal::RGWUser::empty(user)) {
+ if (rgw::sal::User::empty(user)) {
cerr << "ERROR: user id was not provided (via --uid)" << std::endl;
return EINVAL;
}
}
list<rados::cls::otp::otp_info_t> result;
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->cls->mfa.check_mfa(user->get_id(), totp_serial, totp_pin.front(), null_yield);
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->cls->mfa.check_mfa(user->get_id(), totp_serial, totp_pin.front(), null_yield);
if (ret < 0) {
cerr << "MFA check failed, error: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
if (opt_cmd == OPT::MFA_RESYNC) {
- if (rgw::sal::RGWUser::empty(user)) {
+ if (rgw::sal::User::empty(user)) {
cerr << "ERROR: user id was not provided (via --uid)" << std::endl;
return EINVAL;
}
}
rados::cls::otp::otp_info_t config;
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->cls->mfa.get_mfa(user->get_id(), totp_serial, &config, null_yield);
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->cls->mfa.get_mfa(user->get_id(), totp_serial, &config, null_yield);
if (ret < 0) {
if (ret == -ENOENT || ret == -ENODATA) {
cerr << "MFA serial id not found" << std::endl;
ceph::real_time now;
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->cls->mfa.otp_get_current_time(user->get_id(), &now, null_yield);
+ ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->cls->mfa.otp_get_current_time(user->get_id(), &now, null_yield);
if (ret < 0) {
cerr << "ERROR: failed to fetch current time from osd: " << cpp_strerror(-ret) << std::endl;
return -ret;
/* now update the backend */
real_time mtime = real_clock::now();
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->mutate(RGWSI_MetaBackend_OTP::get_meta_key(user->get_id()),
+ ret = static_cast<rgw::sal::RadosStore*>(store)->ctl()->meta.mgr->mutate(RGWSI_MetaBackend_OTP::get_meta_key(user->get_id()),
mtime, &objv_tracker,
null_yield, dpp(),
MDLOG_STATUS_WRITE,
[&] {
- return static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->cls->mfa.create_mfa(user->get_id(), config, &objv_tracker, mtime, null_yield);
+ return static_cast<rgw::sal::RadosStore*>(store)->svc()->cls->mfa.create_mfa(user->get_id(), config, &objv_tracker, mtime, null_yield);
});
if (ret < 0) {
cerr << "MFA update failed, error: " << cpp_strerror(-ret) << std::endl;
}
if (opt_cmd == OPT::RESHARD_STALE_INSTANCES_LIST) {
- if (!static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->can_reshard() && !yes_i_really_mean_it) {
+ if (!static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->can_reshard() && !yes_i_really_mean_it) {
cerr << "Resharding disabled in a multisite env, stale instances unlikely from resharding" << std::endl;
cerr << "These instances may not be safe to delete." << std::endl;
cerr << "Use --yes-i-really-mean-it to force displaying these instances." << std::endl;
}
if (opt_cmd == OPT::RESHARD_STALE_INSTANCES_DELETE) {
- if (!static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->can_reshard()) {
+ if (!static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->can_reshard()) {
cerr << "Resharding disabled in a multisite env. Stale instances are not safe to be deleted." << std::endl;
return EINVAL;
}
if (opt_cmd == OPT::PUBSUB_TOPICS_LIST) {
- RGWPubSub ps(static_cast<rgw::sal::RGWRadosStore*>(store), tenant);
+ RGWPubSub ps(static_cast<rgw::sal::RadosStore*>(store), tenant);
if (!bucket_name.empty()) {
rgw_pubsub_bucket_topics result;
return EINVAL;
}
- RGWPubSub ps(static_cast<rgw::sal::RGWRadosStore*>(store), tenant);
+ RGWPubSub ps(static_cast<rgw::sal::RadosStore*>(store), tenant);
rgw_pubsub_topic_subs topic;
ret = ps.get_topic(topic_name, &topic);
return EINVAL;
}
- RGWPubSub ps(static_cast<rgw::sal::RGWRadosStore*>(store), tenant);
+ RGWPubSub ps(static_cast<rgw::sal::RadosStore*>(store), tenant);
ret = ps.remove_topic(topic_name, null_yield);
if (ret < 0) {
}
if (opt_cmd == OPT::PUBSUB_SUB_GET) {
- if (get_tier_type(static_cast<rgw::sal::RGWRadosStore*>(store)) != "pubsub") {
+ if (get_tier_type(static_cast<rgw::sal::RadosStore*>(store)) != "pubsub") {
cerr << "ERROR: only pubsub tier type supports this command" << std::endl;
return EINVAL;
}
return EINVAL;
}
- RGWPubSub ps(static_cast<rgw::sal::RGWRadosStore*>(store), tenant);
+ RGWPubSub ps(static_cast<rgw::sal::RadosStore*>(store), tenant);
rgw_pubsub_sub_config sub_conf;
}
if (opt_cmd == OPT::PUBSUB_SUB_RM) {
- if (get_tier_type(static_cast<rgw::sal::RGWRadosStore*>(store)) != "pubsub") {
+ if (get_tier_type(static_cast<rgw::sal::RadosStore*>(store)) != "pubsub") {
cerr << "ERROR: only pubsub tier type supports this command" << std::endl;
return EINVAL;
}
return EINVAL;
}
- RGWPubSub ps(static_cast<rgw::sal::RGWRadosStore*>(store), tenant);
+ RGWPubSub ps(static_cast<rgw::sal::RadosStore*>(store), tenant);
auto sub = ps.get_sub(sub_name);
ret = sub->unsubscribe(topic_name, null_yield);
}
if (opt_cmd == OPT::PUBSUB_SUB_PULL) {
- if (get_tier_type(static_cast<rgw::sal::RGWRadosStore*>(store)) != "pubsub") {
+ if (get_tier_type(static_cast<rgw::sal::RadosStore*>(store)) != "pubsub") {
cerr << "ERROR: only pubsub tier type supports this command" << std::endl;
return EINVAL;
}
return EINVAL;
}
- RGWPubSub ps(static_cast<rgw::sal::RGWRadosStore*>(store), tenant);
+ RGWPubSub ps(static_cast<rgw::sal::RadosStore*>(store), tenant);
if (!max_entries_specified) {
max_entries = RGWPubSub::Sub::DEFAULT_MAX_EVENTS;
}
if (opt_cmd == OPT::PUBSUB_EVENT_RM) {
- if (get_tier_type(static_cast<rgw::sal::RGWRadosStore*>(store)) != "pubsub") {
+ if (get_tier_type(static_cast<rgw::sal::RadosStore*>(store)) != "pubsub") {
cerr << "ERROR: only pubsub tier type supports this command" << std::endl;
return EINVAL;
}
return EINVAL;
}
- RGWPubSub ps(static_cast<rgw::sal::RGWRadosStore*>(store), tenant);
+ RGWPubSub ps(static_cast<rgw::sal::RadosStore*>(store), tenant);
auto sub = ps.get_sub_with_events(sub_name);
ret = sub->remove_event(dpp(), event_id);
class RGWLibAdmin
{
- rgw::sal::RGWStore *store;
+ rgw::sal::Store *store;
boost::intrusive_ptr<CephContext> cct;
public:
- rgw::sal::RGWStore* get_store()
+ rgw::sal::Store* get_store()
{
return store;
}
void stop();
void join();
void pause();
- void unpause(rgw::sal::RGWStore* store, rgw_auth_registry_ptr_t);
+ void unpause(rgw::sal::Store* store, rgw_auth_registry_ptr_t);
};
unsigned short parse_port(const char *input, boost::system::error_code& ec)
}
}
-void AsioFrontend::unpause(rgw::sal::RGWStore* const store,
+void AsioFrontend::unpause(rgw::sal::Store* const store,
rgw_auth_registry_ptr_t auth_registry)
{
env.store = store;
}
void RGWAsioFrontend::unpause_with_new_config(
- rgw::sal::RGWStore* const store,
+ rgw::sal::Store* const store,
rgw_auth_registry_ptr_t auth_registry
) {
impl->unpause(store, std::move(auth_registry));
void join() override;
void pause_for_new_config() override;
- void unpause_with_new_config(rgw::sal::RGWStore *store,
+ void unpause_with_new_config(rgw::sal::Store *store,
rgw_auth_registry_ptr_t auth_registry) override;
};
const string& display_name,
RGWUserInfo& user_info) const /* out */
{
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(acct_user);
+ std::unique_ptr<rgw::sal::User> user = store->get_user(acct_user);
user->get_info().display_name = display_name;
user->get_info().type = TYPE_WEB;
user->get_info().max_buckets =
federated_user.tenant = role_tenant;
federated_user.ns = "oidc";
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(federated_user);
+ std::unique_ptr<rgw::sal::User> user = store->get_user(federated_user);
//Check in oidc namespace
if (user->load_by_id(dpp, null_yield) >= 0) {
new_acct_user.tenant = new_acct_user.id;
}
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(new_acct_user);
+ std::unique_ptr<rgw::sal::User> user = store->get_user(new_acct_user);
user->get_info().display_name = info.acct_name;
if (info.acct_type) {
//ldap/keystone for s3 users
auto implicit_value = implicit_tenant_context.get_value();
bool implicit_tenant = implicit_value.implicit_tenants_for_(implicit_tenant_bit);
bool split_mode = implicit_value.is_split_mode();
- std::unique_ptr<rgw::sal::RGWUser> user;
+ std::unique_ptr<rgw::sal::User> user;
/* Normally, empty "tenant" field of acct_user means the authenticated
* identity has the legacy, global tenant. However, due to inclusion
class WebIdentityApplier : public IdentityApplier {
protected:
CephContext* const cct;
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
string role_session;
string role_tenant;
rgw::web_idp::WebTokenClaims token_claims;
RGWUserInfo& user_info) const; /* out */
public:
WebIdentityApplier( CephContext* const cct,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
const string& role_session,
const string& role_tenant,
const rgw::web_idp::WebTokenClaims& token_claims)
CephContext* const cct;
/* Read-write is intensional here due to RGWUserInfo creation process. */
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
/* Supplemental strategy for extracting permissions from ACLs. Its results
* will be combined (ORed) with a default strategy that is responsible for
public:
RemoteApplier(CephContext* const cct,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
acl_strategy_t&& extra_acl_strategy,
const AuthInfo& info,
rgw::auth::ImplicitTenants& implicit_tenant_context,
template <typename T>
class ThirdPartyAccountApplier : public DecoratedApplier<T> {
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
const rgw_user acct_user_override;
public:
static const rgw_user UNKNOWN_ACCT;
template <typename U>
- ThirdPartyAccountApplier(rgw::sal::RGWStore* store,
+ ThirdPartyAccountApplier(rgw::sal::Store* store,
const rgw_user &acct_user_override,
U&& decoratee)
: DecoratedApplier<T>(std::move(decoratee)),
} else {
/* Compatibility mechanism for multi-tenancy. For more details refer to
* load_acct_info method of rgw::auth::RemoteApplier. */
- std::unique_ptr<rgw::sal::RGWUser> user;
+ std::unique_ptr<rgw::sal::User> user;
if (acct_user_override.tenant.empty()) {
const rgw_user tenanted_uid(acct_user_override.id, acct_user_override.id);
}
template <typename T> static inline
-ThirdPartyAccountApplier<T> add_3rdparty(rgw::sal::RGWStore* store,
+ThirdPartyAccountApplier<T> add_3rdparty(rgw::sal::Store* store,
const rgw_user &acct_user_override,
T&& t) {
return ThirdPartyAccountApplier<T>(store, acct_user_override,
template <typename T>
class SysReqApplier : public DecoratedApplier<T> {
CephContext* const cct;
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
const RGWHTTPArgs& args;
mutable boost::tribool is_system;
public:
template <typename U>
SysReqApplier(CephContext* const cct,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
const req_state* const s,
U&& decoratee)
: DecoratedApplier<T>(std::forward<T>(decoratee)),
/* We aren't writing directly to user_info for consistency and security
* reasons. rgw_get_user_info_by_uid doesn't trigger the operator=() but
* calls ::decode instead. */
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(effective_uid);
+ std::unique_ptr<rgw::sal::User> user = store->get_user(effective_uid);
if (user->load_by_id(dpp, null_yield) < 0) {
//ldpp_dout(dpp, 0) << "User lookup failed!" << dendl;
throw -EACCES;
template <typename T> static inline
SysReqApplier<T> add_sysreq(CephContext* const cct,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
const req_state* const s,
T&& t) {
return SysReqApplier<T>(cct, store, s, std::forward<T>(t));
s3_main_strategy_t(CephContext* const cct,
ImplicitTenants& implicit_tenant_context,
- rgw::sal::RGWStore* store)
+ rgw::sal::Store* store)
: s3_main_strategy_plain(cct, implicit_tenant_context, store),
s3_main_strategy_boto2(cct, implicit_tenant_context, store) {
add_engine(Strategy::Control::SUFFICIENT, s3_main_strategy_plain);
public:
StrategyRegistry(CephContext* const cct,
ImplicitTenants& implicit_tenant_context,
- rgw::sal::RGWStore* store)
+ rgw::sal::Store* store)
: s3_main_strategy(cct, implicit_tenant_context, store),
s3_post_strategy(cct, implicit_tenant_context, store),
swift_strategy(cct, implicit_tenant_context, store),
static std::shared_ptr<StrategyRegistry>
create(CephContext* const cct,
ImplicitTenants& implicit_tenant_context,
- rgw::sal::RGWStore* store) {
+ rgw::sal::Store* store) {
return std::make_shared<StrategyRegistry>(cct, implicit_tenant_context, store);
}
};
public rgw::auth::LocalApplier::Factory,
public rgw::auth::RoleApplier::Factory {
typedef rgw::auth::IdentityApplier::aplptr_t aplptr_t;
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
rgw::auth::ImplicitTenants& implicit_tenant_context;
STSEngine sts_engine;
public:
STSAuthStrategy(CephContext* const cct,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
rgw::auth::ImplicitTenants& implicit_tenant_context,
AWSEngine::VersionAbstractor* const ver_abstractor)
: store(store),
class ExternalAuthStrategy : public rgw::auth::Strategy,
public rgw::auth::RemoteApplier::Factory {
typedef rgw::auth::IdentityApplier::aplptr_t aplptr_t;
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
rgw::auth::ImplicitTenants& implicit_tenant_context;
using keystone_config_t = rgw::keystone::CephCtxConfig;
public:
ExternalAuthStrategy(CephContext* const cct,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
rgw::auth::ImplicitTenants& implicit_tenant_context,
AWSEngine::VersionAbstractor* const ver_abstractor)
: store(store),
AbstractorT>::value,
"AbstractorT must be a subclass of rgw::auth::s3::VersionAbstractor");
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
AbstractorT ver_abstractor;
S3AnonymousEngine anonymous_engine;
AWSAuthStrategy(CephContext* const cct,
rgw::auth::ImplicitTenants& implicit_tenant_context,
- rgw::sal::RGWStore* store)
+ rgw::sal::Store* store)
: store(store),
ver_abstractor(cct),
anonymous_engine(cct,
}
}
-void check_bad_user_bucket_mapping(rgw::sal::RGWStore *store, rgw::sal::RGWUser* user,
+void check_bad_user_bucket_mapping(rgw::sal::Store *store, rgw::sal::User* user,
bool fix,
optional_yield y,
const DoutPrefixProvider *dpp)
{
- rgw::sal::RGWBucketList user_buckets;
+ rgw::sal::BucketList user_buckets;
string marker;
CephContext *cct = store->ctx();
return;
}
- map<string, std::unique_ptr<rgw::sal::RGWBucket>>& buckets = user_buckets.get_buckets();
+ map<string, std::unique_ptr<rgw::sal::Bucket>>& buckets = user_buckets.get_buckets();
for (auto i = buckets.begin();
i != buckets.end();
++i) {
auto& bucket = i->second;
- std::unique_ptr<rgw::sal::RGWBucket> actual_bucket;
+ std::unique_ptr<rgw::sal::Bucket> actual_bucket;
int r = store->get_bucket(dpp, user, user->get_tenant(), bucket->get_name(), &actual_bucket, null_yield);
if (r < 0) {
ldout(store->ctx(), 0) << "could not get bucket info for bucket=" << bucket << dendl;
return rgw_obj_key::oid_to_key_in_ns(oid, &key, ns);
}
-int rgw_remove_object(const DoutPrefixProvider *dpp, rgw::sal::RGWStore *store, rgw::sal::RGWBucket* bucket, rgw_obj_key& key)
+int rgw_remove_object(const DoutPrefixProvider *dpp, rgw::sal::Store *store, rgw::sal::Bucket* bucket, rgw_obj_key& key)
{
RGWObjectCtx rctx(store);
key.instance = "null";
}
- std::unique_ptr<rgw::sal::RGWObject> object = bucket->get_object(key);
+ std::unique_ptr<rgw::sal::Object> object = bucket->get_object(key);
return object->delete_object(dpp, &rctx, null_yield);
}
-int rgw_remove_bucket_bypass_gc(rgw::sal::RGWStore *store, rgw::sal::RGWBucket* bucket,
+int rgw_remove_bucket_bypass_gc(rgw::sal::Store *store, rgw::sal::Bucket* bucket,
int concurrent_max, bool keep_index_consistent,
optional_yield y,
const DoutPrefixProvider *dpp)
return ret;
}
- rgw::sal::RGWBucket::ListParams params;
- rgw::sal::RGWBucket::ListResults results;
+ rgw::sal::Bucket::ListParams params;
+ rgw::sal::Bucket::ListResults results;
params.list_versions = true;
params.allow_unordered = true;
std::vector<rgw_bucket_dir_entry>::iterator it = results.objs.begin();
for (; it != results.objs.end(); ++it) {
RGWObjState *astate = NULL;
- std::unique_ptr<rgw::sal::RGWObject> obj = bucket->get_object((*it).key);
+ std::unique_ptr<rgw::sal::Object> obj = bucket->get_object((*it).key);
ret = obj->get_obj_state(dpp, &obj_ctx, &astate, y, false);
if (ret == -ENOENT) {
if (astate->manifest) {
RGWObjManifest& manifest = *astate->manifest;
RGWObjManifest::obj_iterator miter = manifest.obj_begin();
- std::unique_ptr<rgw::sal::RGWObject> head_obj = bucket->get_object(manifest.get_obj().key);
+ std::unique_ptr<rgw::sal::Object> head_obj = bucket->get_object(manifest.get_obj().key);
rgw_raw_obj raw_head_obj;
head_obj->get_raw_obj(&raw_head_obj);
*sink = msg;
}
-int RGWBucket::init(rgw::sal::RGWStore *_store, RGWBucketAdminOpState& op_state,
+int RGWBucket::init(rgw::sal::Store *_store, RGWBucketAdminOpState& op_state,
optional_yield y, const DoutPrefixProvider *dpp, std::string *err_msg)
{
if (!_store) {
op_state.set_bucket(bucket->clone());
- if (!rgw::sal::RGWUser::empty(user.get())) {
+ if (!rgw::sal::User::empty(user.get())) {
r = user->load_by_id(dpp, y);
if (r < 0) {
set_err_msg(err_msg, "failed to fetch user info");
return 0;
}
-bool rgw_find_bucket_by_id(CephContext *cct, rgw::sal::RGWStore* store,
+bool rgw_find_bucket_by_id(CephContext *cct, rgw::sal::Store* store,
const string& marker, const string& bucket_id, rgw_bucket* bucket_out)
{
void *handle = NULL;
string bucket_id = op_state.get_bucket_id();
std::string display_name = op_state.get_user_display_name();
- std::unique_ptr<rgw::sal::RGWBucket> loc_bucket;
- std::unique_ptr<rgw::sal::RGWBucket> old_bucket;
+ std::unique_ptr<rgw::sal::Bucket> loc_bucket;
+ std::unique_ptr<rgw::sal::Bucket> old_bucket;
loc_bucket = op_state.get_bucket()->clone();
return -EIO;
}
- std::unique_ptr<rgw::sal::RGWUser> owner_user = store->get_user(owner.get_id());
+ std::unique_ptr<rgw::sal::User> owner_user = store->get_user(owner.get_id());
int r = old_bucket->unlink(dpp, owner_user.get(), y, false);
if (r < 0) {
bucket = op_state.get_bucket()->clone();
- rgw::sal::RGWBucket::ListParams params;
+ rgw::sal::Bucket::ListParams params;
params.list_versions = true;
params.ns = RGW_OBJ_NS_MULTIPART;
do {
- rgw::sal::RGWBucket::ListResults results;
+ rgw::sal::Bucket::ListResults results;
int r = bucket->list(dpp, params, listing_max_entries, results, null_yield);
if (r < 0) {
set_err_msg(err_msg, "failed to list objects in bucket=" + bucket->get_name() +
string prefix;
string empty_delimiter;
- rgw::sal::RGWBucket::ListResults results;
+ rgw::sal::Bucket::ListResults results;
results.is_truncated = true;
Formatter *formatter = flusher.get_formatter();
formatter->open_object_section("objects");
while (results.is_truncated) {
- rgw::sal::RGWBucket::ListParams params;
+ rgw::sal::Bucket::ListParams params;
params.marker = results.next_marker;
params.prefix = prefix;
int shard_id = bucket->get_info().layout.current_index.layout.normal.num_shards? 0 : -1;
if (!sync) {
- r = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->bilog_rados->log_stop(bucket->get_info(), -1);
+ r = static_cast<rgw::sal::RadosStore*>(store)->svc()->bilog_rados->log_stop(bucket->get_info(), -1);
if (r < 0) {
set_err_msg(err_msg, "ERROR: failed writing stop bilog:" + cpp_strerror(-r));
return r;
}
} else {
- r = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->bilog_rados->log_start(bucket->get_info(), -1);
+ r = static_cast<rgw::sal::RadosStore*>(store)->svc()->bilog_rados->log_start(bucket->get_info(), -1);
if (r < 0) {
set_err_msg(err_msg, "ERROR: failed writing resync bilog:" + cpp_strerror(-r));
return r;
}
for (int i = 0; i < shards_num; ++i, ++shard_id) {
- r = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->datalog_rados->add_entry(dpp, bucket->get_info(), shard_id);
+ r = static_cast<rgw::sal::RadosStore*>(store)->svc()->datalog_rados->add_entry(dpp, bucket->get_info(), shard_id);
if (r < 0) {
set_err_msg(err_msg, "ERROR: failed writing data log:" + cpp_strerror(-r));
return r;
}
int rgw_object_get_attr(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore* store, rgw::sal::RGWObject* obj,
+ rgw::sal::Store* store, rgw::sal::Object* obj,
const char* attr_name, bufferlist& out_bl, optional_yield y)
{
RGWObjectCtx obj_ctx(store);
- std::unique_ptr<rgw::sal::RGWObject::ReadOp> rop = obj->get_read_op(&obj_ctx);
+ std::unique_ptr<rgw::sal::Object::ReadOp> rop = obj->get_read_op(&obj_ctx);
return rop->get_attr(dpp, attr_name, out_bl, y);
}
if (!object_name.empty()) {
bufferlist bl;
- std::unique_ptr<rgw::sal::RGWObject> obj = bucket->get_object(rgw_obj_key(object_name));
+ std::unique_ptr<rgw::sal::Object> obj = bucket->get_object(rgw_obj_key(object_name));
ret = rgw_object_get_attr(dpp, store, obj.get(), RGW_ATTR_ACL, bl, y);
if (ret < 0){
}
-int RGWBucketAdminOp::get_policy(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state,
+int RGWBucketAdminOp::get_policy(rgw::sal::Store *store, RGWBucketAdminOpState& op_state,
RGWAccessControlPolicy& policy, const DoutPrefixProvider *dpp)
{
RGWBucket bucket;
/* Wrappers to facilitate RESTful interface */
-int RGWBucketAdminOp::get_policy(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state,
+int RGWBucketAdminOp::get_policy(rgw::sal::Store *store, RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher, const DoutPrefixProvider *dpp)
{
RGWAccessControlPolicy policy(store->ctx());
return 0;
}
-int RGWBucketAdminOp::dump_s3_policy(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state,
+int RGWBucketAdminOp::dump_s3_policy(rgw::sal::Store *store, RGWBucketAdminOpState& op_state,
ostream& os, const DoutPrefixProvider *dpp)
{
RGWAccessControlPolicy_S3 policy(store->ctx());
return 0;
}
-int RGWBucketAdminOp::unlink(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp)
+int RGWBucketAdminOp::unlink(rgw::sal::Store *store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp)
{
RGWBucket bucket;
return bucket.unlink(op_state, null_yield, dpp);
}
-int RGWBucketAdminOp::link(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp, string *err)
+int RGWBucketAdminOp::link(rgw::sal::Store *store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp, string *err)
{
RGWBucket bucket;
int ret = bucket.init(store, op_state, null_yield, dpp, err);
}
-int RGWBucketAdminOp::chown(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state, const string& marker, const DoutPrefixProvider *dpp, string *err)
+int RGWBucketAdminOp::chown(rgw::sal::Store *store, RGWBucketAdminOpState& op_state, const string& marker, const DoutPrefixProvider *dpp, string *err)
{
RGWBucket bucket;
}
-int RGWBucketAdminOp::check_index(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state,
+int RGWBucketAdminOp::check_index(rgw::sal::Store *store, RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher, optional_yield y, const DoutPrefixProvider *dpp)
{
int ret;
return 0;
}
-int RGWBucketAdminOp::remove_bucket(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state,
+int RGWBucketAdminOp::remove_bucket(rgw::sal::Store *store, RGWBucketAdminOpState& op_state,
optional_yield y, const DoutPrefixProvider *dpp,
bool bypass_gc, bool keep_index_consistent)
{
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(op_state.get_user_id());
+ std::unique_ptr<rgw::sal::Bucket> bucket;
+ std::unique_ptr<rgw::sal::User> user = store->get_user(op_state.get_user_id());
int ret = store->get_bucket(dpp, user.get(), user->get_tenant(), op_state.get_bucket_name(),
&bucket, y);
return ret;
}
-int RGWBucketAdminOp::remove_object(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp)
+int RGWBucketAdminOp::remove_object(rgw::sal::Store *store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp)
{
RGWBucket bucket;
return bucket.remove_object(dpp, op_state);
}
-int RGWBucketAdminOp::sync_bucket(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp, string *err_msg)
+int RGWBucketAdminOp::sync_bucket(rgw::sal::Store *store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp, string *err_msg)
{
RGWBucket bucket;
int ret = bucket.init(store, op_state, null_yield, dpp, err_msg);
return bucket.sync(op_state, dpp, err_msg);
}
-static int bucket_stats(rgw::sal::RGWStore *store,
+static int bucket_stats(rgw::sal::Store *store,
const std::string& tenant_name,
const std::string& bucket_name,
Formatter *formatter,
const DoutPrefixProvider *dpp)
{
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
map<RGWObjCategory, RGWStorageStats> stats;
real_time mtime;
return 0;
}
-int RGWBucketAdminOp::limit_check(rgw::sal::RGWStore *store,
+int RGWBucketAdminOp::limit_check(rgw::sal::Store *store,
RGWBucketAdminOpState& op_state,
const std::list<std::string>& user_ids,
RGWFormatterFlusher& flusher, optional_yield y,
formatter->open_array_section("buckets");
string marker;
- rgw::sal::RGWBucketList buckets;
+ rgw::sal::BucketList buckets;
do {
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(rgw_user(user_id));
+ std::unique_ptr<rgw::sal::User> user = store->get_user(rgw_user(user_id));
ret = user->list_buckets(dpp, marker, string(), max_entries, false, buckets, y);
if (ret < 0)
return ret;
- map<string, std::unique_ptr<rgw::sal::RGWBucket>>& m_buckets = buckets.get_buckets();
+ map<string, std::unique_ptr<rgw::sal::Bucket>>& m_buckets = buckets.get_buckets();
for (const auto& iter : m_buckets) {
auto& bucket = iter.second;
return ret;
} /* RGWBucketAdminOp::limit_check */
-int RGWBucketAdminOp::info(rgw::sal::RGWStore *store,
+int RGWBucketAdminOp::info(rgw::sal::Store *store,
RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher,
optional_yield y,
if (op_state.is_user_op()) {
formatter->open_array_section("buckets");
- rgw::sal::RGWBucketList buckets;
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(op_state.get_user_id());
+ rgw::sal::BucketList buckets;
+ std::unique_ptr<rgw::sal::User> user = store->get_user(op_state.get_user_id());
std::string marker;
const std::string empty_end_marker;
constexpr bool no_need_stats = false; // set need_stats to false
}
const std::string* marker_cursor = nullptr;
- map<string, std::unique_ptr<rgw::sal::RGWBucket>>& m = buckets.get_buckets();
+ map<string, std::unique_ptr<rgw::sal::Bucket>>& m = buckets.get_buckets();
for (const auto& i : m) {
const std::string& obj_name = i.first;
return 0;
}
-int RGWBucketAdminOp::set_quota(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp)
+int RGWBucketAdminOp::set_quota(rgw::sal::Store *store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp)
{
RGWBucket bucket;
return bucket.set_quota(op_state, dpp);
}
-static int purge_bucket_instance(rgw::sal::RGWStore *store, const RGWBucketInfo& bucket_info, const DoutPrefixProvider *dpp)
+static int purge_bucket_instance(rgw::sal::Store *store, const RGWBucketInfo& bucket_info, const DoutPrefixProvider *dpp)
{
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
int ret = store->get_bucket(nullptr, bucket_info, &bucket);
if (ret < 0)
return ret;
}
using bucket_instance_ls = std::vector<RGWBucketInfo>;
-void get_stale_instances(rgw::sal::RGWStore *store, const std::string& bucket_name,
+void get_stale_instances(rgw::sal::Store *store, const std::string& bucket_name,
const vector<std::string>& lst,
bucket_instance_ls& stale_instances,
const DoutPrefixProvider *dpp)
// are guaranteed to be stale
for (const auto& bucket_instance : lst){
RGWBucketInfo binfo;
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
rgw_bucket rbucket;
rgw_bucket_parse_bucket_key(store->ctx(), bucket_instance, &rbucket, nullptr);
int r = store->get_bucket(dpp, nullptr, rbucket, &bucket, null_yield);
// all the instances
auto [tenant, bname] = split_tenant(bucket_name);
RGWBucketInfo cur_bucket_info;
- std::unique_ptr<rgw::sal::RGWBucket> cur_bucket;
+ std::unique_ptr<rgw::sal::Bucket> cur_bucket;
int r = store->get_bucket(dpp, nullptr, tenant, bname, &cur_bucket, null_yield);
if (r < 0) {
if (r == -ENOENT) {
// bucket and walk through these instances to make sure no one else interferes
// with these
{
- RGWBucketReshardLock reshard_lock(static_cast<rgw::sal::RGWRadosStore*>(store), cur_bucket->get_info(), true);
+ RGWBucketReshardLock reshard_lock(static_cast<rgw::sal::RadosStore*>(store), cur_bucket->get_info(), true);
r = reshard_lock.lock();
if (r < 0) {
// most likely bucket is under reshard, return the sureshot stale instances
return;
}
-static int process_stale_instances(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state,
+static int process_stale_instances(rgw::sal::Store *store, RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher,
const DoutPrefixProvider *dpp,
std::function<void(const bucket_instance_ls&,
Formatter *,
- rgw::sal::RGWStore*)> process_f)
+ rgw::sal::Store*)> process_f)
{
std::string marker;
void *handle;
return 0;
}
-int RGWBucketAdminOp::list_stale_instances(rgw::sal::RGWStore *store,
+int RGWBucketAdminOp::list_stale_instances(rgw::sal::Store *store,
RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher,
const DoutPrefixProvider *dpp)
{
auto process_f = [](const bucket_instance_ls& lst,
Formatter *formatter,
- rgw::sal::RGWStore*){
+ rgw::sal::Store*){
for (const auto& binfo: lst)
formatter->dump_string("key", binfo.bucket.get_key());
};
}
-int RGWBucketAdminOp::clear_stale_instances(rgw::sal::RGWStore *store,
+int RGWBucketAdminOp::clear_stale_instances(rgw::sal::Store *store,
RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher,
const DoutPrefixProvider *dpp)
{
auto process_f = [dpp](const bucket_instance_ls& lst,
Formatter *formatter,
- rgw::sal::RGWStore *store){
+ rgw::sal::Store *store){
for (const auto &binfo: lst) {
int ret = purge_bucket_instance(store, binfo, dpp);
if (ret == 0){
return process_stale_instances(store, op_state, flusher, dpp, process_f);
}
-static int fix_single_bucket_lc(rgw::sal::RGWStore *store,
+static int fix_single_bucket_lc(rgw::sal::Store *store,
const std::string& tenant_name,
const std::string& bucket_name,
const DoutPrefixProvider *dpp)
{
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
int ret = store->get_bucket(dpp, nullptr, tenant_name, bucket_name, &bucket, null_yield);
if (ret < 0) {
// TODO: Should we handle the case where the bucket could've been removed between
formatter->close_section(); // bucket_entry
}
-static void process_single_lc_entry(rgw::sal::RGWStore *store,
+static void process_single_lc_entry(rgw::sal::Store *store,
Formatter *formatter,
const std::string& tenant_name,
const std::string& bucket_name,
format_lc_status(formatter, tenant_name, bucket_name, -ret);
}
-int RGWBucketAdminOp::fix_lc_shards(rgw::sal::RGWStore *store,
+int RGWBucketAdminOp::fix_lc_shards(rgw::sal::Store *store,
RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher,
const DoutPrefixProvider *dpp)
}
static bool has_object_expired(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
- rgw::sal::RGWBucket* bucket,
+ rgw::sal::Store *store,
+ rgw::sal::Bucket* bucket,
const rgw_obj_key& key, utime_t& delete_at)
{
- std::unique_ptr<rgw::sal::RGWObject> obj = bucket->get_object(key);
+ std::unique_ptr<rgw::sal::Object> obj = bucket->get_object(key);
bufferlist delete_at_bl;
int ret = rgw_object_get_attr(dpp, store, obj.get(), RGW_ATTR_DELETE_AT, delete_at_bl, null_yield);
}
static int fix_bucket_obj_expiry(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
- rgw::sal::RGWBucket* bucket,
+ rgw::sal::Store *store,
+ rgw::sal::Bucket* bucket,
RGWFormatterFlusher& flusher, bool dry_run)
{
if (bucket->get_key().bucket_id == bucket->get_key().marker) {
formatter->flush(std::cout);
});
- rgw::sal::RGWBucket::ListParams params;
- rgw::sal::RGWBucket::ListResults results;
+ rgw::sal::Bucket::ListParams params;
+ rgw::sal::Bucket::ListResults results;
params.list_versions = bucket->versioned();
params.allow_unordered = true;
return 0;
}
-int RGWBucketAdminOp::fix_obj_expiry(rgw::sal::RGWStore *store,
+int RGWBucketAdminOp::fix_obj_expiry(rgw::sal::Store *store,
RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher,
const DoutPrefixProvider *dpp, bool dry_run)
lderr(store->ctx()) << "failed to initialize bucket" << dendl;
return ret;
}
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
ret = store->get_bucket(nullptr, admin_bucket.get_bucket_info(), &bucket);
if (ret < 0) {
return ret;
}
// TODO: remove RGWRados dependency for bucket listing
-int RGWBucketCtl::chown(rgw::sal::RGWStore *store, rgw::sal::RGWBucket* bucket,
+int RGWBucketCtl::chown(rgw::sal::Store *store, rgw::sal::Bucket* bucket,
const rgw_user& user_id, const std::string& display_name,
const std::string& marker, optional_yield y, const DoutPrefixProvider *dpp)
{
RGWObjectCtx obj_ctx(store);
map<string, bool> common_prefixes;
- rgw::sal::RGWBucket::ListParams params;
- rgw::sal::RGWBucket::ListResults results;
+ rgw::sal::Bucket::ListParams params;
+ rgw::sal::Bucket::ListResults results;
params.list_versions = true;
params.allow_unordered = true;
count += results.objs.size();
for (const auto& obj : results.objs) {
- std::unique_ptr<rgw::sal::RGWObject> r_obj = bucket->get_object(obj.key);
+ std::unique_ptr<rgw::sal::Object> r_obj = bucket->get_object(obj.key);
ret = r_obj->get_obj_attrs(&obj_ctx, y, dpp);
if (ret < 0){
static RGWBucketInstanceMetadataHandlerBase *alloc();
};
-extern int rgw_remove_object(const DoutPrefixProvider *dpp, rgw::sal::RGWStore *store, rgw::sal::RGWBucket* bucket, rgw_obj_key& key);
-extern int rgw_remove_bucket_bypass_gc(rgw::sal::RGWStore *store, rgw::sal::RGWBucket* bucket, int concurrent_max, optional_yield y);
+extern int rgw_remove_object(const DoutPrefixProvider *dpp, rgw::sal::Store *store, rgw::sal::Bucket* bucket, rgw_obj_key& key);
+extern int rgw_remove_bucket_bypass_gc(rgw::sal::Store *store, rgw::sal::Bucket* bucket, int concurrent_max, optional_yield y);
-extern int rgw_object_get_attr(rgw::sal::RGWStore* store, rgw::sal::RGWObject* obj,
+extern int rgw_object_get_attr(rgw::sal::Store* store, rgw::sal::Object* obj,
const char* attr_name, bufferlist& out_bl,
optional_yield y);
-extern void check_bad_user_bucket_mapping(rgw::sal::RGWStore *store, rgw::sal::RGWUser* user, bool fix, optional_yield y, const DoutPrefixProvider *dpp);
+extern void check_bad_user_bucket_mapping(rgw::sal::Store *store, rgw::sal::User* user, bool fix, optional_yield y, const DoutPrefixProvider *dpp);
struct RGWBucketAdminOpState {
rgw_user uid;
bool sync_bucket;
int max_aio = 0;
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
RGWQuotaInfo quota;
std::string& get_object_name() { return object_name; }
std::string& get_tenant() { return uid.tenant; }
- rgw::sal::RGWBucket* get_bucket() { return bucket.get(); }
- void set_bucket(std::unique_ptr<rgw::sal::RGWBucket> _bucket) {
+ rgw::sal::Bucket* get_bucket() { return bucket.get(); }
+ void set_bucket(std::unique_ptr<rgw::sal::Bucket> _bucket) {
bucket = std::move(_bucket);
bucket_stored = true;
}
class RGWBucket
{
RGWUserBuckets buckets;
- rgw::sal::RGWStore *store;
+ rgw::sal::Store *store;
RGWAccessHandle handle;
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
- std::unique_ptr<rgw::sal::RGWUser> user;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
+ std::unique_ptr<rgw::sal::User> user;
bool failure;
public:
RGWBucket() : store(NULL), handle(NULL), failure(false) {}
- int init(rgw::sal::RGWStore *storage, RGWBucketAdminOpState& op_state, optional_yield y,
+ int init(rgw::sal::Store *storage, RGWBucketAdminOpState& op_state, optional_yield y,
const DoutPrefixProvider *dpp, std::string *err_msg = NULL);
int check_bad_index_multipart(RGWBucketAdminOpState& op_state,
class RGWBucketAdminOp
{
public:
- static int get_policy(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state,
+ static int get_policy(rgw::sal::Store *store, RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher, const DoutPrefixProvider *dpp);
- static int get_policy(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state,
+ static int get_policy(rgw::sal::Store *store, RGWBucketAdminOpState& op_state,
RGWAccessControlPolicy& policy, const DoutPrefixProvider *dpp);
- static int dump_s3_policy(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state,
+ static int dump_s3_policy(rgw::sal::Store *store, RGWBucketAdminOpState& op_state,
ostream& os, const DoutPrefixProvider *dpp);
- static int unlink(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp);
- static int link(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp, string *err_msg = NULL);
- static int chown(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state, const string& marker, const DoutPrefixProvider *dpp, string *err_msg = NULL);
+ static int unlink(rgw::sal::Store *store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp);
+ static int link(rgw::sal::Store *store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp, string *err_msg = NULL);
+ static int chown(rgw::sal::Store *store, RGWBucketAdminOpState& op_state, const string& marker, const DoutPrefixProvider *dpp, string *err_msg = NULL);
- static int check_index(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state,
+ static int check_index(rgw::sal::Store *store, RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher, optional_yield y, const DoutPrefixProvider *dpp);
- static int remove_bucket(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state, optional_yield y,
+ static int remove_bucket(rgw::sal::Store *store, RGWBucketAdminOpState& op_state, optional_yield y,
const DoutPrefixProvider *dpp, bool bypass_gc = false, bool keep_index_consistent = true);
- static int remove_object(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp);
- static int info(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state, RGWFormatterFlusher& flusher, optional_yield y, const DoutPrefixProvider *dpp);
- static int limit_check(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state,
+ static int remove_object(rgw::sal::Store *store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp);
+ static int info(rgw::sal::Store *store, RGWBucketAdminOpState& op_state, RGWFormatterFlusher& flusher, optional_yield y, const DoutPrefixProvider *dpp);
+ static int limit_check(rgw::sal::Store *store, RGWBucketAdminOpState& op_state,
const std::list<std::string>& user_ids,
RGWFormatterFlusher& flusher, optional_yield y,
const DoutPrefixProvider *dpp,
bool warnings_only = false);
- static int set_quota(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp);
+ static int set_quota(rgw::sal::Store *store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp);
- static int list_stale_instances(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state,
+ static int list_stale_instances(rgw::sal::Store *store, RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher, const DoutPrefixProvider *dpp);
- static int clear_stale_instances(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state,
+ static int clear_stale_instances(rgw::sal::Store *store, RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher, const DoutPrefixProvider *dpp);
- static int fix_lc_shards(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state,
+ static int fix_lc_shards(rgw::sal::Store *store, RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher, const DoutPrefixProvider *dpp);
- static int fix_obj_expiry(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state,
+ static int fix_obj_expiry(rgw::sal::Store *store, RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher, const DoutPrefixProvider *dpp, bool dry_run = false);
- static int sync_bucket(rgw::sal::RGWStore *store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp, string *err_msg = NULL);
+ static int sync_bucket(rgw::sal::Store *store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp, string *err_msg = NULL);
};
struct rgw_ep_info {
const DoutPrefixProvider *dpp,
bool update_entrypoint = true);
- int chown(rgw::sal::RGWStore *store, rgw::sal::RGWBucket* bucket,
+ int chown(rgw::sal::Store *store, rgw::sal::Bucket* bucket,
const rgw_user& user_id, const std::string& display_name,
const std::string& marker, optional_yield y, const DoutPrefixProvider *dpp);
};
-bool rgw_find_bucket_by_id(CephContext *cct, rgw::sal::RGWStore* store, const string& marker,
+bool rgw_find_bucket_by_id(CephContext *cct, rgw::sal::Store* store, const string& marker,
const string& bucket_id, rgw_bucket* bucket_out);
#endif
}
-int verify_object_lock(const DoutPrefixProvider* dpp, const rgw::sal::RGWAttrs& attrs, const bool bypass_perm, const bool bypass_governance_mode) {
+int verify_object_lock(const DoutPrefixProvider* dpp, const rgw::sal::Attrs& attrs, const bool bypass_perm, const bool bypass_governance_mode) {
auto aiter = attrs.find(RGW_ATTR_OBJECT_RETENTION);
if (aiter != attrs.end()) {
RGWObjectRetention obj_retention;
}
namespace rgw::sal {
- class RGWUser;
- class RGWBucket;
- class RGWObject;
- using RGWAttrs = std::map<std::string, ceph::buffer::list>;
+ class User;
+ class Bucket;
+ class Object;
+ using Attrs = std::map<std::string, ceph::buffer::list>;
}
using ceph::crypto::MD5;
string bucket_tenant;
string bucket_name;
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
- std::unique_ptr<rgw::sal::RGWObject> object;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
+ std::unique_ptr<rgw::sal::Object> object;
string src_tenant_name;
string src_bucket_name;
- std::unique_ptr<rgw::sal::RGWObject> src_object;
+ std::unique_ptr<rgw::sal::Object> src_object;
ACLOwner bucket_owner;
ACLOwner owner;
bool has_bad_meta{false};
- std::unique_ptr<rgw::sal::RGWUser> user;
+ std::unique_ptr<rgw::sal::User> user;
struct {
/* TODO(rzarzynski): switch out to the static_ptr for both members. */
~req_state();
- void set_user(std::unique_ptr<rgw::sal::RGWUser>& u) { user.swap(u); }
+ void set_user(std::unique_ptr<rgw::sal::User>& u) { user.swap(u); }
bool is_err() const { return err.is_err(); }
// implements DoutPrefixProvider
int perm);
extern int verify_object_lock(
const DoutPrefixProvider* dpp,
- const rgw::sal::RGWAttrs& attrs,
+ const rgw::sal::Attrs& attrs,
const bool bypass_perm,
const bool bypass_governance_mode);
}
-RGWOmapAppend::RGWOmapAppend(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RGWRadosStore *_store, const rgw_raw_obj& _obj,
+RGWOmapAppend::RGWOmapAppend(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore *_store, const rgw_raw_obj& _obj,
uint64_t _window_size)
: RGWConsumerCR<string>(_store->ctx()), async_rados(_async_rados),
store(_store), obj(_obj), going_down(false), num_pending_entries(0), window_size(_window_size), total_entries(0)
return l.lock_exclusive(&ref.pool.ioctx(), ref.obj.oid);
}
-RGWAsyncLockSystemObj::RGWAsyncLockSystemObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RGWRadosStore *_store,
+RGWAsyncLockSystemObj::RGWAsyncLockSystemObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RadosStore *_store,
RGWObjVersionTracker *_objv_tracker, const rgw_raw_obj& _obj,
const string& _name, const string& _cookie, uint32_t _duration_secs) : RGWAsyncRadosRequest(caller, cn), store(_store),
obj(_obj),
return l.unlock(&ref.pool.ioctx(), ref.obj.oid);
}
-RGWAsyncUnlockSystemObj::RGWAsyncUnlockSystemObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RGWRadosStore *_store,
+RGWAsyncUnlockSystemObj::RGWAsyncUnlockSystemObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RadosStore *_store,
RGWObjVersionTracker *_objv_tracker, const rgw_raw_obj& _obj,
const string& _name, const string& _cookie) : RGWAsyncRadosRequest(caller, cn), store(_store),
obj(_obj),
{
}
-RGWRadosSetOmapKeysCR::RGWRadosSetOmapKeysCR(rgw::sal::RGWRadosStore *_store,
+RGWRadosSetOmapKeysCR::RGWRadosSetOmapKeysCR(rgw::sal::RadosStore *_store,
const rgw_raw_obj& _obj,
map<string, bufferlist>& _entries) : RGWSimpleCoroutine(_store->ctx()),
store(_store),
return r;
}
-RGWRadosGetOmapKeysCR::RGWRadosGetOmapKeysCR(rgw::sal::RGWRadosStore *_store,
+RGWRadosGetOmapKeysCR::RGWRadosGetOmapKeysCR(rgw::sal::RadosStore *_store,
const rgw_raw_obj& _obj,
const string& _marker,
int _max_entries,
return r;
}
-RGWRadosGetOmapValsCR::RGWRadosGetOmapValsCR(rgw::sal::RGWRadosStore *_store,
+RGWRadosGetOmapValsCR::RGWRadosGetOmapValsCR(rgw::sal::RadosStore *_store,
const rgw_raw_obj& _obj,
const string& _marker,
int _max_entries,
return r;
}
-RGWRadosRemoveOmapKeysCR::RGWRadosRemoveOmapKeysCR(rgw::sal::RGWRadosStore *_store,
+RGWRadosRemoveOmapKeysCR::RGWRadosRemoveOmapKeysCR(rgw::sal::RadosStore *_store,
const rgw_raw_obj& _obj,
const set<string>& _keys) : RGWSimpleCoroutine(_store->ctx()),
store(_store),
return r;
}
-RGWRadosRemoveCR::RGWRadosRemoveCR(rgw::sal::RGWRadosStore *store, const rgw_raw_obj& obj,
+RGWRadosRemoveCR::RGWRadosRemoveCR(rgw::sal::RadosStore *store, const rgw_raw_obj& obj,
RGWObjVersionTracker* objv_tracker)
: RGWSimpleCoroutine(store->ctx()),
store(store), obj(obj), objv_tracker(objv_tracker)
return r;
}
-RGWSimpleRadosLockCR::RGWSimpleRadosLockCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RGWRadosStore *_store,
+RGWSimpleRadosLockCR::RGWSimpleRadosLockCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore *_store,
const rgw_raw_obj& _obj,
const string& _lock_name,
const string& _cookie,
return req->get_ret_status();
}
-RGWSimpleRadosUnlockCR::RGWSimpleRadosUnlockCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RGWRadosStore *_store,
+RGWSimpleRadosUnlockCR::RGWSimpleRadosUnlockCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore *_store,
const rgw_raw_obj& _obj,
const string& _lock_name,
const string& _cookie) : RGWSimpleCoroutine(_store->ctx()),
return 0;
}
-RGWRadosBILogTrimCR::RGWRadosBILogTrimCR(rgw::sal::RGWRadosStore *store,
+RGWRadosBILogTrimCR::RGWRadosBILogTrimCR(rgw::sal::RadosStore *store,
const RGWBucketInfo& bucket_info,
int shard_id,
const std::string& start_marker,
char buf[16];
snprintf(buf, sizeof(buf), ".%lld", (long long)store->getRados()->instance_id());
- rgw::sal::RGWAttrs attrs;
+ rgw::sal::Attrs attrs;
- rgw::sal::RGWRadosBucket bucket(store, src_bucket);
- rgw::sal::RGWRadosObject src_obj(store, key, &bucket);
- rgw::sal::RGWRadosBucket dest_bucket(store, dest_bucket_info);
- rgw::sal::RGWRadosObject dest_obj(store, dest_key.value_or(key), &dest_bucket);
+ rgw::sal::RadosBucket bucket(store, src_bucket);
+ rgw::sal::RadosObject src_obj(store, key, &bucket);
+ rgw::sal::RadosBucket dest_bucket(store, dest_bucket_info);
+ rgw::sal::RadosObject dest_obj(store, dest_key.value_or(key), &dest_bucket);
std::optional<uint64_t> bytes_transferred;
int r = store->getRados()->fetch_remote_obj(obj_ctx,
char buf[16];
snprintf(buf, sizeof(buf), ".%lld", (long long)store->getRados()->instance_id());
- rgw::sal::RGWRadosBucket bucket(store, src_bucket);
- rgw::sal::RGWRadosObject src_obj(store, key, &bucket);
+ rgw::sal::RadosBucket bucket(store, src_bucket);
+ rgw::sal::RadosObject src_obj(store, key, &bucket);
int r = store->getRados()->stat_remote_obj(obj_ctx,
rgw_user(user_id),
return 0;
}
-RGWRadosTimelogAddCR::RGWRadosTimelogAddCR(rgw::sal::RGWRadosStore *_store, const string& _oid,
+RGWRadosTimelogAddCR::RGWRadosTimelogAddCR(rgw::sal::RadosStore *_store, const string& _oid,
const cls_log_entry& entry) : RGWSimpleCoroutine(_store->ctx()),
store(_store),
oid(_oid), cn(NULL)
return r;
}
-RGWRadosTimelogTrimCR::RGWRadosTimelogTrimCR(rgw::sal::RGWRadosStore *store,
+RGWRadosTimelogTrimCR::RGWRadosTimelogTrimCR(rgw::sal::RadosStore *store,
const std::string& oid,
const real_time& start_time,
const real_time& end_time,
}
-RGWSyncLogTrimCR::RGWSyncLogTrimCR(rgw::sal::RGWRadosStore *store, const std::string& oid,
+RGWSyncLogTrimCR::RGWSyncLogTrimCR(rgw::sal::RadosStore *store, const std::string& oid,
const std::string& to_marker,
std::string *last_trim_marker)
: RGWRadosTimelogTrimCR(store, oid, real_time{}, real_time{},
nullptr, nullptr, objv_tracker, null_yield);
}
-RGWStatObjCR::RGWStatObjCR(RGWAsyncRadosProcessor *async_rados, rgw::sal::RGWRadosStore *store,
+RGWStatObjCR::RGWStatObjCR(RGWAsyncRadosProcessor *async_rados, rgw::sal::RadosStore *store,
const RGWBucketInfo& _bucket_info, const rgw_obj& obj, uint64_t *psize,
real_time* pmtime, uint64_t *pepoch,
RGWObjVersionTracker *objv_tracker)
return req->get_ret_status();
}
-RGWRadosNotifyCR::RGWRadosNotifyCR(rgw::sal::RGWRadosStore *store, const rgw_raw_obj& obj,
+RGWRadosNotifyCR::RGWRadosNotifyCR(rgw::sal::RadosStore *store, const rgw_raw_obj& obj,
bufferlist& request, uint64_t timeout_ms,
bufferlist *response)
: RGWSimpleCoroutine(store->ctx()), store(store), obj(obj),
template <class P>
class RGWSimpleWriteOnlyAsyncCR : public RGWSimpleCoroutine {
RGWAsyncRadosProcessor *async_rados;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
P params;
const DoutPrefixProvider *dpp;
class Request : public RGWAsyncRadosRequest {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
P params;
const DoutPrefixProvider *dpp;
protected:
public:
Request(RGWCoroutine *caller,
RGWAioCompletionNotifier *cn,
- rgw::sal::RGWRadosStore *store,
+ rgw::sal::RadosStore *store,
const P& _params,
const DoutPrefixProvider *dpp) : RGWAsyncRadosRequest(caller, cn),
store(store),
public:
RGWSimpleWriteOnlyAsyncCR(RGWAsyncRadosProcessor *_async_rados,
- rgw::sal::RGWRadosStore *_store,
+ rgw::sal::RadosStore *_store,
const P& _params,
const DoutPrefixProvider *_dpp) : RGWSimpleCoroutine(_store->ctx()),
async_rados(_async_rados),
template <class P, class R>
class RGWSimpleAsyncCR : public RGWSimpleCoroutine {
RGWAsyncRadosProcessor *async_rados;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
P params;
std::shared_ptr<R> result;
const DoutPrefixProvider *dpp;
class Request : public RGWAsyncRadosRequest {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
P params;
std::shared_ptr<R> result;
const DoutPrefixProvider *dpp;
public:
Request(RGWCoroutine *caller,
RGWAioCompletionNotifier *cn,
- rgw::sal::RGWRadosStore *_store,
+ rgw::sal::RadosStore *_store,
const P& _params,
std::shared_ptr<R>& _result,
const DoutPrefixProvider *_dpp) : RGWAsyncRadosRequest(caller, cn),
public:
RGWSimpleAsyncCR(RGWAsyncRadosProcessor *_async_rados,
- rgw::sal::RGWRadosStore *_store,
+ rgw::sal::RadosStore *_store,
const P& _params,
std::shared_ptr<R>& _result,
const DoutPrefixProvider *_dpp) : RGWSimpleCoroutine(_store->ctx()),
class RGWGenericAsyncCR : public RGWSimpleCoroutine {
RGWAsyncRadosProcessor *async_rados;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
public:
};
class RGWAsyncLockSystemObj : public RGWAsyncRadosRequest {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
rgw_raw_obj obj;
string lock_name;
string cookie;
protected:
int _send_request() override;
public:
- RGWAsyncLockSystemObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RGWRadosStore *_store,
+ RGWAsyncLockSystemObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RadosStore *_store,
RGWObjVersionTracker *_objv_tracker, const rgw_raw_obj& _obj,
const string& _name, const string& _cookie, uint32_t _duration_secs);
};
class RGWAsyncUnlockSystemObj : public RGWAsyncRadosRequest {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
rgw_raw_obj obj;
string lock_name;
string cookie;
protected:
int _send_request() override;
public:
- RGWAsyncUnlockSystemObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RGWRadosStore *_store,
+ RGWAsyncUnlockSystemObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RadosStore *_store,
RGWObjVersionTracker *_objv_tracker, const rgw_raw_obj& _obj,
const string& _name, const string& _cookie);
};
};
class RGWRadosSetOmapKeysCR : public RGWSimpleCoroutine {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
map<string, bufferlist> entries;
rgw_rados_ref ref;
boost::intrusive_ptr<RGWAioCompletionNotifier> cn;
public:
- RGWRadosSetOmapKeysCR(rgw::sal::RGWRadosStore *_store,
+ RGWRadosSetOmapKeysCR(rgw::sal::RadosStore *_store,
const rgw_raw_obj& _obj,
map<string, bufferlist>& _entries);
};
using ResultPtr = std::shared_ptr<Result>;
- RGWRadosGetOmapKeysCR(rgw::sal::RGWRadosStore *_store, const rgw_raw_obj& _obj,
+ RGWRadosGetOmapKeysCR(rgw::sal::RadosStore *_store, const rgw_raw_obj& _obj,
const string& _marker, int _max_entries,
ResultPtr result);
int request_complete() override;
private:
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
rgw_raw_obj obj;
string marker;
int max_entries;
};
using ResultPtr = std::shared_ptr<Result>;
- RGWRadosGetOmapValsCR(rgw::sal::RGWRadosStore *_store, const rgw_raw_obj& _obj,
+ RGWRadosGetOmapValsCR(rgw::sal::RadosStore *_store, const rgw_raw_obj& _obj,
const string& _marker, int _max_entries,
ResultPtr result);
int request_complete() override;
private:
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
rgw_raw_obj obj;
string marker;
int max_entries;
};
class RGWRadosRemoveOmapKeysCR : public RGWSimpleCoroutine {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
rgw_rados_ref ref;
boost::intrusive_ptr<RGWAioCompletionNotifier> cn;
public:
- RGWRadosRemoveOmapKeysCR(rgw::sal::RGWRadosStore *_store,
+ RGWRadosRemoveOmapKeysCR(rgw::sal::RadosStore *_store,
const rgw_raw_obj& _obj,
const set<string>& _keys);
};
class RGWRadosRemoveCR : public RGWSimpleCoroutine {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
librados::IoCtx ioctx;
const rgw_raw_obj obj;
RGWObjVersionTracker* objv_tracker;
boost::intrusive_ptr<RGWAioCompletionNotifier> cn;
public:
- RGWRadosRemoveCR(rgw::sal::RGWRadosStore *store, const rgw_raw_obj& obj,
+ RGWRadosRemoveCR(rgw::sal::RadosStore *store, const rgw_raw_obj& obj,
RGWObjVersionTracker* objv_tracker = nullptr);
int send_request() override;
class RGWSimpleRadosLockCR : public RGWSimpleCoroutine {
RGWAsyncRadosProcessor *async_rados;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
string lock_name;
string cookie;
uint32_t duration;
RGWAsyncLockSystemObj *req;
public:
- RGWSimpleRadosLockCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RGWRadosStore *_store,
+ RGWSimpleRadosLockCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore *_store,
const rgw_raw_obj& _obj,
const string& _lock_name,
const string& _cookie,
class RGWSimpleRadosUnlockCR : public RGWSimpleCoroutine {
RGWAsyncRadosProcessor *async_rados;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
string lock_name;
string cookie;
RGWAsyncUnlockSystemObj *req;
public:
- RGWSimpleRadosUnlockCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RGWRadosStore *_store,
+ RGWSimpleRadosUnlockCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore *_store,
const rgw_raw_obj& _obj,
const string& _lock_name,
const string& _cookie);
class RGWOmapAppend : public RGWConsumerCR<string> {
RGWAsyncRadosProcessor *async_rados;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
rgw_raw_obj obj;
uint64_t window_size;
uint64_t total_entries;
public:
- RGWOmapAppend(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RGWRadosStore *_store,
+ RGWOmapAppend(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore *_store,
const rgw_raw_obj& _obj,
uint64_t _window_size = OMAP_APPEND_MAX_ENTRIES_DEFAULT);
int operate() override;
class RGWShardedOmapCRManager {
RGWAsyncRadosProcessor *async_rados;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
RGWCoroutine *op;
int num_shards;
vector<RGWOmapAppend *> shards;
public:
- RGWShardedOmapCRManager(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RGWRadosStore *_store, RGWCoroutine *_op, int _num_shards, const rgw_pool& pool, const string& oid_prefix)
+ RGWShardedOmapCRManager(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore *_store, RGWCoroutine *_op, int _num_shards, const rgw_pool& pool, const string& oid_prefix)
: async_rados(_async_rados),
store(_store), op(_op), num_shards(_num_shards) {
shards.reserve(num_shards);
};
class RGWAsyncGetBucketInstanceInfo : public RGWAsyncRadosRequest {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
rgw_bucket bucket;
const DoutPrefixProvider *dpp;
int _send_request() override;
public:
RGWAsyncGetBucketInstanceInfo(RGWCoroutine *caller, RGWAioCompletionNotifier *cn,
- rgw::sal::RGWRadosStore *_store, const rgw_bucket& bucket,
+ rgw::sal::RadosStore *_store, const rgw_bucket& bucket,
const DoutPrefixProvider *dpp)
: RGWAsyncRadosRequest(caller, cn), store(_store), bucket(bucket), dpp(dpp) {}
class RGWGetBucketInstanceInfoCR : public RGWSimpleCoroutine {
RGWAsyncRadosProcessor *async_rados;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
rgw_bucket bucket;
RGWBucketInfo *bucket_info;
map<string, bufferlist> *pattrs;
public:
// rgw_bucket constructor
- RGWGetBucketInstanceInfoCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RGWRadosStore *_store,
+ RGWGetBucketInstanceInfoCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore *_store,
const rgw_bucket& _bucket, RGWBucketInfo *_bucket_info,
map<string, bufferlist> *_pattrs, const DoutPrefixProvider *dpp)
: RGWSimpleCoroutine(_store->ctx()), async_rados(_async_rados), store(_store),
std::string end_marker;
boost::intrusive_ptr<RGWAioCompletionNotifier> cn;
public:
- RGWRadosBILogTrimCR(rgw::sal::RGWRadosStore *store, const RGWBucketInfo& bucket_info,
+ RGWRadosBILogTrimCR(rgw::sal::RadosStore *store, const RGWBucketInfo& bucket_info,
int shard_id, const std::string& start_marker,
const std::string& end_marker);
};
class RGWAsyncFetchRemoteObj : public RGWAsyncRadosRequest {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
rgw_zone_id source_zone;
std::optional<rgw_user> user_id;
protected:
int _send_request() override;
public:
- RGWAsyncFetchRemoteObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RGWRadosStore *_store,
+ RGWAsyncFetchRemoteObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RadosStore *_store,
const rgw_zone_id& _source_zone,
std::optional<rgw_user>& _user_id,
const rgw_bucket& _src_bucket,
class RGWFetchRemoteObjCR : public RGWSimpleCoroutine {
CephContext *cct;
RGWAsyncRadosProcessor *async_rados;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
rgw_zone_id source_zone;
std::optional<rgw_user> user_id;
const DoutPrefixProvider *dpp;
public:
- RGWFetchRemoteObjCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RGWRadosStore *_store,
+ RGWFetchRemoteObjCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore *_store,
const rgw_zone_id& _source_zone,
std::optional<rgw_user> _user_id,
const rgw_bucket& _src_bucket,
};
class RGWAsyncStatRemoteObj : public RGWAsyncRadosRequest {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
rgw_zone_id source_zone;
rgw_bucket src_bucket;
protected:
int _send_request() override;
public:
- RGWAsyncStatRemoteObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RGWRadosStore *_store,
+ RGWAsyncStatRemoteObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RadosStore *_store,
const rgw_zone_id& _source_zone,
rgw_bucket& _src_bucket,
const rgw_obj_key& _key,
class RGWStatRemoteObjCR : public RGWSimpleCoroutine {
CephContext *cct;
RGWAsyncRadosProcessor *async_rados;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
rgw_zone_id source_zone;
rgw_bucket src_bucket;
RGWAsyncStatRemoteObj *req;
public:
- RGWStatRemoteObjCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RGWRadosStore *_store,
+ RGWStatRemoteObjCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore *_store,
const rgw_zone_id& _source_zone,
rgw_bucket& _src_bucket,
const rgw_obj_key& _key,
class RGWAsyncRemoveObj : public RGWAsyncRadosRequest {
const DoutPrefixProvider *dpp;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
rgw_zone_id source_zone;
RGWBucketInfo bucket_info;
int _send_request() override;
public:
RGWAsyncRemoveObj(const DoutPrefixProvider *_dpp, RGWCoroutine *caller, RGWAioCompletionNotifier *cn,
- rgw::sal::RGWRadosStore *_store,
+ rgw::sal::RadosStore *_store,
const rgw_zone_id& _source_zone,
RGWBucketInfo& _bucket_info,
const rgw_obj_key& _key,
const DoutPrefixProvider *dpp;
CephContext *cct;
RGWAsyncRadosProcessor *async_rados;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
rgw_zone_id source_zone;
RGWBucketInfo bucket_info;
rgw_zone_set *zones_trace;
public:
- RGWRemoveObjCR(const DoutPrefixProvider *_dpp, RGWAsyncRadosProcessor *_async_rados, rgw::sal::RGWRadosStore *_store,
+ RGWRemoveObjCR(const DoutPrefixProvider *_dpp, RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore *_store,
const rgw_zone_id& _source_zone,
RGWBucketInfo& _bucket_info,
const rgw_obj_key& _key,
class RGWContinuousLeaseCR : public RGWCoroutine {
RGWAsyncRadosProcessor *async_rados;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
const rgw_raw_obj obj;
bool aborted{false};
public:
- RGWContinuousLeaseCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RGWRadosStore *_store,
+ RGWContinuousLeaseCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore *_store,
const rgw_raw_obj& _obj,
const string& _lock_name, int _interval, RGWCoroutine *_caller)
: RGWCoroutine(_store->ctx()), async_rados(_async_rados), store(_store),
};
class RGWRadosTimelogAddCR : public RGWSimpleCoroutine {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
list<cls_log_entry> entries;
string oid;
boost::intrusive_ptr<RGWAioCompletionNotifier> cn;
public:
- RGWRadosTimelogAddCR(rgw::sal::RGWRadosStore *_store, const string& _oid,
+ RGWRadosTimelogAddCR(rgw::sal::RadosStore *_store, const string& _oid,
const cls_log_entry& entry);
int send_request() override;
};
class RGWRadosTimelogTrimCR : public RGWSimpleCoroutine {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
boost::intrusive_ptr<RGWAioCompletionNotifier> cn;
protected:
std::string oid;
std::string to_marker;
public:
- RGWRadosTimelogTrimCR(rgw::sal::RGWRadosStore *store, const std::string& oid,
+ RGWRadosTimelogTrimCR(rgw::sal::RadosStore *store, const std::string& oid,
const real_time& start_time, const real_time& end_time,
const std::string& from_marker,
const std::string& to_marker);
public:
static constexpr const char* max_marker = "99999999";
- RGWSyncLogTrimCR(rgw::sal::RGWRadosStore *store, const std::string& oid,
+ RGWSyncLogTrimCR(rgw::sal::RadosStore *store, const std::string& oid,
const std::string& to_marker, std::string *last_trim_marker);
int request_complete() override;
};
class RGWAsyncStatObj : public RGWAsyncRadosRequest {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
RGWBucketInfo bucket_info;
rgw_obj obj;
uint64_t *psize;
protected:
int _send_request() override;
public:
- RGWAsyncStatObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RGWRadosStore *store,
+ RGWAsyncStatObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RadosStore *store,
const RGWBucketInfo& _bucket_info, const rgw_obj& obj, uint64_t *psize = nullptr,
real_time *pmtime = nullptr, uint64_t *pepoch = nullptr,
RGWObjVersionTracker *objv_tracker = nullptr)
};
class RGWStatObjCR : public RGWSimpleCoroutine {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
RGWAsyncRadosProcessor *async_rados;
RGWBucketInfo bucket_info;
rgw_obj obj;
RGWObjVersionTracker *objv_tracker;
RGWAsyncStatObj *req = nullptr;
public:
- RGWStatObjCR(RGWAsyncRadosProcessor *async_rados, rgw::sal::RGWRadosStore *store,
+ RGWStatObjCR(RGWAsyncRadosProcessor *async_rados, rgw::sal::RadosStore *store,
const RGWBucketInfo& _bucket_info, const rgw_obj& obj, uint64_t *psize = nullptr,
real_time* pmtime = nullptr, uint64_t *pepoch = nullptr,
RGWObjVersionTracker *objv_tracker = nullptr);
/// coroutine wrapper for IoCtx::aio_notify()
class RGWRadosNotifyCR : public RGWSimpleCoroutine {
- rgw::sal::RGWRadosStore *const store;
+ rgw::sal::RadosStore *const store;
const rgw_raw_obj obj;
bufferlist request;
const uint64_t timeout_ms;
boost::intrusive_ptr<RGWAioCompletionNotifier> cn;
public:
- RGWRadosNotifyCR(rgw::sal::RGWRadosStore *store, const rgw_raw_obj& obj,
+ RGWRadosNotifyCR(rgw::sal::RadosStore *store, const rgw_raw_obj& obj,
bufferlist& request, uint64_t timeout_ms,
bufferlist *response);
};
struct rgw_get_bucket_info_result {
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
};
using RGWGetBucketInfoCR = RGWSimpleAsyncCR<rgw_get_bucket_info_params, rgw_get_bucket_info_result>;
struct rgw_bucket_lifecycle_config_params {
- rgw::sal::RGWBucket* bucket;
- rgw::sal::RGWAttrs bucket_attrs;
+ rgw::sal::Bucket* bucket;
+ rgw::sal::Attrs bucket_attrs;
RGWLifecycleConfiguration config;
};
static constexpr uint32_t lock_duration = 30;
RGWDataSyncCtx *sc;
RGWDataSyncEnv *sync_env;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
const rgw_pool& pool;
const uint32_t num_shards;
};
RGWRemoteDataLog::RGWRemoteDataLog(const DoutPrefixProvider *dpp,
- rgw::sal::RGWRadosStore *store,
+ rgw::sal::RadosStore *store,
RGWAsyncRadosProcessor *async_rados)
: RGWCoroutinesManager(store->ctx(), store->getRados()->get_cr_registry()),
dpp(dpp), store(store),
RGWDataSyncCtx *sc;
RGWDataSyncEnv *sync_env;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
rgw_data_sync_status *sync_status;
int num_shards;
class RGWReadRecoveringBucketShardsCoroutine : public RGWCoroutine {
RGWDataSyncCtx *sc;
RGWDataSyncEnv *sync_env;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
const int shard_id;
int max_entries;
class RGWReadPendingBucketShardsCoroutine : public RGWCoroutine {
RGWDataSyncCtx *sc;
RGWDataSyncEnv *sync_env;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
const int shard_id;
int max_entries;
return new RGWReadBucketPipeSyncStatusCoroutine(&sc, sync_pairs[num], sync_status, nullptr);
}
-RGWBucketPipeSyncStatusManager::RGWBucketPipeSyncStatusManager(rgw::sal::RGWRadosStore *_store,
+RGWBucketPipeSyncStatusManager::RGWBucketPipeSyncStatusManager(rgw::sal::RadosStore *_store,
std::optional<rgw_zone_id> _source_zone,
std::optional<rgw_bucket> _source_bucket,
const rgw_bucket& _dest_bucket) : store(_store),
string RGWBucketPipeSyncStatusManager::obj_status_oid(const rgw_bucket_sync_pipe& sync_pipe,
const rgw_zone_id& source_zone,
- const rgw::sal::RGWObject* obj)
+ const rgw::sal::Object* obj)
{
string prefix = object_status_oid_prefix + "." + source_zone.id + ":" + obj->get_bucket()->get_key().get_key();
if (sync_pipe.source_bucket_info.bucket !=
class RGWCollectBucketSyncStatusCR : public RGWShardCollectCR {
static constexpr int max_concurrent_shards = 16;
- rgw::sal::RGWRadosStore *const store;
+ rgw::sal::RadosStore *const store;
RGWDataSyncCtx *const sc;
RGWDataSyncEnv *const env;
RGWBucketInfo source_bucket_info;
Vector::iterator i, end;
public:
- RGWCollectBucketSyncStatusCR(rgw::sal::RGWRadosStore *store, RGWDataSyncCtx *sc,
+ RGWCollectBucketSyncStatusCR(rgw::sal::RadosStore *store, RGWDataSyncCtx *sc,
const RGWBucketInfo& source_bucket_info,
const RGWBucketInfo& dest_bucket_info,
Vector *status)
};
int rgw_bucket_sync_status(const DoutPrefixProvider *dpp,
- rgw::sal::RGWRadosStore *store,
+ rgw::sal::RadosStore *store,
const rgw_sync_bucket_pipe& pipe,
const RGWBucketInfo& dest_bucket_info,
const RGWBucketInfo *psource_bucket_info,
struct RGWDataSyncEnv {
const DoutPrefixProvider *dpp{nullptr};
CephContext *cct{nullptr};
- rgw::sal::RGWRadosStore *store{nullptr};
+ rgw::sal::RadosStore *store{nullptr};
RGWServices *svc{nullptr};
RGWAsyncRadosProcessor *async_rados{nullptr};
RGWHTTPManager *http_manager{nullptr};
RGWDataSyncEnv() {}
- void init(const DoutPrefixProvider *_dpp, CephContext *_cct, rgw::sal::RGWRadosStore *_store, RGWServices *_svc,
+ void init(const DoutPrefixProvider *_dpp, CephContext *_cct, rgw::sal::RadosStore *_store, RGWServices *_svc,
RGWAsyncRadosProcessor *_async_rados, RGWHTTPManager *_http_manager,
RGWSyncErrorLogger *_error_logger, RGWSyncTraceManager *_sync_tracer,
RGWSyncModuleInstanceRef& _sync_module,
class RGWRemoteDataLog : public RGWCoroutinesManager {
const DoutPrefixProvider *dpp;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
CephContext *cct;
RGWCoroutinesManagerRegistry *cr_registry;
RGWAsyncRadosProcessor *async_rados;
public:
RGWRemoteDataLog(const DoutPrefixProvider *dpp,
- rgw::sal::RGWRadosStore *_store,
+ rgw::sal::RadosStore *_store,
RGWAsyncRadosProcessor *async_rados);
int init(const rgw_zone_id& _source_zone, RGWRESTConn *_conn, RGWSyncErrorLogger *_error_logger,
RGWSyncTraceManager *_sync_tracer, RGWSyncModuleInstanceRef& module,
};
class RGWDataSyncStatusManager : public DoutPrefixProvider {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
rgw_zone_id source_zone;
RGWRESTConn *conn;
int num_shards;
public:
- RGWDataSyncStatusManager(rgw::sal::RGWRadosStore *_store, RGWAsyncRadosProcessor *async_rados,
+ RGWDataSyncStatusManager(rgw::sal::RadosStore *_store, RGWAsyncRadosProcessor *async_rados,
const rgw_zone_id& _source_zone, PerfCounters* counters)
: store(_store), source_zone(_source_zone), conn(NULL), error_logger(NULL),
sync_module(nullptr), counters(counters),
source_log(this, store, async_rados), num_shards(0) {}
- RGWDataSyncStatusManager(rgw::sal::RGWRadosStore *_store, RGWAsyncRadosProcessor *async_rados,
+ RGWDataSyncStatusManager(rgw::sal::RadosStore *_store, RGWAsyncRadosProcessor *async_rados,
const rgw_zone_id& _source_zone, PerfCounters* counters,
const RGWSyncModuleInstanceRef& _sync_module)
: store(_store), source_zone(_source_zone), conn(NULL), error_logger(NULL),
optional_yield y);
class RGWBucketPipeSyncStatusManager : public DoutPrefixProvider {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
RGWDataSyncEnv sync_env;
int num_shards;
public:
- RGWBucketPipeSyncStatusManager(rgw::sal::RGWRadosStore *_store,
+ RGWBucketPipeSyncStatusManager(rgw::sal::RadosStore *_store,
std::optional<rgw_zone_id> _source_zone,
std::optional<rgw_bucket> _source_bucket,
const rgw_bucket& dest_bucket);
static string status_oid(const rgw_zone_id& source_zone, const rgw_bucket_sync_pair_info& bs);
static string obj_status_oid(const rgw_bucket_sync_pipe& sync_pipe,
- const rgw_zone_id& source_zone, const rgw::sal::RGWObject* obj); /* specific source obj sync status,
+ const rgw_zone_id& source_zone, const rgw::sal::Object* obj); /* specific source obj sync status,
can be used by sync modules */
// implements DoutPrefixProvider
/// read the sync status of all bucket shards from the given source zone
int rgw_bucket_sync_status(const DoutPrefixProvider *dpp,
- rgw::sal::RGWRadosStore *store,
+ rgw::sal::RadosStore *store,
const rgw_sync_bucket_pipe& pipe,
const RGWBucketInfo& dest_bucket_info,
const RGWBucketInfo *psource_bucket_info,
std::string uid; // should match user.user_id, iiuc
- std::unique_ptr<rgw::sal::RGWUser> user;
+ std::unique_ptr<rgw::sal::User> user;
RGWAccessKey key; // XXXX acc_key
static std::atomic<uint32_t> fs_inst_counter;
(void) fh_lru.unref(fh, cohort::lru::FLAG_NONE);
}
- int authorize(const DoutPrefixProvider *dpp, rgw::sal::RGWStore* store) {
+ int authorize(const DoutPrefixProvider *dpp, rgw::sal::Store* store) {
int ret = store->get_user_by_access_key(dpp, key.id, null_yield, &user);
if (ret == 0) {
RGWAccessKey* k = user->get_info().get_key(key.id);
uint32_t d_count;
bool rcb_eof; // caller forced early stop in readdir cycle
- RGWListBucketsRequest(CephContext* _cct, std::unique_ptr<rgw::sal::RGWUser> _user,
+ RGWListBucketsRequest(CephContext* _cct, std::unique_ptr<rgw::sal::User> _user,
RGWFileHandle* _rgw_fh, rgw_readdir_cb _rcb,
void* _cb_arg, RGWFileHandle::readdir_offset& _offset)
: RGWLibRequest(_cct, std::move(_user)), rgw_fh(_rgw_fh), offset(_offset),
sent_data = true;
}
- void send_response_data(rgw::sal::RGWBucketList& buckets) override {
+ void send_response_data(rgw::sal::BucketList& buckets) override {
if (!sent_data)
return;
auto& m = buckets.get_buckets();
uint32_t d_count;
bool rcb_eof; // caller forced early stop in readdir cycle
- RGWReaddirRequest(CephContext* _cct, std::unique_ptr<rgw::sal::RGWUser> _user,
+ RGWReaddirRequest(CephContext* _cct, std::unique_ptr<rgw::sal::User> _user,
RGWFileHandle* _rgw_fh, rgw_readdir_cb _rcb,
void* _cb_arg, RGWFileHandle::readdir_offset& _offset)
: RGWLibRequest(_cct, std::move(_user)), rgw_fh(_rgw_fh), offset(_offset),
bool valid;
bool has_children;
- RGWRMdirCheck (CephContext* _cct, std::unique_ptr<rgw::sal::RGWUser> _user,
+ RGWRMdirCheck (CephContext* _cct, std::unique_ptr<rgw::sal::User> _user,
const RGWFileHandle* _rgw_fh)
: RGWLibRequest(_cct, std::move(_user)), rgw_fh(_rgw_fh), valid(false),
has_children(false) {
public:
const std::string& bucket_name;
- RGWCreateBucketRequest(CephContext* _cct, std::unique_ptr<rgw::sal::RGWUser> _user,
+ RGWCreateBucketRequest(CephContext* _cct, std::unique_ptr<rgw::sal::User> _user,
std::string& _bname)
: RGWLibRequest(_cct, std::move(_user)), bucket_name(_bname) {
op = this;
public:
const std::string& bucket_name;
- RGWDeleteBucketRequest(CephContext* _cct, std::unique_ptr<rgw::sal::RGWUser> _user,
+ RGWDeleteBucketRequest(CephContext* _cct, std::unique_ptr<rgw::sal::User> _user,
std::string& _bname)
: RGWLibRequest(_cct, std::move(_user)), bucket_name(_bname) {
op = this;
buffer::list& bl; /* XXX */
size_t bytes_written;
- RGWPutObjRequest(CephContext* _cct, std::unique_ptr<rgw::sal::RGWUser> _user,
+ RGWPutObjRequest(CephContext* _cct, std::unique_ptr<rgw::sal::User> _user,
const std::string& _bname, const std::string& _oname,
buffer::list& _bl)
: RGWLibRequest(_cct, std::move(_user)), bucket_name(_bname), obj_name(_oname),
size_t read_resid; /* initialize to len, <= sizeof(ulp_buffer) */
bool do_hexdump = false;
- RGWReadRequest(CephContext* _cct, std::unique_ptr<rgw::sal::RGWUser> _user,
+ RGWReadRequest(CephContext* _cct, std::unique_ptr<rgw::sal::User> _user,
RGWFileHandle* _rgw_fh, uint64_t off, uint64_t len,
void *_ulp_buffer)
: RGWLibRequest(_cct, std::move(_user)), rgw_fh(_rgw_fh), ulp_buffer(_ulp_buffer),
const std::string& bucket_name;
const std::string& obj_name;
- RGWDeleteObjRequest(CephContext* _cct, std::unique_ptr<rgw::sal::RGWUser> _user,
+ RGWDeleteObjRequest(CephContext* _cct, std::unique_ptr<rgw::sal::User> _user,
const std::string& _bname, const std::string& _oname)
: RGWLibRequest(_cct, std::move(_user)), bucket_name(_bname), obj_name(_oname) {
op = this;
static constexpr uint32_t FLAG_NONE = 0x000;
- RGWStatObjRequest(CephContext* _cct, std::unique_ptr<rgw::sal::RGWUser> _user,
+ RGWStatObjRequest(CephContext* _cct, std::unique_ptr<rgw::sal::User> _user,
const std::string& _bname, const std::string& _oname,
uint32_t _flags)
: RGWLibRequest(_cct, std::move(_user)), bucket_name(_bname), obj_name(_oname),
std::map<std::string, buffer::list> attrs;
RGWLibFS::BucketStats& bs;
- RGWStatBucketRequest(CephContext* _cct, std::unique_ptr<rgw::sal::RGWUser> _user,
+ RGWStatBucketRequest(CephContext* _cct, std::unique_ptr<rgw::sal::User> _user,
const std::string& _path,
RGWLibFS::BucketStats& _stats)
: RGWLibRequest(_cct, std::move(_user)), bs(_stats) {
bool is_dir;
bool exact_matched;
- RGWStatLeafRequest(CephContext* _cct, std::unique_ptr<rgw::sal::RGWUser> _user,
+ RGWStatLeafRequest(CephContext* _cct, std::unique_ptr<rgw::sal::User> _user,
RGWFileHandle* _rgw_fh, const std::string& _path)
: RGWLibRequest(_cct, std::move(_user)), rgw_fh(_rgw_fh), path(_path),
matched(false), is_dir(false), exact_matched(false) {
size_t bytes_written;
bool eio;
- RGWWriteRequest(rgw::sal::RGWStore* store,
- std::unique_ptr<rgw::sal::RGWUser> _user,
+ RGWWriteRequest(rgw::sal::Store* store,
+ std::unique_ptr<rgw::sal::User> _user,
RGWFileHandle* _fh, const std::string& _bname,
const std::string& _oname)
: RGWLibContinuedReq(store->ctx(), std::move(_user)),
const std::string& src_name;
const std::string& dst_name;
- RGWCopyObjRequest(CephContext* _cct, std::unique_ptr<rgw::sal::RGWUser> _user,
+ RGWCopyObjRequest(CephContext* _cct, std::unique_ptr<rgw::sal::User> _user,
RGWFileHandle* _src_parent, RGWFileHandle* _dst_parent,
const std::string& _src_name, const std::string& _dst_name)
: RGWLibRequest(_cct, std::move(_user)), src_parent(_src_parent),
const std::string& obj_name;
RGWGetAttrsRequest(CephContext* _cct,
- std::unique_ptr<rgw::sal::RGWUser> _user,
+ std::unique_ptr<rgw::sal::User> _user,
const std::string& _bname, const std::string& _oname)
: RGWLibRequest(_cct, std::move(_user)), RGWGetAttrs(),
bucket_name(_bname), obj_name(_oname) {
const std::string& bucket_name;
const std::string& obj_name;
- RGWSetAttrsRequest(CephContext* _cct, std::unique_ptr<rgw::sal::RGWUser> _user,
+ RGWSetAttrsRequest(CephContext* _cct, std::unique_ptr<rgw::sal::User> _user,
const std::string& _bname, const std::string& _oname)
: RGWLibRequest(_cct, std::move(_user)), bucket_name(_bname), obj_name(_oname) {
op = this;
const std::string& obj_name;
RGWRMAttrsRequest(CephContext* _cct,
- std::unique_ptr<rgw::sal::RGWUser> _user,
+ std::unique_ptr<rgw::sal::User> _user,
const std::string& _bname, const std::string& _oname)
: RGWLibRequest(_cct, std::move(_user)), RGWRMAttrs(),
bucket_name(_bname), obj_name(_oname) {
op = this;
}
- const rgw::sal::RGWAttrs& get_attrs() {
+ const rgw::sal::Attrs& get_attrs() {
return attrs;
}
public RGWGetClusterStat {
public:
struct rados_cluster_stat_t& stats_req;
- RGWGetClusterStatReq(CephContext* _cct, std::unique_ptr<rgw::sal::RGWUser> _user,
+ RGWGetClusterStatReq(CephContext* _cct, std::unique_ptr<rgw::sal::User> _user,
rados_cluster_stat_t& _stats):
RGWLibRequest(_cct, std::move(_user)), stats_req(_stats){
op = this;
virtual void join() = 0;
virtual void pause_for_new_config() = 0;
- virtual void unpause_with_new_config(rgw::sal::RGWStore* store,
+ virtual void unpause_with_new_config(rgw::sal::Store* store,
rgw_auth_registry_ptr_t auth_registry) = 0;
};
env.mutex.get_write();
}
- void unpause_with_new_config(rgw::sal::RGWStore* const store,
+ void unpause_with_new_config(rgw::sal::Store* const store,
rgw_auth_registry_ptr_t auth_registry) override {
env.store = store;
env.auth_registry = std::move(auth_registry);
pprocess->pause();
}
- void unpause_with_new_config(rgw::sal::RGWStore* const store,
+ void unpause_with_new_config(rgw::sal::Store* const store,
rgw_auth_registry_ptr_t auth_registry) override {
env.store = store;
env.auth_registry = auth_registry;
}
rgw_user uid(uid_str);
- std::unique_ptr<rgw::sal::RGWUser> user = env.store->get_user(uid);
+ std::unique_ptr<rgw::sal::User> user = env.store->get_user(uid);
int ret = user->load_by_id(this, null_yield);
if (ret < 0) {
if (pauser)
pauser->pause();
}
- void resume(rgw::sal::RGWStore *store) override {
+ void resume(rgw::sal::Store *store) override {
/* Initialize the registry of auth strategies which will coordinate
* the dynamic reconfiguration. */
auto auth_registry = \
return NULL;
}
-void RGWLC::initialize(CephContext *_cct, rgw::sal::RGWStore *_store) {
+void RGWLC::initialize(CephContext *_cct, rgw::sal::Store *_store) {
cct = _cct;
store = _store;
sal_lc = store->get_lifecycle();
return (timediff >= cmp);
}
-static bool pass_object_lock_check(rgw::sal::RGWStore* store, rgw::sal::RGWObject* obj, RGWObjectCtx& ctx, const DoutPrefixProvider *dpp)
+static bool pass_object_lock_check(rgw::sal::Store* store, rgw::sal::Object* obj, RGWObjectCtx& ctx, const DoutPrefixProvider *dpp)
{
if (!obj->get_bucket()->get_info().obj_lock_enabled()) {
return true;
}
- std::unique_ptr<rgw::sal::RGWObject::ReadOp> read_op = obj->get_read_op(&ctx);
+ std::unique_ptr<rgw::sal::Object::ReadOp> read_op = obj->get_read_op(&ctx);
int ret = read_op->prepare(null_yield, dpp);
if (ret < 0) {
if (ret == -ENOENT) {
}
class LCObjsLister {
- rgw::sal::RGWStore *store;
- rgw::sal::RGWBucket* bucket;
- rgw::sal::RGWBucket::ListParams list_params;
- rgw::sal::RGWBucket::ListResults list_results;
+ rgw::sal::Store *store;
+ rgw::sal::Bucket* bucket;
+ rgw::sal::Bucket::ListParams list_params;
+ rgw::sal::Bucket::ListResults list_results;
string prefix;
vector<rgw_bucket_dir_entry>::iterator obj_iter;
rgw_bucket_dir_entry pre_obj;
int64_t delay_ms;
public:
- LCObjsLister(rgw::sal::RGWStore *_store, rgw::sal::RGWBucket* _bucket) :
+ LCObjsLister(rgw::sal::Store *_store, rgw::sal::Bucket* _bucket) :
store(_store), bucket(_bucket) {
list_params.list_versions = bucket->versioned();
list_params.allow_unordered = true;
using LCWorker = RGWLC::LCWorker;
lc_op op;
- rgw::sal::RGWStore *store;
+ rgw::sal::Store *store;
LCWorker* worker;
- rgw::sal::RGWBucket* bucket;
+ rgw::sal::Bucket* bucket;
LCObjsLister& ol;
- op_env(lc_op& _op, rgw::sal::RGWStore *_store, LCWorker* _worker,
- rgw::sal::RGWBucket* _bucket, LCObjsLister& _ol)
+ op_env(lc_op& _op, rgw::sal::Store *_store, LCWorker* _worker,
+ rgw::sal::Bucket* _bucket, LCObjsLister& _ol)
: op(_op), store(_store), worker(_worker), bucket(_bucket),
ol(_ol) {}
}; /* op_env */
boost::optional<std::string> next_key_name;
ceph::real_time effective_mtime;
- rgw::sal::RGWStore *store;
- rgw::sal::RGWBucket* bucket;
+ rgw::sal::Store *store;
+ rgw::sal::Bucket* bucket;
lc_op& op; // ok--refers to expanded env.op
LCObjsLister& ol;
- std::unique_ptr<rgw::sal::RGWObject> obj;
+ std::unique_ptr<rgw::sal::Object> obj;
RGWObjectCtx rctx;
const DoutPrefixProvider *dpp;
WorkQ* wq;
obj_key.instance = "null";
}
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
- std::unique_ptr<rgw::sal::RGWObject> obj;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
+ std::unique_ptr<rgw::sal::Object> obj;
ret = store->get_bucket(nullptr, bucket_info, &bucket);
if (ret < 0) {
}
obj = bucket->get_object(obj_key);
- std::unique_ptr<rgw::sal::RGWObject::DeleteOp> del_op = obj->get_delete_op(&oc.rctx);
+ std::unique_ptr<rgw::sal::Object::DeleteOp> del_op = obj->get_delete_op(&oc.rctx);
del_op->params.versioning_status = obj->get_bucket()->get_info().versioning_status();
del_op->params.obj_owner.set_id(rgw_user {meta.owner});
return !once && stop_at < time(nullptr);
}
-int RGWLC::handle_multipart_expiration(rgw::sal::RGWBucket* target,
+int RGWLC::handle_multipart_expiration(rgw::sal::Bucket* target,
const multimap<string, lc_op>& prefix_map,
LCWorker* worker, time_t stop_at, bool once)
{
MultipartMetaFilter mp_filter;
int ret;
- rgw::sal::RGWBucket::ListParams params;
- rgw::sal::RGWBucket::ListResults results;
+ rgw::sal::Bucket::ListParams params;
+ rgw::sal::Bucket::ListResults results;
auto delay_ms = cct->_conf.get_val<int64_t>("rgw_lc_thread_delay");
params.list_versions = false;
/* lifecycle processing does not depend on total order, so can
return 0;
}
-static int read_obj_tags(const DoutPrefixProvider *dpp, rgw::sal::RGWObject* obj, RGWObjectCtx& ctx, bufferlist& tags_bl)
+static int read_obj_tags(const DoutPrefixProvider *dpp, rgw::sal::Object* obj, RGWObjectCtx& ctx, bufferlist& tags_bl)
{
- std::unique_ptr<rgw::sal::RGWObject::ReadOp> rop = obj->get_read_op(&ctx);
+ std::unique_ptr<rgw::sal::Object::ReadOp> rop = obj->get_read_op(&ctx);
return rop->get_attr(dpp, RGW_ATTR_TAGS, tags_bl, null_yield);
}
time_t stop_at, bool once)
{
RGWLifecycleConfiguration config(cct);
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
string no_ns, list_versions;
vector<rgw_bucket_dir_entry> objs;
vector<std::string> result;
}
template<typename F>
-static int guard_lc_modify(rgw::sal::RGWStore* store,
+static int guard_lc_modify(rgw::sal::Store* store,
rgw::sal::Lifecycle* sal_lc,
const rgw_bucket& bucket, const string& cookie,
const F& f) {
return ret;
}
-int RGWLC::set_bucket_config(rgw::sal::RGWBucket* bucket,
- const rgw::sal::RGWAttrs& bucket_attrs,
+int RGWLC::set_bucket_config(rgw::sal::Bucket* bucket,
+ const rgw::sal::Attrs& bucket_attrs,
RGWLifecycleConfiguration *config)
{
- rgw::sal::RGWAttrs attrs = bucket_attrs;
+ rgw::sal::Attrs attrs = bucket_attrs;
bufferlist lc_bl;
config->encode(lc_bl);
return ret;
}
-int RGWLC::remove_bucket_config(rgw::sal::RGWBucket* bucket,
- const rgw::sal::RGWAttrs& bucket_attrs)
+int RGWLC::remove_bucket_config(rgw::sal::Bucket* bucket,
+ const rgw::sal::Attrs& bucket_attrs)
{
- rgw::sal::RGWAttrs attrs = bucket_attrs;
+ rgw::sal::Attrs attrs = bucket_attrs;
attrs.erase(RGW_ATTR_LC);
int ret = bucket->set_instance_attrs(this, attrs, null_yield);
namespace rgw::lc {
-int fix_lc_shard_entry(rgw::sal::RGWStore* store,
+int fix_lc_shard_entry(rgw::sal::Store* store,
rgw::sal::Lifecycle* sal_lc,
- rgw::sal::RGWBucket* bucket)
+ rgw::sal::Bucket* bucket)
{
if (auto aiter = bucket->get_attrs().find(RGW_ATTR_LC);
aiter == bucket->get_attrs().end()) {
class RGWLC : public DoutPrefixProvider {
CephContext *cct;
- rgw::sal::RGWStore *store;
+ rgw::sal::Store *store;
std::unique_ptr<rgw::sal::Lifecycle> sal_lc;
int max_objs{0};
string *obj_names{nullptr};
RGWLC() : cct(nullptr), store(nullptr) {}
~RGWLC();
- void initialize(CephContext *_cct, rgw::sal::RGWStore *_store);
+ void initialize(CephContext *_cct, rgw::sal::Store *_store);
void finalize();
int process(LCWorker* worker, bool once);
bool going_down();
void start_processor();
void stop_processor();
- int set_bucket_config(rgw::sal::RGWBucket* bucket,
- const rgw::sal::RGWAttrs& bucket_attrs,
+ int set_bucket_config(rgw::sal::Bucket* bucket,
+ const rgw::sal::Attrs& bucket_attrs,
RGWLifecycleConfiguration *config);
- int remove_bucket_config(rgw::sal::RGWBucket* bucket,
- const rgw::sal::RGWAttrs& bucket_attrs);
+ int remove_bucket_config(rgw::sal::Bucket* bucket,
+ const rgw::sal::Attrs& bucket_attrs);
CephContext *get_cct() const override { return cct; }
rgw::sal::Lifecycle *get_lc() const { return sal_lc.get(); }
private:
- int handle_multipart_expiration(rgw::sal::RGWBucket* target,
+ int handle_multipart_expiration(rgw::sal::Bucket* 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::RGWStore *store,
+int fix_lc_shard_entry(rgw::sal::Store *store,
rgw::sal::Lifecycle* sal_lc,
- rgw::sal::RGWBucket* bucket);
+ rgw::sal::Bucket* bucket);
std::string s3_expiration_header(
DoutPrefixProvider* dpp,
OpsLogSocket* olog;
rgw::LDAPHelper* ldh{nullptr};
RGWREST rest; // XXX needed for RGWProcessEnv
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
boost::intrusive_ptr<CephContext> cct;
public:
{}
~RGWLib() {}
- rgw::sal::RGWStore* get_store() { return store; }
+ rgw::sal::Store* get_store() { return store; }
RGWLibFrontend* get_fe() { return fe; }
return user_info;
}
- int set_uid(rgw::sal::RGWStore* store, const rgw_user& uid);
+ int set_uid(rgw::sal::Store* store, const rgw_user& uid);
int write_data(const char *buf, int len);
int read_data(char *buf, int len);
RGWHandler_Lib() {}
~RGWHandler_Lib() override {}
- static int init_from_header(rgw::sal::RGWStore *store,
+ static int init_from_header(rgw::sal::Store *store,
struct req_state *s);
}; /* RGWHandler_Lib */
class RGWLibRequest : public RGWRequest,
public RGWHandler_Lib {
private:
- std::unique_ptr<rgw::sal::RGWUser> tuser; // Don't use this. It's empty except during init.
+ std::unique_ptr<rgw::sal::User> tuser; // Don't use this. It's empty except during init.
public:
CephContext* cct;
/* unambiguiously return req_state */
inline struct req_state* get_state() { return this->RGWRequest::s; }
- RGWLibRequest(CephContext* _cct, std::unique_ptr<rgw::sal::RGWUser> _user)
+ RGWLibRequest(CephContext* _cct, std::unique_ptr<rgw::sal::User> _user)
: RGWRequest(rgwlib.get_store()->get_new_req_id()),
tuser(std::move(_user)), cct(_cct)
{}
public:
RGWLibContinuedReq(CephContext* _cct,
- std::unique_ptr<rgw::sal::RGWUser> _user)
+ std::unique_ptr<rgw::sal::User> _user)
: RGWLibRequest(_cct, std::move(_user)), io_ctx(),
rstate(_cct, &io_ctx.get_env(), id),
rados_ctx(rgwlib.get_store(), &rstate)
<< get_state()->trans_id.c_str() << dendl;
}
- inline rgw::sal::RGWStore* get_store() { return store; }
+ inline rgw::sal::Store* get_store() { return store; }
inline RGWLibIO& get_io() { return io_ctx; }
inline RGWObjectCtx& get_octx() { return rados_ctx; }
/* usage logger */
class UsageLogger {
CephContext *cct;
- rgw::sal::RGWStore *store;
+ rgw::sal::Store *store;
map<rgw_user_bucket, RGWUsageBatch> usage_map;
ceph::mutex lock = ceph::make_mutex("UsageLogger");
int32_t num_entries;
}
public:
- UsageLogger(CephContext *_cct, rgw::sal::RGWStore *_store) : cct(_cct), store(_store), num_entries(0), timer(cct, timer_lock) {
+ UsageLogger(CephContext *_cct, rgw::sal::Store *_store) : cct(_cct), store(_store), num_entries(0), timer(cct, timer_lock) {
timer.init();
std::lock_guard l{timer_lock};
set_timer();
static UsageLogger *usage_logger = NULL;
-void rgw_log_usage_init(CephContext *cct, rgw::sal::RGWStore *store)
+void rgw_log_usage_init(CephContext *cct, rgw::sal::Store *store)
{
usage_logger = new UsageLogger(cct, store);
}
if (!bucket_name.empty()) {
bucket_name = s->bucket_name;
user = s->bucket_owner.get_id();
- if (!rgw::sal::RGWBucket::empty(s->bucket.get()) &&
+ if (!rgw::sal::Bucket::empty(s->bucket.get()) &&
s->bucket->get_info().requester_pays) {
payer = s->user->get_id();
}
append_output(bl);
}
-int rgw_log_op(rgw::sal::RGWStore *store, RGWREST* const rest, struct req_state *s,
+int rgw_log_op(rgw::sal::Store *store, RGWREST* const rest, struct req_state *s,
const string& op_name, OpsLogSocket *olog)
{
struct rgw_log_entry entry;
ldout(s->cct, 5) << "nothing to log for operation" << dendl;
return -EINVAL;
}
- if (s->err.ret == -ERR_NO_SUCH_BUCKET || rgw::sal::RGWBucket::empty(s->bucket.get())) {
+ if (s->err.ret == -ERR_NO_SUCH_BUCKET || rgw::sal::Bucket::empty(s->bucket.get())) {
if (!s->cct->_conf->rgw_log_nonexistent_bucket) {
ldout(s->cct, 5) << "bucket " << s->bucket_name << " doesn't exist, not logging" << dendl;
return 0;
return 0;
}
- if (!rgw::sal::RGWObject::empty(s->object.get())) {
+ if (!rgw::sal::Object::empty(s->object.get())) {
entry.obj = s->object->get_key();
} else {
entry.obj = rgw_obj_key("-");
#include "common/OutputDataSocket.h"
namespace rgw { namespace sal {
- class RGWStore;
+ class Store;
} }
struct rgw_log_entry {
class RGWREST;
-int rgw_log_op(rgw::sal::RGWStore* store, RGWREST* const rest, struct req_state* s,
+int rgw_log_op(rgw::sal::Store* store, RGWREST* const rest, struct req_state* s,
const string& op_name, OpsLogSocket* olog);
-void rgw_log_usage_init(CephContext* cct, rgw::sal::RGWStore* store);
+void rgw_log_usage_init(CephContext* cct, rgw::sal::Store* store);
void rgw_log_usage_finalize();
void rgw_format_ops_log_entry(struct rgw_log_entry& entry,
ceph::Formatter *formatter);
}
-int read_script(const DoutPrefixProvider *dpp, rgw::sal::RGWStore* store, const std::string& tenant, optional_yield y, context ctx, std::string& script)
+int read_script(const DoutPrefixProvider *dpp, rgw::sal::Store* store, const std::string& tenant, optional_yield y, context ctx, std::string& script)
{
RGWObjVersionTracker objv_tracker;
return 0;
}
-int write_script(rgw::sal::RGWStore* store, const std::string& tenant, optional_yield y, context ctx, const std::string& script)
+int write_script(rgw::sal::Store* store, const std::string& tenant, optional_yield y, context ctx, const std::string& script)
{
RGWObjVersionTracker objv_tracker;
return 0;
}
-int delete_script(rgw::sal::RGWStore* store, const std::string& tenant, optional_yield y, context ctx)
+int delete_script(rgw::sal::Store* store, const std::string& tenant, optional_yield y, context ctx)
{
RGWObjVersionTracker objv_tracker;
namespace bp = boost::process;
-int add_package(rgw::sal::RGWStore* store, optional_yield y, const std::string& package_name, bool allow_compilation) {
+int add_package(rgw::sal::Store* store, optional_yield y, const std::string& package_name, bool allow_compilation) {
// verify that luarocks can load this oackage
const auto p = bp::search_path("luarocks");
if (p.empty()) {
std::map<std::string, bufferlist> new_package{{package_name, empty_bl}};
librados::ObjectWriteOperation op;
op.omap_set(new_package);
- ret = rgw_rados_operate(*(static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->get_lc_pool_ctx()),
+ ret = rgw_rados_operate(*(static_cast<rgw::sal::RadosStore*>(store)->getRados()->get_lc_pool_ctx()),
PACKAGE_LIST_OBJECT_NAME, &op, y);
if (ret < 0) {
return 0;
}
-int remove_package(rgw::sal::RGWStore* store, optional_yield y, const std::string& package_name) {
+int remove_package(rgw::sal::Store* store, optional_yield y, const std::string& package_name) {
librados::ObjectWriteOperation op;
op.omap_rm_keys(std::set<std::string>({package_name}));
- const auto ret = rgw_rados_operate(*(static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->get_lc_pool_ctx()),
+ const auto ret = rgw_rados_operate(*(static_cast<rgw::sal::RadosStore*>(store)->getRados()->get_lc_pool_ctx()),
PACKAGE_LIST_OBJECT_NAME, &op, y);
if (ret < 0) {
return 0;
}
-int list_packages(rgw::sal::RGWStore* store, optional_yield y, packages_t& packages) {
+int list_packages(rgw::sal::Store* store, optional_yield y, packages_t& packages) {
constexpr auto max_chunk = 1024U;
std::string start_after;
bool more = true;
librados::ObjectReadOperation op;
packages_t packages_chunk;
op.omap_get_keys2(start_after, max_chunk, &packages_chunk, &more, &rval);
- const auto ret = rgw_rados_operate(*(static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->get_lc_pool_ctx()),
+ const auto ret = rgw_rados_operate(*(static_cast<rgw::sal::RadosStore*>(store)->getRados()->get_lc_pool_ctx()),
PACKAGE_LIST_OBJECT_NAME, &op, nullptr, y);
if (ret < 0) {
return 0;
}
-int install_packages(rgw::sal::RGWStore* store, optional_yield y, packages_t& failed_packages, std::string& output) {
+int install_packages(rgw::sal::Store* store, optional_yield y, packages_t& failed_packages, std::string& output) {
// luarocks directory cleanup
boost::system::error_code ec;
const auto& luarocks_path = store->get_luarocks_path();
class lua_State;
class rgw_user;
namespace rgw::sal {
- class RGWStore;
+ class Store;
}
namespace rgw::lua {
bool verify(const std::string& script, std::string& err_msg);
// store a lua script in a context
-int write_script(rgw::sal::RGWStore* store, const std::string& tenant, optional_yield y, context ctx, const std::string& script);
+int write_script(rgw::sal::Store* store, const std::string& tenant, optional_yield y, context ctx, const std::string& script);
// read the stored lua script from a context
-int read_script(const DoutPrefixProvider *dpp, rgw::sal::RGWStore* store, const std::string& tenant, optional_yield y, context ctx, std::string& script);
+int read_script(const DoutPrefixProvider *dpp, rgw::sal::Store* store, const std::string& tenant, optional_yield y, context ctx, std::string& script);
// delete the stored lua script from a context
-int delete_script(rgw::sal::RGWStore* store, const std::string& tenant, optional_yield y, context ctx);
+int delete_script(rgw::sal::Store* store, const std::string& tenant, optional_yield y, context ctx);
#ifdef WITH_RADOSGW_LUA_PACKAGES
#include <set>
using packages_t = std::set<std::string>;
// add a lua package to the allowlist
-int add_package(rgw::sal::RGWStore* store, optional_yield y, const std::string& package_name, bool allow_compilation);
+int add_package(rgw::sal::Store* store, optional_yield y, const std::string& package_name, bool allow_compilation);
// remove a lua package from the allowlist
-int remove_package(rgw::sal::RGWStore* store, optional_yield y, const std::string& package_name);
+int remove_package(rgw::sal::Store* store, optional_yield y, const std::string& package_name);
// list lua packages in the allowlist
-int list_packages(rgw::sal::RGWStore* store, optional_yield y, packages_t& packages);
+int list_packages(rgw::sal::Store* store, optional_yield y, packages_t& packages);
// install all packages from the allowlist
// return the list of packages that failed to install and the output of the install command
-int install_packages(rgw::sal::RGWStore* store, optional_yield y, packages_t& failed_packages, std::string& output);
+int install_packages(rgw::sal::Store* store, optional_yield y, packages_t& failed_packages, std::string& output);
#endif
}
int RequestLog(lua_State* L)
{
- const auto store = reinterpret_cast<rgw::sal::RGWRadosStore*>(lua_touserdata(L, lua_upvalueindex(1)));
+ const auto store = reinterpret_cast<rgw::sal::RadosStore*>(lua_touserdata(L, lua_upvalueindex(1)));
const auto rest = reinterpret_cast<RGWREST*>(lua_touserdata(L, lua_upvalueindex(2)));
const auto olog = reinterpret_cast<OpsLogSocket*>(lua_touserdata(L, lua_upvalueindex(3)));
const auto s = reinterpret_cast<req_state*>(lua_touserdata(L, lua_upvalueindex(4)));
static std::string TableName() {return "Bucket";}
static std::string Name() {return TableName() + "Meta";}
- using Type = rgw::sal::RGWBucket;
+ using Type = rgw::sal::Bucket;
static int IndexClosure(lua_State* L) {
const auto bucket = reinterpret_cast<Type*>(lua_touserdata(L, lua_upvalueindex(1)));
static const std::string TableName() {return "Object";}
static std::string Name() {return TableName() + "Meta";}
- using Type = rgw::sal::RGWObject;
+ using Type = rgw::sal::Object;
static int IndexClosure(lua_State* L) {
const auto obj = reinterpret_cast<const Type*>(lua_touserdata(L, lua_upvalueindex(1)));
};
int execute(
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
RGWREST* rest,
OpsLogSocket* olog,
req_state* s,
class RGWREST;
class OpsLogSocket;
namespace rgw::sal {
- class RGWStore;
+ class Store;
}
namespace rgw::lua::request {
// execute a lua script in the Request context
int execute(
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
RGWREST* rest,
OpsLogSocket* olog,
req_state *s,
return mgr;
}
-static RGWRESTMgr *rest_filter(rgw::sal::RGWStore* store, int dialect, RGWRESTMgr *orig)
+static RGWRESTMgr *rest_filter(rgw::sal::Store* store, int dialect, RGWRESTMgr *orig)
{
RGWSyncModuleInstanceRef sync_module = store->get_sync_module();
if (sync_module) {
#endif
const DoutPrefix dp(cct.get(), dout_subsys, "rgw main: ");
- rgw::sal::RGWStore *store =
- RGWStoreManager::get_storage(&dp, g_ceph_context,
+ rgw::sal::Store *store =
+ StoreManager::get_storage(&dp, g_ceph_context,
"rados",
g_conf()->rgw_enable_gc_threads,
g_conf()->rgw_enable_lc_threads,
delete olog;
- RGWStoreManager::close_storage(store);
+ StoreManager::close_storage(store);
rgw::auth::s3::LDAPEngine::shutdown();
rgw_tools_cleanup();
rgw_shutdown_resolver();
namespace rgw { namespace sal {
-class RGWStore;
+class Store;
} }
class RGWCoroutine;
class JSONObj;
(strncmp(uid, MULTIPART_UPLOAD_ID_PREFIX_LEGACY, sizeof(MULTIPART_UPLOAD_ID_PREFIX_LEGACY) - 1) == 0);
}
-int list_multipart_parts(rgw::sal::RGWBucket* bucket,
+int list_multipart_parts(rgw::sal::Bucket* bucket,
CephContext *cct,
const string& upload_id,
const string& meta_oid, int num_parts,
map<string, bufferlist> parts_map;
map<string, bufferlist>::iterator iter;
- std::unique_ptr<rgw::sal::RGWObject> obj = bucket->get_object(
+ std::unique_ptr<rgw::sal::Object> obj = bucket->get_object(
rgw_obj_key(meta_oid, std::string(), RGW_OBJ_NS_MULTIPART));
obj->set_in_extra_data(true);
}
int abort_multipart_upload(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store, CephContext *cct,
- RGWObjectCtx *obj_ctx, rgw::sal::RGWBucket* bucket,
+ rgw::sal::Store *store, CephContext *cct,
+ RGWObjectCtx *obj_ctx, rgw::sal::Bucket* bucket,
RGWMPObj& mp_obj)
{
- std::unique_ptr<rgw::sal::RGWObject> meta_obj = bucket->get_object(
+ std::unique_ptr<rgw::sal::Object> meta_obj = bucket->get_object(
rgw_obj_key(mp_obj.get_meta(), std::string(), RGW_OBJ_NS_MULTIPART));
meta_obj->set_in_extra_data(true);
meta_obj->set_hash_source(mp_obj.get_key());
RGWUploadPartInfo& obj_part = obj_iter->second;
if (obj_part.manifest.empty()) {
string oid = mp_obj.get_part(obj_iter->second.num);
- std::unique_ptr<rgw::sal::RGWObject> obj = bucket->get_object(
+ std::unique_ptr<rgw::sal::Object> obj = bucket->get_object(
rgw_obj_key(oid, std::string(), RGW_OBJ_NS_MULTIPART));
obj->set_hash_source(mp_obj.get_key());
ret = obj->delete_object(dpp, obj_ctx, null_yield);
chain->update(&obj_part.manifest);
RGWObjManifest::obj_iterator oiter = obj_part.manifest.obj_begin();
if (oiter != obj_part.manifest.obj_end()) {
- std::unique_ptr<rgw::sal::RGWObject> head = bucket->get_object(rgw_obj_key());
+ std::unique_ptr<rgw::sal::Object> head = bucket->get_object(rgw_obj_key());
rgw_raw_obj raw_head = oiter.get_location().get_raw_obj(store);
head->raw_obj_to_obj(raw_head);
chain->delete_inline(mp_obj.get_upload_id());
}
- std::unique_ptr<rgw::sal::RGWObject::DeleteOp> del_op = meta_obj->get_delete_op(obj_ctx);
+ std::unique_ptr<rgw::sal::Object::DeleteOp> del_op = meta_obj->get_delete_op(obj_ctx);
del_op->params.bucket_owner = bucket->get_acl_owner();
del_op->params.versioning_status = 0;
if (!remove_objs.empty()) {
}
int list_bucket_multiparts(const DoutPrefixProvider *dpp,
- rgw::sal::RGWBucket* bucket,
+ rgw::sal::Bucket* bucket,
const string& prefix, const string& marker,
const string& delim,
const int& max_uploads,
vector<rgw_bucket_dir_entry> *objs,
map<string, bool> *common_prefixes, bool *is_truncated)
{
- rgw::sal::RGWBucket::ListParams params;
- rgw::sal::RGWBucket::ListResults results;
+ rgw::sal::Bucket::ListParams params;
+ rgw::sal::Bucket::ListResults results;
MultipartMetaFilter mp_filter;
params.prefix = prefix;
}
int abort_bucket_multiparts(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store, CephContext *cct,
- rgw::sal::RGWBucket* bucket, string& prefix, string& delim)
+ rgw::sal::Store *store, CephContext *cct,
+ rgw::sal::Bucket* bucket, string& prefix, string& delim)
{
constexpr int max = 1000;
int ret, num_deleted = 0;
#include "rgw_compression_types.h"
namespace rgw { namespace sal {
- class RGWStore;
+ class Store;
} }
#define MULTIPART_UPLOAD_ID_PREFIX_LEGACY "2/"
extern bool is_v2_upload_id(const string& upload_id);
-extern int list_multipart_parts(rgw::sal::RGWBucket* bucket,
+extern int list_multipart_parts(rgw::sal::Bucket* bucket,
CephContext *cct,
const string& upload_id,
const string& meta_oid, int num_parts,
int *next_marker, bool *truncated,
bool assume_unsorted = false);
-extern int abort_multipart_upload(const DoutPrefixProvider *dpp, rgw::sal::RGWStore *store,
+extern int abort_multipart_upload(const DoutPrefixProvider *dpp, rgw::sal::Store *store,
CephContext *cct, RGWObjectCtx *obj_ctx,
- rgw::sal::RGWBucket* bucket, RGWMPObj& mp_obj);
+ rgw::sal::Bucket* bucket, RGWMPObj& mp_obj);
extern int list_bucket_multiparts(const DoutPrefixProvider *dpp,
- rgw::sal::RGWBucket* bucket,
+ rgw::sal::Bucket* bucket,
const string& prefix,
const string& marker,
const string& delim,
map<string, bool> *common_prefixes, bool *is_truncated);
extern int abort_bucket_multiparts(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store, CephContext *cct,
- rgw::sal::RGWBucket* bucket,
+ rgw::sal::Store *store, CephContext *cct,
+ rgw::sal::Bucket* bucket,
string& prefix, string& delim);
#endif
Manager(CephContext* _cct, uint32_t _max_queue_size, uint32_t _queues_update_period_ms,
uint32_t _queues_update_retry_ms, uint32_t _queue_idle_sleep_us, u_int32_t failover_time_ms,
uint32_t _stale_reservations_period_s, uint32_t _reservations_cleanup_period_s,
- uint32_t _worker_count, rgw::sal::RGWRadosStore* store) :
+ uint32_t _worker_count, rgw::sal::RadosStore* store) :
max_queue_size(_max_queue_size),
queues_update_period_ms(_queues_update_period_ms),
queues_update_retry_ms(_queues_update_retry_ms),
constexpr uint32_t STALE_RESERVATIONS_PERIOD_S = 120; // cleanup reservations that are more than 2 minutes old
constexpr uint32_t RESERVATIONS_CLEANUP_PERIOD_S = 30; // reservation cleanup every 30 seconds
-bool init(CephContext* cct, rgw::sal::RGWRadosStore* store, const DoutPrefixProvider *dpp) {
+bool init(CephContext* cct, rgw::sal::RadosStore* store, const DoutPrefixProvider *dpp) {
if (s_manager) {
return false;
}
return s_manager->remove_persistent_topic(topic_name, y);
}
-rgw::sal::RGWObject* get_object_with_atttributes(const req_state* s, rgw::sal::RGWObject* obj) {
+rgw::sal::Object* get_object_with_atttributes(const req_state* s, rgw::sal::Object* obj) {
// in case of copy obj, the tags and metadata are taken from source
const auto src_obj = s->src_object ? s->src_object.get() : obj;
if (src_obj->get_attrs().empty()) {
return src_obj;
}
-void metadata_from_attributes(const req_state* s, rgw::sal::RGWObject* obj, KeyValueMap& metadata) {
+void metadata_from_attributes(const req_state* s, rgw::sal::Object* obj, KeyValueMap& metadata) {
const auto src_obj = get_object_with_atttributes(s, obj);
if (!src_obj) {
return;
}
}
-void tags_from_attributes(const req_state* s, rgw::sal::RGWObject* obj, KeyValueMap& tags) {
+void tags_from_attributes(const req_state* s, rgw::sal::Object* obj, KeyValueMap& tags) {
const auto src_obj = get_object_with_atttributes(s, obj);
if (!src_obj) {
return;
// populate event from request
void populate_event_from_request(const req_state *s,
- rgw::sal::RGWObject* obj,
+ rgw::sal::Object* obj,
uint64_t size,
const ceph::real_time& mtime,
const std::string& etag,
// opaque data will be filled from topic configuration
}
-bool notification_match(const rgw_pubsub_topic_filter& filter, const req_state* s, rgw::sal::RGWObject* obj,
+bool notification_match(const rgw_pubsub_topic_filter& filter, const req_state* s, rgw::sal::Object* obj,
EventType event, const RGWObjTags* req_tags) {
if (!match(filter.events, event)) {
return false;
return 0;
}
-int publish_commit(rgw::sal::RGWObject* obj,
+int publish_commit(rgw::sal::Object* obj,
uint64_t size,
const ceph::real_time& mtime,
const std::string& etag,
// forward declarations
namespace rgw::sal {
- class RGWRadosStore;
+ class RadosStore;
class RGWObject;
}
// initialize the notification manager
// notification manager is dequeing the 2-phase-commit queues
// and send the notifications to the endpoints
-bool init(CephContext* cct, rgw::sal::RGWRadosStore* store, const DoutPrefixProvider *dpp);
+bool init(CephContext* cct, rgw::sal::RadosStore* store, const DoutPrefixProvider *dpp);
// shutdown the notification manager
void shutdown();
};
std::vector<topic_t> topics;
- rgw::sal::RGWRadosStore* const store;
+ rgw::sal::RadosStore* const store;
const req_state* const s;
size_t size;
- rgw::sal::RGWObject* const object;
+ rgw::sal::Object* const object;
- reservation_t(rgw::sal::RGWRadosStore* _store, const req_state* _s, rgw::sal::RGWObject* _object) :
+ reservation_t(rgw::sal::RadosStore* _store, const req_state* _s, rgw::sal::Object* _object) :
store(_store), s(_s), object(_object) {}
// dtor doing resource leak guarding
const RGWObjTags* req_tags);
// commit the reservation to the queue
-int publish_commit(rgw::sal::RGWObject* obj,
+int publish_commit(rgw::sal::Object* obj,
uint64_t size,
const ceph::real_time& mtime,
const std::string& etag,
}
rgw_raw_obj get_raw_obj(const RGWZoneGroup& zonegroup, const RGWZoneParams& zone_params) const;
- rgw_raw_obj get_raw_obj(rgw::sal::RGWStore* store) const;
+ rgw_raw_obj get_raw_obj(rgw::sal::Store* store) const;
rgw_obj_select& operator=(const rgw_obj& rhs) {
obj = rhs;
int create_next(uint64_t ofs);
rgw_raw_obj get_cur_obj(RGWZoneGroup& zonegroup, RGWZoneParams& zone_params) { return cur_obj.get_raw_obj(zonegroup, zone_params); }
- rgw_raw_obj get_cur_obj(rgw::sal::RGWStore* store) const { return cur_obj.get_raw_obj(store); }
+ rgw_raw_obj get_cur_obj(rgw::sal::Store* store) const { return cur_obj.get_raw_obj(store); }
/* total max size of current stripe (including head obj) */
uint64_t cur_stripe_max_size() const {
#define dout_subsys ceph_subsys_rgw
-static rgw::sal::RGWStore *store = NULL;
+static rgw::sal::Store *store = NULL;
class StoreDestructor {
- rgw::sal::RGWStore *store;
+ rgw::sal::Store *store;
public:
- explicit StoreDestructor(rgw::sal::RGWStore *_s) : store(_s) {}
+ explicit StoreDestructor(rgw::sal::Store *_s) : store(_s) {}
~StoreDestructor() {
if (store) {
- RGWStoreManager::close_storage(store);
+ StoreManager::close_storage(store);
}
}
};
common_init_finish(g_ceph_context);
const DoutPrefix dp(cct.get(), dout_subsys, "rgw object expirer: ");
- store = RGWStoreManager::get_storage(&dp, g_ceph_context, "rados", false, false, false, false, false);
+ store = StoreManager::get_storage(&dp, g_ceph_context, "rados", false, false, false, false, false);
if (!store) {
std::cerr << "couldn't init storage provider" << std::endl;
return EIO;
int RGWObjectExpirer::garbage_single_object(const DoutPrefixProvider *dpp, objexp_hint_entry& hint)
{
RGWBucketInfo bucket_info;
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
int ret = store->get_bucket(dpp, nullptr, rgw_bucket(hint.tenant, hint.bucket_name, hint.bucket_id), &bucket, null_yield);
if (-ENOENT == ret) {
key.instance = "null";
}
- std::unique_ptr<rgw::sal::RGWObject> obj = bucket->get_object(key);
+ std::unique_ptr<rgw::sal::Object> obj = bucket->get_object(key);
obj->set_atomic(&rctx);
ret = obj->delete_object(dpp, &rctx, null_yield);
utime_t time(max_secs, 0);
l.set_duration(time);
- int ret = l.lock_exclusive(&static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->objexp_pool_ctx, shard);
+ int ret = l.lock_exclusive(&static_cast<rgw::sal::RadosStore*>(store)->getRados()->objexp_pool_ctx, shard);
if (ret == -EBUSY) { /* already locked by another processor */
ldpp_dout(dpp, 5) << __func__ << "(): failed to acquire lock on " << shard << dendl;
return false;
marker = out_marker;
} while (truncated);
- l.unlock(&static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->objexp_pool_ctx, shard);
+ l.unlock(&static_cast<rgw::sal::RadosStore*>(store)->getRados()->objexp_pool_ctx, shard);
return done;
}
class RGWObjectExpirer {
protected:
- rgw::sal::RGWStore *store;
+ rgw::sal::Store *store;
RGWObjExpStore exp_store;
class OEWorker : public Thread, public DoutPrefixProvider {
std::atomic<bool> down_flag = { false };
public:
- explicit RGWObjectExpirer(rgw::sal::RGWStore *_store)
+ explicit RGWObjectExpirer(rgw::sal::Store *_store)
: store(_store),
- exp_store(_store->ctx(), static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->rados, store->get_zone()),
+ exp_store(_store->ctx(), static_cast<rgw::sal::RadosStore*>(store)->svc()->rados, store->get_zone()),
worker(NULL) {
}
~RGWObjectExpirer() {
}
int RGWOIDCProvider::get_providers(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
const string& tenant,
vector<RGWOIDCProvider>& providers)
{
static constexpr int MAX_OIDC_URL_LEN = 255;
CephContext *cct;
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
string id;
string provider_url;
string arn;
public:
RGWOIDCProvider(CephContext *cct,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
string provider_url,
string tenant,
vector<string> client_ids,
}
RGWOIDCProvider(CephContext *cct,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
string arn,
string tenant)
: cct(cct),
}
RGWOIDCProvider(CephContext *cct,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
string tenant)
: cct(cct),
store(store),
tenant(std::move(tenant)) {}
RGWOIDCProvider(CephContext *cct,
- rgw::sal::RGWStore* store)
+ rgw::sal::Store* store)
: cct(cct),
store(store) {}
static const string& get_url_oid_prefix();
static int get_providers(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
const string& tenant,
vector<RGWOIDCProvider>& providers);
};
*/
int rgw_op_get_bucket_policy_from_attr(const DoutPrefixProvider *dpp,
CephContext *cct,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWBucketInfo& bucket_info,
map<string, bufferlist>& bucket_attrs,
RGWAccessControlPolicy *policy,
return ret;
} else {
ldpp_dout(dpp, 0) << "WARNING: couldn't find acl header for bucket, generating default" << dendl;
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(bucket_info.owner);
+ std::unique_ptr<rgw::sal::User> user = store->get_user(bucket_info.owner);
/* object exists, but policy is broken */
int r = user->load_by_id(dpp, y);
if (r < 0)
static int get_obj_policy_from_attr(const DoutPrefixProvider *dpp,
CephContext *cct,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWObjectCtx& obj_ctx,
RGWBucketInfo& bucket_info,
map<string, bufferlist>& bucket_attrs,
RGWAccessControlPolicy *policy,
string *storage_class,
- rgw::sal::RGWObject* obj,
+ rgw::sal::Object* obj,
optional_yield y)
{
bufferlist bl;
int ret = 0;
- std::unique_ptr<rgw::sal::RGWObject::ReadOp> rop = obj->get_read_op(&obj_ctx);
+ std::unique_ptr<rgw::sal::Object::ReadOp> rop = obj->get_read_op(&obj_ctx);
ret = rop->get_attr(dpp, RGW_ATTR_ACL, bl, y);
if (ret >= 0) {
} else if (ret == -ENODATA) {
/* object exists, but policy is broken */
ldpp_dout(dpp, 0) << "WARNING: couldn't find acl header for object, generating default" << dendl;
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(bucket_info.owner);
+ std::unique_ptr<rgw::sal::User> user = store->get_user(bucket_info.owner);
ret = user->load_by_id(dpp, y);
if (ret < 0)
return ret;
static int get_obj_head(const DoutPrefixProvider *dpp,
struct req_state *s,
- rgw::sal::RGWObject* obj,
+ rgw::sal::Object* obj,
bufferlist *pbl)
{
- std::unique_ptr<rgw::sal::RGWObject::ReadOp> read_op = obj->get_read_op(s->obj_ctx);
+ std::unique_ptr<rgw::sal::Object::ReadOp> read_op = obj->get_read_op(s->obj_ctx);
obj->set_prefetch_data(s->obj_ctx);
int ret = read_op->prepare(s->yield, dpp);
WRITE_CLASS_ENCODER(multipart_upload_info)
static int get_multipart_info(const DoutPrefixProvider *dpp, struct req_state *s,
- rgw::sal::RGWObject* obj,
+ rgw::sal::Object* obj,
multipart_upload_info *upload_info)
{
bufferlist header;
map<string, bufferlist>::iterator iter;
bufferlist header;
- std::unique_ptr<rgw::sal::RGWObject> meta_obj;
+ std::unique_ptr<rgw::sal::Object> meta_obj;
meta_obj = s->bucket->get_object(rgw_obj_key(meta_oid, string(), mp_ns));
meta_obj->set_in_extra_data(true);
}
static int read_bucket_policy(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
struct req_state *s,
RGWBucketInfo& bucket_info,
map<string, bufferlist>& bucket_attrs,
}
static int read_obj_policy(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
struct req_state *s,
RGWBucketInfo& bucket_info,
map<string, bufferlist>& bucket_attrs,
RGWAccessControlPolicy* acl,
string *storage_class,
boost::optional<Policy>& policy,
- rgw::sal::RGWBucket* bucket,
- rgw::sal::RGWObject* object,
+ rgw::sal::Bucket* bucket,
+ rgw::sal::Object* object,
optional_yield y,
bool copy_src=false)
{
string upload_id;
upload_id = s->info.args.get("uploadId");
- std::unique_ptr<rgw::sal::RGWObject> mpobj;
+ std::unique_ptr<rgw::sal::Object> mpobj;
rgw_obj obj;
if (!s->system_request && bucket_info.flags & BUCKET_SUSPENDED) {
* only_bucket: If true, reads the user and bucket ACLs rather than the object ACL.
* Returns: 0 on success, -ERR# otherwise.
*/
-int rgw_build_bucket_policies(const DoutPrefixProvider *dpp, rgw::sal::RGWStore* store, struct req_state* s, optional_yield y)
+int rgw_build_bucket_policies(const DoutPrefixProvider *dpp, rgw::sal::Store* store, struct req_state* s, optional_yield y)
{
int ret = 0;
/* check if copy source is within the current domain */
if (!s->src_bucket_name.empty()) {
- std::unique_ptr<rgw::sal::RGWBucket> src_bucket;
+ std::unique_ptr<rgw::sal::Bucket> src_bucket;
ret = store->get_bucket(dpp, nullptr,
rgw_bucket(s->src_tenant_name,
s->src_bucket_name,
/* If op is get bucket location, don't redirect */
} else if (!s->local_source ||
(s->op != OP_PUT && s->op != OP_COPY) ||
- rgw::sal::RGWObject::empty(s->object.get())) {
+ rgw::sal::Object::empty(s->object.get())) {
return -ERR_PERMANENT_REDIRECT;
}
}
/* handle user ACL only for those APIs which support it */
if (s->user_acl) {
- rgw::sal::RGWAttrs uattrs;
- std::unique_ptr<rgw::sal::RGWUser> acl_user = store->get_user(acct_acl_user.uid);
+ rgw::sal::Attrs uattrs;
+ std::unique_ptr<rgw::sal::User> acl_user = store->get_user(acct_acl_user.uid);
ret = acl_user->read_attrs(dpp, y, &uattrs);
if (!ret) {
// hence the check for user type
if (! s->user->get_id().empty() && s->auth.identity->get_identity_type() != TYPE_ROLE) {
try {
- rgw::sal::RGWAttrs uattrs;
+ rgw::sal::Attrs uattrs;
ret = s->user->read_attrs(dpp, y, &uattrs);
if (ret == 0) {
auto user_policies = get_iam_user_policy_from_attr(s->cct, uattrs, s->user->get_tenant());
* only_bucket: If true, reads the bucket ACL rather than the object ACL.
* Returns: 0 on success, -ERR# otherwise.
*/
-int rgw_build_object_policies(const DoutPrefixProvider *dpp, rgw::sal::RGWStore *store,
+int rgw_build_object_policies(const DoutPrefixProvider *dpp, rgw::sal::Store *store,
struct req_state *s, bool prefetch_data, optional_yield y)
{
int ret = 0;
- if (!rgw::sal::RGWObject::empty(s->object.get())) {
+ if (!rgw::sal::Object::empty(s->object.get())) {
if (!s->bucket_exists) {
return -ERR_NO_SUCH_BUCKET;
}
return 0;
}
-static int rgw_iam_add_existing_objtags(const DoutPrefixProvider *dpp, rgw::sal::RGWStore* store, struct req_state* s, std::uint64_t action) {
+static int rgw_iam_add_existing_objtags(const DoutPrefixProvider *dpp, rgw::sal::Store* store, struct req_state* s, std::uint64_t action) {
s->object->set_atomic(s->obj_ctx);
int op_ret = s->object->get_obj_attrs(s->obj_ctx, s->yield, dpp);
if (op_ret < 0)
return op_ret;
- rgw::sal::RGWAttrs attrs = s->object->get_attrs();
+ rgw::sal::Attrs attrs = s->object->get_attrs();
auto tags = attrs.find(RGW_ATTR_TAGS);
if (tags != attrs.end()){
return rgw_iam_add_tags_from_bl(s, tags->second);
}
}
-void rgw_build_iam_environment(rgw::sal::RGWStore* store,
+void rgw_build_iam_environment(rgw::sal::Store* store,
struct req_state* s)
{
const auto& m = s->info.env->get_map();
// general, they should just return op_ret.
namespace {
template<typename F>
-int retry_raced_bucket_write(const DoutPrefixProvider *dpp, rgw::sal::RGWBucket* b, const F& f) {
+int retry_raced_bucket_write(const DoutPrefixProvider *dpp, rgw::sal::Bucket* b, const F& f) {
auto r = f();
for (auto i = 0u; i < 15u && r == -ECANCELED; ++i) {
r = b->try_refresh_info(dpp, nullptr);
void RGWGetObjTags::execute(optional_yield y)
{
- rgw::sal::RGWAttrs attrs;
+ rgw::sal::Attrs attrs;
s->object->set_atomic(s->obj_ctx);
if (op_ret < 0)
return;
- if (rgw::sal::RGWObject::empty(s->object.get())){
+ if (rgw::sal::Object::empty(s->object.get())){
op_ret= -EINVAL; // we only support tagging on existing objects
return;
}
int RGWDeleteObjTags::verify_permission(optional_yield y)
{
- if (!rgw::sal::RGWObject::empty(s->object.get())) {
+ if (!rgw::sal::Object::empty(s->object.get())) {
auto iam_action = s->object->get_instance().empty() ?
rgw::IAM::s3DeleteObjectTagging:
rgw::IAM::s3DeleteObjectVersionTagging;
void RGWDeleteObjTags::execute(optional_yield y)
{
- if (rgw::sal::RGWObject::empty(s->object.get()))
+ if (rgw::sal::Object::empty(s->object.get()))
return;
op_ret = s->object->delete_obj_attrs(this, s->obj_ctx, RGW_ATTR_TAGS, y);
}
op_ret = retry_raced_bucket_write(this, s->bucket.get(), [this, y] {
- rgw::sal::RGWAttrs attrs = s->bucket->get_attrs();
+ rgw::sal::Attrs attrs = s->bucket->get_attrs();
attrs[RGW_ATTR_TAGS] = tags_bl;
return s->bucket->set_instance_attrs(this, attrs, y);
});
}
op_ret = retry_raced_bucket_write(this, s->bucket.get(), [this, y] {
- rgw::sal::RGWAttrs attrs = s->bucket->get_attrs();
+ rgw::sal::Attrs attrs = s->bucket->get_attrs();
attrs.erase(RGW_ATTR_TAGS);
op_ret = s->bucket->set_instance_attrs(this, attrs, y);
if (op_ret < 0) {
}
/* only interested in object related ops */
- if (rgw::sal::RGWBucket::empty(s->bucket.get())
- || rgw::sal::RGWObject::empty(s->object.get())) {
+ if (rgw::sal::Bucket::empty(s->bucket.get())
+ || rgw::sal::Object::empty(s->object.get())) {
return 0;
}
- std::unique_ptr<rgw::sal::RGWUser> owner_user =
+ std::unique_ptr<rgw::sal::User> owner_user =
store->get_user(s->bucket->get_info().owner);
- rgw::sal::RGWUser* user;
+ rgw::sal::User* user;
if (s->user->get_id() == s->bucket_owner.get_id()) {
user = s->user.get();
return true;
}
-int RGWGetObj::read_user_manifest_part(rgw::sal::RGWBucket* bucket,
+int RGWGetObj::read_user_manifest_part(rgw::sal::Bucket* bucket,
const rgw_bucket_dir_entry& ent,
RGWAccessControlPolicy * const bucket_acl,
const boost::optional<Policy>& bucket_policy,
int64_t cur_ofs = start_ofs;
int64_t cur_end = end_ofs;
- std::unique_ptr<rgw::sal::RGWObject> part = bucket->get_object(ent.key);
+ std::unique_ptr<rgw::sal::Object> part = bucket->get_object(ent.key);
RGWObjectCtx obj_ctx(store);
RGWAccessControlPolicy obj_policy(s->cct);
part->set_atomic(&obj_ctx);
part->set_prefetch_data(&obj_ctx);
- std::unique_ptr<rgw::sal::RGWObject::ReadOp> read_op = part->get_read_op(&obj_ctx);
+ std::unique_ptr<rgw::sal::Object::ReadOp> read_op = part->get_read_op(&obj_ctx);
if (!swift_slo) {
/* SLO etag is optional */
static int iterate_user_manifest_parts(const DoutPrefixProvider *dpp,
CephContext * const cct,
- rgw::sal::RGWStore* const store,
+ rgw::sal::Store* const store,
const off_t ofs,
const off_t end,
- rgw::sal::RGWBucket* bucket,
+ rgw::sal::Bucket* bucket,
const string& obj_prefix,
RGWAccessControlPolicy * const bucket_acl,
const boost::optional<Policy>& bucket_policy,
uint64_t * const ptotal_len,
uint64_t * const pobj_size,
string * const pobj_sum,
- int (*cb)(rgw::sal::RGWBucket* bucket,
+ int (*cb)(rgw::sal::Bucket* bucket,
const rgw_bucket_dir_entry& ent,
RGWAccessControlPolicy * const bucket_acl,
const boost::optional<Policy>& bucket_policy,
utime_t start_time = ceph_clock_now();
- rgw::sal::RGWBucket::ListParams params;
+ rgw::sal::Bucket::ListParams params;
params.prefix = obj_prefix;
params.delim = delim;
- rgw::sal::RGWBucket::ListResults results;
+ rgw::sal::Bucket::ListResults results;
MD5 etag_sum;
do {
static constexpr auto MAX_LIST_OBJS = 100u;
struct rgw_slo_part {
RGWAccessControlPolicy *bucket_acl = nullptr;
Policy* bucket_policy = nullptr;
- rgw::sal::RGWBucket* bucket;
+ rgw::sal::Bucket* bucket;
string obj_name;
uint64_t size = 0;
string etag;
};
static int iterate_slo_parts(CephContext *cct,
- rgw::sal::RGWStore*store,
+ rgw::sal::Store*store,
off_t ofs,
off_t end,
map<uint64_t, rgw_slo_part>& slo_parts,
- int (*cb)(rgw::sal::RGWBucket* bucket,
+ int (*cb)(rgw::sal::Bucket* bucket,
const rgw_bucket_dir_entry& ent,
RGWAccessControlPolicy *bucket_acl,
const boost::optional<Policy>& bucket_policy,
return 0;
}
-static int get_obj_user_manifest_iterate_cb(rgw::sal::RGWBucket* bucket,
+static int get_obj_user_manifest_iterate_cb(rgw::sal::Bucket* bucket,
const rgw_bucket_dir_entry& ent,
RGWAccessControlPolicy * const bucket_acl,
const boost::optional<Policy>& bucket_policy,
boost::optional<Policy> _bucket_policy;
boost::optional<Policy>* bucket_policy;
RGWBucketInfo bucket_info;
- std::unique_ptr<rgw::sal::RGWBucket> ubucket;
- rgw::sal::RGWBucket *pbucket = NULL;
+ std::unique_ptr<rgw::sal::Bucket> ubucket;
+ rgw::sal::Bucket *pbucket = NULL;
int r = 0;
if (bucket_name.compare(s->bucket->get_name()) != 0) {
vector<RGWAccessControlPolicy> allocated_acls;
map<string, pair<RGWAccessControlPolicy *, boost::optional<Policy>>> policies;
- map<string, std::unique_ptr<rgw::sal::RGWBucket>> buckets;
+ map<string, std::unique_ptr<rgw::sal::Bucket>> buckets;
map<uint64_t, rgw_slo_part> slo_parts;
string bucket_name = path.substr(pos_init, pos_sep - pos_init);
string obj_name = path.substr(pos_sep + 1);
- rgw::sal::RGWBucket* bucket;
+ rgw::sal::Bucket* bucket;
RGWAccessControlPolicy *bucket_acl;
Policy* bucket_policy;
allocated_acls.push_back(RGWAccessControlPolicy(s->cct));
RGWAccessControlPolicy& _bucket_acl = allocated_acls.back();
- std::unique_ptr<rgw::sal::RGWBucket> tmp_bucket;
+ std::unique_ptr<rgw::sal::Bucket> tmp_bucket;
int r = store->get_bucket(this, s->user.get(), s->user->get_tenant(), bucket_name, &tmp_bucket, y);
if (r < 0) {
ldpp_dout(this, 0) << "could not get bucket info for bucket="
perfcounter->inc(l_rgw_get);
- std::unique_ptr<rgw::sal::RGWObject::ReadOp> read_op(s->object->get_read_op(s->obj_ctx));
+ std::unique_ptr<rgw::sal::Object::ReadOp> read_op(s->object->get_read_op(s->obj_ctx));
op_ret = get_params(y);
if (op_ret < 0)
is_truncated = false;
do {
- rgw::sal::RGWBucketList buckets;
+ rgw::sal::BucketList buckets;
uint64_t read_count;
if (limit >= 0) {
read_count = min(limit - total_count, max_buckets);
decltype(policies_stats)::mapped_type());
}
- std::map<std::string, std::unique_ptr<rgw::sal::RGWBucket>>& m = buckets.get_buckets();
+ std::map<std::string, std::unique_ptr<rgw::sal::Bucket>>& m = buckets.get_buckets();
for (const auto& kv : m) {
const auto& bucket = kv.second;
void RGWStatAccount::execute(optional_yield y)
{
string marker;
- rgw::sal::RGWBucketList buckets;
+ rgw::sal::BucketList buckets;
uint64_t max_buckets = s->cct->_conf->rgw_list_buckets_max_chunk;
const string *lastmarker;
decltype(policies_stats)::mapped_type());
}
- std::map<std::string, std::unique_ptr<rgw::sal::RGWBucket>>& m = buckets.get_buckets();
+ std::map<std::string, std::unique_ptr<rgw::sal::Bucket>>& m = buckets.get_buckets();
for (const auto& kv : m) {
const auto& bucket = kv.second;
lastmarker = &kv.first;
} else {
return op_ret;
}
- s->bucket->set_attrs(rgw::sal::RGWAttrs(s->bucket_attrs));
+ s->bucket->set_attrs(rgw::sal::Attrs(s->bucket_attrs));
return s->bucket->put_instance_info(this, false, real_time());
});
op_ret = s->bucket->update_container_stats(s);
}
- rgw::sal::RGWBucket::ListParams params;
+ rgw::sal::Bucket::ListParams params;
params.prefix = prefix;
params.delim = delimiter;
params.marker = marker;
params.allow_unordered = allow_unordered;
params.shard_id = shard_id;
- rgw::sal::RGWBucket::ListResults results;
+ rgw::sal::Bucket::ListResults results;
op_ret = s->bucket->list(this, params, max, results, y);
if (op_ret >= 0) {
}
if (s->user->get_max_buckets()) {
- rgw::sal::RGWBucketList buckets;
+ rgw::sal::BucketList buckets;
string marker;
op_ret = s->user->list_buckets(this, marker, string(), s->user->get_max_buckets(),
false, buckets, y);
return ret;
}
}
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
ret = store->get_bucket(this, s->user.get(), copy_source_tenant_name, copy_source_bucket_name,
&bucket, y);
if (ret < 0) {
RGWAccessControlPolicy cs_acl(s->cct);
boost::optional<Policy> policy;
map<string, bufferlist> cs_attrs;
- std::unique_ptr<rgw::sal::RGWBucket> cs_bucket;
+ std::unique_ptr<rgw::sal::Bucket> cs_bucket;
int ret = store->get_bucket(NULL, copy_source_bucket_info, &cs_bucket);
if (ret < 0)
return ret;
- std::unique_ptr<rgw::sal::RGWObject> cs_object =
+ std::unique_ptr<rgw::sal::Object> cs_object =
cs_bucket->get_object(rgw_obj_key(copy_source_object_name, copy_source_version_id));
cs_object->set_atomic(s->obj_ctx);
new_ofs = fst;
new_end = lst;
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
ret = store->get_bucket(nullptr, copy_source_bucket_info, &bucket);
if (ret < 0)
return ret;
- std::unique_ptr<rgw::sal::RGWObject> obj = bucket->get_object(rgw_obj_key(copy_source_object_name, copy_source_version_id));
- std::unique_ptr<rgw::sal::RGWObject::ReadOp> read_op(obj->get_read_op(s->obj_ctx));
+ std::unique_ptr<rgw::sal::Object> obj = bucket->get_object(rgw_obj_key(copy_source_object_name, copy_source_version_id));
+ std::unique_ptr<rgw::sal::Object::ReadOp> read_op(obj->get_read_op(s->obj_ctx));
ret = read_op->prepare(s->yield, this);
if (ret < 0)
});
op_ret = -EINVAL;
- if (rgw::sal::RGWObject::empty(s->object.get())) {
+ if (rgw::sal::Object::empty(s->object.get())) {
return;
}
}
if ((! copy_source.empty()) && !copy_source_range) {
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
op_ret = store->get_bucket(nullptr, copy_source_bucket_info, &bucket);
if (op_ret < 0) {
ldpp_dout(this, 0) << "ERROR: failed to get bucket with error" << op_ret << dendl;
return;
}
- std::unique_ptr<rgw::sal::RGWObject> obj =
+ std::unique_ptr<rgw::sal::Object> obj =
bucket->get_object(rgw_obj_key(copy_source_object_name, copy_source_version_id));
RGWObjState *astate;
ldpp_dout(this, 15) << "supplied_md5=" << supplied_md5 << dendl;
}
- std::unique_ptr<rgw::sal::RGWObject> obj =
+ std::unique_ptr<rgw::sal::Object> obj =
s->bucket->get_object(rgw_obj_key(get_current_filename()));
if (s->bucket->versioning_enabled()) {
obj->gen_rand_obj_instance_name();
void RGWPutMetadataObject::execute(optional_yield y)
{
rgw_obj target_obj;
- rgw::sal::RGWAttrs attrs, rmattrs;
+ rgw::sal::Attrs attrs, rmattrs;
s->object->set_atomic(s->obj_ctx);
}
s->object->set_bucket(s->bucket.get());
- rgw::sal::RGWAttrs attrs;
+ rgw::sal::Attrs attrs;
bool check_obj_lock = s->object->have_instance() && s->bucket->get_info().obj_lock_enabled();
- if (!rgw::sal::RGWObject::empty(s->object.get())) {
+ if (!rgw::sal::Object::empty(s->object.get())) {
op_ret = s->object->get_obj_attrs(s->obj_ctx, s->yield, this);
if (op_ret < 0) {
if (need_object_expiration() || multipart_delete) {
return;
}
- std::unique_ptr<rgw::sal::RGWObject::DeleteOp> del_op = s->object->get_delete_op(obj_ctx);
+ std::unique_ptr<rgw::sal::Object::DeleteOp> del_op = s->object->get_delete_op(obj_ctx);
del_op->params.obj_owner = s->owner;
del_op->params.bucket_owner = s->bucket_owner;
del_op->params.versioning_status = s->bucket->get_info().versioning_status();
int RGWGetACLs::verify_permission(optional_yield y)
{
bool perm;
- if (!rgw::sal::RGWObject::empty(s->object.get())) {
+ if (!rgw::sal::Object::empty(s->object.get())) {
auto iam_action = s->object->get_instance().empty() ?
rgw::IAM::s3GetObjectAcl :
rgw::IAM::s3GetObjectVersionAcl;
{
stringstream ss;
RGWAccessControlPolicy* const acl = \
- (!rgw::sal::RGWObject::empty(s->object.get()) ? s->object_acl.get() : s->bucket_acl.get());
+ (!rgw::sal::Object::empty(s->object.get()) ? s->object_acl.get() : s->bucket_acl.get());
RGWAccessControlPolicy_S3* const s3policy = \
static_cast<RGWAccessControlPolicy_S3*>(acl);
s3policy->to_xml(ss);
rgw_add_to_iam_environment(s->env, "s3:x-amz-acl", s->canned_acl);
rgw_add_grant_to_iam_environment(s->env, s);
- if (!rgw::sal::RGWObject::empty(s->object.get())) {
+ if (!rgw::sal::Object::empty(s->object.get())) {
auto iam_action = s->object->get_instance().empty() ? rgw::IAM::s3PutObjectAcl : rgw::IAM::s3PutObjectVersionAcl;
op_ret = rgw_iam_add_existing_objtags(this, store, s, iam_action);
perm = verify_object_permission(this, s, iam_action);
RGWAccessControlPolicy* const existing_policy = \
- (rgw::sal::RGWObject::empty(s->object.get()) ? s->bucket_acl.get() : s->object_acl.get());
+ (rgw::sal::Object::empty(s->object.get()) ? s->bucket_acl.get() : s->object_acl.get());
owner = existing_policy->get_owner();
}
// forward bucket acl requests to meta master zone
- if ((rgw::sal::RGWObject::empty(s->object.get()))) {
+ if ((rgw::sal::Object::empty(s->object.get()))) {
bufferlist in_data;
// include acl data unless it was generated from a canned_acl
if (s->canned_acl.empty()) {
new_policy.encode(bl);
map<string, bufferlist> attrs;
- if (!rgw::sal::RGWObject::empty(s->object.get())) {
+ if (!rgw::sal::Object::empty(s->object.get())) {
s->object->set_atomic(s->obj_ctx);
//if instance is empty, we should modify the latest object
op_ret = s->object->modify_obj_attrs(s->obj_ctx, RGW_ATTR_ACL, bl, s->yield, this);
}
op_ret = retry_raced_bucket_write(this, s->bucket.get(), [this] {
- rgw::sal::RGWAttrs attrs(s->bucket_attrs);
+ rgw::sal::Attrs attrs(s->bucket_attrs);
attrs[RGW_ATTR_CORS] = cors_bl;
return s->bucket->set_instance_attrs(this, attrs, s->yield);
});
return op_ret;
}
- rgw::sal::RGWAttrs attrs(s->bucket_attrs);
+ rgw::sal::Attrs attrs(s->bucket_attrs);
attrs.erase(RGW_ATTR_CORS);
op_ret = s->bucket->set_instance_attrs(this, attrs, s->yield);
if (op_ret < 0) {
void RGWInitMultipart::execute(optional_yield y)
{
bufferlist aclbl;
- rgw::sal::RGWAttrs attrs;
+ rgw::sal::Attrs attrs;
if (get_params(y) < 0)
return;
- if (rgw::sal::RGWObject::empty(s->object.get()))
+ if (rgw::sal::Object::empty(s->object.get()))
return;
policy.encode(aclbl);
do {
char buf[33];
- std::unique_ptr<rgw::sal::RGWObject> obj;
+ std::unique_ptr<rgw::sal::Object> obj;
gen_rand_alphanumeric(s->cct, buf, sizeof(buf) - 1);
upload_id = MULTIPART_UPLOAD_ID_PREFIX; /* v2 upload id */
upload_id.append(buf);
obj->set_in_extra_data(true);
obj->set_hash_source(s->object->get_name());
- std::unique_ptr<rgw::sal::RGWObject::WriteOp> obj_op = obj->get_write_op(s->obj_ctx);
+ std::unique_ptr<rgw::sal::Object::WriteOp> obj_op = obj->get_write_op(s->obj_ctx);
obj_op->params.versioning_disabled = true; /* no versioning for multipart meta */
obj_op->params.owner = s->owner;
string meta_oid;
map<uint32_t, RGWUploadPartInfo> obj_parts;
map<uint32_t, RGWUploadPartInfo>::iterator obj_iter;
- rgw::sal::RGWAttrs attrs;
+ rgw::sal::Attrs attrs;
off_t ofs = 0;
MD5 hash;
char final_etag[CEPH_CRYPTO_MD5_DIGESTSIZE];
char final_etag_str[CEPH_CRYPTO_MD5_DIGESTSIZE * 2 + 16];
bufferlist etag_bl;
- std::unique_ptr<rgw::sal::RGWObject> meta_obj;
- std::unique_ptr<rgw::sal::RGWObject> target_obj;
+ std::unique_ptr<rgw::sal::Object> meta_obj;
+ std::unique_ptr<rgw::sal::Object> target_obj;
RGWMPObj mp;
RGWObjManifest manifest;
uint64_t olh_epoch = 0;
target_obj->set_atomic(&obj_ctx);
- std::unique_ptr<rgw::sal::RGWObject::WriteOp> obj_op = target_obj->get_write_op(&obj_ctx);
+ std::unique_ptr<rgw::sal::Object::WriteOp> obj_op = target_obj->get_write_op(&obj_ctx);
obj_op->params.manifest = &manifest;
obj_op->params.remove_objs = &remove_objs;
rgw_obj meta_obj;
RGWMPObj mp;
- if (upload_id.empty() || rgw::sal::RGWObject::empty(s->object.get()))
+ if (upload_id.empty() || rgw::sal::Object::empty(s->object.get()))
return;
mp.init(s->object->get_name(), upload_id);
}
}
- bool not_versioned = rgw::sal::RGWObject::empty(s->object.get()) || s->object->get_instance().empty();
+ bool not_versioned = rgw::sal::Object::empty(s->object.get()) || s->object->get_instance().empty();
auto usr_policy_res = eval_user_policies(s->iam_user_policies, s->env,
boost::none,
iter != multi_delete->objects.end();
++iter) {
std::string version_id;
- std::unique_ptr<rgw::sal::RGWObject> obj = bucket->get_object(*iter);
+ std::unique_ptr<rgw::sal::Object> obj = bucket->get_object(*iter);
if (s->iam_policy || ! s->iam_user_policies.empty()) {
auto usr_policy_res = eval_user_policies(s->iam_user_policies, s->env,
boost::none,
obj->set_atomic(obj_ctx);
- std::unique_ptr<rgw::sal::RGWObject::DeleteOp> del_op = obj->get_delete_op(obj_ctx);
+ std::unique_ptr<rgw::sal::Object::DeleteOp> del_op = obj->get_delete_op(obj_ctx);
del_op->params.versioning_status = obj->get_bucket()->get_info().versioning_status();
del_op->params.obj_owner = s->owner;
del_op->params.bucket_owner = s->bucket_owner;
bool RGWBulkDelete::Deleter::delete_single(const acct_path_t& path, optional_yield y)
{
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
ACLOwner bowner;
RGWObjVersionTracker ot;
ACLOwner bucket_owner;
bucket_owner.set_id(bucket->get_info().owner);
- std::unique_ptr<rgw::sal::RGWObject> obj = bucket->get_object(path.obj_key);
+ std::unique_ptr<rgw::sal::Object> obj = bucket->get_object(path.obj_key);
obj->set_atomic(s->obj_ctx);
- std::unique_ptr<rgw::sal::RGWObject::DeleteOp> del_op = obj->get_delete_op(s->obj_ctx);
+ std::unique_ptr<rgw::sal::Object::DeleteOp> del_op = obj->get_delete_op(s->obj_ctx);
del_op->params.versioning_status = obj->get_bucket()->get_info().versioning_status();
del_op->params.obj_owner = bowner;
del_op->params.bucket_owner = bucket_owner;
std::string bucket_path, file_prefix;
if (! s->init_state.url_bucket.empty()) {
file_prefix = bucket_path = s->init_state.url_bucket + "/";
- if (!rgw::sal::RGWObject::empty(s->object.get())) {
+ if (!rgw::sal::Object::empty(s->object.get())) {
const std::string& object_name = s->object->get_name();
/* As rgw_obj_key::empty() already verified emptiness of s->object->get_name(),
int RGWBulkUploadOp::handle_dir_verify_permission(optional_yield y)
{
if (s->user->get_max_buckets() > 0) {
- rgw::sal::RGWBucketList buckets;
+ rgw::sal::BucketList buckets;
std::string marker;
op_ret = s->user->list_buckets(this, marker, std::string(), s->user->get_max_buckets(),
false, buckets, y);
info.effective_uri = "/" + bucket_name;
}
-void RGWBulkUploadOp::init(rgw::sal::RGWStore* const store,
+void RGWBulkUploadOp::init(rgw::sal::Store* const store,
struct req_state* const s,
RGWHandler* const h)
{
/* we need to make sure we read bucket info, it's not read before for this
* specific request */
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
/* Create metadata: ACLs. */
std::map<std::string, ceph::bufferlist> attrs;
std::tie(bucket_name, object) = *parse_path(path);
auto& obj_ctx = *static_cast<RGWObjectCtx *>(s->obj_ctx);
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
ACLOwner bowner;
op_ret = store->get_bucket(this, s->user.get(), rgw_bucket(rgw_bucket_key(s->user->get_tenant(), bucket_name)), &bucket, y);
return op_ret;
}
- std::unique_ptr<rgw::sal::RGWObject> obj = bucket->get_object(object);
+ std::unique_ptr<rgw::sal::Object> obj = bucket->get_object(object);
if (! handle_file_verify_permission(bucket->get_info(),
obj->get_obj(),
// This looks to be part of the RGW-NFS machinery and has no S3 or
// Swift equivalent.
bool perm;
- if (!rgw::sal::RGWObject::empty(s->object.get())) {
+ if (!rgw::sal::Object::empty(s->object.get())) {
perm = verify_object_permission_no_policy(this, s, RGW_PERM_WRITE);
} else {
perm = verify_bucket_permission_no_policy(this, s, RGW_PERM_WRITE);
// This looks to be part of the RGW-NFS machinery and has no S3 or
// Swift equivalent.
bool perm;
- if (!rgw::sal::RGWObject::empty(s->object.get())) {
+ if (!rgw::sal::Object::empty(s->object.get())) {
perm = verify_object_permission_no_policy(this, s, RGW_PERM_WRITE);
} else {
perm = verify_bucket_permission_no_policy(this, s, RGW_PERM_WRITE);
if (op_ret < 0)
return;
- if (!rgw::sal::RGWObject::empty(s->object.get())) {
- rgw::sal::RGWAttrs a(attrs);
+ if (!rgw::sal::Object::empty(s->object.get())) {
+ rgw::sal::Attrs a(attrs);
op_ret = s->object->set_obj_attrs(this, s->obj_ctx, &a, nullptr, y);
} else {
for (auto& iter : attrs) {
/* Make sure bucket is correct */
s->object->set_bucket(s->bucket.get());
- std::unique_ptr<rgw::sal::RGWObject::ReadOp> stat_op(s->object->get_read_op(s->obj_ctx));
+ std::unique_ptr<rgw::sal::Object::ReadOp> stat_op(s->object->get_read_op(s->obj_ctx));
op_ret = stat_op->prepare(y, this);
{
}
-int RGWHandler::init(rgw::sal::RGWStore *_store,
+int RGWHandler::init(rgw::sal::Store *_store,
struct req_state *_s,
rgw::io::BasicClient *cio)
{
try {
const Policy p(s->cct, s->bucket_tenant, data);
- rgw::sal::RGWAttrs attrs(s->bucket_attrs);
+ rgw::sal::Attrs attrs(s->bucket_attrs);
if (s->bucket_access_conf &&
s->bucket_access_conf->block_public_policy() &&
rgw::IAM::is_public(p)) {
void RGWGetBucketPolicy::execute(optional_yield y)
{
- rgw::sal::RGWAttrs attrs(s->bucket_attrs);
+ rgw::sal::Attrs attrs(s->bucket_attrs);
auto aiter = attrs.find(RGW_ATTR_IAM_POLICY);
if (aiter == attrs.end()) {
ldpp_dout(this, 0) << "can't find bucket IAM POLICY attr bucket_name = "
void RGWDeleteBucketPolicy::execute(optional_yield y)
{
op_ret = retry_raced_bucket_write(this, s->bucket.get(), [this] {
- rgw::sal::RGWAttrs attrs(s->bucket_attrs);
+ rgw::sal::Attrs attrs(s->bucket_attrs);
attrs.erase(RGW_ATTR_IAM_POLICY);
op_ret = s->bucket->set_instance_attrs(this, attrs, s->yield);
return op_ret;
ldpp_dout(this, 0) << "ERROR: get obj attr error"<< dendl;
return;
}
- rgw::sal::RGWAttrs attrs = s->object->get_attrs();
+ rgw::sal::Attrs attrs = s->object->get_attrs();
auto aiter = attrs.find(RGW_ATTR_OBJECT_RETENTION);
if (aiter != attrs.end()) {
RGWObjectRetention old_obj_retention;
<< " ret=" << op_ret << dendl;
return;
}
- rgw::sal::RGWAttrs attrs = s->object->get_attrs();
+ rgw::sal::Attrs attrs = s->object->get_attrs();
auto aiter = attrs.find(RGW_ATTR_OBJECT_RETENTION);
if (aiter == attrs.end()) {
op_ret = -ERR_NO_SUCH_OBJECT_LOCK_CONFIGURATION;
bufferlist bl;
access_conf.encode(bl);
op_ret = retry_raced_bucket_write(this, s->bucket.get(), [this, &bl] {
- rgw::sal::RGWAttrs attrs(s->bucket_attrs);
+ rgw::sal::Attrs attrs(s->bucket_attrs);
attrs[RGW_ATTR_PUBLIC_ACCESS] = bl;
return s->bucket->set_instance_attrs(this, attrs, s->yield);
});
void RGWDeleteBucketPublicAccessBlock::execute(optional_yield y)
{
op_ret = retry_raced_bucket_write(this, s->bucket.get(), [this] {
- rgw::sal::RGWAttrs attrs(s->bucket_attrs);
+ rgw::sal::Attrs attrs(s->bucket_attrs);
attrs.erase(RGW_ATTR_PUBLIC_ACCESS);
op_ret = s->bucket->set_instance_attrs(this, attrs, s->yield);
return op_ret;
int rgw_op_get_bucket_policy_from_attr(const DoutPrefixProvider *dpp,
CephContext *cct,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWBucketInfo& bucket_info,
map<string, bufferlist>& bucket_attrs,
RGWAccessControlPolicy *policy,
class RGWHandler {
protected:
- rgw::sal::RGWStore* store{nullptr};
+ rgw::sal::Store* store{nullptr};
struct req_state *s{nullptr};
int do_init_permissions(const DoutPrefixProvider *dpp, optional_yield y);
RGWHandler() {}
virtual ~RGWHandler();
- virtual int init(rgw::sal::RGWStore* store,
+ virtual int init(rgw::sal::Store* store,
struct req_state* _s,
rgw::io::BasicClient* cio);
protected:
struct req_state *s;
RGWHandler *dialect_handler;
- rgw::sal::RGWStore *store;
+ rgw::sal::Store *store;
RGWCORSConfiguration bucket_cors;
bool cors_exist;
RGWQuotaInfo bucket_quota;
return 0;
}
- virtual void init(rgw::sal::RGWStore *store, struct req_state *s, RGWHandler *dialect_handler) {
+ virtual void init(rgw::sal::Store *store, struct req_state *s, RGWHandler *dialect_handler) {
this->store = store;
this->s = s;
this->dialect_handler = dialect_handler;
ceph::real_time unmod_time;
ceph::real_time *mod_ptr;
ceph::real_time *unmod_ptr;
- rgw::sal::RGWAttrs attrs;
+ rgw::sal::Attrs attrs;
bool get_data;
bool partial_content;
bool ignore_invalid_range;
void execute(optional_yield y) override;
int parse_range();
int read_user_manifest_part(
- rgw::sal::RGWBucket* bucket,
+ rgw::sal::Bucket* bucket,
const rgw_bucket_dir_entry& ent,
RGWAccessControlPolicy * const bucket_acl,
const boost::optional<rgw::IAM::Policy>& bucket_policy,
unsigned int num_unfound;
std::list<fail_desc_t> failures;
- rgw::sal::RGWStore * const store;
+ rgw::sal::Store * const store;
req_state * const s;
public:
- Deleter(const DoutPrefixProvider* dpp, rgw::sal::RGWStore * const str, req_state * const s)
+ Deleter(const DoutPrefixProvider* dpp, rgw::sal::Store * const str, req_state * const s)
: dpp(dpp),
num_deleted(0),
num_unfound(0),
: num_created(0) {
}
- void init(rgw::sal::RGWStore* const store,
+ void init(rgw::sal::Store* const store,
struct req_state* const s,
RGWHandler* const h) override;
std::string end_marker;
int64_t limit;
uint64_t limit_max;
- rgw::sal::RGWAttrs attrs;
+ rgw::sal::Attrs attrs;
bool is_truncated;
RGWUsageStats global_stats;
void execute(optional_yield y) override;
virtual int get_params(optional_yield y) = 0;
- virtual void handle_listing_chunk(rgw::sal::RGWBucketList&& buckets) {
+ virtual void handle_listing_chunk(rgw::sal::BucketList&& buckets) {
/* The default implementation, used by e.g. S3, just generates a new
* part of listing and sends it client immediately. Swift can behave
* differently: when the reverse option is requested, all incoming
return send_response_data(buckets);
}
virtual void send_response_begin(bool has_buckets) = 0;
- virtual void send_response_data(rgw::sal::RGWBucketList& buckets) = 0;
+ virtual void send_response_data(rgw::sal::BucketList& buckets) = 0;
virtual void send_response_end() = 0;
void send_response() override {}
void pre_exec() override;
void execute(optional_yield y) override;
- void init(rgw::sal::RGWStore *store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store *store, struct req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
}
virtual int get_params(optional_yield y) = 0;
class RGWStatBucket : public RGWOp {
protected:
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
public:
int verify_permission(optional_yield y) override;
int verify_permission(optional_yield y) override;
void pre_exec() override;
void execute(optional_yield y) override;
- void init(rgw::sal::RGWStore *store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store *store, struct req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
policy.set_ctx(s->cct);
relaxed_region_enforcement =
std::unique_ptr <RGWObjTags> obj_tags;
const char *dlo_manifest;
RGWSLOInfo *slo_info;
- rgw::sal::RGWAttrs attrs;
+ rgw::sal::Attrs attrs;
ceph::real_time mtime;
uint64_t olh_epoch;
string version_id;
delete obj_legal_hold;
}
- void init(rgw::sal::RGWStore *store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store *store, struct req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
policy.set_ctx(s->cct);
}
attrs.emplace(std::move(key), std::move(bl)); /* key and bl are r-value refs */
}
- void init(rgw::sal::RGWStore *store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store *store, struct req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
policy.set_ctx(s->cct);
}
has_policy(false) {
}
- void init(rgw::sal::RGWStore *store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store *store, struct req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
policy.set_ctx(s->cct);
}
class RGWPutMetadataBucket : public RGWOp {
protected:
- rgw::sal::RGWAttrs attrs;
+ rgw::sal::Attrs attrs;
set<string> rmattr_names;
bool has_policy, has_cors;
uint32_t policy_rw_mask;
attrs.emplace(std::move(key), std::move(bl)); /* key and bl are r-value refs */
}
- void init(rgw::sal::RGWStore *store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store *store, struct req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
policy.set_ctx(s->cct);
}
: dlo_manifest(NULL)
{}
- void init(rgw::sal::RGWStore *store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store *store, struct req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
policy.set_ctx(s->cct);
}
ceph::real_time unmod_time;
ceph::real_time *mod_ptr;
ceph::real_time *unmod_ptr;
- rgw::sal::RGWAttrs attrs;
+ rgw::sal::Attrs attrs;
string src_tenant_name, src_bucket_name, src_obj_name;
- std::unique_ptr<rgw::sal::RGWBucket> src_bucket;
- std::unique_ptr<rgw::sal::RGWObject> src_object;
+ std::unique_ptr<rgw::sal::Bucket> src_bucket;
+ std::unique_ptr<rgw::sal::Object> src_object;
string dest_tenant_name, dest_bucket_name, dest_obj_name;
- std::unique_ptr<rgw::sal::RGWBucket> dest_bucket;
- std::unique_ptr<rgw::sal::RGWObject> dest_object;
+ std::unique_ptr<rgw::sal::Bucket> dest_bucket;
+ std::unique_ptr<rgw::sal::Object> dest_object;
ceph::real_time src_mtime;
ceph::real_time mtime;
rgw::sal::AttrsMod attrs_mod;
attrs.emplace(std::move(key), std::move(bl));
}
- void init(rgw::sal::RGWStore *store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store *store, struct req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
dest_policy.set_ctx(s->cct);
}
void pre_exec() override;
void execute(optional_yield y) override;
- virtual int get_policy_from_state(rgw::sal::RGWStore *store, struct req_state *s, stringstream& ss) { return 0; }
+ virtual int get_policy_from_state(rgw::sal::Store *store, struct req_state *s, stringstream& ss) { return 0; }
virtual int get_params(optional_yield y) = 0;
void send_response() override = 0;
const char* name() const override { return "put_acls"; }
}
~RGWPutLC() override {}
- void init(rgw::sal::RGWStore *store, struct req_state *s, RGWHandler *dialect_handler) override {
+ void init(rgw::sal::Store *store, struct req_state *s, RGWHandler *dialect_handler) override {
#define COOKIE_LEN 16
char buf[COOKIE_LEN + 1];
public:
RGWInitMultipart() {}
- void init(rgw::sal::RGWStore *store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store *store, struct req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
policy.set_ctx(s->cct);
}
truncated = false;
}
- void init(rgw::sal::RGWStore *store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store *store, struct req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
policy = RGWAccessControlPolicy(s->cct);
}
default_max = 0;
}
- void init(rgw::sal::RGWStore *store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store *store, struct req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
max_uploads = default_max;
}
class RGWDeleteMultiObj : public RGWOp {
protected:
bufferlist data;
- rgw::sal::RGWBucket* bucket;
+ rgw::sal::Bucket* bucket;
bool quiet;
bool status_dumped;
bool acl_allowed = false;
uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
};
-extern int rgw_build_bucket_policies(const DoutPrefixProvider *dpp, rgw::sal::RGWStore* store,
+extern int rgw_build_bucket_policies(const DoutPrefixProvider *dpp, rgw::sal::Store* store,
struct req_state* s, optional_yield y);
-extern int rgw_build_object_policies(const DoutPrefixProvider *dpp, rgw::sal::RGWStore *store,
+extern int rgw_build_object_policies(const DoutPrefixProvider *dpp, rgw::sal::Store *store,
struct req_state *s, bool prefetch_data, optional_yield y);
-extern void rgw_build_iam_environment(rgw::sal::RGWStore* store,
+extern void rgw_build_iam_environment(rgw::sal::Store* store,
struct req_state* s);
extern vector<rgw::IAM::Policy> get_iam_user_policy_from_attr(CephContext* cct,
map<string, bufferlist>& attrs,
class RGWRMAttrs : public RGWOp {
protected:
- rgw::sal::RGWAttrs attrs;
+ rgw::sal::Attrs attrs;
public:
RGWRMAttrs()
public:
RGWGetClusterStat() {}
- void init(rgw::sal::RGWStore *store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store *store, struct req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
}
int verify_permission(optional_yield) override {return 0;}
int RGWOrphanStore::init()
{
const rgw_pool& log_pool = store->get_zone()->get_params().log_pool;
- int r = rgw_init_ioctx(static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->get_rados_handle(), log_pool, ioctx);
+ int r = rgw_init_ioctx(static_cast<rgw::sal::RadosStore*>(store)->getRados()->get_rados_handle(), log_pool, ioctx);
if (r < 0) {
cerr << "ERROR: failed to open log pool (" << log_pool << " ret=" << r << std::endl;
return r;
{
librados::IoCtx ioctx;
- int ret = rgw_init_ioctx(static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->get_rados_handle(), search_info.pool, ioctx);
+ int ret = rgw_init_ioctx(static_cast<rgw::sal::RadosStore*>(store)->getRados()->get_rados_handle(), search_info.pool, ioctx);
if (ret < 0) {
lderr(store->ctx()) << __func__ << ": rgw_init_ioctx() returned ret=" << ret << dendl;
return ret;
return 0;
}
-int RGWOrphanSearch::handle_stat_result(map<int, list<string> >& oids, rgw::sal::RGWObject::StatOp::Result& result)
+int RGWOrphanSearch::handle_stat_result(map<int, list<string> >& oids, rgw::sal::Object::StatOp::Result& result)
{
set<string> obj_oids;
- rgw::sal::RGWBucket* bucket = result.obj->get_bucket();
+ rgw::sal::Bucket* bucket = result.obj->get_bucket();
if (!result.manifest) { /* a very very old object, or part of a multipart upload during upload */
const string loc = bucket->get_bucket_id() + "_" + result.obj->get_oid();
obj_oids.insert(obj_fingerprint(loc));
return 0;
}
-int RGWOrphanSearch::pop_and_handle_stat_op(map<int, list<string> >& oids, std::deque<std::unique_ptr<rgw::sal::RGWObject::StatOp>>& ops)
+int RGWOrphanSearch::pop_and_handle_stat_op(map<int, list<string> >& oids, std::deque<std::unique_ptr<rgw::sal::Object::StatOp>>& ops)
{
- rgw::sal::RGWObject::StatOp* front_op = ops.front().get();
+ rgw::sal::Object::StatOp* front_op = ops.front().get();
int ret = front_op->wait();
if (ret < 0) {
return ret;
}
- std::unique_ptr<rgw::sal::RGWBucket> cur_bucket;
+ std::unique_ptr<rgw::sal::Bucket> cur_bucket;
ret = store->get_bucket(dpp, nullptr, orphan_bucket, &cur_bucket, null_yield);
if (ret < 0) {
if (ret == -ENOENT) {
rgw_bucket b;
rgw_bucket_parse_bucket_key(store->ctx(), bucket_instance_id, &b, nullptr);
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
ret = store->get_bucket(dpp, nullptr, b, &bucket, null_yield);
if (ret < 0) {
if (ret == -ENOENT) {
}
ldpp_dout(dpp, 10) << "building linked oids for bucket instance: " << bucket_instance_id << dendl;
- rgw::sal::RGWBucket::ListParams params;
- rgw::sal::RGWBucket::ListResults results;
+ rgw::sal::Bucket::ListParams params;
+ rgw::sal::Bucket::ListResults results;
string marker;
params.marker = rgw_obj_key(marker);
params.list_versions = true;
params.enforce_ns = false;
- std::deque<std::unique_ptr<rgw::sal::RGWObject>> objs;
- std::deque<std::unique_ptr<rgw::sal::RGWObject::StatOp>> stat_ops;
+ std::deque<std::unique_ptr<rgw::sal::Object>> objs;
+ std::deque<std::unique_ptr<rgw::sal::Object::StatOp>> stat_ops;
do {
ret = bucket->list(dpp, params, max_list_bucket_entries, results, null_yield);
continue;
}
- std::unique_ptr<rgw::sal::RGWObject> obj = bucket->get_object(entry.key);
- std::unique_ptr<rgw::sal::RGWObject::StatOp> stat_op = obj->get_stat_op(&obj_ctx);
- rgw::sal::RGWObject::StatOp* op = stat_op.get();
+ std::unique_ptr<rgw::sal::Object> obj = bucket->get_object(entry.key);
+ std::unique_ptr<rgw::sal::Object::StatOp> stat_op = obj->get_stat_op(&obj_ctx);
+ rgw::sal::Object::StatOp* op = stat_op.get();
objs.push_back(std::move(obj));
stat_ops.push_back(std::move(stat_op));
librados::IoCtx data_ioctx;
- int ret = rgw_init_ioctx(static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->get_rados_handle(), search_info.pool, data_ioctx);
+ int ret = rgw_init_ioctx(static_cast<rgw::sal::RadosStore*>(store)->getRados()->get_rados_handle(), search_info.pool, data_ioctx);
if (ret < 0) {
lderr(store->ctx()) << __func__ << ": rgw_init_ioctx() returned ret=" << ret << dendl;
return ret;
}
-int RGWRadosList::handle_stat_result(rgw::sal::RGWObject::StatOp::Result& result,
+int RGWRadosList::handle_stat_result(rgw::sal::Object::StatOp::Result& result,
std::string& bucket_name,
rgw_obj_key& obj_key,
std::set<string>& obj_oids)
{
obj_oids.clear();
- rgw::sal::RGWBucket* bucket = result.obj->get_bucket();
+ rgw::sal::Bucket* bucket = result.obj->get_bucket();
ldout(store->ctx(), 20) << "RGWRadosList::" << __func__ <<
" bucket=" << bucket <<
int RGWRadosList::pop_and_handle_stat_op(
RGWObjectCtx& obj_ctx,
- std::deque<std::unique_ptr<rgw::sal::RGWObject::StatOp>>& ops)
+ std::deque<std::unique_ptr<rgw::sal::Object::StatOp>>& ops)
{
std::string bucket_name;
rgw_obj_key obj_key;
std::set<std::string> obj_oids;
- std::unique_ptr<rgw::sal::RGWObject::StatOp> front_op = std::move(ops.front());
+ std::unique_ptr<rgw::sal::Object::StatOp> front_op = std::move(ops.front());
int ret = front_op->wait();
if (ret < 0) {
rgw_bucket b;
rgw_bucket_parse_bucket_key(store->ctx(), bucket_instance_id, &b, nullptr);
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
int ret = store->get_bucket(dpp, nullptr, b, &bucket, null_yield);
if (ret < 0) {
if (ret == -ENOENT) {
return ret;
}
- rgw::sal::RGWBucket::ListParams params;
- rgw::sal::RGWBucket::ListResults results;
+ rgw::sal::Bucket::ListParams params;
+ rgw::sal::Bucket::ListResults results;
std::string marker;
params.marker = rgw_obj_key(marker);
params.allow_unordered = false;
params.prefix = prefix;
- std::deque<std::unique_ptr<rgw::sal::RGWObject>> objs;
- std::deque<std::unique_ptr<rgw::sal::RGWObject::StatOp>> stat_ops;
+ std::deque<std::unique_ptr<rgw::sal::Object>> objs;
+ std::deque<std::unique_ptr<rgw::sal::Object::StatOp>> stat_ops;
std::string prev_versioned_key_name = "";
RGWObjectCtx obj_ctx(store);
[&](const rgw_obj_key& key) -> int {
int ret;
- std::unique_ptr<rgw::sal::RGWObject> obj = bucket->get_object(key);
- std::unique_ptr<rgw::sal::RGWObject::StatOp> stat_op = obj->get_stat_op(&obj_ctx);
- rgw::sal::RGWObject::StatOp* op = stat_op.get();
+ std::unique_ptr<rgw::sal::Object> obj = bucket->get_object(key);
+ std::unique_ptr<rgw::sal::Object::StatOp> stat_op = obj->get_stat_op(&obj_ctx);
+ rgw::sal::Object::StatOp* op = stat_op.get();
objs.push_back(std::move(obj));
stat_ops.push_back(std::move(stat_op));
int RGWRadosList::run(const DoutPrefixProvider *dpp, const std::string& start_bucket_name)
{
RGWObjectCtx obj_ctx(store);
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
int ret;
add_bucket_entire(start_bucket_name);
std::swap(process, front->second);
bucket_process_map.erase(front);
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
ret = store->get_bucket(dpp, nullptr, tenant_name, bucket_name, &bucket, null_yield);
if (ret == -ENOENT) {
std::cerr << "WARNING: bucket " << bucket_name <<
int RGWRadosList::do_incomplete_multipart(const DoutPrefixProvider *dpp,
- rgw::sal::RGWBucket* bucket)
+ rgw::sal::Bucket* bucket)
{
constexpr int max_uploads = 1000;
constexpr int max_parts = 1000;
int ret;
- rgw::sal::RGWBucket::ListParams params;
- rgw::sal::RGWBucket::ListResults results;
+ rgw::sal::Bucket::ListParams params;
+ rgw::sal::Bucket::ListResults results;
params.ns = mp_ns;
params.filter = &mp_filter;
WRITE_CLASS_ENCODER(RGWOrphanSearchState)
class RGWOrphanStore {
- rgw::sal::RGWStore *store;
+ rgw::sal::Store *store;
librados::IoCtx ioctx;
string oid;
public:
- explicit RGWOrphanStore(rgw::sal::RGWStore *_store) : store(_store), oid(RGW_ORPHAN_INDEX_OID) {}
+ explicit RGWOrphanStore(rgw::sal::Store *_store) : store(_store), oid(RGW_ORPHAN_INDEX_OID) {}
librados::IoCtx& get_ioctx() { return ioctx; }
class RGWOrphanSearch {
- rgw::sal::RGWStore *store;
+ rgw::sal::Store *store;
RGWOrphanStore orphan_store;
return ceph_str_hash_linux(str.c_str(), str.size()) % RGW_ORPHANSEARCH_HASH_PRIME % search_info.num_shards;
}
- int handle_stat_result(map<int, list<string> >& oids, rgw::sal::RGWObject::StatOp::Result& result);
- int pop_and_handle_stat_op(map<int, list<string> >& oids, std::deque<std::unique_ptr<rgw::sal::RGWObject::StatOp>>& ops);
+ int handle_stat_result(map<int, list<string> >& oids, rgw::sal::Object::StatOp::Result& result);
+ int pop_and_handle_stat_op(map<int, list<string> >& oids, std::deque<std::unique_ptr<rgw::sal::Object::StatOp>>& ops);
int remove_index(map<int, string>& index);
public:
- RGWOrphanSearch(rgw::sal::RGWStore *_store, int _max_ios, uint64_t _stale_secs) : store(_store), orphan_store(store), max_concurrent_ios(_max_ios), stale_secs(_stale_secs) {}
+ RGWOrphanSearch(rgw::sal::Store *_store, int _max_ios, uint64_t _stale_secs) : store(_store), orphan_store(store), max_concurrent_ios(_max_ios), stale_secs(_stale_secs) {}
int save_state() {
RGWOrphanSearchState state;
p.first->second.filter_keys.insert(obj_key);
}
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
uint16_t max_concurrent_ios;
uint64_t stale_secs;
bool include_rgw_obj_name;
std::string field_separator;
- int handle_stat_result(rgw::sal::RGWObject::StatOp::Result& result,
+ int handle_stat_result(rgw::sal::Object::StatOp::Result& result,
std::string& bucket_name,
rgw_obj_key& obj_key,
std::set<string>& obj_oids);
int pop_and_handle_stat_op(RGWObjectCtx& obj_ctx,
- std::deque<std::unique_ptr<rgw::sal::RGWObject::StatOp>>& ops);
+ std::deque<std::unique_ptr<rgw::sal::Object::StatOp>>& ops);
public:
- RGWRadosList(rgw::sal::RGWStore* _store,
+ RGWRadosList(rgw::sal::Store* _store,
int _max_ios,
uint64_t _stale_secs,
const std::string& _tenant_name) :
const std::set<rgw_obj_key>& entries_filter);
int do_incomplete_multipart(const DoutPrefixProvider *dpp,
- rgw::sal::RGWBucket* bucket);
+ rgw::sal::Bucket* bucket);
int build_linked_oids_index();
namespace rgw {
/* static */
- int RGWHandler_Lib::init_from_header(rgw::sal::RGWStore *store,
+ int RGWHandler_Lib::init_from_header(rgw::sal::Store *store,
struct req_state *s)
{
string req;
#define CEPH_RGW_OTP_H
namespace rgw { namespace sal {
-class RGWStore;
+class Store;
} }
#include "cls/otp/cls_otp_types.h"
};
-RGWPeriodPusher::RGWPeriodPusher(rgw::sal::RGWStore* store,
+RGWPeriodPusher::RGWPeriodPusher(rgw::sal::Store* store,
optional_yield y)
: cct(store->ctx()), store(store)
{
// always send out the current period on startup
RGWPeriod period;
// XXX dang
- int r = period.init(cct, static_cast<rgw::sal::RGWRadosStore *>(store)->svc()->sysobj, realm_id, y, realm.get_name());
+ int r = period.init(cct, static_cast<rgw::sal::RadosStore *>(store)->svc()->sysobj, realm_id, y, realm.get_name());
if (r < 0) {
lderr(cct) << "failed to load period for realm " << realm_id << dendl;
return;
store = nullptr;
}
-void RGWPeriodPusher::resume(rgw::sal::RGWStore* store)
+void RGWPeriodPusher::resume(rgw::sal::Store* store)
{
std::lock_guard<std::mutex> lock(mutex);
this->store = store;
namespace rgw {
namespace sal {
-class RGWStore;
+class Store;
}
}
class RGWPeriodPusher final : public RGWRealmWatcher::Watcher,
public RGWRealmReloader::Pauser {
public:
- explicit RGWPeriodPusher(rgw::sal::RGWStore* store, optional_yield y);
+ explicit RGWPeriodPusher(rgw::sal::Store* store, optional_yield y);
~RGWPeriodPusher() override;
/// respond to realm notifications by pushing new periods to other zones
void pause() override;
/// continue processing notifications with a new RGWRados instance
- void resume(rgw::sal::RGWStore* store) override;
+ void resume(rgw::sal::Store* store) override;
private:
void handle_notify(RGWZonesNeedPeriod&& period);
CephContext *const cct;
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
std::mutex mutex;
epoch_t realm_epoch{0}; //< the current realm epoch being sent
return 0;
}
-int process_request(rgw::sal::RGWStore* const store,
+int process_request(rgw::sal::Store* const store,
RGWREST* const rest,
RGWRequest* const req,
const std::string& frontend_prefix,
struct req_state rstate(g_ceph_context, &rgw_env, req->id);
struct req_state *s = &rstate;
- std::unique_ptr<rgw::sal::RGWUser> u = store->get_user(rgw_user());
+ std::unique_ptr<rgw::sal::User> u = store->get_user(rgw_user());
s->set_user(u);
RGWObjectCtx rados_ctx(store, s);
}
int op_ret = 0;
- if (user && !rgw::sal::RGWUser::empty(s->user.get())) {
+ if (user && !rgw::sal::User::empty(s->user.get())) {
*user = s->user->get_id().to_str();
}
}
struct RGWProcessEnv {
- rgw::sal::RGWStore *store;
+ rgw::sal::Store *store;
RGWREST *rest;
OpsLogSocket *olog;
int port;
deque<RGWRequest*> m_req_queue;
protected:
CephContext *cct;
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
rgw_auth_registry_ptr_t auth_registry;
OpsLogSocket* olog;
ThreadPool m_tp;
m_tp.pause();
}
- void unpause_with_new_config(rgw::sal::RGWStore* const store,
+ void unpause_with_new_config(rgw::sal::Store* const store,
rgw_auth_registry_ptr_t auth_registry) {
this->store = store;
this->auth_registry = std::move(auth_registry);
void set_access_key(RGWAccessKey& key) { access_key = key; }
};
/* process stream request */
-extern int process_request(rgw::sal::RGWStore* store,
+extern int process_request(rgw::sal::Store* store,
RGWREST* rest,
RGWRequest* req,
const std::string& frontend_prefix,
encode_json("s3_id", s3_id, f);
}
-RGWPubSub::RGWPubSub(rgw::sal::RGWRadosStore* _store, const std::string& _tenant) :
+RGWPubSub::RGWPubSub(rgw::sal::RadosStore* _store, const std::string& _tenant) :
store(_store),
tenant(_tenant),
obj_ctx(store->svc()->sysobj->init_obj_ctx()) {
int RGWPubSub::Bucket::create_notification(const string& topic_name,const rgw::notify::EventTypeList& events, OptionalFilter s3_filter, const std::string& notif_name, optional_yield y) {
rgw_pubsub_topic_subs topic_info;
- rgw::sal::RGWRadosStore *store = ps->store;
+ rgw::sal::RadosStore *store = ps->store;
int ret = ps->get_topic(topic_name, &topic_info);
if (ret < 0) {
int RGWPubSub::Bucket::remove_notification(const string& topic_name, optional_yield y)
{
rgw_pubsub_topic_subs topic_info;
- rgw::sal::RGWRadosStore *store = ps->store;
+ rgw::sal::RadosStore *store = ps->store;
int ret = ps->get_topic(topic_name, &topic_info);
if (ret < 0) {
{
RGWObjVersionTracker objv_tracker;
rgw_pubsub_topics topics;
- rgw::sal::RGWRadosStore *store = ps->store;
+ rgw::sal::RadosStore *store = ps->store;
int ret = ps->read_topics(&topics, &objv_tracker);
if (ret < 0) {
{
string topic = _topic;
RGWObjVersionTracker sobjv_tracker;
- rgw::sal::RGWRadosStore *store = ps->store;
+ rgw::sal::RadosStore *store = ps->store;
if (topic.empty()) {
rgw_pubsub_sub_config sub_conf;
template<typename EventType>
int RGWPubSub::SubWithEvents<EventType>::remove_event(const DoutPrefixProvider *dpp, const string& event_id)
{
- rgw::sal::RGWRadosStore *store = ps->store;
+ rgw::sal::RadosStore *store = ps->store;
rgw_pubsub_sub_config sub_conf;
int ret = get_conf(&sub_conf);
if (ret < 0) {
#include "rgw_notify_event_type.h"
#include <boost/container/flat_map.hpp>
-namespace rgw::sal { class RGWRadosStore; }
+namespace rgw::sal { class RadosStore; }
class XMLObj;
{
friend class Bucket;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
const std::string tenant;
RGWSysObjectCtx obj_ctx;
RGWObjVersionTracker* objv_tracker, optional_yield y);
public:
- RGWPubSub(rgw::sal::RGWRadosStore *_store, const std::string& tenant);
+ RGWPubSub(rgw::sal::RadosStore *_store, const std::string& tenant);
class Bucket {
friend class RGWPubSub;
const std::string& etag,
ceph::real_time *mtime,
ceph::real_time set_mtime,
- rgw::sal::RGWAttrs& attrs,
+ rgw::sal::Attrs& attrs,
ceph::real_time delete_at,
const char *if_match,
const char *if_nomatch,
head_obj->set_atomic(&obj_ctx);
- std::unique_ptr<rgw::sal::RGWObject::WriteOp> obj_op = head_obj->get_write_op(&obj_ctx);
+ std::unique_ptr<rgw::sal::Object::WriteOp> obj_op = head_obj->get_write_op(&obj_ctx);
/* some object types shouldn't be versioned, e.g., multipart parts */
obj_op->params.versioning_disabled = !bucket->versioning_enabled();
return r;
}
- std::unique_ptr<rgw::sal::RGWObject::WriteOp> obj_op = head_obj->get_write_op(&obj_ctx);
+ std::unique_ptr<rgw::sal::Object::WriteOp> obj_op = head_obj->get_write_op(&obj_ctx);
obj_op->params.versioning_disabled = true;
obj_op->params.set_mtime = set_mtime;
encode(info, bl);
- std::unique_ptr<rgw::sal::RGWObject> meta_obj =
+ std::unique_ptr<rgw::sal::Object> meta_obj =
bucket->get_object(rgw_obj_key(mp.get_meta(), std::string(), RGW_OBJ_NS_MULTIPART));
meta_obj->set_in_extra_data(true);
}
int AppendObjectProcessor::complete(size_t accounted_size, const string &etag, ceph::real_time *mtime,
- ceph::real_time set_mtime, rgw::sal::RGWAttrs& attrs,
+ ceph::real_time set_mtime, rgw::sal::Attrs& attrs,
ceph::real_time delete_at, const char *if_match, const char *if_nomatch,
const string *user_data, rgw_zone_set *zones_trace, bool *pcanceled,
optional_yield y)
return r;
}
head_obj->set_atomic(&obj_ctx);
- std::unique_ptr<rgw::sal::RGWObject::WriteOp> obj_op = head_obj->get_write_op(&obj_ctx);
+ std::unique_ptr<rgw::sal::Object::WriteOp> obj_op = head_obj->get_write_op(&obj_ctx);
//For Append obj, disable versioning
obj_op->params.versioning_disabled = true;
if (cur_manifest) {
class ManifestObjectProcessor : public HeadObjectProcessor,
public StripeGenerator {
protected:
- rgw::sal::RGWStore *const store;
- rgw::sal::RGWBucket* bucket;
+ rgw::sal::Store *const store;
+ rgw::sal::Bucket* bucket;
rgw_placement_rule tail_placement_rule;
rgw_user owner;
RGWObjectCtx& obj_ctx;
- std::unique_ptr<rgw::sal::RGWObject> head_obj;
+ std::unique_ptr<rgw::sal::Object> head_obj;
std::unique_ptr<rgw::sal::Writer> writer;
RGWObjManifest manifest;
int next(uint64_t offset, uint64_t *stripe_size) override;
public:
- ManifestObjectProcessor(Aio *aio, rgw::sal::RGWStore *store,
- rgw::sal::RGWBucket* bucket,
+ ManifestObjectProcessor(Aio *aio, rgw::sal::Store *store,
+ rgw::sal::Bucket* bucket,
const rgw_placement_rule *ptail_placement_rule,
const rgw_user& owner, RGWObjectCtx& obj_ctx,
- std::unique_ptr<rgw::sal::RGWObject> _head_obj,
+ std::unique_ptr<rgw::sal::Object> _head_obj,
const DoutPrefixProvider* dpp, optional_yield y)
: HeadObjectProcessor(0),
store(store), bucket(bucket),
int process_first_chunk(bufferlist&& data, DataProcessor **processor) override;
public:
- AtomicObjectProcessor(Aio *aio, rgw::sal::RGWStore *store,
- rgw::sal::RGWBucket* bucket,
+ AtomicObjectProcessor(Aio *aio, rgw::sal::Store *store,
+ rgw::sal::Bucket* bucket,
const rgw_placement_rule *ptail_placement_rule,
const rgw_user& owner,
RGWObjectCtx& obj_ctx,
- std::unique_ptr<rgw::sal::RGWObject> _head_obj,
+ std::unique_ptr<rgw::sal::Object> _head_obj,
std::optional<uint64_t> olh_epoch,
const std::string& unique_tag,
const DoutPrefixProvider *dpp, optional_yield y)
// part's head is written with an exclusive create to detect racing uploads of
// the same part/upload id, which are restarted with a random oid prefix
class MultipartObjectProcessor : public ManifestObjectProcessor {
- std::unique_ptr<rgw::sal::RGWObject> target_obj; // target multipart object
+ std::unique_ptr<rgw::sal::Object> target_obj; // target multipart object
const std::string upload_id;
const int part_num;
const std::string part_num_str;
// prepare the head stripe and manifest
int prepare_head();
public:
- MultipartObjectProcessor(Aio *aio, rgw::sal::RGWStore *store,
- rgw::sal::RGWBucket* bucket,
+ MultipartObjectProcessor(Aio *aio, rgw::sal::Store *store,
+ rgw::sal::Bucket* bucket,
const rgw_placement_rule *ptail_placement_rule,
const rgw_user& owner, RGWObjectCtx& obj_ctx,
- std::unique_ptr<rgw::sal::RGWObject> _head_obj,
+ std::unique_ptr<rgw::sal::Object> _head_obj,
const std::string& upload_id, uint64_t part_num,
const std::string& part_num_str,
const DoutPrefixProvider *dpp, optional_yield y)
int process_first_chunk(bufferlist&& data, DataProcessor **processor) override;
public:
- AppendObjectProcessor(Aio *aio, rgw::sal::RGWStore *store,
- rgw::sal::RGWBucket* bucket,
+ AppendObjectProcessor(Aio *aio, rgw::sal::Store *store,
+ rgw::sal::Bucket* bucket,
const rgw_placement_rule *ptail_placement_rule,
const rgw_user& owner, RGWObjectCtx& obj_ctx,
- std::unique_ptr<rgw::sal::RGWObject> _head_obj,
+ std::unique_ptr<rgw::sal::Object> _head_obj,
const std::string& unique_tag, uint64_t position,
uint64_t *cur_accounted_size,
const DoutPrefixProvider *dpp, optional_yield y)
template<class T>
class RGWQuotaCache {
protected:
- rgw::sal::RGWStore *store;
+ rgw::sal::Store *store;
lru_map<T, RGWQuotaCacheStats> stats_map;
RefCountedWaitObject *async_refcount;
virtual void data_modified(const rgw_user& user, rgw_bucket& bucket) {}
public:
- RGWQuotaCache(rgw::sal::RGWStore *_store, int size) : store(_store), stats_map(size) {
+ RGWQuotaCache(rgw::sal::Store *_store, int size) : store(_store), stats_map(size) {
async_refcount = new RefCountedWaitObject;
}
virtual ~RGWQuotaCache() {
class AsyncRefreshHandler {
protected:
- rgw::sal::RGWStore *store;
+ rgw::sal::Store *store;
RGWQuotaCache<T> *cache;
public:
- AsyncRefreshHandler(rgw::sal::RGWStore *_store, RGWQuotaCache<T> *_cache) : store(_store), cache(_cache) {}
+ AsyncRefreshHandler(rgw::sal::Store *_store, RGWQuotaCache<T> *_cache) : store(_store), cache(_cache) {}
virtual ~AsyncRefreshHandler() {}
virtual int init_fetch() = 0;
public RGWGetBucketStats_CB {
rgw_user user;
public:
- BucketAsyncRefreshHandler(rgw::sal::RGWStore *_store, RGWQuotaCache<rgw_bucket> *_cache,
+ BucketAsyncRefreshHandler(rgw::sal::Store *_store, RGWQuotaCache<rgw_bucket> *_cache,
const rgw_user& _user, const rgw_bucket& _bucket) :
RGWQuotaCache<rgw_bucket>::AsyncRefreshHandler(_store, _cache),
RGWGetBucketStats_CB(_bucket), user(_user) {}
int BucketAsyncRefreshHandler::init_fetch()
{
- std::unique_ptr<rgw::sal::RGWBucket> rbucket;
+ std::unique_ptr<rgw::sal::Bucket> rbucket;
const DoutPrefix dp(store->ctx(), dout_subsys, "rgw bucket async refresh handler: ");
int r = store->get_bucket(&dp, nullptr, bucket, &rbucket, null_yield);
int fetch_stats_from_storage(const rgw_user& user, const rgw_bucket& bucket, RGWStorageStats& stats, optional_yield y, const DoutPrefixProvider *dpp) override;
public:
- explicit RGWBucketStatsCache(rgw::sal::RGWStore *_store) : RGWQuotaCache<rgw_bucket>(_store, _store->ctx()->_conf->rgw_bucket_quota_cache_size) {
+ explicit RGWBucketStatsCache(rgw::sal::Store *_store) : RGWQuotaCache<rgw_bucket>(_store, _store->ctx()->_conf->rgw_bucket_quota_cache_size) {
}
AsyncRefreshHandler *allocate_refresh_handler(const rgw_user& user, const rgw_bucket& bucket) override {
int RGWBucketStatsCache::fetch_stats_from_storage(const rgw_user& _u, const rgw_bucket& _b, RGWStorageStats& stats, optional_yield y, const DoutPrefixProvider *dpp)
{
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(_u);
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::User> user = store->get_user(_u);
+ std::unique_ptr<rgw::sal::Bucket> bucket;
int r = store->get_bucket(dpp, user.get(), _b, &bucket, y);
if (r < 0) {
public RGWGetUserStats_CB {
rgw_bucket bucket;
public:
- UserAsyncRefreshHandler(rgw::sal::RGWStore *_store, RGWQuotaCache<rgw_user> *_cache,
+ UserAsyncRefreshHandler(rgw::sal::Store *_store, RGWQuotaCache<rgw_user> *_cache,
const rgw_user& _user, const rgw_bucket& _bucket) :
RGWQuotaCache<rgw_user>::AsyncRefreshHandler(_store, _cache),
RGWGetUserStats_CB(_user),
int UserAsyncRefreshHandler::init_fetch()
{
- std::unique_ptr<rgw::sal::RGWUser> ruser = store->get_user(user);
+ std::unique_ptr<rgw::sal::User> ruser = store->get_user(user);
ldout(store->ctx(), 20) << "initiating async quota refresh for user=" << user << dendl;
int r = ruser->read_stats_async(this);
}
public:
- RGWUserStatsCache(rgw::sal::RGWStore *_store, bool quota_threads)
+ RGWUserStatsCache(rgw::sal::Store *_store, bool quota_threads)
: RGWQuotaCache<rgw_user>(_store, _store->ctx()->_conf->rgw_bucket_quota_cache_size)
{
if (quota_threads) {
optional_yield y,
const DoutPrefixProvider *dpp)
{
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(_u);
+ std::unique_ptr<rgw::sal::User> user = store->get_user(_u);
int r = user->read_stats(y, &stats);
if (r < 0) {
ldout(store->ctx(), 0) << "could not get user stats for user=" << user << dendl;
int RGWUserStatsCache::sync_bucket(const rgw_user& _u, rgw_bucket& _b, optional_yield y, const DoutPrefixProvider *dpp)
{
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(_u);
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::User> user = store->get_user(_u);
+ std::unique_ptr<rgw::sal::Bucket> bucket;
int r = store->get_bucket(dpp, user.get(), _b, &bucket, y);
if (r < 0) {
RGWStorageStats stats;
ceph::real_time last_stats_sync;
ceph::real_time last_stats_update;
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(rgw_user(_u.to_str()));
+ std::unique_ptr<rgw::sal::User> user = store->get_user(rgw_user(_u.to_str()));
int ret = user->read_stats(y, &stats, &last_stats_sync, &last_stats_update);
if (ret < 0) {
class RGWQuotaHandlerImpl : public RGWQuotaHandler {
- rgw::sal::RGWStore *store;
+ rgw::sal::Store *store;
RGWBucketStatsCache bucket_stats_cache;
RGWUserStatsCache user_stats_cache;
return 0;
}
public:
- RGWQuotaHandlerImpl(rgw::sal::RGWStore *_store, bool quota_threads) : store(_store),
+ RGWQuotaHandlerImpl(rgw::sal::Store *_store, bool quota_threads) : store(_store),
bucket_stats_cache(_store),
user_stats_cache(_store, quota_threads) {}
};
-RGWQuotaHandler *RGWQuotaHandler::generate_handler(rgw::sal::RGWStore *store, bool quota_threads)
+RGWQuotaHandler *RGWQuotaHandler::generate_handler(rgw::sal::Store *store, bool quota_threads)
{
return new RGWQuotaHandlerImpl(store, quota_threads);
}
class JSONObj;
namespace rgw { namespace sal {
- class RGWStore;
+ class Store;
} }
struct RGWQuotaInfo {
virtual void update_stats(const rgw_user& bucket_owner, rgw_bucket& bucket, int obj_delta, uint64_t added_bytes, uint64_t removed_bytes) = 0;
- static RGWQuotaHandler *generate_handler(rgw::sal::RGWStore *store, bool quota_threads);
+ static RGWQuotaHandler *generate_handler(rgw::sal::Store *store, bool quota_threads);
static void free_handler(RGWQuotaHandler *handler);
};
return raw_obj;
}
-rgw_raw_obj rgw_obj_select::get_raw_obj(rgw::sal::RGWStore* store) const
+rgw_raw_obj rgw_obj_select::get_raw_obj(rgw::sal::Store* store) const
{
if (!is_raw) {
rgw_raw_obj r;
sync.stop();
}
public:
- RGWMetaSyncProcessorThread(rgw::sal::RGWRadosStore *_store, RGWAsyncRadosProcessor *async_rados)
+ RGWMetaSyncProcessorThread(rgw::sal::RadosStore *_store, RGWAsyncRadosProcessor *async_rados)
: RGWSyncProcessorThread(_store->getRados(), "meta-sync"), sync(_store, async_rados) {}
void wakeup_sync_shards(set<int>& shard_ids) {
sync.stop();
}
public:
- RGWDataSyncProcessorThread(rgw::sal::RGWRadosStore *_store, RGWAsyncRadosProcessor *async_rados,
+ RGWDataSyncProcessorThread(rgw::sal::RadosStore *_store, RGWAsyncRadosProcessor *async_rados,
const RGWZone* source_zone)
: RGWSyncProcessorThread(_store->getRados(), "data-sync"),
counters(sync_counters::build(store->ctx(), std::string("data-sync-from-") + source_zone->name)),
class RGWSyncLogTrimThread : public RGWSyncProcessorThread, DoutPrefixProvider
{
RGWCoroutinesManager crs;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
rgw::BucketTrimManager *bucket_trim;
RGWHTTPManager http;
const utime_t trim_interval;
uint64_t interval_msec() override { return 0; }
void stop_process() override { crs.stop(); }
public:
- RGWSyncLogTrimThread(rgw::sal::RGWRadosStore *store, rgw::BucketTrimManager *bucket_trim,
+ RGWSyncLogTrimThread(rgw::sal::RadosStore *store, rgw::BucketTrimManager *bucket_trim,
int interval)
: RGWSyncProcessorThread(store->getRados(), "sync-log-trim"),
crs(store->ctx(), store->getRados()->get_cr_registry()), store(store),
int process() override {
list<RGWCoroutinesStack*> stacks;
auto meta = new RGWCoroutinesStack(store->ctx(), &crs);
- meta->call(create_meta_log_trim_cr(this, static_cast<rgw::sal::RGWRadosStore*>(store), &http,
+ meta->call(create_meta_log_trim_cr(this, static_cast<rgw::sal::RadosStore*>(store), &http,
cct->_conf->rgw_md_log_max_shards,
trim_interval));
stacks.push_back(meta);
if (store->svc()->zone->sync_module_exports_data()) {
auto data = new RGWCoroutinesStack(store->ctx(), &crs);
- data->call(create_data_log_trim_cr(static_cast<rgw::sal::RGWRadosStore*>(store), &http,
+ data->call(create_data_log_trim_cr(static_cast<rgw::sal::RadosStore*>(store), &http,
cct->_conf->rgw_data_log_num_shards,
trim_interval));
stacks.push_back(data);
return 0;
}
-bool RGWRados::swift_versioning_enabled(rgw::sal::RGWBucket* bucket) const
+bool RGWRados::swift_versioning_enabled(rgw::sal::Bucket* bucket) const
{
return bucket->get_info().has_swift_versioning() &&
bucket->get_info().swift_ver_location.size();
int RGWRados::swift_versioning_copy(RGWObjectCtx& obj_ctx,
const rgw_user& user,
- rgw::sal::RGWBucket* bucket,
- rgw::sal::RGWObject* obj,
+ rgw::sal::Bucket* bucket,
+ rgw::sal::Object* obj,
const DoutPrefixProvider *dpp,
optional_yield y)
{
return -ERR_PRECONDITION_FAILED;
}
- rgw::sal::RGWRadosBucket dest_bucket(store, dest_bucket_info);
- rgw::sal::RGWRadosObject dest_obj(store, rgw_obj_key(buf), &dest_bucket);
+ rgw::sal::RadosBucket dest_bucket(store, dest_bucket_info);
+ rgw::sal::RadosObject dest_obj(store, rgw_obj_key(buf), &dest_bucket);
if (dest_bucket_info.versioning_enabled()){
dest_obj.gen_rand_obj_instance_name();
int RGWRados::swift_versioning_restore(RGWObjectCtx& obj_ctx,
const rgw_user& user,
- rgw::sal::RGWBucket* bucket,
- rgw::sal::RGWObject* obj,
+ rgw::sal::Bucket* bucket,
+ rgw::sal::Object* obj,
bool& restored, /* out */
const DoutPrefixProvider *dpp)
{
* irrelevant and may be safely skipped. */
std::map<std::string, ceph::bufferlist> no_attrs;
- rgw::sal::RGWRadosBucket archive_bucket(store, archive_binfo);
- rgw::sal::RGWRadosObject archive_obj(store, entry.key, &archive_bucket);
+ rgw::sal::RadosBucket archive_bucket(store, archive_binfo);
+ rgw::sal::RadosObject archive_obj(store, entry.key, &archive_bucket);
if (bucket->versioning_enabled()){
obj->gen_rand_obj_instance_name();
}
}
-int RGWRados::rewrite_obj(RGWBucketInfo& dest_bucket_info, rgw::sal::RGWObject* obj, const DoutPrefixProvider *dpp, optional_yield y)
+int RGWRados::rewrite_obj(RGWBucketInfo& dest_bucket_info, rgw::sal::Object* obj, const DoutPrefixProvider *dpp, optional_yield y)
{
RGWObjectCtx rctx(this->store);
- rgw::sal::RGWRadosBucket bucket(store, dest_bucket_info);
+ rgw::sal::RadosBucket bucket(store, dest_bucket_info);
return obj->copy_obj_data(rctx, &bucket, obj, 0, NULL, dpp, y);
}
const rgw_user& user_id,
req_info *info,
const rgw_zone_id& source_zone,
- rgw::sal::RGWObject* src_obj,
+ rgw::sal::Object* src_obj,
const RGWBucketInfo *src_bucket_info,
real_time *src_mtime,
uint64_t *psize,
const rgw_user& user_id,
req_info *info,
const rgw_zone_id& source_zone,
- rgw::sal::RGWObject* dest_obj,
- rgw::sal::RGWObject* src_obj,
- rgw::sal::RGWBucket* dest_bucket,
- rgw::sal::RGWBucket* src_bucket,
+ rgw::sal::Object* dest_obj,
+ rgw::sal::Object* src_obj,
+ rgw::sal::Bucket* dest_bucket,
+ rgw::sal::Bucket* src_bucket,
std::optional<rgw_placement_rule> dest_placement_rule,
real_time *src_mtime,
real_time *mtime,
const char *if_nomatch,
AttrsMod attrs_mod,
bool copy_if_newer,
- rgw::sal::RGWAttrs& attrs,
+ rgw::sal::Attrs& attrs,
RGWObjCategory category,
std::optional<uint64_t> olh_epoch,
real_time delete_at,
map<string, bufferlist>& src_attrs,
RGWRados::Object::Read& read_op,
const rgw_user& user_id,
- rgw::sal::RGWObject* dest_obj,
+ rgw::sal::Object* dest_obj,
real_time *mtime)
{
string etag;
const rgw_user& user_id,
req_info *info,
const rgw_zone_id& source_zone,
- rgw::sal::RGWObject* dest_obj,
- rgw::sal::RGWObject* src_obj,
- rgw::sal::RGWBucket* dest_bucket,
- rgw::sal::RGWBucket* src_bucket,
+ rgw::sal::Object* dest_obj,
+ rgw::sal::Object* src_obj,
+ rgw::sal::Bucket* dest_bucket,
+ rgw::sal::Bucket* src_bucket,
const rgw_placement_rule& dest_placement,
real_time *src_mtime,
real_time *mtime,
const char *if_nomatch,
AttrsMod attrs_mod,
bool copy_if_newer,
- rgw::sal::RGWAttrs& attrs,
+ rgw::sal::Attrs& attrs,
RGWObjCategory category,
uint64_t olh_epoch,
real_time delete_at,
int RGWRados::copy_obj_data(RGWObjectCtx& obj_ctx,
- rgw::sal::RGWBucket* bucket,
+ rgw::sal::Bucket* bucket,
const rgw_placement_rule& dest_placement,
RGWRados::Object::Read& read_op, off_t end,
- rgw::sal::RGWObject* dest_obj,
+ rgw::sal::Object* dest_obj,
real_time *mtime,
real_time set_mtime,
- rgw::sal::RGWAttrs& attrs,
+ rgw::sal::Attrs& attrs,
uint64_t olh_epoch,
real_time delete_at,
string *petag,
}
int RGWRados::transition_obj(RGWObjectCtx& obj_ctx,
- rgw::sal::RGWBucket* bucket,
- rgw::sal::RGWObject& obj,
+ rgw::sal::Bucket* bucket,
+ rgw::sal::Object& obj,
const rgw_placement_rule& placement_rule,
const real_time& mtime,
uint64_t olh_epoch,
const DoutPrefixProvider *dpp,
optional_yield y)
{
- rgw::sal::RGWAttrs attrs;
+ rgw::sal::Attrs attrs;
real_time read_mtime;
uint64_t obj_size;
return index_op.complete_del(dpp, -1 /* pool */, 0, mtime, NULL);
}
-static void generate_fake_tag(rgw::sal::RGWStore* store, map<string, bufferlist>& attrset, RGWObjManifest& manifest, bufferlist& manifest_bl, bufferlist& tag_bl)
+static void generate_fake_tag(rgw::sal::Store* store, map<string, bufferlist>& attrset, RGWObjManifest& manifest, bufferlist& manifest_bl, bufferlist& tag_bl)
{
string tag;
};
class RGWObjectCtx {
- rgw::sal::RGWStore *store;
+ rgw::sal::Store *store;
ceph::shared_mutex lock = ceph::make_shared_mutex("RGWObjectCtx");
void *s{nullptr};
std::map<rgw_obj, RGWObjState> objs_state;
public:
- explicit RGWObjectCtx(rgw::sal::RGWStore *_store) : store(_store) {}
- explicit RGWObjectCtx(rgw::sal::RGWStore *_store, void *_s) : store(_store), s(_s) {}
+ explicit RGWObjectCtx(rgw::sal::Store *_store) : store(_store) {}
+ explicit RGWObjectCtx(rgw::sal::Store *_store, void *_s) : store(_store), s(_s) {}
void *get_private() {
return s;
}
- rgw::sal::RGWStore *get_store() {
+ rgw::sal::Store *get_store() {
return store;
}
class RGWGetDirHeader_CB;
class RGWGetUserHeader_CB;
namespace rgw { namespace sal {
- class RGWStore;
- class RGWRadosStore;
+ class Store;
+ class RadosStore;
class MPRadosSerializer;
class LCRadosSerializer;
} }
friend class BucketIndexLockGuard;
friend class rgw::sal::MPRadosSerializer;
friend class rgw::sal::LCRadosSerializer;
- friend class rgw::sal::RGWRadosStore;
+ friend class rgw::sal::RadosStore;
/** Open the pool used as root for this gateway */
int open_root_pool_ctx();
ceph::mutex lock = ceph::make_mutex("rados_timer_lock");
SafeTimer *timer;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
RGWGC *gc;
RGWLC *lc;
RGWObjectExpirer *obj_expirer;
void set_context(CephContext *_cct) {
cct = _cct;
}
- void set_store(rgw::sal::RGWRadosStore *_store) {
+ void set_store(rgw::sal::RadosStore *_store) {
store = _store;
}
const std::string& obj_delim,
std::function<int(const rgw_bucket_dir_entry&)> handler);
- bool swift_versioning_enabled(rgw::sal::RGWBucket* bucket) const;
+ bool swift_versioning_enabled(rgw::sal::Bucket* bucket) const;
int swift_versioning_copy(RGWObjectCtx& obj_ctx, /* in/out */
const rgw_user& user, /* in */
- rgw::sal::RGWBucket* bucket, /* in */
- rgw::sal::RGWObject* obj, /* in */
+ rgw::sal::Bucket* bucket, /* in */
+ rgw::sal::Object* obj, /* in */
const DoutPrefixProvider *dpp, /* in/out */
optional_yield y); /* in */
int swift_versioning_restore(RGWObjectCtx& obj_ctx, /* in/out */
const rgw_user& user, /* in */
- rgw::sal::RGWBucket* bucket, /* in */
- rgw::sal::RGWObject* obj, /* in */
+ rgw::sal::Bucket* bucket, /* in */
+ rgw::sal::Object* obj, /* in */
bool& restored, /* out */
const DoutPrefixProvider *dpp); /* in/out */
int copy_obj_to_remote_dest(const DoutPrefixProvider *dpp,
map<string, bufferlist>& src_attrs,
RGWRados::Object::Read& read_op,
const rgw_user& user_id,
- rgw::sal::RGWObject* dest_obj,
+ rgw::sal::Object* dest_obj,
ceph::real_time *mtime);
enum AttrsMod {
ATTRSMOD_MERGE = 2
};
- int rewrite_obj(RGWBucketInfo& dest_bucket_info, rgw::sal::RGWObject* obj, const DoutPrefixProvider *dpp, optional_yield y);
+ int rewrite_obj(RGWBucketInfo& dest_bucket_info, rgw::sal::Object* obj, const DoutPrefixProvider *dpp, optional_yield y);
int stat_remote_obj(RGWObjectCtx& obj_ctx,
const rgw_user& user_id,
req_info *info,
const rgw_zone_id& source_zone,
- rgw::sal::RGWObject* src_obj,
+ rgw::sal::Object* src_obj,
const RGWBucketInfo *src_bucket_info,
real_time *src_mtime,
uint64_t *psize,
const rgw_user& user_id,
req_info *info,
const rgw_zone_id& source_zone,
- rgw::sal::RGWObject* dest_obj,
- rgw::sal::RGWObject* src_obj,
- rgw::sal::RGWBucket* dest_bucket,
- rgw::sal::RGWBucket* src_bucket,
+ rgw::sal::Object* dest_obj,
+ rgw::sal::Object* src_obj,
+ rgw::sal::Bucket* dest_bucket,
+ rgw::sal::Bucket* src_bucket,
std::optional<rgw_placement_rule> dest_placement,
ceph::real_time *src_mtime,
ceph::real_time *mtime,
const char *if_nomatch,
AttrsMod attrs_mod,
bool copy_if_newer,
- rgw::sal::RGWAttrs& attrs,
+ rgw::sal::Attrs& attrs,
RGWObjCategory category,
std::optional<uint64_t> olh_epoch,
ceph::real_time delete_at,
const rgw_user& user_id,
req_info *info,
const rgw_zone_id& source_zone,
- rgw::sal::RGWObject* dest_obj,
- rgw::sal::RGWObject* src_obj,
- rgw::sal::RGWBucket* dest_bucket,
- rgw::sal::RGWBucket* src_bucket,
+ rgw::sal::Object* dest_obj,
+ rgw::sal::Object* src_obj,
+ rgw::sal::Bucket* dest_bucket,
+ rgw::sal::Bucket* src_bucket,
const rgw_placement_rule& dest_placement,
ceph::real_time *src_mtime,
ceph::real_time *mtime,
optional_yield y);
int copy_obj_data(RGWObjectCtx& obj_ctx,
- rgw::sal::RGWBucket* bucket,
+ rgw::sal::Bucket* bucket,
const rgw_placement_rule& dest_placement,
RGWRados::Object::Read& read_op, off_t end,
- rgw::sal::RGWObject* dest_obj,
+ rgw::sal::Object* dest_obj,
ceph::real_time *mtime,
ceph::real_time set_mtime,
map<string, bufferlist>& attrs,
optional_yield y);
int transition_obj(RGWObjectCtx& obj_ctx,
- rgw::sal::RGWBucket* bucket,
- rgw::sal::RGWObject& obj,
+ rgw::sal::Bucket* bucket,
+ rgw::sal::Object& obj,
const rgw_placement_rule& placement_rule,
const real_time& mtime,
uint64_t olh_epoch,
static constexpr bool USE_SAFE_TIMER_CALLBACKS = false;
-RGWRealmReloader::RGWRealmReloader(rgw::sal::RGWStore*& store, std::map<std::string, std::string>& service_map_meta,
+RGWRealmReloader::RGWRealmReloader(rgw::sal::Store*& store, std::map<std::string, std::string>& service_map_meta,
Pauser* frontends)
: store(store),
service_map_meta(service_map_meta),
rgw_log_usage_finalize();
// destroy the existing store
- RGWStoreManager::close_storage(store);
+ StoreManager::close_storage(store);
store = nullptr;
ldout(cct, 1) << "Store closed" << dendl;
while (!store) {
// recreate and initialize a new store
store =
- RGWStoreManager::get_storage(&dp, cct,
+ StoreManager::get_storage(&dp, cct,
"rados",
cct->_conf->rgw_enable_gc_threads,
cct->_conf->rgw_enable_lc_threads,
ldout(cct, 1) << "Creating new store" << dendl;
- rgw::sal::RGWStore* store_cleanup = nullptr;
+ rgw::sal::Store* store_cleanup = nullptr;
{
std::unique_lock lock{mutex};
ldout(cct, 4) << "Got another notification, restarting RGWRados "
"initialization." << dendl;
- RGWStoreManager::close_storage(store_cleanup);
+ StoreManager::close_storage(store_cleanup);
}
}
namespace rgw {
namespace sal {
-class RGWStore;
+class Store;
}
}
/// pause all frontends while realm reconfiguration is in progress
virtual void pause() = 0;
/// resume all frontends with the given RGWRados instance
- virtual void resume(rgw::sal::RGWStore* store) = 0;
+ virtual void resume(rgw::sal::Store* store) = 0;
};
- RGWRealmReloader(rgw::sal::RGWStore*& store, std::map<std::string, std::string>& service_map_meta,
+ RGWRealmReloader(rgw::sal::Store*& store, std::map<std::string, std::string>& service_map_meta,
Pauser* frontends);
~RGWRealmReloader() override;
class C_Reload; //< Context that calls reload()
- /// main()'s RGWStore pointer as a reference, modified by reload()
- rgw::sal::RGWStore*& store;
+ /// main()'s Store pointer as a reference, modified by reload()
+ rgw::sal::Store*& store;
std::map<std::string, std::string>& service_map_meta;
Pauser *const frontends;
};
class BucketReshardShard {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
const RGWBucketInfo& bucket_info;
int num_shard;
const rgw::bucket_index_layout_generation& idx_layout;
public:
BucketReshardShard(const DoutPrefixProvider *dpp,
- rgw::sal::RGWRadosStore *_store, const RGWBucketInfo& _bucket_info,
+ rgw::sal::RadosStore *_store, const RGWBucketInfo& _bucket_info,
int _num_shard, const rgw::bucket_index_layout_generation& _idx_layout,
deque<librados::AioCompletion *>& _completions) :
store(_store), bucket_info(_bucket_info), idx_layout(_idx_layout), bs(store->getRados()),
class BucketReshardManager {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
const RGWBucketInfo& target_bucket_info;
deque<librados::AioCompletion *> completions;
int num_target_shards;
public:
BucketReshardManager(const DoutPrefixProvider *dpp,
- rgw::sal::RGWRadosStore *_store,
+ rgw::sal::RadosStore *_store,
const RGWBucketInfo& _target_bucket_info,
int _num_target_shards) :
store(_store), target_bucket_info(_target_bucket_info),
}
}; // class BucketReshardManager
-RGWBucketReshard::RGWBucketReshard(rgw::sal::RGWRadosStore *_store,
+RGWBucketReshard::RGWBucketReshard(rgw::sal::RadosStore *_store,
const RGWBucketInfo& _bucket_info,
const map<string, bufferlist>& _bucket_attrs,
RGWBucketReshardLock* _outer_reshard_lock) :
outer_reshard_lock(_outer_reshard_lock)
{ }
-int RGWBucketReshard::set_resharding_status(rgw::sal::RGWRadosStore* store,
+int RGWBucketReshard::set_resharding_status(rgw::sal::RadosStore* store,
const RGWBucketInfo& bucket_info,
const string& new_instance_id,
int32_t num_shards,
}
// reshard lock assumes lock is held
-int RGWBucketReshard::clear_resharding(rgw::sal::RGWRadosStore* store,
+int RGWBucketReshard::clear_resharding(rgw::sal::RadosStore* store,
const RGWBucketInfo& bucket_info)
{
int ret = clear_index_shard_reshard_status(store, bucket_info);
return 0;
}
-int RGWBucketReshard::clear_index_shard_reshard_status(rgw::sal::RGWRadosStore* store,
+int RGWBucketReshard::clear_index_shard_reshard_status(rgw::sal::RadosStore* store,
const RGWBucketInfo& bucket_info)
{
uint32_t num_shards = bucket_info.layout.current_index.layout.normal.num_shards;
return 0;
}
-static int create_new_bucket_instance(rgw::sal::RGWRadosStore *store,
+static int create_new_bucket_instance(rgw::sal::RadosStore *store,
int new_num_shards,
const RGWBucketInfo& bucket_info,
map<string, bufferlist>& attrs,
class BucketInfoReshardUpdate
{
const DoutPrefixProvider *dpp;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
RGWBucketInfo& bucket_info;
std::map<string, bufferlist> bucket_attrs;
public:
BucketInfoReshardUpdate(const DoutPrefixProvider *_dpp,
- rgw::sal::RGWRadosStore *_store,
+ rgw::sal::RadosStore *_store,
RGWBucketInfo& _bucket_info,
map<string, bufferlist>& _bucket_attrs,
const string& new_bucket_id) :
};
-RGWBucketReshardLock::RGWBucketReshardLock(rgw::sal::RGWRadosStore* _store,
+RGWBucketReshardLock::RGWBucketReshardLock(rgw::sal::RadosStore* _store,
const std::string& reshard_lock_oid,
bool _ephemeral) :
store(_store),
} // execute
-RGWReshard::RGWReshard(rgw::sal::RGWRadosStore* _store, bool _verbose, ostream *_out,
+RGWReshard::RGWReshard(rgw::sal::RadosStore* _store, bool _verbose, ostream *_out,
Formatter *_formatter) :
store(_store), instance_lock(bucket_instance_lock_name),
verbose(_verbose), out(_out), formatter(_formatter)
class RGWReshard;
namespace rgw { namespace sal {
- class RGWRadosStore;
+ class RadosStore;
} }
class RGWBucketReshardLock {
using Clock = ceph::coarse_mono_clock;
- rgw::sal::RGWRadosStore* store;
+ rgw::sal::RadosStore* store;
const std::string lock_oid;
const bool ephemeral;
rados::cls::lock::Lock internal_lock;
}
public:
- RGWBucketReshardLock(rgw::sal::RGWRadosStore* _store,
+ RGWBucketReshardLock(rgw::sal::RadosStore* _store,
const std::string& reshard_lock_oid,
bool _ephemeral);
- RGWBucketReshardLock(rgw::sal::RGWRadosStore* _store,
+ RGWBucketReshardLock(rgw::sal::RadosStore* _store,
const RGWBucketInfo& bucket_info,
bool _ephemeral) :
RGWBucketReshardLock(_store, bucket_info.bucket.get_key(':'), _ephemeral)
private:
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
RGWBucketInfo bucket_info;
std::map<string, bufferlist> bucket_attrs;
// pass nullptr for the final parameter if no outer reshard lock to
// manage
- RGWBucketReshard(rgw::sal::RGWRadosStore *_store,
+ RGWBucketReshard(rgw::sal::RadosStore *_store,
const RGWBucketInfo& _bucket_info,
const std::map<string, bufferlist>& _bucket_attrs,
RGWBucketReshardLock* _outer_reshard_lock);
RGWReshard *reshard_log = nullptr);
int get_status(std::list<cls_rgw_bucket_instance_entry> *status);
int cancel();
- static int clear_resharding(rgw::sal::RGWRadosStore* store,
+ static int clear_resharding(rgw::sal::RadosStore* store,
const RGWBucketInfo& bucket_info);
int clear_resharding() {
return clear_resharding(store, bucket_info);
}
- static int clear_index_shard_reshard_status(rgw::sal::RGWRadosStore* store,
+ static int clear_index_shard_reshard_status(rgw::sal::RadosStore* store,
const RGWBucketInfo& bucket_info);
int clear_index_shard_reshard_status() {
return clear_index_shard_reshard_status(store, bucket_info);
}
- static int set_resharding_status(rgw::sal::RGWRadosStore* store,
+ static int set_resharding_status(rgw::sal::RadosStore* store,
const RGWBucketInfo& bucket_info,
const string& new_instance_id,
int32_t num_shards,
using Clock = ceph::coarse_mono_clock;
private:
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
string lock_name;
rados::cls::lock::Lock instance_lock;
int num_logshards;
void get_bucket_logshard_oid(const string& tenant, const string& bucket_name, string *oid);
public:
- RGWReshard(rgw::sal::RGWRadosStore* _store, bool _verbose = false, ostream *_out = nullptr, Formatter *_formatter = nullptr);
+ RGWReshard(rgw::sal::RadosStore* _store, bool _verbose = false, ostream *_out = nullptr, Formatter *_formatter = nullptr);
int add(cls_rgw_reshard_entry& entry);
int update(const RGWBucketInfo& bucket_info, const RGWBucketInfo& new_bucket_info);
int get(cls_rgw_reshard_entry& entry);
// We don't need user policies in case of STS token returned by AssumeRole, hence the check for user type
if (! s->user->get_id().empty() && s->auth.identity->get_identity_type() != TYPE_ROLE) {
try {
- rgw::sal::RGWAttrs uattrs;
+ rgw::sal::Attrs uattrs;
if (auto ret = s->user->read_attrs(s, y, &uattrs); ! ret) {
auto user_policies = get_iam_user_policy_from_attr(s->cct, uattrs, s->user->get_tenant());
s->iam_user_policies.insert(s->iam_user_policies.end(),
}
RGWHandler_REST* RGWREST::get_handler(
- rgw::sal::RGWStore * const store,
+ rgw::sal::Store * const store,
struct req_state* const s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix,
public:
RGWGetObj_ObjStore() : sent_header(false) {}
- void init(rgw::sal::RGWStore *store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store *store, struct req_state *s, RGWHandler *h) override {
RGWGetObj::init(store, s, h);
sent_header = false;
}
RGWRESTFlusher flusher;
public:
- void init(rgw::sal::RGWStore *store, struct req_state *s,
+ void init(rgw::sal::Store *store, struct req_state *s,
RGWHandler *dialect_handler) override {
RGWOp::init(store, s, dialect_handler);
flusher.init(s, this);
}
virtual RGWHandler_REST* get_handler(
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
struct req_state* const s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix
static int preprocess(struct req_state *s, rgw::io::BasicClient* rio);
public:
RGWREST() {}
- RGWHandler_REST *get_handler(rgw::sal::RGWStore *store,
+ RGWHandler_REST *get_handler(rgw::sal::Store *store,
struct req_state *s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix,
{
std::string bucket_name;
bool delete_children;
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
RESTArgs::get_string(s, "bucket", bucket_name, &bucket_name);
RESTArgs::get_bool(s, "purge-objects", false, &delete_children);
}
}
if (use_http_params) {
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
op_ret = store->get_bucket(s, nullptr, uid.tenant, bucket_name, &bucket, s->yield);
if (op_ret < 0) {
return;
RGWRESTMgr_Bucket() = default;
~RGWRESTMgr_Bucket() override = default;
- RGWHandler_REST* get_handler(rgw::sal::RGWStore *store,
+ RGWHandler_REST* get_handler(rgw::sal::Store *store,
struct req_state*,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string&) override {
return 0;
}
-void RGWRESTStreamS3PutObj::send_init(rgw::sal::RGWObject* obj)
+void RGWRESTStreamS3PutObj::send_init(rgw::sal::Object* obj)
{
string resource_str;
string resource;
out_cb = new RGWRESTStreamOutCB(this);
}
-void RGWRESTStreamS3PutObj::put_obj_init(RGWAccessKey& key, rgw::sal::RGWObject* obj, map<string, bufferlist>& attrs)
+void RGWRESTStreamS3PutObj::put_obj_init(RGWAccessKey& key, rgw::sal::Object* obj, map<string, bufferlist>& attrs)
{
send_init(obj);
send_ready(key, attrs);
out_cb(NULL), new_info(cct, &new_env), headers_gen(_cct, &new_env, &new_info) {}
~RGWRESTStreamS3PutObj() override;
- void send_init(rgw::sal::RGWObject* obj);
+ void send_init(rgw::sal::Object* obj);
void send_ready(RGWAccessKey& key, map<string, bufferlist>& rgw_attrs);
void send_ready(RGWAccessKey& key, const map<string, string>& http_attrs,
RGWAccessControlPolicy& policy);
void send_ready(RGWAccessKey& key);
- void put_obj_init(RGWAccessKey& key, rgw::sal::RGWObject* obj, map<string, bufferlist>& attrs);
+ void put_obj_init(RGWAccessKey& key, rgw::sal::Object* obj, map<string, bufferlist>& attrs);
RGWGetDataCB *get_out_cb() { return out_cb; }
};
#define dout_subsys ceph_subsys_rgw
void RGWOp_ZoneGroupMap_Get::execute(optional_yield y) {
- op_ret = zonegroup_map.read(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, y);
+ op_ret = zonegroup_map.read(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, y);
if (op_ret < 0) {
dout(5) << "failed to read zone_group map" << dendl;
}
RGWRESTMgr_Config() = default;
~RGWRESTMgr_Config() override = default;
- RGWHandler_REST* get_handler(rgw::sal::RGWStore *,
+ RGWHandler_REST* get_handler(rgw::sal::Store *,
struct req_state*,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string&) override {
}
}
-RGWRESTConn::RGWRESTConn(CephContext *_cct, rgw::sal::RGWStore* store,
+RGWRESTConn::RGWRESTConn(CephContext *_cct, rgw::sal::Store* store,
const string& _remote_id,
const list<string>& remote_endpoints,
std::optional<string> _api_name,
}
}
-RGWRESTConn::RGWRESTConn(CephContext *_cct, rgw::sal::RGWStore* store,
+RGWRESTConn::RGWRESTConn(CephContext *_cct, rgw::sal::Store* store,
const string& _remote_id,
const list<string>& remote_endpoints,
RGWAccessKey _cred,
return req.forward_request(key, info, max_response, inbl, outbl, y);
}
-int RGWRESTConn::put_obj_send_init(rgw::sal::RGWObject* obj, const rgw_http_param_pair *extra_params, RGWRESTStreamS3PutObj **req)
+int RGWRESTConn::put_obj_send_init(rgw::sal::Object* obj, const rgw_http_param_pair *extra_params, RGWRESTStreamS3PutObj **req)
{
string url;
int ret = get_url(url);
return 0;
}
-int RGWRESTConn::put_obj_async_init(const rgw_user& uid, rgw::sal::RGWObject* obj,
+int RGWRESTConn::put_obj_async_init(const rgw_user& uid, rgw::sal::Object* obj,
map<string, bufferlist>& attrs,
RGWRESTStreamS3PutObj **req)
{
}
-int RGWRESTConn::get_obj(const rgw_user& uid, req_info *info /* optional */, const rgw::sal::RGWObject* obj,
+int RGWRESTConn::get_obj(const rgw_user& uid, req_info *info /* optional */, const rgw::sal::Object* obj,
const real_time *mod_ptr, const real_time *unmod_ptr,
uint32_t mod_zone_id, uint64_t mod_pg_ver,
bool prepend_metadata, bool get_op, bool rgwx_stat,
return get_obj(obj, params, send, req);
}
-int RGWRESTConn::get_obj(const rgw::sal::RGWObject* obj, const get_obj_params& in_params, bool send, RGWRESTStreamRWRequest **req)
+int RGWRESTConn::get_obj(const rgw::sal::Object* obj, const get_obj_params& in_params, bool send, RGWRESTStreamRWRequest **req)
{
string url;
int ret = get_url(url);
#include <atomic>
namespace rgw { namespace sal {
- class RGWStore;
+ class Store;
} }
class RGWSI_Zone;
std::optional<string> _api_name,
HostStyle _host_style = PathStyle);
RGWRESTConn(CephContext *_cct,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
const string& _remote_id,
const list<string>& endpoints,
std::optional<string> _api_name,
std::optional<string> _api_name,
HostStyle _host_style = PathStyle);
RGWRESTConn(CephContext *_cct,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
const string& _remote_id,
const list<string>& endpoints,
RGWAccessKey _cred,
/* async requests */
- int put_obj_send_init(rgw::sal::RGWObject* obj, const rgw_http_param_pair *extra_params, RGWRESTStreamS3PutObj **req);
- int put_obj_async_init(const rgw_user& uid, rgw::sal::RGWObject* obj,
+ int put_obj_send_init(rgw::sal::Object* obj, const rgw_http_param_pair *extra_params, RGWRESTStreamS3PutObj **req);
+ int put_obj_async_init(const rgw_user& uid, rgw::sal::Object* obj,
map<string, bufferlist>& attrs, RGWRESTStreamS3PutObj **req);
int complete_request(RGWRESTStreamS3PutObj *req, string& etag,
ceph::real_time *mtime, optional_yield y);
uint64_t range_end{0};
};
- int get_obj(const rgw::sal::RGWObject* obj, const get_obj_params& params, bool send, RGWRESTStreamRWRequest **req);
+ int get_obj(const rgw::sal::Object* obj, const get_obj_params& params, bool send, RGWRESTStreamRWRequest **req);
- int get_obj(const rgw_user& uid, req_info *info /* optional */, const rgw::sal::RGWObject* obj,
+ int get_obj(const rgw_user& uid, req_info *info /* optional */, const rgw::sal::Object* obj,
const ceph::real_time *mod_ptr, const ceph::real_time *unmod_ptr,
uint32_t mod_zone_id, uint64_t mod_pg_ver,
bool prepend_metadata, bool get_op, bool rgwx_stat, bool sync_manifest,
S3RESTConn(CephContext *_cct, RGWSI_Zone *svc_zone, const string& _remote_id, const list<string>& endpoints, std::optional<std::string> _api_name, HostStyle _host_style = PathStyle) :
RGWRESTConn(_cct, svc_zone, _remote_id, endpoints, _api_name, _host_style) {}
- S3RESTConn(CephContext *_cct, rgw::sal::RGWStore* store, const string& _remote_id, const list<string>& endpoints, std::optional<std::string> _api_name, HostStyle _host_style = PathStyle) :
+ S3RESTConn(CephContext *_cct, rgw::sal::Store* store, const string& _remote_id, const list<string>& endpoints, std::optional<std::string> _api_name, HostStyle _host_style = PathStyle) :
RGWRESTConn(_cct, store, _remote_id, endpoints, _api_name, _host_style) {}
S3RESTConn(CephContext *_cct, RGWSI_Zone *svc_zone, const string& _remote_id, const list<string>& endpoints, RGWAccessKey _cred, std::optional<std::string> _api_name, HostStyle _host_style = PathStyle):
RGWRESTConn(_cct, svc_zone, _remote_id, endpoints, _cred, _api_name, _host_style) {}
- S3RESTConn(CephContext *_cct, rgw::sal::RGWStore* store, const string& _remote_id, const list<string>& endpoints, RGWAccessKey _cred, std::optional<std::string> _api_name, HostStyle _host_style = PathStyle):
+ S3RESTConn(CephContext *_cct, rgw::sal::Store* store, const string& _remote_id, const list<string>& endpoints, RGWAccessKey _cred, std::optional<std::string> _api_name, HostStyle _host_style = PathStyle):
RGWRESTConn(_cct, store, _remote_id, endpoints, _cred, _api_name, _host_style) {}
~S3RESTConn() override = default;
return nullptr;
}
-int RGWHandler_REST_IAM::init(rgw::sal::RGWStore *store,
+int RGWHandler_REST_IAM::init(rgw::sal::Store *store,
struct req_state *s,
rgw::io::BasicClient *cio)
{
}
RGWHandler_REST*
-RGWRESTMgr_IAM::get_handler(rgw::sal::RGWStore *store,
+RGWRESTMgr_IAM::get_handler(rgw::sal::Store *store,
struct req_state* const s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix)
post_body(post_body) {}
~RGWHandler_REST_IAM() override = default;
- int init(rgw::sal::RGWStore *store,
+ int init(rgw::sal::Store *store,
struct req_state *s,
rgw::io::BasicClient *cio) override;
int authorize(const DoutPrefixProvider* dpp, optional_yield y) override;
return this;
}
- RGWHandler_REST* get_handler(rgw::sal::RGWStore *store,
+ RGWHandler_REST* get_handler(rgw::sal::Store *store,
struct req_state*,
const rgw::auth::StrategyRegistry&,
const std::string&) override;
}
}
- RGWMetadataLog meta_log{s->cct, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->cls, period};
+ RGWMetadataLog meta_log{s->cct, static_cast<rgw::sal::RadosStore*>(store)->svc()->zone, static_cast<rgw::sal::RadosStore*>(store)->svc()->cls, period};
meta_log.init_list_entries(shard_id, {}, {}, marker, &handle);
for (list<cls_log_entry>::iterator iter = entries.begin();
iter != entries.end(); ++iter) {
cls_log_entry& entry = *iter;
- static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->dump_log_entry(entry, s->formatter);
+ static_cast<rgw::sal::RadosStore*>(store)->ctl()->meta.mgr->dump_log_entry(entry, s->formatter);
flusher.flush();
}
s->formatter->close_section();
void RGWOp_MDLog_Info::execute(optional_yield y) {
num_objects = s->cct->_conf->rgw_md_log_max_shards;
- period = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->mdlog->read_oldest_log_period(y, s);
+ period = static_cast<rgw::sal::RadosStore*>(store)->svc()->mdlog->read_oldest_log_period(y, s);
op_ret = period.get_error();
}
return;
}
}
- RGWMetadataLog meta_log{s->cct, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->cls, period};
+ RGWMetadataLog meta_log{s->cct, static_cast<rgw::sal::RadosStore*>(store)->svc()->zone, static_cast<rgw::sal::RadosStore*>(store)->svc()->cls, period};
op_ret = meta_log.get_info(shard_id, &info);
}
return;
}
}
- RGWMetadataLog meta_log{s->cct, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->cls, period};
+ RGWMetadataLog meta_log{s->cct, static_cast<rgw::sal::RadosStore*>(store)->svc()->zone, static_cast<rgw::sal::RadosStore*>(store)->svc()->cls, period};
op_ret = meta_log.trim(shard_id, {}, {}, {}, marker);
}
return;
}
- RGWMetadataLog meta_log{s->cct, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->cls, period};
+ RGWMetadataLog meta_log{s->cct, static_cast<rgw::sal::RadosStore*>(store)->svc()->zone, static_cast<rgw::sal::RadosStore*>(store)->svc()->cls, period};
unsigned dur;
dur = (unsigned)strict_strtol(duration_str.c_str(), 10, &err);
if (!err.empty() || dur <= 0) {
return;
}
- RGWMetadataLog meta_log{s->cct, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->cls, period};
+ RGWMetadataLog meta_log{s->cct, static_cast<rgw::sal::RadosStore*>(store)->svc()->zone, static_cast<rgw::sal::RadosStore*>(store)->svc()->cls, period};
op_ret = meta_log.unlock(shard_id, zone_id, locker_id);
}
marker = s->info.args.get("marker"),
max_entries_str = s->info.args.get("max-entries"),
bucket_instance = s->info.args.get("bucket-instance");
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
rgw_bucket b(rgw_bucket_key(tenant_name, bucket_name));
unsigned max_entries;
send_response();
do {
list<rgw_bi_log_entry> entries;
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->bilog_rados->log_list(bucket->get_info(), shard_id,
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->bilog_rados->log_list(bucket->get_info(), shard_id,
marker, max_entries - count,
entries, &truncated);
if (ret < 0) {
string tenant_name = s->info.args.get("tenant"),
bucket_name = s->info.args.get("bucket"),
bucket_instance = s->info.args.get("bucket-instance");
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
rgw_bucket b(rgw_bucket_key(tenant_name, bucket_name));
if (bucket_name.empty() && bucket_instance.empty()) {
end_marker = s->info.args.get("end-marker"),
bucket_instance = s->info.args.get("bucket-instance");
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
rgw_bucket b(rgw_bucket_key(tenant_name, bucket_name));
op_ret = 0;
return;
}
- op_ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->bilog_rados->log_trim(bucket->get_info(), shard_id, start_marker, end_marker);
+ op_ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->bilog_rados->log_trim(bucket->get_info(), shard_id, start_marker, end_marker);
if (op_ret < 0) {
ldpp_dout(s, 5) << "ERROR: trim_bi_log_entries() " << dendl;
}
// Note that last_marker is updated to be the marker of the last
// entry listed
- op_ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->datalog_rados->list_entries(shard_id,
+ op_ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->datalog_rados->list_entries(shard_id,
max_entries, entries,
marker, &last_marker,
&truncated);
return;
}
- op_ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->datalog_rados->get_info(shard_id, &info);
+ op_ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->datalog_rados->get_info(shard_id, &info);
}
void RGWOp_DATALog_ShardInfo::send_response() {
return;
}
- op_ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->datalog_rados->trim_entries(shard_id, marker);
+ op_ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->datalog_rados->trim_entries(shard_id, marker);
}
// not in header to avoid pulling in rgw_sync.h
void RGWOp_MDLog_Status::execute(optional_yield y)
{
- auto sync = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->get_meta_sync_manager();
+ auto sync = static_cast<rgw::sal::RadosStore*>(store)->getRados()->get_meta_sync_manager();
if (sync == nullptr) {
ldout(s->cct, 1) << "no sync manager" << dendl;
op_ret = -ENOENT;
}
// read the bucket instance info for num_shards
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
op_ret = store->get_bucket(s, nullptr, b, &bucket, y);
if (op_ret < 0) {
ldpp_dout(s, 4) << "failed to read bucket info: " << cpp_strerror(op_ret) << dendl;
ldout(s->cct, 20) << "RGWOp_BILog_Status::execute(optional_yield y): getting sync status for pipe=" << pipe << dendl;
- op_ret = rgw_bucket_sync_status(this, static_cast<rgw::sal::RGWRadosStore*>(store), pipe, bucket->get_info(), nullptr, &status);
+ op_ret = rgw_bucket_sync_status(this, static_cast<rgw::sal::RadosStore*>(store), pipe, bucket->get_info(), nullptr, &status);
if (op_ret < 0) {
lderr(s->cct) << "ERROR: rgw_bucket_sync_status() on pipe=" << pipe << " returned ret=" << op_ret << dendl;
if (*pipe.dest.bucket != pinfo->bucket) {
opt_dest_info.emplace();
- std::unique_ptr<rgw::sal::RGWBucket> dest_bucket;
+ std::unique_ptr<rgw::sal::Bucket> dest_bucket;
op_ret = store->get_bucket(s, nullptr, *pipe.dest.bucket, &dest_bucket, y);
if (op_ret < 0) {
ldpp_dout(s, 4) << "failed to read target bucket info (bucket=: " << cpp_strerror(op_ret) << dendl;
pipe.dest.bucket = pinfo->bucket;
}
- int r = rgw_bucket_sync_status(this, static_cast<rgw::sal::RGWRadosStore*>(store), pipe, *pinfo, &bucket->get_info(), ¤t_status);
+ int r = rgw_bucket_sync_status(this, static_cast<rgw::sal::RadosStore*>(store), pipe, *pinfo, &bucket->get_info(), ¤t_status);
if (r < 0) {
lderr(s->cct) << "ERROR: rgw_bucket_sync_status() on pipe=" << pipe << " returned ret=" << r << dendl;
op_ret = r;
RGWRESTMgr_Log() = default;
~RGWRESTMgr_Log() override = default;
- RGWHandler_REST* get_handler(rgw::sal::RGWStore *store,
+ RGWHandler_REST* get_handler(rgw::sal::Store *store,
struct req_state* const,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefixs) override {
frame_metadata_key(s, metadata_key);
- auto meta_mgr = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr;
+ auto meta_mgr = static_cast<rgw::sal::RadosStore*>(store)->ctl()->meta.mgr;
/* Get keys */
op_ret = meta_mgr->get(metadata_key, s->formatter, s->yield, s);
}
}
- op_ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->put(metadata_key, bl, s->yield, s, sync_type,
+ op_ret = static_cast<rgw::sal::RadosStore*>(store)->ctl()->meta.mgr->put(metadata_key, bl, s->yield, s, sync_type,
false, &ondisk_version);
if (op_ret < 0) {
ldpp_dout(s, 5) << "ERROR: can't put key: " << cpp_strerror(op_ret) << dendl;
string metadata_key;
frame_metadata_key(s, metadata_key);
- op_ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->remove(metadata_key, s->yield, s);
+ op_ret = static_cast<rgw::sal::RadosStore*>(store)->ctl()->meta.mgr->remove(metadata_key, s->yield, s);
if (op_ret < 0) {
ldpp_dout(s, 5) << "ERROR: can't remove key: " << cpp_strerror(op_ret) << dendl;
return;
RGWRESTMgr_Metadata() = default;
~RGWRESTMgr_Metadata() override = default;
- RGWHandler_REST* get_handler(rgw::sal::RGWStore *store,
+ RGWHandler_REST* get_handler(rgw::sal::Store *store,
struct req_state* const s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix) override {
return;
}
- ps.emplace(static_cast<rgw::sal::RGWRadosStore*>(store), s->owner.get_id().tenant);
+ ps.emplace(static_cast<rgw::sal::RadosStore*>(store), s->owner.get_id().tenant);
auto b = ps->get_bucket(bucket_info.bucket);
ceph_assert(b);
std::string data_bucket_prefix = "";
return;
}
- ps.emplace(static_cast<rgw::sal::RGWRadosStore*>(store), s->owner.get_id().tenant);
+ ps.emplace(static_cast<rgw::sal::RadosStore*>(store), s->owner.get_id().tenant);
auto b = ps->get_bucket(bucket_info.bucket);
ceph_assert(b);
};
void RGWPSListNotifs_ObjStore_S3::execute(optional_yield y) {
- ps.emplace(static_cast<rgw::sal::RGWRadosStore*>(store), s->owner.get_id().tenant);
+ ps.emplace(static_cast<rgw::sal::RadosStore*>(store), s->owner.get_id().tenant);
auto b = ps->get_bucket(bucket_info.bucket);
ceph_assert(b);
return;
}
- ps.emplace(static_cast<rgw::sal::RGWRadosStore*>(store), s->owner.get_id().tenant);
+ ps.emplace(static_cast<rgw::sal::RadosStore*>(store), s->owner.get_id().tenant);
op_ret = ps->create_topic(topic_name, dest, topic_arn, opaque_data, y);
if (op_ret < 0) {
ldout(s->cct, 1) << "failed to create topic '" << topic_name << "', ret=" << op_ret << dendl;
}
void RGWPSListTopicsOp::execute(optional_yield y) {
- ps.emplace(static_cast<rgw::sal::RGWRadosStore*>(store), s->owner.get_id().tenant);
+ ps.emplace(static_cast<rgw::sal::RadosStore*>(store), s->owner.get_id().tenant);
op_ret = ps->get_topics(&result);
// if there are no topics it is not considered an error
op_ret = op_ret == -ENOENT ? 0 : op_ret;
if (op_ret < 0) {
return;
}
- ps.emplace(static_cast<rgw::sal::RGWRadosStore*>(store), s->owner.get_id().tenant);
+ ps.emplace(static_cast<rgw::sal::RadosStore*>(store), s->owner.get_id().tenant);
op_ret = ps->get_topic(topic_name, &result);
if (topic_has_endpoint_secret(result) && !rgw_transport_is_secure(s->cct, *(s->info.env))) {
ldout(s->cct, 1) << "topic '" << topic_name << "' contain secret and cannot be sent over insecure transport" << dendl;
if (op_ret < 0) {
return;
}
- ps.emplace(static_cast<rgw::sal::RGWRadosStore*>(store), s->owner.get_id().tenant);
+ ps.emplace(static_cast<rgw::sal::RadosStore*>(store), s->owner.get_id().tenant);
op_ret = ps->remove_topic(topic_name, y);
if (op_ret < 0) {
ldout(s->cct, 1) << "failed to remove topic '" << topic_name << ", ret=" << op_ret << dendl;
if (op_ret < 0) {
return;
}
- ps.emplace(static_cast<rgw::sal::RGWRadosStore*>(store), s->owner.get_id().tenant);
+ ps.emplace(static_cast<rgw::sal::RadosStore*>(store), s->owner.get_id().tenant);
auto sub = ps->get_sub(sub_name);
op_ret = sub->subscribe(topic_name, dest, y);
if (op_ret < 0) {
if (op_ret < 0) {
return;
}
- ps.emplace(static_cast<rgw::sal::RGWRadosStore*>(store), s->owner.get_id().tenant);
+ ps.emplace(static_cast<rgw::sal::RadosStore*>(store), s->owner.get_id().tenant);
auto sub = ps->get_sub(sub_name);
op_ret = sub->get_conf(&result);
if (subscription_has_endpoint_secret(result) && !rgw_transport_is_secure(s->cct, *(s->info.env))) {
if (op_ret < 0) {
return;
}
- ps.emplace(static_cast<rgw::sal::RGWRadosStore*>(store), s->owner.get_id().tenant);
+ ps.emplace(static_cast<rgw::sal::RadosStore*>(store), s->owner.get_id().tenant);
auto sub = ps->get_sub(sub_name);
op_ret = sub->unsubscribe(topic_name, y);
if (op_ret < 0) {
if (op_ret < 0) {
return;
}
- ps.emplace(static_cast<rgw::sal::RGWRadosStore*>(store), s->owner.get_id().tenant);
+ ps.emplace(static_cast<rgw::sal::RadosStore*>(store), s->owner.get_id().tenant);
auto sub = ps->get_sub_with_events(sub_name);
op_ret = sub->remove_event(s, event_id);
if (op_ret < 0) {
if (op_ret < 0) {
return;
}
- ps.emplace(static_cast<rgw::sal::RGWRadosStore*>(store), s->owner.get_id().tenant);
+ ps.emplace(static_cast<rgw::sal::RadosStore*>(store), s->owner.get_id().tenant);
sub = ps->get_sub_with_events(sub_name);
if (!sub) {
op_ret = -ENOENT;
return ret;
}
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(s->owner.get_id());
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::User> user = store->get_user(s->owner.get_id());
+ std::unique_ptr<rgw::sal::Bucket> bucket;
ret = store->get_bucket(this, user.get(), s->owner.get_id().tenant, bucket_name, &bucket, y);
if (ret < 0) {
ldout(s->cct, 1) << "failed to get bucket info, cannot verify ownership" << dendl;
return ret;
}
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(s->owner.get_id());
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::User> user = store->get_user(s->owner.get_id());
+ std::unique_ptr<rgw::sal::Bucket> bucket;
ret = store->get_bucket(this, user.get(), s->owner.get_id().tenant, bucket_name, &bucket, y);
if (ret < 0) {
return ret;
return ret;
}
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(s->owner.get_id());
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::User> user = store->get_user(s->owner.get_id());
+ std::unique_ptr<rgw::sal::Bucket> bucket;
ret = store->get_bucket(this, user.get(), s->owner.get_id().tenant, bucket_name, &bucket, y);
if (ret < 0) {
return ret;
period.set_id(period_id);
period.set_epoch(epoch);
- op_ret = period.init(store->ctx(), static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, realm_id, y, realm_name);
+ op_ret = period.init(store->ctx(), static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, realm_id, y, realm_name);
if (op_ret < 0)
ldout(store->ctx(), 5) << "failed to read period" << dendl;
}
auto cct = store->ctx();
// initialize the period without reading from rados
- period.init(cct, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, y, false);
+ period.init(cct, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, y, false);
// decode the period from input
const auto max_size = cct->_conf->rgw_max_put_param_size;
// period that we haven't restarted with yet. we also don't want to modify
// the objects in use by RGWRados
RGWRealm realm(period.get_realm());
- op_ret = realm.init(cct, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, y);
+ op_ret = realm.init(cct, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, y);
if (op_ret < 0) {
lderr(cct) << "failed to read current realm: "
<< cpp_strerror(-op_ret) << dendl;
}
RGWPeriod current_period;
- op_ret = current_period.init(cct, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, realm.get_id(), y);
+ op_ret = current_period.init(cct, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, realm.get_id(), y);
if (op_ret < 0) {
lderr(cct) << "failed to read current period: "
<< cpp_strerror(-op_ret) << dendl;
return;
}
- auto period_history = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->mdlog->get_period_history();
+ auto period_history = static_cast<rgw::sal::RadosStore*>(store)->svc()->mdlog->get_period_history();
// decide whether we can set_current_period() or set_latest_epoch()
if (period.get_id() != current_period.get_id()) {
class RGWRESTMgr_Period : public RGWRESTMgr {
public:
- RGWHandler_REST* get_handler(rgw::sal::RGWStore *store,
+ RGWHandler_REST* get_handler(rgw::sal::Store *store,
struct req_state*,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string&) override {
// read realm
realm.reset(new RGWRealm(id, name));
- op_ret = realm->init(g_ceph_context, static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj, y);
+ op_ret = realm->init(g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, y);
if (op_ret < 0)
lderr(store->ctx()) << "failed to read realm id=" << id
<< " name=" << name << dendl;
{
{
// read default realm
- RGWRealm realm(store->ctx(), static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->sysobj);
+ RGWRealm realm(store->ctx(), static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj);
[[maybe_unused]] int ret = realm.read_default_id(default_id, y);
}
- op_ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->list_realms(realms);
+ op_ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->list_realms(realms);
if (op_ret < 0)
lderr(store->ctx()) << "failed to list realms" << dendl;
}
}
RGWHandler_REST*
-RGWRESTMgr_Realm::get_handler(rgw::sal::RGWStore *store,
+RGWRESTMgr_Realm::get_handler(rgw::sal::Store *store,
struct req_state*,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string&)
public:
RGWRESTMgr_Realm();
- RGWHandler_REST* get_handler(rgw::sal::RGWStore *store,
+ RGWHandler_REST* get_handler(rgw::sal::Store *store,
struct req_state*,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string&) override;
s->formatter->close_section();
}
-void dump_bucket(struct req_state *s, rgw::sal::RGWBucket& obj)
+void dump_bucket(struct req_state *s, rgw::sal::Bucket& obj)
{
s->formatter->open_object_section("Bucket");
s->formatter->dump_string("Name", obj.get_name());
}
};
- set<rgw_zone_id> get_zone_ids_from_names(rgw::sal::RGWStore *store,
+ set<rgw_zone_id> get_zone_ids_from_names(rgw::sal::Store *store,
const vector<string>& zone_names) const {
set<rgw_zone_id> ids;
for (auto& name : zone_names) {
rgw_zone_id id;
- if (static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->find_zone_id_by_name(name, &id)) {
+ if (static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone_id_by_name(name, &id)) {
ids.insert(std::move(id));
}
}
return ids;
}
- vector<string> get_zone_names_from_ids(rgw::sal::RGWStore *store,
+ vector<string> get_zone_names_from_ids(rgw::sal::Store *store,
const set<rgw_zone_id>& zone_ids) const {
vector<string> names;
for (auto& id : zone_ids) {
RGWZone *zone;
- if (static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->find_zone(id, &zone)) {
+ if (static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone(id, &zone)) {
names.emplace_back(zone->name);
}
}
return true;
}
- int to_sync_policy_pipe(req_state *s, rgw::sal::RGWStore *store,
+ int to_sync_policy_pipe(req_state *s, rgw::sal::Store *store,
rgw_sync_bucket_pipes *pipe,
bool *enabled) const {
if (!is_valid(s->cct)) {
return 0;
}
- void from_sync_policy_pipe(rgw::sal::RGWStore *store,
+ void from_sync_policy_pipe(rgw::sal::Store *store,
const rgw_sync_bucket_pipes& pipe,
bool enabled) {
id = pipe.id;
encode_xml("Rule", rules, f);
}
- int to_sync_policy_groups(req_state *s, rgw::sal::RGWStore *store,
+ int to_sync_policy_groups(req_state *s, rgw::sal::Store *store,
vector<rgw_sync_policy_group> *result) const {
result->resize(2);
return 0;
}
- void from_sync_policy_group(rgw::sal::RGWStore *store,
+ void from_sync_policy_group(rgw::sal::Store *store,
const rgw_sync_policy_group& group) {
bool enabled = (group.status == rgw_sync_policy_group::Status::ENABLED);
}
}
-void RGWListBuckets_ObjStore_S3::send_response_data(rgw::sal::RGWBucketList& buckets)
+void RGWListBuckets_ObjStore_S3::send_response_data(rgw::sal::BucketList& buckets)
{
if (!sent_data)
return;
rgw_flush_formatter_and_reset(s, s->formatter);
}
-static void dump_bucket_metadata(struct req_state *s, rgw::sal::RGWBucket* bucket)
+static void dump_bucket_metadata(struct req_state *s, rgw::sal::Bucket* bucket)
{
dump_header(s, "X-RGW-Object-Count", static_cast<long long>(bucket->get_count()));
dump_header(s, "X-RGW-Bytes-Used", static_cast<long long>(bucket->get_size()));
dump_start(s);
}
-static int create_s3_policy(struct req_state *s, rgw::sal::RGWStore *store,
+static int create_s3_policy(struct req_state *s, rgw::sal::Store *store,
RGWAccessControlPolicy_S3& s3policy,
ACLOwner& owner)
{
int res = 0;
if (!multipart_upload_id.empty()) {
RGWMPObj mp(s->object->get_name(), multipart_upload_id);
- std::unique_ptr<rgw::sal::RGWObject> obj = s->bucket->get_object(
+ std::unique_ptr<rgw::sal::Object> obj = s->bucket->get_object(
rgw_obj_key(mp.get_meta(),
std::string(),
RGW_OBJ_NS_MULTIPART));
return res;
}
-void RGWPostObj_ObjStore_S3::rebuild_key(rgw::sal::RGWObject* obj)
+void RGWPostObj_ObjStore_S3::rebuild_key(rgw::sal::Object* obj)
{
string key = obj->get_name();
static string var = "${filename}";
rebuild_key(s->object.get());
- if (rgw::sal::RGWObject::empty(s->object.get())) {
+ if (rgw::sal::Object::empty(s->object.get())) {
err_msg = "Empty object name";
return -EINVAL;
}
return ret;
}
-int RGWPutACLs_ObjStore_S3::get_policy_from_state(rgw::sal::RGWStore *store,
+int RGWPutACLs_ObjStore_S3::get_policy_from_state(rgw::sal::Store *store,
struct req_state *s,
stringstream& ss)
{
RGWAccessControlPolicy_S3 s3policy(s->cct);
// bucket-* canned acls do not apply to bucket
- if (rgw::sal::RGWObject::empty(s->object.get())) {
+ if (rgw::sal::Object::empty(s->object.get())) {
if (s->canned_acl.find("bucket") != string::npos)
s->canned_acl.clear();
}
} else if (is_notification_op()) {
return RGWHandler_REST_PSNotifs_S3::create_put_op();
} else if (is_replication_op()) {
- auto sync_policy_handler = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->get_sync_policy_handler(nullopt);
+ auto sync_policy_handler = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->get_sync_policy_handler(nullopt);
if (!sync_policy_handler ||
sync_policy_handler->is_legacy_config()) {
return nullptr;
return new RGWOptionsCORS_ObjStore_S3;
}
-int RGWHandler_REST_S3::init_from_header(rgw::sal::RGWStore *store,
+int RGWHandler_REST_S3::init_from_header(rgw::sal::Store *store,
struct req_state* s,
int default_formatter,
bool configurable_format)
return 0;
}
-static int verify_mfa(rgw::sal::RGWStore *store, RGWUserInfo *user,
+static int verify_mfa(rgw::sal::Store *store, RGWUserInfo *user,
const string& mfa_str, bool *verified, const DoutPrefixProvider *dpp, optional_yield y)
{
vector<string> params;
return -EACCES;
}
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->cls->mfa.check_mfa(user->user_id, serial, pin, y);
+ int ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->cls->mfa.check_mfa(user->user_id, serial, pin, y);
if (ret < 0) {
ldpp_dout(dpp, 20) << "NOTICE: failed to check MFA, serial=" << serial << dendl;
return -EACCES;
ret = rgw_validate_tenant_name(s->bucket_tenant);
if (ret)
return ret;
- if (!s->bucket_name.empty() && !rgw::sal::RGWObject::empty(s->object.get())) {
+ if (!s->bucket_name.empty() && !rgw::sal::Object::empty(s->object.get())) {
ret = validate_object_name(s->object->get_name());
if (ret)
return ret;
return 0;
}
-int RGWHandler_REST_S3::init(rgw::sal::RGWStore *store, struct req_state *s,
+int RGWHandler_REST_S3::init(rgw::sal::Store *store, struct req_state *s,
rgw::io::BasicClient *cio)
{
int ret;
* it tries AWS v4 before AWS v2
*/
int RGW_Auth_S3::authorize(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore* const store,
+ rgw::sal::Store* const store,
const rgw::auth::StrategyRegistry& auth_registry,
struct req_state* const s, optional_yield y)
{
return ret;
}
-int RGWHandler_Auth_S3::init(rgw::sal::RGWStore *store, struct req_state *state,
+int RGWHandler_Auth_S3::init(rgw::sal::Store *store, struct req_state *state,
rgw::io::BasicClient *cio)
{
int ret = RGWHandler_REST_S3::init_from_header(store, state, RGW_FORMAT_JSON, true);
return RGWHandler_REST::init(store, state, cio);
}
-RGWHandler_REST* RGWRESTMgr_S3::get_handler(rgw::sal::RGWStore *store,
+RGWHandler_REST* RGWRESTMgr_S3::get_handler(rgw::sal::Store *store,
struct req_state* const s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix)
if (is_s3website) {
if (s->init_state.url_bucket.empty()) {
handler = new RGWHandler_REST_Service_S3Website(auth_registry);
- } else if (rgw::sal::RGWObject::empty(s->object.get())) {
+ } else if (rgw::sal::Object::empty(s->object.get())) {
handler = new RGWHandler_REST_Bucket_S3Website(auth_registry);
} else {
handler = new RGWHandler_REST_Obj_S3Website(auth_registry);
} else {
if (s->init_state.url_bucket.empty()) {
handler = new RGWHandler_REST_Service_S3(auth_registry, enable_sts, enable_iam, enable_pubsub);
- } else if (!rgw::sal::RGWObject::empty(s->object.get())) {
+ } else if (!rgw::sal::Object::empty(s->object.get())) {
handler = new RGWHandler_REST_Obj_S3(auth_registry);
} else if (s->info.args.exist_obj_excl_sub_resource()) {
return NULL;
bool RGWHandler_REST_S3Website::web_dir() const {
std::string subdir_name;
- if (!rgw::sal::RGWObject::empty(s->object.get())) {
+ if (!rgw::sal::Object::empty(s->object.get())) {
subdir_name = url_decode(s->object->get_name());
}
subdir_name.pop_back();
}
- std::unique_ptr<rgw::sal::RGWObject> obj = s->bucket->get_object(rgw_obj_key(subdir_name));
+ std::unique_ptr<rgw::sal::Object> obj = s->bucket->get_object(rgw_obj_key(subdir_name));
RGWObjectCtx& obj_ctx = *static_cast<RGWObjectCtx *>(s->obj_ctx);
obj->set_atomic(&obj_ctx);
return state->exists;
}
-int RGWHandler_REST_S3Website::init(rgw::sal::RGWStore *store, req_state *s,
+int RGWHandler_REST_S3Website::init(rgw::sal::Store *store, req_state *s,
rgw::io::BasicClient* cio)
{
// save the original object name before retarget() replaces it with the
// result of get_effective_key(). the error_handler() needs the original
// object name for redirect handling
- if (!rgw::sal::RGWObject::empty(s->object.get())) {
+ if (!rgw::sal::Object::empty(s->object.get())) {
original_object_name = s->object->get_name();
} else {
original_object_name = "";
rgw_obj_key new_obj;
string key_name;
- if (!rgw::sal::RGWObject::empty(s->object.get())) {
+ if (!rgw::sal::Object::empty(s->object.get())) {
key_name = s->object->get_name();
}
bool get_res = s->bucket->get_info().website_conf.get_effective_key(key_name, &new_obj.name, web_dir());
ldpp_dout(s, 10) << "RGWHandler_REST_S3Website::error_handler err_no=" << err_no << " http_ret=" << http_error_code << dendl;
RGWBWRoutingRule rrule;
- bool have_bucket = !rgw::sal::RGWBucket::empty(s->bucket.get());
+ bool have_bucket = !rgw::sal::Bucket::empty(s->bucket.get());
bool should_redirect = false;
if (have_bucket) {
should_redirect =
optional_yield y) const
{
/* get the user info */
- std::unique_ptr<rgw::sal::RGWUser> user;
+ std::unique_ptr<rgw::sal::User> user;
const std::string access_key_id(_access_key_id);
/* TODO(rzarzynski): we need to have string-view taking variant. */
if (store->get_user_by_access_key(dpp, access_key_id, y, &user) < 0) {
}
// Get all the authorization info
- std::unique_ptr<rgw::sal::RGWUser> user;
+ std::unique_ptr<rgw::sal::User> user;
rgw_user user_id;
string role_id;
rgw::auth::RoleApplier::Role r;
return 0;
}
void send_response_begin(bool has_buckets) override;
- void send_response_data(rgw::sal::RGWBucketList& buckets) override;
+ void send_response_data(rgw::sal::BucketList& buckets) override;
void send_response_end() override;
};
int get_policy(optional_yield y);
int get_tags();
- void rebuild_key(rgw::sal::RGWObject* obj);
+ void rebuild_key(rgw::sal::Object* obj);
std::string get_current_filename() const override;
std::string get_current_content_type() const override;
RGWPutACLs_ObjStore_S3() {}
~RGWPutACLs_ObjStore_S3() override {}
- int get_policy_from_state(rgw::sal::RGWStore *store, struct req_state *s, stringstream& ss) override;
+ int get_policy_from_state(rgw::sal::Store *store, struct req_state *s, stringstream& ss) override;
void send_response() override;
int get_params(optional_yield y) override;
};
class RGW_Auth_S3 {
public:
static int authorize(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
const rgw::auth::StrategyRegistry& auth_registry,
struct req_state *s, optional_yield y);
};
static int validate_bucket_name(const string& bucket);
static int validate_object_name(const string& bucket);
- int init(rgw::sal::RGWStore *store,
+ int init(rgw::sal::Store *store,
struct req_state *s,
rgw::io::BasicClient *cio) override;
int authorize(const DoutPrefixProvider *dpp, optional_yield y) override {
protected:
const rgw::auth::StrategyRegistry& auth_registry;
public:
- static int init_from_header(rgw::sal::RGWStore *store, struct req_state *s, int default_formatter, bool configurable_format);
+ static int init_from_header(rgw::sal::Store *store, struct req_state *s, int default_formatter, bool configurable_format);
explicit RGWHandler_REST_S3(const rgw::auth::StrategyRegistry& auth_registry)
: RGWHandler_REST(),
}
~RGWHandler_REST_S3() override = default;
- int init(rgw::sal::RGWStore *store,
+ int init(rgw::sal::Store *store,
struct req_state *s,
rgw::io::BasicClient *cio) override;
int authorize(const DoutPrefixProvider *dpp, optional_yield y) override;
~RGWRESTMgr_S3() override = default;
- RGWHandler_REST *get_handler(rgw::sal::RGWStore *store,
+ RGWHandler_REST *get_handler(rgw::sal::Store *store,
struct req_state* s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix) override;
using result_t = rgw::auth::Engine::result_t;
protected:
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
const rgw::auth::RemoteApplier::Factory* const apl_factory;
acl_strategy_t get_acl_strategy() const;
optional_yield y) const override;
public:
LDAPEngine(CephContext* const cct,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
const VersionAbstractor& ver_abstractor,
const rgw::auth::RemoteApplier::Factory* const apl_factory)
: AWSEngine(cct, ver_abstractor),
};
class LocalEngine : public AWSEngine {
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
const rgw::auth::LocalApplier::Factory* const apl_factory;
result_t authenticate(const DoutPrefixProvider* dpp,
optional_yield y) const override;
public:
LocalEngine(CephContext* const cct,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
const VersionAbstractor& ver_abstractor,
const rgw::auth::LocalApplier::Factory* const apl_factory)
: AWSEngine(cct, ver_abstractor),
};
class STSEngine : public AWSEngine {
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
const rgw::auth::LocalApplier::Factory* const local_apl_factory;
const rgw::auth::RemoteApplier::Factory* const remote_apl_factory;
const rgw::auth::RoleApplier::Factory* const role_apl_factory;
optional_yield y) const override;
public:
STSEngine(CephContext* const cct,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
const VersionAbstractor& ver_abstractor,
const rgw::auth::LocalApplier::Factory* const local_apl_factory,
const rgw::auth::RemoteApplier::Factory* const remote_apl_factory,
using RGWHandler_REST_S3::RGWHandler_REST_S3;
~RGWHandler_REST_S3Website() override = default;
- int init(rgw::sal::RGWStore *store, req_state *s, rgw::io::BasicClient* cio) override;
+ int init(rgw::sal::Store *store, req_state *s, rgw::io::BasicClient* cio) override;
int error_handler(int err_no, string *error_content, optional_yield y) override;
};
}
int RGW_Auth_STS::authorize(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
const rgw::auth::StrategyRegistry& auth_registry,
struct req_state *s, optional_yield y)
{
return nullptr;
}
-int RGWHandler_REST_STS::init(rgw::sal::RGWStore *store,
+int RGWHandler_REST_STS::init(rgw::sal::Store *store,
struct req_state *s,
rgw::io::BasicClient *cio)
{
}
RGWHandler_REST*
-RGWRESTMgr_STS::get_handler(rgw::sal::RGWStore *store,
+RGWRESTMgr_STS::get_handler(rgw::sal::Store *store,
struct req_state* const s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix)
class WebTokenEngine : public rgw::auth::Engine {
CephContext* const cct;
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
using result_t = rgw::auth::Engine::result_t;
using token_t = rgw::web_idp::WebTokenClaims;
public:
WebTokenEngine(CephContext* const cct,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
const rgw::auth::TokenExtractor* const extractor,
const rgw::auth::WebIdentityApplier::Factory* const apl_factory)
: cct(cct),
class DefaultStrategy : public rgw::auth::Strategy,
public rgw::auth::TokenExtractor,
public rgw::auth::WebIdentityApplier::Factory {
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
ImplicitTenants& implicit_tenant_context;
/* The engine. */
public:
DefaultStrategy(CephContext* const cct,
ImplicitTenants& implicit_tenant_context,
- rgw::sal::RGWStore* store)
+ rgw::sal::Store* store)
: store(store),
implicit_tenant_context(implicit_tenant_context),
web_token_engine(cct, store,
class RGW_Auth_STS {
public:
static int authorize(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
const rgw::auth::StrategyRegistry& auth_registry,
struct req_state *s, optional_yield y);
};
post_body(post_body) {}
~RGWHandler_REST_STS() override = default;
- int init(rgw::sal::RGWStore *store,
+ int init(rgw::sal::Store *store,
struct req_state *s,
rgw::io::BasicClient *cio) override;
int authorize(const DoutPrefixProvider* dpp, optional_yield y) override;
return this;
}
- RGWHandler_REST* get_handler(rgw::sal::RGWStore *store,
+ RGWHandler_REST* get_handler(rgw::sal::Store *store,
struct req_state*,
const rgw::auth::StrategyRegistry&,
const std::string&) override;
}
}
-void RGWListBuckets_ObjStore_SWIFT::handle_listing_chunk(rgw::sal::RGWBucketList&& buckets)
+void RGWListBuckets_ObjStore_SWIFT::handle_listing_chunk(rgw::sal::BucketList&& buckets)
{
if (wants_reversed) {
/* Just store in the reversal buffer. Its content will be handled later,
}
}
-void RGWListBuckets_ObjStore_SWIFT::send_response_data(rgw::sal::RGWBucketList& buckets)
+void RGWListBuckets_ObjStore_SWIFT::send_response_data(rgw::sal::BucketList& buckets)
{
if (! sent_data) {
return;
}
}
-void RGWListBuckets_ObjStore_SWIFT::dump_bucket_entry(const rgw::sal::RGWBucket& bucket)
+void RGWListBuckets_ObjStore_SWIFT::dump_bucket_entry(const rgw::sal::Bucket& bucket)
{
s->formatter->open_object_section("container");
s->formatter->dump_string("name", bucket.get_name());
}
}
-void RGWListBuckets_ObjStore_SWIFT::send_response_data_reversed(rgw::sal::RGWBucketList& buckets)
+void RGWListBuckets_ObjStore_SWIFT::send_response_data_reversed(rgw::sal::BucketList& buckets)
{
if (! sent_data) {
return;
}
static void dump_container_metadata(struct req_state *,
- const rgw::sal::RGWBucket*,
+ const rgw::sal::Bucket*,
const RGWQuotaInfo&,
const RGWBucketWebsiteConf&);
} // RGWListBucket_ObjStore_SWIFT::send_response
static void dump_container_metadata(struct req_state *s,
- const rgw::sal::RGWBucket* bucket,
+ const rgw::sal::Bucket* bucket,
const RGWQuotaInfo& quota,
const RGWBucketWebsiteConf& ws_conf)
{
dump_header(s, "X-Container-Bytes-Used", bucket->get_size());
dump_header(s, "X-Container-Bytes-Used-Actual", bucket->get_size_rounded());
- if (rgw::sal::RGWObject::empty(s->object.get())) {
+ if (rgw::sal::Object::empty(s->object.get())) {
auto swift_policy = \
static_cast<RGWAccessControlPolicy_SWIFT*>(s->bucket_acl.get());
std::string read_acl, write_acl;
}
static int get_swift_container_settings(req_state * const s,
- rgw::sal::RGWStore * const store,
+ rgw::sal::Store * const store,
RGWAccessControlPolicy * const policy,
bool * const has_policy,
uint32_t * rw_mask,
string bucket_name = path.substr(pos_init, pos_sep - pos_init);
string obj_name = path.substr(pos_sep + 1);
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
if (bucket_name.compare(s->bucket->get_name()) != 0) {
r = store->get_bucket(s, s->user.get(), s->user->get_id().tenant, bucket_name, &bucket, s->yield);
}
/* fetch the stored size of the seg (or error if not valid) */
- std::unique_ptr<rgw::sal::RGWObject> slo_seg = bucket->get_object(rgw_obj_key(obj_name));
+ std::unique_ptr<rgw::sal::Object> slo_seg = bucket->get_object(rgw_obj_key(obj_name));
/* no prefetch */
RGWObjectCtx obj_ctx(store);
}
static int get_swift_account_settings(req_state * const s,
- rgw::sal::RGWStore * const store,
+ rgw::sal::Store * const store,
RGWAccessControlPolicy_SWIFTAcct * const policy,
bool * const has_policy)
{
void RGWInfo_ObjStore_SWIFT::list_swift_data(Formatter& formatter,
const ConfigProxy& config,
- rgw::sal::RGWStore* store)
+ rgw::sal::Store* store)
{
formatter.open_object_section("swift");
formatter.dump_int("max_file_size", config->rgw_max_put_size);
void RGWInfo_ObjStore_SWIFT::list_tempauth_data(Formatter& formatter,
const ConfigProxy& config,
- rgw::sal::RGWStore* store)
+ rgw::sal::Store* store)
{
formatter.open_object_section("tempauth");
formatter.dump_bool("account_acls", true);
}
void RGWInfo_ObjStore_SWIFT::list_tempurl_data(Formatter& formatter,
const ConfigProxy& config,
- rgw::sal::RGWStore* store)
+ rgw::sal::Store* store)
{
formatter.open_object_section("tempurl");
formatter.open_array_section("methods");
void RGWInfo_ObjStore_SWIFT::list_slo_data(Formatter& formatter,
const ConfigProxy& config,
- rgw::sal::RGWStore* store)
+ rgw::sal::Store* store)
{
formatter.open_object_section("slo");
formatter.dump_int("max_manifest_segments", config->rgw_max_slo_entries);
}
-void RGWFormPost::init(rgw::sal::RGWStore* const store,
+void RGWFormPost::init(rgw::sal::Store* const store,
req_state* const s,
RGWHandler* const dialect_handler)
{
* now. It will be initialized in RGWHandler_REST_SWIFT::postauth_init(). */
const string& bucket_name = s->init_state.url_bucket;
- std::unique_ptr<rgw::sal::RGWUser> user;
+ std::unique_ptr<rgw::sal::User> user;
/* TempURL in Formpost only requires that bucket name is specified. */
if (bucket_name.empty()) {
}
/* Need to get user info of bucket owner. */
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
int ret = store->get_bucket(s, user.get(), user->get_tenant(), bucket_name, &bucket, s->yield);
if (ret < 0) {
throw ret;
class RGWGetErrorPage : public RGWGetObj_ObjStore_SWIFT {
public:
- RGWGetErrorPage(rgw::sal::RGWStore* const store,
+ RGWGetErrorPage(rgw::sal::Store* const store,
RGWHandler_REST* const handler,
req_state* const s,
const int http_ret) {
}
} get_errpage_op(store, handler, s, http_ret);
- if (!rgw::sal::RGWBucket::empty(s->bucket.get())) {
+ if (!rgw::sal::Bucket::empty(s->bucket.get())) {
s->object = s->bucket->get_object(rgw_obj_key(std::to_string(http_ret) + error_doc));
} else {
s->object = store->get_object(rgw_obj_key(std::to_string(http_ret) + error_doc));
subdir_name.pop_back();
}
- std::unique_ptr<rgw::sal::RGWObject> obj = s->bucket->get_object(rgw_obj_key(std::move(subdir_name)));
+ std::unique_ptr<rgw::sal::Object> obj = s->bucket->get_object(rgw_obj_key(std::move(subdir_name)));
/* First, get attrset of the object we'll try to retrieve. */
RGWObjectCtx& obj_ctx = *static_cast<RGWObjectCtx *>(s->obj_ctx);
bool RGWSwiftWebsiteHandler::is_index_present(const std::string& index) const
{
- std::unique_ptr<rgw::sal::RGWObject> obj = s->bucket->get_object(rgw_obj_key(index));
+ std::unique_ptr<rgw::sal::Object> obj = s->bucket->get_object(rgw_obj_key(index));
RGWObjectCtx& obj_ctx = *static_cast<RGWObjectCtx *>(s->obj_ctx);
obj->set_atomic(&obj_ctx);
}
}
-int RGWHandler_REST_SWIFT::init_from_header(rgw::sal::RGWStore* store,
+int RGWHandler_REST_SWIFT::init_from_header(rgw::sal::Store* store,
struct req_state* const s,
const std::string& frontend_prefix)
{
return 0;
}
-int RGWHandler_REST_SWIFT::init(rgw::sal::RGWStore* store, struct req_state* s,
+int RGWHandler_REST_SWIFT::init(rgw::sal::Store* store, struct req_state* s,
rgw::io::BasicClient *cio)
{
struct req_init_state *t = &s->init_state;
}
RGWHandler_REST*
-RGWRESTMgr_SWIFT::get_handler(rgw::sal::RGWStore* store,
+RGWRESTMgr_SWIFT::get_handler(rgw::sal::Store* store,
struct req_state* const s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix)
return new RGWHandler_REST_Service_SWIFT(auth_strategy);
}
- if (rgw::sal::RGWObject::empty(s->object.get())) {
+ if (rgw::sal::Object::empty(s->object.get())) {
return new RGWHandler_REST_Bucket_SWIFT(auth_strategy);
}
}
RGWHandler_REST* RGWRESTMgr_SWIFT_Info::get_handler(
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
struct req_state* const s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix)
bool need_stats;
bool wants_reversed;
std::string prefix;
- std::vector<rgw::sal::RGWBucketList> reverse_buffer;
+ std::vector<rgw::sal::BucketList> reverse_buffer;
uint64_t get_default_max() const override {
return 0;
~RGWListBuckets_ObjStore_SWIFT() override {}
int get_params(optional_yield y) override;
- void handle_listing_chunk(rgw::sal::RGWBucketList&& buckets) override;
+ void handle_listing_chunk(rgw::sal::BucketList&& buckets) override;
void send_response_begin(bool has_buckets) override;
- void send_response_data(rgw::sal::RGWBucketList& buckets) override;
- void send_response_data_reversed(rgw::sal::RGWBucketList& buckets);
- void dump_bucket_entry(const rgw::sal::RGWBucket& obj);
+ void send_response_data(rgw::sal::BucketList& buckets) override;
+ void send_response_data_reversed(rgw::sal::BucketList& buckets);
+ void dump_bucket_entry(const rgw::sal::Bucket& obj);
void send_response_end() override;
bool should_get_stats() override { return need_stats; }
struct info
{
bool is_admin_info;
- function<void (Formatter&, const ConfigProxy&, rgw::sal::RGWStore*)> list_data;
+ function<void (Formatter&, const ConfigProxy&, rgw::sal::Store*)> list_data;
};
static const vector<pair<string, struct info>> swift_info;
void execute(optional_yield y) override;
void send_response() override;
- static void list_swift_data(Formatter& formatter, const ConfigProxy& config, rgw::sal::RGWStore* store);
- static void list_tempauth_data(Formatter& formatter, const ConfigProxy& config, rgw::sal::RGWStore* store);
- static void list_tempurl_data(Formatter& formatter, const ConfigProxy& config, rgw::sal::RGWStore* store);
- static void list_slo_data(Formatter& formatter, const ConfigProxy& config, rgw::sal::RGWStore* store);
+ static void list_swift_data(Formatter& formatter, const ConfigProxy& config, rgw::sal::Store* store);
+ static void list_tempauth_data(Formatter& formatter, const ConfigProxy& config, rgw::sal::Store* store);
+ static void list_tempurl_data(Formatter& formatter, const ConfigProxy& config, rgw::sal::Store* store);
+ static void list_slo_data(Formatter& formatter, const ConfigProxy& config, rgw::sal::Store* store);
static bool is_expired(const std::string& expires, const DoutPrefixProvider* dpp);
};
RGWFormPost() = default;
~RGWFormPost() = default;
- void init(rgw::sal::RGWStore* store,
+ void init(rgw::sal::Store* store,
req_state* s,
RGWHandler* dialect_handler) override;
class RGWSwiftWebsiteHandler {
- rgw::sal::RGWStore* const store;
+ rgw::sal::Store* const store;
req_state* const s;
RGWHandler_REST* const handler;
RGWOp* get_ws_index_op();
RGWOp* get_ws_listing_op();
public:
- RGWSwiftWebsiteHandler(rgw::sal::RGWStore* const store,
+ RGWSwiftWebsiteHandler(rgw::sal::Store* const store,
req_state* const s,
RGWHandler_REST* const handler)
: store(store),
return false;
}
- static int init_from_header(rgw::sal::RGWStore* store, struct req_state* s,
+ static int init_from_header(rgw::sal::Store* store, struct req_state* s,
const std::string& frontend_prefix);
public:
explicit RGWHandler_REST_SWIFT(const rgw::auth::Strategy& auth_strategy)
int validate_bucket_name(const string& bucket);
- int init(rgw::sal::RGWStore *store, struct req_state *s, rgw::io::BasicClient *cio) override;
+ int init(rgw::sal::Store *store, struct req_state *s, rgw::io::BasicClient *cio) override;
int authorize(const DoutPrefixProvider *dpp, optional_yield y) override;
int postauth_init(optional_yield y) override;
return website_handler->retarget_bucket(op, new_op);
}
- int init(rgw::sal::RGWStore* const store,
+ int init(rgw::sal::Store* const store,
struct req_state* const s,
rgw::io::BasicClient* const cio) override {
website_handler = boost::in_place<RGWSwiftWebsiteHandler>(store, s, this);
return website_handler->retarget_object(op, new_op);
}
- int init(rgw::sal::RGWStore* const store,
+ int init(rgw::sal::Store* const store,
struct req_state* const s,
rgw::io::BasicClient* const cio) override {
website_handler = boost::in_place<RGWSwiftWebsiteHandler>(store, s, this);
RGWRESTMgr_SWIFT() = default;
~RGWRESTMgr_SWIFT() override = default;
- RGWHandler_REST *get_handler(rgw::sal::RGWStore *store,
+ RGWHandler_REST *get_handler(rgw::sal::Store *store,
struct req_state *s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix) override;
return new RGWGetCrossDomainPolicy_ObjStore_SWIFT();
}
- int init(rgw::sal::RGWStore* const store,
+ int init(rgw::sal::Store* const store,
struct req_state* const state,
rgw::io::BasicClient* const cio) override {
state->dialect = "swift";
RGWRESTMgr_SWIFT_CrossDomain() = default;
~RGWRESTMgr_SWIFT_CrossDomain() override = default;
- RGWHandler_REST* get_handler(rgw::sal::RGWStore *store,
+ RGWHandler_REST* get_handler(rgw::sal::Store *store,
struct req_state* const s,
const rgw::auth::StrategyRegistry&,
const std::string&) override {
return new RGWGetHealthCheck_ObjStore_SWIFT();
}
- int init(rgw::sal::RGWStore* const store,
+ int init(rgw::sal::Store* const store,
struct req_state* const state,
rgw::io::BasicClient* const cio) override {
state->dialect = "swift";
RGWRESTMgr_SWIFT_HealthCheck() = default;
~RGWRESTMgr_SWIFT_HealthCheck() override = default;
- RGWHandler_REST* get_handler(rgw::sal::RGWStore *store,
+ RGWHandler_REST* get_handler(rgw::sal::Store *store,
struct req_state* const s,
const rgw::auth::StrategyRegistry&,
const std::string&) override {
return new RGWInfo_ObjStore_SWIFT();
}
- int init(rgw::sal::RGWStore* const store,
+ int init(rgw::sal::Store* const store,
struct req_state* const state,
rgw::io::BasicClient* const cio) override {
state->dialect = "swift";
RGWRESTMgr_SWIFT_Info() = default;
~RGWRESTMgr_SWIFT_Info() override = default;
- RGWHandler_REST *get_handler(rgw::sal::RGWStore *store,
+ RGWHandler_REST *get_handler(rgw::sal::Store *store,
struct req_state* s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix) override;
RESTArgs::get_string(s, "uid", uid_str, &uid_str);
RESTArgs::get_string(s, "bucket", bucket_name, &bucket_name);
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(rgw_user(uid_str));
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::User> user = store->get_user(rgw_user(uid_str));
+ std::unique_ptr<rgw::sal::Bucket> bucket;
if (!bucket_name.empty()) {
store->get_bucket(nullptr, user.get(), std::string(), bucket_name, &bucket, null_yield);
RESTArgs::get_string(s, "uid", uid_str, &uid_str);
RESTArgs::get_string(s, "bucket", bucket_name, &bucket_name);
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(rgw_user(uid_str));
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::User> user = store->get_user(rgw_user(uid_str));
+ std::unique_ptr<rgw::sal::Bucket> bucket;
if (!bucket_name.empty()) {
store->get_bucket(nullptr, user.get(), std::string(), bucket_name, &bucket, null_yield);
RESTArgs::get_epoch(s, "start", 0, &start);
RESTArgs::get_epoch(s, "end", (uint64_t)-1, &end);
- if (rgw::sal::RGWUser::empty(user.get()) &&
+ if (rgw::sal::User::empty(user.get()) &&
!bucket_name.empty() &&
!start &&
end == (uint64_t)-1) {
RGWRESTMgr_Usage() = default;
~RGWRESTMgr_Usage() override = default;
- RGWHandler_REST* get_handler(rgw::sal::RGWStore* store,
+ RGWHandler_REST* get_handler(rgw::sal::Store* store,
struct req_state*,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string&) override {
RGWRESTMgr_User() = default;
~RGWRESTMgr_User() override = default;
- RGWHandler_REST *get_handler(rgw::sal::RGWStore *store,
+ RGWHandler_REST *get_handler(rgw::sal::Store *store,
struct req_state*,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string&) override {
bufferlist bl = bufferlist::static_from_string(policy);
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(rgw_user(user_name));
+ std::unique_ptr<rgw::sal::User> user = store->get_user(rgw_user(user_name));
op_ret = user->load_by_id(s, s->yield);
if (op_ret < 0) {
return;
}
- rgw::sal::RGWAttrs uattrs;
+ rgw::sal::Attrs uattrs;
op_ret = user->read_attrs(s, s->yield, &uattrs);
if (op_ret == -ENOENT) {
op_ret = -ERR_NO_SUCH_ENTITY;
return;
}
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(rgw_user(user_name));
- rgw::sal::RGWAttrs uattrs;
+ std::unique_ptr<rgw::sal::User> user = store->get_user(rgw_user(user_name));
+ rgw::sal::Attrs uattrs;
op_ret = user->read_attrs(s, s->yield, &uattrs);
if (op_ret == -ENOENT) {
ldpp_dout(this, 0) << "ERROR: attrs not found for user" << user_name << dendl;
return;
}
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(rgw_user(user_name));
- rgw::sal::RGWAttrs uattrs;
+ std::unique_ptr<rgw::sal::User> user = store->get_user(rgw_user(user_name));
+ rgw::sal::Attrs uattrs;
op_ret = user->read_attrs(s, s->yield, &uattrs);
if (op_ret == -ENOENT) {
ldpp_dout(this, 0) << "ERROR: attrs not found for user" << user_name << dendl;
return;
}
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(rgw_user(user_name));
+ std::unique_ptr<rgw::sal::User> user = store->get_user(rgw_user(user_name));
op_ret = user->load_by_id(s, s->yield);
if (op_ret < 0) {
op_ret = -ERR_NO_SUCH_ENTITY;
return;
}
- rgw::sal::RGWAttrs uattrs;
+ rgw::sal::Attrs uattrs;
op_ret = user->read_attrs(this, s->yield, &uattrs);
if (op_ret == -ENOENT) {
op_ret = -ERR_NO_SUCH_ENTITY;
}
int RGWRole::get_roles_by_path_prefix(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
CephContext *cct,
const string& path_prefix,
const string& tenant,
#include "rgw/rgw_rados.h"
-namespace rgw { namespace sal { class RGWStore; } }
+namespace rgw { namespace sal { class Store; } }
class RGWRole
{
static constexpr uint64_t SESSION_DURATION_MAX = 43200; // in seconds
CephContext *cct;
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
string id;
string name;
string path;
public:
RGWRole(CephContext *cct,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
string name,
string path,
string trust_policy,
}
RGWRole(CephContext *cct,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
string name,
string tenant)
: cct(cct),
}
RGWRole(CephContext *cct,
- rgw::sal::RGWStore* store,
+ rgw::sal::Store* store,
string id)
: cct(cct),
store(store),
id(std::move(id)) {}
RGWRole(CephContext *cct,
- rgw::sal::RGWStore* store)
+ rgw::sal::Store* store)
: cct(cct),
store(store) {}
static const string& get_info_oid_prefix();
static const string& get_path_oid_prefix();
static int get_roles_by_path_prefix(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
CephContext *cct,
const string& path_prefix,
const string& tenant,
#define dout_subsys ceph_subsys_rgw
extern "C" {
-extern rgw::sal::RGWStore* newRGWStore(void);
+extern rgw::sal::Store* newStore(void);
}
-rgw::sal::RGWStore *RGWStoreManager::init_storage_provider(const DoutPrefixProvider *dpp, CephContext *cct, const std::string svc, bool use_gc_thread, bool use_lc_thread, bool quota_threads, bool run_sync_thread, bool run_reshard_thread, bool use_cache)
+rgw::sal::Store *StoreManager::init_storage_provider(const DoutPrefixProvider *dpp, CephContext *cct, const std::string svc, bool use_gc_thread, bool use_lc_thread, bool quota_threads, bool run_sync_thread, bool run_reshard_thread, bool use_cache)
{
- rgw::sal::RGWStore *store = nullptr;
+ rgw::sal::Store *store = nullptr;
if (svc.compare("rados") == 0) {
- store = newRGWStore();
- RGWRados *rados = static_cast<rgw::sal::RGWRadosStore *>(store)->getRados();
+ store = newStore();
+ RGWRados *rados = static_cast<rgw::sal::RadosStore *>(store)->getRados();
if ((*rados).set_use_cache(use_cache)
.set_run_gc_thread(use_gc_thread)
return store;
}
-rgw::sal::RGWStore *RGWStoreManager::init_raw_storage_provider(const DoutPrefixProvider *dpp, CephContext *cct, const std::string svc)
+rgw::sal::Store *StoreManager::init_raw_storage_provider(const DoutPrefixProvider *dpp, CephContext *cct, const std::string svc)
{
- rgw::sal::RGWStore *store = nullptr;
+ rgw::sal::Store *store = nullptr;
if (svc.compare("rados") == 0) {
- store = newRGWStore();
- RGWRados *rados = static_cast<rgw::sal::RGWRadosStore *>(store)->getRados();
+ store = newStore();
+ RGWRados *rados = static_cast<rgw::sal::RadosStore *>(store)->getRados();
rados->set_context(cct);
return store;
}
-void RGWStoreManager::close_storage(rgw::sal::RGWStore *store)
+void StoreManager::close_storage(rgw::sal::Store *store)
{
if (!store)
return;
#define RGW_SAL_VERSION 1
-class RGWUser;
-class RGWBucket;
-class RGWObject;
-class RGWBucketList;
+class User;
+class Bucket;
+class Object;
+class BucketList;
struct MPSerializer;
class Lifecycle;
class Notification;
virtual int drain() = 0;
};
-using RGWAttrs = std::map<std::string, ceph::buffer::list>;
+using Attrs = std::map<std::string, ceph::buffer::list>;
-class RGWStore {
+class Store {
public:
- RGWStore() {}
- virtual ~RGWStore() = default;
+ Store() {}
+ virtual ~Store() = default;
/* This one does not query the cluster for info */
- virtual std::unique_ptr<RGWUser> get_user(const rgw_user& u) = 0;
+ virtual std::unique_ptr<User> get_user(const rgw_user& u) = 0;
/* These three do query the cluster for info */
- virtual int get_user_by_access_key(const DoutPrefixProvider *dpp, const std::string& key, optional_yield y, std::unique_ptr<RGWUser>* user) = 0;
- virtual int get_user_by_email(const DoutPrefixProvider *dpp, const std::string& email, optional_yield y, std::unique_ptr<RGWUser>* user) = 0;
- virtual int get_user_by_swift(const DoutPrefixProvider *dpp, const std::string& user_str, optional_yield y, std::unique_ptr<RGWUser>* user) = 0;
- virtual std::unique_ptr<RGWObject> get_object(const rgw_obj_key& k) = 0;
- virtual int get_bucket(const DoutPrefixProvider *dpp, RGWUser* u, const rgw_bucket& b, std::unique_ptr<RGWBucket>* bucket, optional_yield y) = 0;
- virtual int get_bucket(RGWUser* u, const RGWBucketInfo& i, std::unique_ptr<RGWBucket>* bucket) = 0;
- virtual int get_bucket(const DoutPrefixProvider *dpp, RGWUser* u, const std::string& tenant, const std::string& name, std::unique_ptr<RGWBucket>* bucket, optional_yield y) = 0;
+ virtual int get_user_by_access_key(const DoutPrefixProvider *dpp, const std::string& key, optional_yield y, std::unique_ptr<User>* user) = 0;
+ virtual int get_user_by_email(const DoutPrefixProvider *dpp, const std::string& email, optional_yield y, std::unique_ptr<User>* user) = 0;
+ virtual int get_user_by_swift(const DoutPrefixProvider *dpp, const std::string& user_str, optional_yield y, std::unique_ptr<User>* user) = 0;
+ virtual std::unique_ptr<Object> get_object(const rgw_obj_key& k) = 0;
+ virtual int get_bucket(const DoutPrefixProvider *dpp, User* u, const rgw_bucket& b, std::unique_ptr<Bucket>* bucket, optional_yield y) = 0;
+ virtual int get_bucket(User* u, const RGWBucketInfo& i, std::unique_ptr<Bucket>* bucket) = 0;
+ virtual int get_bucket(const DoutPrefixProvider *dpp, User* u, const std::string& tenant, const std::string& name, std::unique_ptr<Bucket>* bucket, optional_yield y) = 0;
virtual int create_bucket(const DoutPrefixProvider *dpp,
- RGWUser& u, const rgw_bucket& b,
+ User& u, const rgw_bucket& b,
const std::string& zonegroup_id,
rgw_placement_rule& placement_rule,
std::string& swift_ver_location,
const RGWQuotaInfo * pquota_info,
const RGWAccessControlPolicy& policy,
- RGWAttrs& attrs,
+ Attrs& attrs,
RGWBucketInfo& info,
obj_version& ep_objv,
bool exclusive,
bool obj_lock_enabled,
bool *existed,
req_info& req_info,
- std::unique_ptr<RGWBucket>* bucket,
+ std::unique_ptr<Bucket>* bucket,
optional_yield y) = 0;
virtual bool is_meta_master() = 0;
- virtual int forward_request_to_master(RGWUser* user, obj_version *objv,
+ virtual int forward_request_to_master(User* user, obj_version *objv,
bufferlist& in_data, JSONParser *jp, req_info& info,
optional_yield y) = 0;
- virtual int defer_gc(const DoutPrefixProvider *dpp, RGWObjectCtx *rctx, RGWBucket* bucket, RGWObject* obj,
+ virtual int defer_gc(const DoutPrefixProvider *dpp, RGWObjectCtx *rctx, Bucket* bucket, Object* obj,
optional_yield y) = 0;
virtual Zone* get_zone() = 0;
virtual std::string zone_unique_id(uint64_t unique_num) = 0;
virtual int cluster_stat(RGWClusterStat& stats) = 0;
virtual std::unique_ptr<Lifecycle> get_lifecycle(void) = 0;
virtual std::unique_ptr<Completions> get_completions(void) = 0;
- virtual std::unique_ptr<Notification> get_notification(rgw::sal::RGWObject* obj, struct req_state* s, rgw::notify::EventType event_type) = 0;
- virtual std::unique_ptr<GCChain> get_gc_chain(rgw::sal::RGWObject* obj) = 0;
- virtual std::unique_ptr<Writer> get_writer(Aio *aio, rgw::sal::RGWBucket* bucket,
- RGWObjectCtx& obj_ctx, std::unique_ptr<rgw::sal::RGWObject> _head_obj,
+ virtual std::unique_ptr<Notification> get_notification(rgw::sal::Object* obj, struct req_state* s, rgw::notify::EventType event_type) = 0;
+ virtual std::unique_ptr<GCChain> get_gc_chain(rgw::sal::Object* obj) = 0;
+ virtual std::unique_ptr<Writer> get_writer(Aio *aio, rgw::sal::Bucket* bucket,
+ RGWObjectCtx& obj_ctx, std::unique_ptr<rgw::sal::Object> _head_obj,
const DoutPrefixProvider *dpp, optional_yield y) = 0;
virtual RGWLC* get_rgwlc(void) = 0;
virtual RGWCoroutinesManagerRegistry* get_cr_registry() = 0;
virtual void set_luarocks_path(const std::string& path) = 0;
};
-class RGWUser {
+class User {
protected:
RGWUserInfo info;
RGWObjVersionTracker objv_tracker;
public:
- RGWUser() : info() {}
- RGWUser(const rgw_user& _u) : info() { info.user_id = _u; }
- RGWUser(const RGWUserInfo& _i) : info(_i) {}
- RGWUser(RGWUser& _o) = default;
- virtual ~RGWUser() = default;
+ User() : info() {}
+ User(const rgw_user& _u) : info() { info.user_id = _u; }
+ User(const RGWUserInfo& _i) : info(_i) {}
+ User(User& _o) = default;
+ virtual ~User() = default;
- virtual std::unique_ptr<RGWUser> clone() = 0;
+ virtual std::unique_ptr<User> clone() = 0;
virtual int list_buckets(const DoutPrefixProvider *dpp,
const std::string& marker, const std::string& end_marker,
- uint64_t max, bool need_stats, RGWBucketList& buckets,
+ uint64_t max, bool need_stats, BucketList& buckets,
optional_yield y) = 0;
- virtual RGWBucket* create_bucket(rgw_bucket& bucket, ceph::real_time creation_time) = 0;
- friend class RGWBucket;
+ virtual Bucket* create_bucket(rgw_bucket& bucket, ceph::real_time creation_time) = 0;
+ friend class Bucket;
virtual std::string& get_display_name() { return info.display_name; }
const std::string& get_tenant() { return info.user_id.tenant; }
uint32_t get_type() const { return info.type; }
int32_t get_max_buckets() const { return info.max_buckets; }
const RGWUserCaps& get_caps() const { return info.caps; }
- static bool empty(RGWUser* u) { return (!u || u->info.user_id.id.empty()); }
- static bool empty(std::unique_ptr<RGWUser>& u) { return (!u || u->info.user_id.id.empty()); }
- virtual int read_attrs(const DoutPrefixProvider *dpp, optional_yield y, RGWAttrs* uattrs, RGWObjVersionTracker* tracker = nullptr) = 0;
+ static bool empty(User* u) { return (!u || u->info.user_id.id.empty()); }
+ static bool empty(std::unique_ptr<User>& u) { return (!u || u->info.user_id.id.empty()); }
+ virtual int read_attrs(const DoutPrefixProvider *dpp, optional_yield y, Attrs* uattrs, RGWObjVersionTracker* tracker = nullptr) = 0;
virtual int read_stats(optional_yield y, RGWStorageStats* stats,
ceph::real_time *last_stats_sync = nullptr,
ceph::real_time *last_stats_update = nullptr) = 0;
/* dang temporary; will be removed when User is complete */
RGWUserInfo& get_info() { return info; }
- friend inline ostream& operator<<(ostream& out, const RGWUser& u) {
+ friend inline ostream& operator<<(ostream& out, const User& u) {
out << u.info.user_id;
return out;
}
- friend inline ostream& operator<<(ostream& out, const RGWUser* u) {
+ friend inline ostream& operator<<(ostream& out, const User* u) {
if (!u)
out << "<NULL>";
else
return out;
}
- friend inline ostream& operator<<(ostream& out, const std::unique_ptr<RGWUser>& p) {
+ friend inline ostream& operator<<(ostream& out, const std::unique_ptr<User>& p) {
out << p.get();
return out;
}
};
-class RGWBucket {
+class Bucket {
protected:
RGWBucketEnt ent;
RGWBucketInfo info;
- RGWUser* owner = nullptr;
- RGWAttrs attrs;
+ User* owner = nullptr;
+ Attrs attrs;
obj_version bucket_version;
ceph::real_time mtime;
rgw_obj_key next_marker;
};
- RGWBucket() = default;
- RGWBucket(RGWUser* _u) :
+ Bucket() = default;
+ Bucket(User* _u) :
owner(_u) { }
- RGWBucket(const rgw_bucket& _b) { ent.bucket = _b; info.bucket = _b; }
- RGWBucket(const RGWBucketEnt& _e) : ent(_e) {
+ Bucket(const rgw_bucket& _b) { ent.bucket = _b; info.bucket = _b; }
+ Bucket(const RGWBucketEnt& _e) : ent(_e) {
info.bucket = ent.bucket;
info.placement_rule = ent.placement_rule;
info.creation_time = ent.creation_time;
}
- RGWBucket(const RGWBucketInfo& _i) : info(_i) {
+ Bucket(const RGWBucketInfo& _i) : info(_i) {
ent.bucket = info.bucket;
ent.placement_rule = info.placement_rule;
ent.creation_time = info.creation_time;
}
- RGWBucket(const rgw_bucket& _b, RGWUser* _u) :
+ Bucket(const rgw_bucket& _b, User* _u) :
owner(_u) { ent.bucket = _b; info.bucket = _b; }
- RGWBucket(const RGWBucketEnt& _e, RGWUser* _u) : ent(_e), owner(_u) {
+ Bucket(const RGWBucketEnt& _e, User* _u) : ent(_e), owner(_u) {
info.bucket = ent.bucket;
info.placement_rule = ent.placement_rule;
info.creation_time = ent.creation_time;
}
- RGWBucket(const RGWBucketInfo& _i, RGWUser* _u) : info(_i), owner(_u) {
+ Bucket(const RGWBucketInfo& _i, User* _u) : info(_i), owner(_u) {
ent.bucket = info.bucket;
ent.placement_rule = info.placement_rule;
ent.creation_time = info.creation_time;
}
- virtual ~RGWBucket() = default;
+ virtual ~Bucket() = default;
- virtual std::unique_ptr<RGWObject> get_object(const rgw_obj_key& key) = 0;
+ virtual std::unique_ptr<Object> get_object(const rgw_obj_key& key) = 0;
virtual int list(const DoutPrefixProvider *dpp, ListParams&, int, ListResults&, optional_yield y) = 0;
- virtual RGWObject* create_object(const rgw_obj_key& key /* Attributes */) = 0;
- virtual RGWAttrs& get_attrs(void) { return attrs; }
- virtual int set_attrs(RGWAttrs a) { attrs = a; return 0; }
+ virtual Object* create_object(const rgw_obj_key& key /* Attributes */) = 0;
+ virtual Attrs& get_attrs(void) { return attrs; }
+ virtual int set_attrs(Attrs a) { attrs = a; return 0; }
virtual int remove_bucket(const DoutPrefixProvider *dpp, bool delete_children, std::string prefix, std::string delimiter, bool forward_to_master, req_info* req_info, optional_yield y) = 0;
virtual RGWAccessControlPolicy& get_acl(void) = 0;
virtual int set_acl(const DoutPrefixProvider *dpp, RGWAccessControlPolicy& acl, optional_yield y) = 0;
virtual int sync_user_stats(optional_yield y) = 0;
virtual int update_container_stats(const DoutPrefixProvider *dpp) = 0;
virtual int check_bucket_shards(const DoutPrefixProvider *dpp) = 0;
- virtual int link(const DoutPrefixProvider *dpp, RGWUser* new_user, optional_yield y, bool update_entrypoint = true, RGWObjVersionTracker* objv = nullptr) = 0;
- virtual int unlink(const DoutPrefixProvider *dpp, RGWUser* new_user, optional_yield y, bool update_entrypoint = true) = 0;
- virtual int chown(const DoutPrefixProvider *dpp, RGWUser* new_user, RGWUser* old_user, optional_yield y, const std::string* marker = nullptr) = 0;
+ virtual int link(const DoutPrefixProvider *dpp, User* new_user, optional_yield y, bool update_entrypoint = true, RGWObjVersionTracker* objv = nullptr) = 0;
+ virtual int unlink(const DoutPrefixProvider *dpp, User* new_user, optional_yield y, bool update_entrypoint = true) = 0;
+ virtual int chown(const DoutPrefixProvider *dpp, User* new_user, User* old_user, optional_yield y, const std::string* marker = nullptr) = 0;
virtual int put_instance_info(const DoutPrefixProvider *dpp, bool exclusive, ceph::real_time mtime) = 0;
virtual int remove_entrypoint(const DoutPrefixProvider *dpp, RGWObjVersionTracker* objv, optional_yield y) = 0;
virtual int remove_instance_info(const DoutPrefixProvider *dpp, RGWObjVersionTracker* objv, optional_yield y) = 0;
- virtual bool is_owner(RGWUser* user) = 0;
- virtual RGWUser* get_owner(void) { return owner; };
+ virtual bool is_owner(User* user) = 0;
+ virtual User* get_owner(void) { return owner; };
virtual ACLOwner get_acl_owner(void) { return ACLOwner(info.owner); };
virtual int check_empty(const DoutPrefixProvider *dpp, optional_yield y) = 0;
virtual int check_quota(RGWQuotaInfo& user_quota, RGWQuotaInfo& bucket_quota, uint64_t obj_size, optional_yield y, bool check_size_only = false) = 0;
- virtual int set_instance_attrs(const DoutPrefixProvider *dpp, RGWAttrs& attrs, optional_yield y) = 0;
+ virtual int set_instance_attrs(const DoutPrefixProvider *dpp, Attrs& attrs, optional_yield y) = 0;
virtual int try_refresh_info(const DoutPrefixProvider *dpp, ceph::real_time *pmtime) = 0;
virtual int read_usage(uint64_t start_epoch, uint64_t end_epoch, uint32_t max_entries,
bool *is_truncated, RGWUsageIter& usage_iter,
ent.convert(b);
}
- static bool empty(RGWBucket* b) { return (!b || b->empty()); }
- virtual std::unique_ptr<RGWBucket> clone() = 0;
+ static bool empty(Bucket* b) { return (!b || b->empty()); }
+ virtual std::unique_ptr<Bucket> clone() = 0;
/* dang - This is temporary, until the API is completed */
rgw_bucket& get_key() { return info.bucket; }
RGWBucketInfo& get_info() { return info; }
- friend inline ostream& operator<<(ostream& out, const RGWBucket& b) {
+ friend inline ostream& operator<<(ostream& out, const Bucket& b) {
out << b.info.bucket;
return out;
}
- friend inline ostream& operator<<(ostream& out, const RGWBucket* b) {
+ friend inline ostream& operator<<(ostream& out, const Bucket* b) {
if (!b)
out << "<NULL>";
else
return out;
}
- friend inline ostream& operator<<(ostream& out, const std::unique_ptr<RGWBucket>& p) {
+ friend inline ostream& operator<<(ostream& out, const std::unique_ptr<Bucket>& p) {
out << p.get();
return out;
}
- bool operator==(const RGWBucket& b) const {
+ bool operator==(const Bucket& b) const {
return (info.bucket.tenant == b.info.bucket.tenant) &&
(info.bucket.name == b.info.bucket.name) &&
(info.bucket.bucket_id == b.info.bucket.bucket_id);
}
- bool operator!=(const RGWBucket& b) const {
+ bool operator!=(const Bucket& b) const {
return (info.bucket.tenant != b.info.bucket.tenant) ||
(info.bucket.name != b.info.bucket.name) ||
(info.bucket.bucket_id != b.info.bucket.bucket_id);
}
- friend class RGWBucketList;
+ friend class BucketList;
protected:
virtual void set_ent(RGWBucketEnt& _ent) { ent = _ent; info.bucket = ent.bucket; info.placement_rule = ent.placement_rule; }
};
-class RGWBucketList {
- std::map<std::string, std::unique_ptr<RGWBucket>> buckets;
+class BucketList {
+ std::map<std::string, std::unique_ptr<Bucket>> buckets;
bool truncated;
public:
- RGWBucketList() : buckets(), truncated(false) {}
- RGWBucketList(RGWBucketList&& _bl) :
+ BucketList() : buckets(), truncated(false) {}
+ BucketList(BucketList&& _bl) :
buckets(std::move(_bl.buckets)),
truncated(_bl.truncated)
{ }
- RGWBucketList& operator=(const RGWBucketList&) = delete;
- RGWBucketList& operator=(RGWBucketList&& _bl) {
+ BucketList& operator=(const BucketList&) = delete;
+ BucketList& operator=(BucketList&& _bl) {
for (auto& ent : _bl.buckets) {
buckets.emplace(ent.first, std::move(ent.second));
}
return *this;
};
- map<std::string, std::unique_ptr<RGWBucket>>& get_buckets() { return buckets; }
+ map<std::string, std::unique_ptr<Bucket>>& get_buckets() { return buckets; }
bool is_truncated(void) const { return truncated; }
void set_truncated(bool trunc) { truncated = trunc; }
- void add(std::unique_ptr<RGWBucket> bucket) {
+ void add(std::unique_ptr<Bucket> bucket) {
buckets.emplace(bucket->info.bucket.name, std::move(bucket));
}
size_t count() const { return buckets.size(); }
}
};
-class RGWObject {
+class Object {
protected:
rgw_obj_key key;
- RGWBucket* bucket;
+ Bucket* bucket;
std::string index_hash_source;
uint64_t obj_size;
- RGWAttrs attrs;
+ Attrs attrs;
ceph::real_time mtime;
bool delete_marker{false};
bool in_extra_data{false};
struct Params {
bool versioning_disabled{false};
ceph::real_time* mtime{nullptr};
- RGWAttrs* rmattrs{nullptr};
+ Attrs* rmattrs{nullptr};
const bufferlist* data{nullptr};
RGWObjManifest* manifest{nullptr};
const string* ptag{nullptr};
bool modify_tail{false};
bool completeMultipart{false};
bool appendable{false};
- RGWAttrs* attrs{nullptr};
+ Attrs* attrs{nullptr};
} params;
virtual ~WriteOp() = default;
struct StatOp {
struct Result {
- RGWObject* obj;
+ Object* obj;
RGWObjManifest* manifest;
} result;
virtual int wait() = 0;
};
- RGWObject()
+ Object()
: key(),
bucket(nullptr),
index_hash_source(),
obj_size(),
attrs(),
mtime() {}
- RGWObject(const rgw_obj_key& _k)
+ Object(const rgw_obj_key& _k)
: key(_k),
bucket(),
index_hash_source(),
obj_size(),
attrs(),
mtime() {}
- RGWObject(const rgw_obj_key& _k, RGWBucket* _b)
+ Object(const rgw_obj_key& _k, Bucket* _b)
: key(_k),
bucket(_b),
index_hash_source(),
obj_size(),
attrs(),
mtime() {}
- RGWObject(RGWObject& _o) = default;
+ Object(Object& _o) = default;
- virtual ~RGWObject() = default;
+ virtual ~Object() = default;
virtual int delete_object(const DoutPrefixProvider *dpp, RGWObjectCtx* obj_ctx, optional_yield y) = 0;
virtual int delete_obj_aio(const DoutPrefixProvider *dpp, RGWObjState *astate, Completions* aio,
bool keep_index_consistent, optional_yield y) = 0;
- virtual int copy_object(RGWObjectCtx& obj_ctx, RGWUser* user,
+ virtual int copy_object(RGWObjectCtx& obj_ctx, User* user,
req_info *info, const rgw_zone_id& source_zone,
- rgw::sal::RGWObject* dest_object, rgw::sal::RGWBucket* dest_bucket,
- rgw::sal::RGWBucket* src_bucket,
+ rgw::sal::Object* dest_object, rgw::sal::Bucket* dest_bucket,
+ rgw::sal::Bucket* src_bucket,
const rgw_placement_rule& dest_placement,
ceph::real_time *src_mtime, ceph::real_time *mtime,
const ceph::real_time *mod_ptr, const ceph::real_time *unmod_ptr,
bool high_precision_time,
const char *if_match, const char *if_nomatch,
- AttrsMod attrs_mod, bool copy_if_newer, RGWAttrs& attrs,
+ AttrsMod attrs_mod, bool copy_if_newer, Attrs& attrs,
RGWObjCategory category, uint64_t olh_epoch,
boost::optional<ceph::real_time> delete_at,
string *version_id, string *tag, string *etag,
const std::string &get_name() const { return key.name; }
virtual int get_obj_state(const DoutPrefixProvider *dpp, RGWObjectCtx *rctx, RGWObjState **state, optional_yield y, bool follow_olh = false) = 0;
- virtual int set_obj_attrs(const DoutPrefixProvider *dpp, RGWObjectCtx* rctx, RGWAttrs* setattrs, RGWAttrs* delattrs, optional_yield y, rgw_obj* target_obj = NULL) = 0;
+ virtual int set_obj_attrs(const DoutPrefixProvider *dpp, RGWObjectCtx* rctx, Attrs* setattrs, Attrs* delattrs, optional_yield y, rgw_obj* target_obj = NULL) = 0;
virtual int get_obj_attrs(RGWObjectCtx *rctx, optional_yield y, const DoutPrefixProvider *dpp, rgw_obj* target_obj = NULL) = 0;
virtual int modify_obj_attrs(RGWObjectCtx *rctx, const char *attr_name, bufferlist& attr_val, optional_yield y, const DoutPrefixProvider *dpp) = 0;
virtual int delete_obj_attrs(const DoutPrefixProvider *dpp, RGWObjectCtx *rctx, const char *attr_name, optional_yield y) = 0;
- virtual int copy_obj_data(RGWObjectCtx& rctx, RGWBucket* dest_bucket, RGWObject* dest_obj, uint16_t olh_epoch, std::string* petag, const DoutPrefixProvider *dpp, optional_yield y) = 0;
+ virtual int copy_obj_data(RGWObjectCtx& rctx, Bucket* dest_bucket, Object* dest_obj, uint16_t olh_epoch, std::string* petag, const DoutPrefixProvider *dpp, optional_yield y) = 0;
virtual bool is_expired() = 0;
virtual void gen_rand_obj_instance_name() = 0;
virtual void raw_obj_to_obj(const rgw_raw_obj& raw_obj) = 0;
virtual void get_raw_obj(rgw_raw_obj* raw_obj) = 0;
virtual MPSerializer* get_serializer(const std::string& lock_name) = 0;
virtual int transition(RGWObjectCtx& rctx,
- RGWBucket* bucket,
+ Bucket* bucket,
const rgw_placement_rule& placement_rule,
const real_time& mtime,
uint64_t olh_epoch,
virtual void get_max_aligned_size(uint64_t size, uint64_t alignment, uint64_t *max_size) = 0;
virtual bool placement_rules_match(rgw_placement_rule& r1, rgw_placement_rule& r2) = 0;
- RGWAttrs& get_attrs(void) { return attrs; }
- const RGWAttrs& get_attrs(void) const { return attrs; }
+ Attrs& get_attrs(void) { return attrs; }
+ const Attrs& get_attrs(void) const { return attrs; }
ceph::real_time get_mtime(void) const { return mtime; }
uint64_t get_obj_size(void) const { return obj_size; }
- RGWBucket* get_bucket(void) const { return bucket; }
- void set_bucket(RGWBucket* b) { bucket = b; }
+ Bucket* get_bucket(void) const { return bucket; }
+ void set_bucket(Bucket* b) { bucket = b; }
std::string get_hash_source(void) { return index_hash_source; }
void set_hash_source(std::string s) { index_hash_source = s; }
std::string get_oid(void) const { return key.get_oid(); }
optional_yield y) = 0;
virtual int omap_get_vals_by_keys(const std::string& oid,
const std::set<std::string>& keys,
- RGWAttrs *vals) = 0;
+ Attrs *vals) = 0;
virtual int omap_set_val_by_key(const std::string& key, bufferlist& val,
bool must_exist, optional_yield y) = 0;
- static bool empty(RGWObject* o) { return (!o || o->empty()); }
- virtual std::unique_ptr<RGWObject> clone() = 0;
+ static bool empty(Object* o) { return (!o || o->empty()); }
+ virtual std::unique_ptr<Object> clone() = 0;
/* dang - Not sure if we want this, but it simplifies things a lot */
const std::string &get_instance() const { return key.instance; }
bool have_instance(void) { return key.have_instance(); }
- friend inline ostream& operator<<(ostream& out, const RGWObject& o) {
+ friend inline ostream& operator<<(ostream& out, const Object& o) {
if (o.bucket)
out << o.bucket << ":";
out << o.key;
return out;
}
- friend inline ostream& operator<<(ostream& out, const RGWObject* o) {
+ friend inline ostream& operator<<(ostream& out, const Object* o) {
if (!o)
out << "<NULL>";
else
out << *o;
return out;
}
- friend inline ostream& operator<<(ostream& out, const std::unique_ptr<RGWObject>& p) {
+ friend inline ostream& operator<<(ostream& out, const std::unique_ptr<Object>& p) {
out << p.get();
return out;
}
class Notification {
protected:
- RGWObject* obj;
+ Object* obj;
rgw::notify::EventType event_type;
public:
- Notification(RGWObject* _obj, rgw::notify::EventType _type) : obj(_obj), event_type(_type) {}
+ Notification(Object* _obj, rgw::notify::EventType _type) : obj(_obj), event_type(_type) {}
virtual ~Notification() = default;
virtual int publish_reserve(RGWObjTags* obj_tags = nullptr) = 0;
class GCChain {
protected:
- RGWObject* obj;
+ Object* obj;
public:
- GCChain(RGWObject* _obj) : obj(_obj) {}
+ GCChain(Object* _obj) : obj(_obj) {}
virtual ~GCChain() = default;
virtual void update(RGWObjManifest* manifest) = 0;
class Writer : public rgw::putobj::DataProcessor {
protected:
Aio *const aio;
- rgw::sal::RGWBucket* bucket;
+ rgw::sal::Bucket* bucket;
RGWObjectCtx& obj_ctx;
- std::unique_ptr<rgw::sal::RGWObject> head_obj;
+ std::unique_ptr<rgw::sal::Object> head_obj;
RawObjSet written; // set of written objects for deletion
const DoutPrefixProvider *dpp;
optional_yield y;
public:
Writer(Aio *aio,
- rgw::sal::RGWBucket* bucket,
- RGWObjectCtx& obj_ctx, std::unique_ptr<rgw::sal::RGWObject> _head_obj,
+ rgw::sal::Bucket* bucket,
+ RGWObjectCtx& obj_ctx, std::unique_ptr<rgw::sal::Object> _head_obj,
const DoutPrefixProvider *dpp, optional_yield y)
: aio(aio), bucket(bucket),
obj_ctx(obj_ctx), head_obj(std::move(_head_obj)), dpp(dpp), y(y)
} } // namespace rgw::sal
-class RGWStoreManager {
+class StoreManager {
public:
- RGWStoreManager() {}
- static rgw::sal::RGWStore *get_storage(const DoutPrefixProvider *dpp, CephContext *cct, const std::string svc, bool use_gc_thread, bool use_lc_thread, bool quota_threads,
+ StoreManager() {}
+ static rgw::sal::Store *get_storage(const DoutPrefixProvider *dpp, CephContext *cct, const std::string svc, bool use_gc_thread, bool use_lc_thread, bool quota_threads,
bool run_sync_thread, bool run_reshard_thread, bool use_cache = true) {
- rgw::sal::RGWStore *store = init_storage_provider(dpp, cct, svc, use_gc_thread, use_lc_thread,
+ rgw::sal::Store *store = init_storage_provider(dpp, cct, svc, use_gc_thread, use_lc_thread,
quota_threads, run_sync_thread, run_reshard_thread, use_cache);
return store;
}
- static rgw::sal::RGWStore *get_raw_storage(const DoutPrefixProvider *dpp, CephContext *cct, const std::string svc) {
- rgw::sal::RGWStore *store = init_raw_storage_provider(dpp, cct, svc);
+ static rgw::sal::Store *get_raw_storage(const DoutPrefixProvider *dpp, CephContext *cct, const std::string svc) {
+ rgw::sal::Store *store = init_raw_storage_provider(dpp, cct, svc);
return store;
}
- static rgw::sal::RGWStore *init_storage_provider(const DoutPrefixProvider *dpp, CephContext *cct, const std::string svc, bool use_gc_thread, bool use_lc_thread, bool quota_threads, bool run_sync_thread, bool run_reshard_thread, bool use_metadata_cache);
- static rgw::sal::RGWStore *init_raw_storage_provider(const DoutPrefixProvider *dpp, CephContext *cct, const std::string svc);
- static void close_storage(rgw::sal::RGWStore *store);
+ static rgw::sal::Store *init_storage_provider(const DoutPrefixProvider *dpp, CephContext *cct, const std::string svc, bool use_gc_thread, bool use_lc_thread, bool quota_threads, bool run_sync_thread, bool run_reshard_thread, bool use_metadata_cache);
+ static rgw::sal::Store *init_raw_storage_provider(const DoutPrefixProvider *dpp, CephContext *cct, const std::string svc);
+ static void close_storage(rgw::sal::Store *store);
};
}
static int rgw_op_get_bucket_policy_from_attr(const DoutPrefixProvider *dpp,
- RGWRadosStore *store,
- RGWUser& user,
- RGWAttrs& bucket_attrs,
+ RadosStore *store,
+ User& user,
+ Attrs& bucket_attrs,
RGWAccessControlPolicy *policy,
optional_yield y)
{
return ret;
}
-int RGWRadosUser::list_buckets(const DoutPrefixProvider *dpp, const string& marker,
+int RadosUser::list_buckets(const DoutPrefixProvider *dpp, const string& marker,
const string& end_marker, uint64_t max, bool need_stats,
- RGWBucketList &buckets, optional_yield y)
+ BucketList &buckets, optional_yield y)
{
RGWUserBuckets ulist;
bool is_truncated = false;
buckets.set_truncated(is_truncated);
for (const auto& ent : ulist.get_buckets()) {
- buckets.add(std::unique_ptr<RGWBucket>(new RGWRadosBucket(this->store, ent.second, this)));
+ buckets.add(std::unique_ptr<Bucket>(new RadosBucket(this->store, ent.second, this)));
}
return 0;
}
-RGWBucket* RGWRadosUser::create_bucket(rgw_bucket& bucket,
+Bucket* RadosUser::create_bucket(rgw_bucket& bucket,
ceph::real_time creation_time)
{
return NULL;
}
-int RGWRadosUser::read_attrs(const DoutPrefixProvider *dpp, optional_yield y, RGWAttrs* uattrs, RGWObjVersionTracker* tracker)
+int RadosUser::read_attrs(const DoutPrefixProvider *dpp, optional_yield y, Attrs* uattrs, RGWObjVersionTracker* tracker)
{
return store->ctl()->user->get_attrs_by_uid(dpp, get_id(), uattrs, y, tracker);
}
-int RGWRadosUser::read_stats(optional_yield y, RGWStorageStats* stats,
+int RadosUser::read_stats(optional_yield y, RGWStorageStats* stats,
ceph::real_time *last_stats_sync,
ceph::real_time *last_stats_update)
{
return store->ctl()->user->read_stats(get_id(), stats, y, last_stats_sync, last_stats_update);
}
-int RGWRadosUser::read_stats_async(RGWGetUserStats_CB *cb)
+int RadosUser::read_stats_async(RGWGetUserStats_CB *cb)
{
return store->ctl()->user->read_stats_async(get_id(), cb);
}
-int RGWRadosUser::complete_flush_stats(optional_yield y)
+int RadosUser::complete_flush_stats(optional_yield y)
{
return store->ctl()->user->complete_flush_stats(get_id(), y);
}
-int RGWRadosUser::read_usage(uint64_t start_epoch, uint64_t end_epoch,
+int RadosUser::read_usage(uint64_t start_epoch, uint64_t end_epoch,
uint32_t max_entries, bool *is_truncated,
RGWUsageIter& usage_iter,
map<rgw_user_bucket, rgw_usage_log_entry>& usage)
usage_iter, usage);
}
-int RGWRadosUser::trim_usage(uint64_t start_epoch, uint64_t end_epoch)
+int RadosUser::trim_usage(uint64_t start_epoch, uint64_t end_epoch)
{
std::string bucket_name;
return store->getRados()->trim_usage(get_id(), bucket_name, start_epoch, end_epoch);
}
-int RGWRadosUser::load_by_id(const DoutPrefixProvider *dpp, optional_yield y)
+int RadosUser::load_by_id(const DoutPrefixProvider *dpp, optional_yield y)
{
return store->ctl()->user->get_info_by_uid(dpp, info.user_id, &info, y, RGWUserCtl::GetParams().set_objv_tracker(&objv_tracker));
}
-int RGWRadosUser::store_info(const DoutPrefixProvider *dpp, optional_yield y, const RGWUserCtl::PutParams& params)
+int RadosUser::store_info(const DoutPrefixProvider *dpp, optional_yield y, const RGWUserCtl::PutParams& params)
{
return store->ctl()->user->store_info(dpp, info, y, params);
}
-int RGWRadosUser::remove_info(const DoutPrefixProvider *dpp, optional_yield y, const RGWUserCtl::RemoveParams& params)
+int RadosUser::remove_info(const DoutPrefixProvider *dpp, optional_yield y, const RGWUserCtl::RemoveParams& params)
{
return store->ctl()->user->remove_info(dpp, info, y, params);
}
/* Placeholder */
-RGWObject *RGWRadosBucket::create_object(const rgw_obj_key &key)
+Object *RadosBucket::create_object(const rgw_obj_key &key)
{
return nullptr;
}
-int RGWRadosBucket::remove_bucket(const DoutPrefixProvider *dpp, bool delete_children, std::string prefix, std::string delimiter, bool forward_to_master, req_info* req_info, optional_yield y)
+int RadosBucket::remove_bucket(const DoutPrefixProvider *dpp, bool delete_children, std::string prefix, std::string delimiter, bool forward_to_master, req_info* req_info, optional_yield y)
{
int ret;
return ret;
}
-int RGWRadosBucket::get_bucket_info(const DoutPrefixProvider *dpp, optional_yield y)
+int RadosBucket::get_bucket_info(const DoutPrefixProvider *dpp, optional_yield y)
{
auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
int ret;
return ret;
}
-int RGWRadosBucket::get_bucket_stats(int shard_id,
+int RadosBucket::get_bucket_stats(int shard_id,
std::string *bucket_ver, std::string *master_ver,
std::map<RGWObjCategory, RGWStorageStats>& stats,
std::string *max_marker, bool *syncstopped)
return store->getRados()->get_bucket_stats(info, shard_id, bucket_ver, master_ver, stats, max_marker, syncstopped);
}
-int RGWRadosBucket::get_bucket_stats_async(int shard_id, RGWGetBucketStats_CB *ctx)
+int RadosBucket::get_bucket_stats_async(int shard_id, RGWGetBucketStats_CB *ctx)
{
return store->getRados()->get_bucket_stats_async(get_info(), shard_id, ctx);
}
-int RGWRadosBucket::read_bucket_stats(const DoutPrefixProvider *dpp, optional_yield y)
+int RadosBucket::read_bucket_stats(const DoutPrefixProvider *dpp, optional_yield y)
{
int ret = store->ctl()->bucket->read_bucket_stats(info.bucket, &ent, y, dpp);
info.placement_rule = ent.placement_rule;
return ret;
}
-int RGWRadosBucket::sync_user_stats(optional_yield y)
+int RadosBucket::sync_user_stats(optional_yield y)
{
return store->ctl()->bucket->sync_user_stats(owner->get_id(), info, y);
}
-int RGWRadosBucket::update_container_stats(const DoutPrefixProvider *dpp)
+int RadosBucket::update_container_stats(const DoutPrefixProvider *dpp)
{
int ret;
map<std::string, RGWBucketEnt> m;
return 0;
}
-int RGWRadosBucket::check_bucket_shards(const DoutPrefixProvider *dpp)
+int RadosBucket::check_bucket_shards(const DoutPrefixProvider *dpp)
{
return store->getRados()->check_bucket_shards(info, info.bucket, get_count(), dpp);
}
-int RGWRadosBucket::link(const DoutPrefixProvider *dpp, RGWUser* new_user, optional_yield y, bool update_entrypoint, RGWObjVersionTracker* objv)
+int RadosBucket::link(const DoutPrefixProvider *dpp, User* new_user, optional_yield y, bool update_entrypoint, RGWObjVersionTracker* objv)
{
RGWBucketEntryPoint ep;
ep.bucket = info.bucket;
ep.owner = new_user->get_id();
ep.creation_time = get_creation_time();
ep.linked = true;
- RGWAttrs ep_attrs;
+ Attrs ep_attrs;
rgw_ep_info ep_data{ep, ep_attrs};
int r = store->ctl()->bucket->link_bucket(new_user->get_id(), info.bucket,
return r;
}
-int RGWRadosBucket::unlink(const DoutPrefixProvider *dpp, RGWUser* new_user, optional_yield y, bool update_entrypoint)
+int RadosBucket::unlink(const DoutPrefixProvider *dpp, User* new_user, optional_yield y, bool update_entrypoint)
{
return store->ctl()->bucket->unlink_bucket(new_user->get_id(), info.bucket, y, dpp, update_entrypoint);
}
-int RGWRadosBucket::chown(const DoutPrefixProvider *dpp, RGWUser* new_user, RGWUser* old_user, optional_yield y, const std::string* marker)
+int RadosBucket::chown(const DoutPrefixProvider *dpp, User* new_user, User* old_user, optional_yield y, const std::string* marker)
{
string obj_marker;
old_user->get_display_name(), *marker, y, dpp);
}
-int RGWRadosBucket::put_instance_info(const DoutPrefixProvider *dpp, bool exclusive, ceph::real_time _mtime)
+int RadosBucket::put_instance_info(const DoutPrefixProvider *dpp, bool exclusive, ceph::real_time _mtime)
{
mtime = _mtime;
return store->getRados()->put_bucket_instance_info(info, exclusive, mtime, &attrs, dpp);
}
-int RGWRadosBucket::remove_entrypoint(const DoutPrefixProvider *dpp, RGWObjVersionTracker* objv, optional_yield y)
+int RadosBucket::remove_entrypoint(const DoutPrefixProvider *dpp, RGWObjVersionTracker* objv, optional_yield y)
{
return store->ctl()->bucket->remove_bucket_entrypoint_info(get_key(), y, dpp,
RGWBucketCtl::Bucket::RemoveParams()
.set_objv_tracker(objv));
}
-int RGWRadosBucket::remove_instance_info(const DoutPrefixProvider *dpp, RGWObjVersionTracker* objv, optional_yield y)
+int RadosBucket::remove_instance_info(const DoutPrefixProvider *dpp, RGWObjVersionTracker* objv, optional_yield y)
{
return store->ctl()->bucket->remove_bucket_instance_info(get_key(), info, y, dpp,
RGWBucketCtl::BucketInstance::RemoveParams()
}
/* Make sure to call get_bucket_info() if you need it first */
-bool RGWRadosBucket::is_owner(RGWUser* user)
+bool RadosBucket::is_owner(User* user)
{
return (info.owner.compare(user->get_id()) == 0);
}
-int RGWRadosBucket::check_empty(const DoutPrefixProvider *dpp, optional_yield y)
+int RadosBucket::check_empty(const DoutPrefixProvider *dpp, optional_yield y)
{
return store->getRados()->check_bucket_empty(dpp, info, y);
}
-int RGWRadosBucket::check_quota(RGWQuotaInfo& user_quota, RGWQuotaInfo& bucket_quota, uint64_t obj_size,
+int RadosBucket::check_quota(RGWQuotaInfo& user_quota, RGWQuotaInfo& bucket_quota, uint64_t obj_size,
optional_yield y, bool check_size_only)
{
return store->getRados()->check_quota(owner->get_id(), get_key(),
user_quota, bucket_quota, obj_size, y, check_size_only);
}
-int RGWRadosBucket::set_instance_attrs(const DoutPrefixProvider *dpp, RGWAttrs& attrs, optional_yield y)
+int RadosBucket::set_instance_attrs(const DoutPrefixProvider *dpp, Attrs& attrs, optional_yield y)
{
return store->ctl()->bucket->set_bucket_instance_attrs(get_info(),
attrs, &get_info().objv_tracker, y, dpp);
}
-int RGWRadosBucket::try_refresh_info(const DoutPrefixProvider *dpp, ceph::real_time *pmtime)
+int RadosBucket::try_refresh_info(const DoutPrefixProvider *dpp, ceph::real_time *pmtime)
{
return store->getRados()->try_refresh_bucket_info(info, pmtime, dpp, &attrs);
}
-int RGWRadosBucket::read_usage(uint64_t start_epoch, uint64_t end_epoch,
+int RadosBucket::read_usage(uint64_t start_epoch, uint64_t end_epoch,
uint32_t max_entries, bool *is_truncated,
RGWUsageIter& usage_iter,
map<rgw_user_bucket, rgw_usage_log_entry>& usage)
usage_iter, usage);
}
-int RGWRadosBucket::trim_usage(uint64_t start_epoch, uint64_t end_epoch)
+int RadosBucket::trim_usage(uint64_t start_epoch, uint64_t end_epoch)
{
return store->getRados()->trim_usage(owner->get_id(), get_name(), start_epoch, end_epoch);
}
-int RGWRadosBucket::remove_objs_from_index(std::list<rgw_obj_index_key>& objs_to_unlink)
+int RadosBucket::remove_objs_from_index(std::list<rgw_obj_index_key>& objs_to_unlink)
{
return store->getRados()->remove_objs_from_index(info, objs_to_unlink);
}
-int RGWRadosBucket::check_index(std::map<RGWObjCategory, RGWStorageStats>& existing_stats, std::map<RGWObjCategory, RGWStorageStats>& calculated_stats)
+int RadosBucket::check_index(std::map<RGWObjCategory, RGWStorageStats>& existing_stats, std::map<RGWObjCategory, RGWStorageStats>& calculated_stats)
{
return store->getRados()->bucket_check_index(info, &existing_stats, &calculated_stats);
}
-int RGWRadosBucket::rebuild_index()
+int RadosBucket::rebuild_index()
{
return store->getRados()->bucket_rebuild_index(info);
}
-int RGWRadosBucket::set_tag_timeout(uint64_t timeout)
+int RadosBucket::set_tag_timeout(uint64_t timeout)
{
return store->getRados()->cls_obj_set_bucket_tag_timeout(info, timeout);
}
-int RGWRadosBucket::purge_instance(const DoutPrefixProvider *dpp)
+int RadosBucket::purge_instance(const DoutPrefixProvider *dpp)
{
int max_shards = (info.layout.current_index.layout.normal.num_shards > 0 ? info.layout.current_index.layout.normal.num_shards : 1);
for (int i = 0; i < max_shards; i++) {
return 0;
}
-int RGWRadosBucket::set_acl(const DoutPrefixProvider *dpp, RGWAccessControlPolicy &acl, optional_yield y)
+int RadosBucket::set_acl(const DoutPrefixProvider *dpp, RGWAccessControlPolicy &acl, optional_yield y)
{
bufferlist aclbl;
return store->ctl()->bucket->set_acl(acl.get_owner(), info.bucket, info, aclbl, y, dpp);
}
-std::unique_ptr<RGWObject> RGWRadosBucket::get_object(const rgw_obj_key& k)
+std::unique_ptr<Object> RadosBucket::get_object(const rgw_obj_key& k)
{
- return std::unique_ptr<RGWObject>(new RGWRadosObject(this->store, k, this));
+ return std::unique_ptr<Object>(new RadosObject(this->store, k, this));
}
-int RGWRadosBucket::list(const DoutPrefixProvider *dpp, ListParams& params, int max, ListResults& results, optional_yield y)
+int RadosBucket::list(const DoutPrefixProvider *dpp, ListParams& params, int max, ListResults& results, optional_yield y)
{
RGWRados::Bucket target(store->getRados(), get_info());
if (params.shard_id >= 0) {
return ret;
}
-std::unique_ptr<RGWUser> RGWRadosStore::get_user(const rgw_user &u)
+std::unique_ptr<User> RadosStore::get_user(const rgw_user &u)
{
- return std::unique_ptr<RGWUser>(new RGWRadosUser(this, u));
+ return std::unique_ptr<User>(new RadosUser(this, u));
}
-int RGWRadosStore::get_user_by_access_key(const DoutPrefixProvider *dpp, const std::string& key, optional_yield y, std::unique_ptr<RGWUser>* user)
+int RadosStore::get_user_by_access_key(const DoutPrefixProvider *dpp, const std::string& key, optional_yield y, std::unique_ptr<User>* user)
{
RGWUserInfo uinfo;
- RGWUser *u;
+ User *u;
RGWObjVersionTracker objv_tracker;
int r = ctl()->user->get_info_by_access_key(dpp, key, &uinfo, y, RGWUserCtl::GetParams().set_objv_tracker(&objv_tracker));
if (r < 0)
return r;
- u = new RGWRadosUser(this, uinfo);
+ u = new RadosUser(this, uinfo);
if (!u)
return -ENOMEM;
return 0;
}
-int RGWRadosStore::get_user_by_email(const DoutPrefixProvider *dpp, const std::string& email, optional_yield y, std::unique_ptr<RGWUser>* user)
+int RadosStore::get_user_by_email(const DoutPrefixProvider *dpp, const std::string& email, optional_yield y, std::unique_ptr<User>* user)
{
RGWUserInfo uinfo;
- RGWUser *u;
+ User *u;
RGWObjVersionTracker objv_tracker;
int r = ctl()->user->get_info_by_email(dpp, email, &uinfo, y, RGWUserCtl::GetParams().set_objv_tracker(&objv_tracker));
if (r < 0)
return r;
- u = new RGWRadosUser(this, uinfo);
+ u = new RadosUser(this, uinfo);
if (!u)
return -ENOMEM;
return 0;
}
-int RGWRadosStore::get_user_by_swift(const DoutPrefixProvider *dpp, const std::string& user_str, optional_yield y, std::unique_ptr<RGWUser>* user)
+int RadosStore::get_user_by_swift(const DoutPrefixProvider *dpp, const std::string& user_str, optional_yield y, std::unique_ptr<User>* user)
{
RGWUserInfo uinfo;
- RGWUser *u;
+ User *u;
RGWObjVersionTracker objv_tracker;
int r = ctl()->user->get_info_by_swift(dpp, user_str, &uinfo, y, RGWUserCtl::GetParams().set_objv_tracker(&objv_tracker));
if (r < 0)
return r;
- u = new RGWRadosUser(this, uinfo);
+ u = new RadosUser(this, uinfo);
if (!u)
return -ENOMEM;
return 0;
}
-std::unique_ptr<RGWObject> RGWRadosStore::get_object(const rgw_obj_key& k)
+std::unique_ptr<Object> RadosStore::get_object(const rgw_obj_key& k)
{
- return std::unique_ptr<RGWObject>(new RGWRadosObject(this, k));
+ return std::unique_ptr<Object>(new RadosObject(this, k));
}
-int RGWRadosStore::get_bucket(const DoutPrefixProvider *dpp, RGWUser* u, const rgw_bucket& b, std::unique_ptr<RGWBucket>* bucket, optional_yield y)
+int RadosStore::get_bucket(const DoutPrefixProvider *dpp, User* u, const rgw_bucket& b, std::unique_ptr<Bucket>* bucket, optional_yield y)
{
int ret;
- RGWBucket* bp;
+ Bucket* bp;
- bp = new RGWRadosBucket(this, b, u);
+ bp = new RadosBucket(this, b, u);
ret = bp->get_bucket_info(dpp, y);
if (ret < 0) {
delete bp;
return 0;
}
-int RGWRadosStore::get_bucket(RGWUser* u, const RGWBucketInfo& i, std::unique_ptr<RGWBucket>* bucket)
+int RadosStore::get_bucket(User* u, const RGWBucketInfo& i, std::unique_ptr<Bucket>* bucket)
{
- RGWBucket* bp;
+ Bucket* bp;
- bp = new RGWRadosBucket(this, i, u);
+ bp = new RadosBucket(this, i, u);
/* Don't need to fetch the bucket info, use the provided one */
bucket->reset(bp);
return 0;
}
-int RGWRadosStore::get_bucket(const DoutPrefixProvider *dpp, RGWUser* u, const std::string& tenant, const std::string& name, std::unique_ptr<RGWBucket>* bucket, optional_yield y)
+int RadosStore::get_bucket(const DoutPrefixProvider *dpp, User* u, const std::string& tenant, const std::string& name, std::unique_ptr<Bucket>* bucket, optional_yield y)
{
rgw_bucket b;
return get_bucket(dpp, u, b, bucket, y);
}
-int RGWRadosStore::create_bucket(const DoutPrefixProvider *dpp,
- RGWUser& u, const rgw_bucket& b,
+int RadosStore::create_bucket(const DoutPrefixProvider *dpp,
+ User& u, const rgw_bucket& b,
const string& zonegroup_id,
rgw_placement_rule& placement_rule,
string& swift_ver_location,
const RGWQuotaInfo * pquota_info,
const RGWAccessControlPolicy& policy,
- RGWAttrs& attrs,
+ Attrs& attrs,
RGWBucketInfo& info,
obj_version& ep_objv,
bool exclusive,
bool obj_lock_enabled,
bool *existed,
req_info& req_info,
- std::unique_ptr<RGWBucket>* bucket_out,
+ std::unique_ptr<Bucket>* bucket_out,
optional_yield y)
{
int ret;
rgw_bucket *pmaster_bucket;
uint32_t *pmaster_num_shards;
real_time creation_time;
- std::unique_ptr<RGWBucket> bucket;
+ std::unique_ptr<Bucket> bucket;
obj_version objv, *pobjv = NULL;
/* If it exists, look it up; otherwise create it */
return -EEXIST;
}
} else {
- bucket = std::unique_ptr<RGWBucket>(new RGWRadosBucket(this, b, &u));
+ bucket = std::unique_ptr<Bucket>(new RadosBucket(this, b, &u));
*existed = false;
bucket->set_attrs(attrs);
}
return ret;
}
-bool RGWRadosStore::is_meta_master()
+bool RadosStore::is_meta_master()
{
return svc()->zone->is_meta_master();
}
-int RGWRadosStore::forward_request_to_master(RGWUser* user, obj_version *objv,
+int RadosStore::forward_request_to_master(User* user, obj_version *objv,
bufferlist& in_data,
JSONParser *jp, req_info& info,
optional_yield y)
return 0;
}
-int RGWRadosStore::defer_gc(const DoutPrefixProvider *dpp, RGWObjectCtx *rctx, RGWBucket* bucket, RGWObject* obj, optional_yield y)
+int RadosStore::defer_gc(const DoutPrefixProvider *dpp, RGWObjectCtx *rctx, Bucket* bucket, Object* obj, optional_yield y)
{
return rados->defer_gc(dpp, rctx, bucket->get_info(), obj->get_obj(), y);
}
-std::string RGWRadosStore::zone_unique_id(uint64_t unique_num)
+std::string RadosStore::zone_unique_id(uint64_t unique_num)
{
return svc()->zone_utils->unique_id(unique_num);
}
-std::string RGWRadosStore::zone_unique_trans_id(const uint64_t unique_num)
+std::string RadosStore::zone_unique_trans_id(const uint64_t unique_num)
{
return svc()->zone_utils->unique_trans_id(unique_num);
}
-int RGWRadosStore::cluster_stat(RGWClusterStat& stats)
+int RadosStore::cluster_stat(RGWClusterStat& stats)
{
rados_cluster_stat_t rados_stats;
int ret;
return ret;
}
-std::unique_ptr<Lifecycle> RGWRadosStore::get_lifecycle(void)
+std::unique_ptr<Lifecycle> RadosStore::get_lifecycle(void)
{
return std::unique_ptr<Lifecycle>(new RadosLifecycle(this));
}
-std::unique_ptr<Completions> RGWRadosStore::get_completions(void)
+std::unique_ptr<Completions> RadosStore::get_completions(void)
{
return std::unique_ptr<Completions>(new RadosCompletions());
}
-std::unique_ptr<Notification> RGWRadosStore::get_notification(rgw::sal::RGWObject* obj,
+std::unique_ptr<Notification> RadosStore::get_notification(rgw::sal::Object* obj,
struct req_state* s,
rgw::notify::EventType event_type)
{
return std::unique_ptr<Notification>(new RadosNotification(this, obj, s, event_type));
}
-std::unique_ptr<GCChain> RGWRadosStore::get_gc_chain(rgw::sal::RGWObject* obj)
+std::unique_ptr<GCChain> RadosStore::get_gc_chain(rgw::sal::Object* obj)
{
return std::unique_ptr<GCChain>(new RadosGCChain(this, obj));
}
-std::unique_ptr<Writer> RGWRadosStore::get_writer(Aio *aio, rgw::sal::RGWBucket* bucket,
- RGWObjectCtx& obj_ctx, std::unique_ptr<rgw::sal::RGWObject> _head_obj,
+std::unique_ptr<Writer> RadosStore::get_writer(Aio *aio, rgw::sal::Bucket* bucket,
+ RGWObjectCtx& obj_ctx, std::unique_ptr<rgw::sal::Object> _head_obj,
const DoutPrefixProvider *dpp, optional_yield y)
{
return std::unique_ptr<Writer>(new RadosWriter(aio, this, bucket, obj_ctx, std::move(_head_obj), dpp, y));
}
-int RGWRadosStore::delete_raw_obj(const rgw_raw_obj& obj)
+int RadosStore::delete_raw_obj(const rgw_raw_obj& obj)
{
return rados->delete_raw_obj(obj);
}
-int RGWRadosStore::delete_raw_obj_aio(const rgw_raw_obj& obj, Completions* aio)
+int RadosStore::delete_raw_obj_aio(const rgw_raw_obj& obj, Completions* aio)
{
RadosCompletions *raio = static_cast<RadosCompletions*>(aio);
return rados->delete_raw_obj_aio(obj, raio->handles);
}
-void RGWRadosStore::get_raw_obj(const rgw_placement_rule& placement_rule, const rgw_obj& obj, rgw_raw_obj* raw_obj)
+void RadosStore::get_raw_obj(const rgw_placement_rule& placement_rule, const rgw_obj& obj, rgw_raw_obj* raw_obj)
{
rados->obj_to_raw(placement_rule, obj, raw_obj);
}
-int RGWRadosStore::get_raw_chunk_size(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, uint64_t* chunk_size)
+int RadosStore::get_raw_chunk_size(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, uint64_t* chunk_size)
{
return rados->get_max_chunk_size(obj.pool, chunk_size, dpp);
}
-int RGWRadosStore::log_usage(map<rgw_user_bucket, RGWUsageBatch>& usage_info)
+int RadosStore::log_usage(map<rgw_user_bucket, RGWUsageBatch>& usage_info)
{
return rados->log_usage(usage_info);
}
-int RGWRadosStore::log_op(string& oid, bufferlist& bl)
+int RadosStore::log_op(string& oid, bufferlist& bl)
{
rgw_raw_obj obj(svc()->zone->get_zone_params().log_pool, oid);
return ret;
}
-int RGWRadosStore::register_to_service_map(const string& daemon_type,
+int RadosStore::register_to_service_map(const string& daemon_type,
const map<string, string>& meta)
{
return rados->register_to_service_map(daemon_type, meta);
}
-void RGWRadosStore::get_quota(RGWQuotaInfo& bucket_quota, RGWQuotaInfo& user_quota)
+void RadosStore::get_quota(RGWQuotaInfo& bucket_quota, RGWQuotaInfo& user_quota)
{
bucket_quota = svc()->quota->get_bucket_quota();
user_quota = svc()->quota->get_user_quota();
}
-int RGWRadosStore::list_raw_objects(const rgw_pool& pool, const string& prefix_filter,
+int RadosStore::list_raw_objects(const rgw_pool& pool, const string& prefix_filter,
int max, RGWListRawObjsCtx& ctx, list<string>& oids,
bool *is_truncated)
{
return rados->list_raw_objects(pool, prefix_filter, max, ctx, oids, is_truncated);
}
-int RGWRadosStore::set_buckets_enabled(const DoutPrefixProvider *dpp, vector<rgw_bucket>& buckets, bool enabled)
+int RadosStore::set_buckets_enabled(const DoutPrefixProvider *dpp, vector<rgw_bucket>& buckets, bool enabled)
{
return rados->set_buckets_enabled(buckets, enabled, dpp);
}
-int RGWRadosStore::get_sync_policy_handler(const DoutPrefixProvider *dpp,
+int RadosStore::get_sync_policy_handler(const DoutPrefixProvider *dpp,
std::optional<rgw_zone_id> zone,
std::optional<rgw_bucket> bucket,
RGWBucketSyncPolicyHandlerRef *phandler,
return ctl()->bucket->get_sync_policy_handler(zone, bucket, phandler, y, dpp);
}
-RGWDataSyncStatusManager* RGWRadosStore::get_data_sync_manager(const rgw_zone_id& source_zone)
+RGWDataSyncStatusManager* RadosStore::get_data_sync_manager(const rgw_zone_id& source_zone)
{
return rados->get_data_sync_manager(source_zone);
}
-int RGWRadosStore::read_all_usage(uint64_t start_epoch, uint64_t end_epoch,
+int RadosStore::read_all_usage(uint64_t start_epoch, uint64_t end_epoch,
uint32_t max_entries, bool *is_truncated,
RGWUsageIter& usage_iter,
map<rgw_user_bucket, rgw_usage_log_entry>& usage)
is_truncated, usage_iter, usage);
}
-int RGWRadosStore::trim_all_usage(uint64_t start_epoch, uint64_t end_epoch)
+int RadosStore::trim_all_usage(uint64_t start_epoch, uint64_t end_epoch)
{
rgw_user uid;
std::string bucket_name;
return rados->trim_usage(uid, bucket_name, start_epoch, end_epoch);
}
-int RGWRadosStore::get_config_key_val(string name, bufferlist *bl)
+int RadosStore::get_config_key_val(string name, bufferlist *bl)
{
return svc()->config_key->get(name, true, bl);
}
-int RGWRadosStore::put_system_obj(const rgw_pool& pool, const string& oid,
+int RadosStore::put_system_obj(const rgw_pool& pool, const string& oid,
bufferlist& data, bool exclusive,
RGWObjVersionTracker *objv_tracker, real_time set_mtime,
optional_yield y, map<string, bufferlist> *pattrs)
return rgw_put_system_obj(obj_ctx, pool, oid, data, exclusive, objv_tracker, set_mtime, y, pattrs);
}
-int RGWRadosStore::get_system_obj(const DoutPrefixProvider *dpp,
+int RadosStore::get_system_obj(const DoutPrefixProvider *dpp,
const rgw_pool& pool, const string& key,
bufferlist& bl,
RGWObjVersionTracker *objv_tracker, real_time *pmtime,
return rgw_get_system_obj(obj_ctx, pool, key, bl, objv_tracker, pmtime, y, dpp, pattrs, cache_info, refresh_version);
}
-int RGWRadosStore::delete_system_obj(const rgw_pool& pool, const string& oid,
+int RadosStore::delete_system_obj(const rgw_pool& pool, const string& oid,
RGWObjVersionTracker *objv_tracker, optional_yield y)
{
return rgw_delete_system_obj(svc()->sysobj, pool, oid, objv_tracker, y);
}
-int RGWRadosStore::meta_list_keys_init(const string& section, const string& marker, void** phandle)
+int RadosStore::meta_list_keys_init(const string& section, const string& marker, void** phandle)
{
return ctl()->meta.mgr->list_keys_init(section, marker, phandle);
}
-int RGWRadosStore::meta_list_keys_next(void* handle, int max, list<string>& keys, bool* truncated)
+int RadosStore::meta_list_keys_next(void* handle, int max, list<string>& keys, bool* truncated)
{
return ctl()->meta.mgr->list_keys_next(handle, max, keys, truncated);
}
-void RGWRadosStore::meta_list_keys_complete(void* handle)
+void RadosStore::meta_list_keys_complete(void* handle)
{
ctl()->meta.mgr->list_keys_complete(handle);
}
-std::string RGWRadosStore::meta_get_marker(void* handle)
+std::string RadosStore::meta_get_marker(void* handle)
{
return ctl()->meta.mgr->get_marker(handle);
}
-int RGWRadosStore::meta_remove(const DoutPrefixProvider *dpp, string& metadata_key, optional_yield y)
+int RadosStore::meta_remove(const DoutPrefixProvider *dpp, string& metadata_key, optional_yield y)
{
return ctl()->meta.mgr->remove(metadata_key, y, dpp);
}
-void RGWRadosStore::finalize(void)
+void RadosStore::finalize(void)
{
if (rados)
rados->finalize();
}
-int RGWRadosStore::get_obj_head_ioctx(const RGWBucketInfo& bucket_info, const rgw_obj& obj, librados::IoCtx *ioctx)
+int RadosStore::get_obj_head_ioctx(const RGWBucketInfo& bucket_info, const rgw_obj& obj, librados::IoCtx *ioctx)
{
return rados->get_obj_head_ioctx(bucket_info, obj, ioctx);
}
-int RGWObject::range_to_ofs(uint64_t obj_size, int64_t &ofs, int64_t &end)
+int Object::range_to_ofs(uint64_t obj_size, int64_t &ofs, int64_t &end)
{
if (ofs < 0) {
ofs += obj_size;
return 0;
}
-int RGWRadosObject::get_obj_state(const DoutPrefixProvider *dpp, RGWObjectCtx *rctx, RGWObjState **state, optional_yield y, bool follow_olh)
+int RadosObject::get_obj_state(const DoutPrefixProvider *dpp, RGWObjectCtx *rctx, RGWObjState **state, optional_yield y, bool follow_olh)
{
return store->getRados()->get_obj_state(dpp, rctx, bucket->get_info(), get_obj(), state, follow_olh, y);
}
-int RGWRadosObject::read_attrs(const DoutPrefixProvider *dpp, RGWRados::Object::Read &read_op, optional_yield y, rgw_obj *target_obj)
+int RadosObject::read_attrs(const DoutPrefixProvider *dpp, RGWRados::Object::Read &read_op, optional_yield y, rgw_obj *target_obj)
{
read_op.params.attrs = &attrs;
read_op.params.target_obj = target_obj;
return read_op.prepare(y, dpp);
}
-int RGWRadosObject::set_obj_attrs(const DoutPrefixProvider *dpp, RGWObjectCtx* rctx, RGWAttrs* setattrs, RGWAttrs* delattrs, optional_yield y, rgw_obj* target_obj)
+int RadosObject::set_obj_attrs(const DoutPrefixProvider *dpp, RGWObjectCtx* rctx, Attrs* setattrs, Attrs* delattrs, optional_yield y, rgw_obj* target_obj)
{
- RGWAttrs empty;
+ Attrs empty;
rgw_obj target = get_obj();
if (!target_obj)
y);
}
-int RGWRadosObject::get_obj_attrs(RGWObjectCtx *rctx, optional_yield y, const DoutPrefixProvider *dpp, rgw_obj* target_obj)
+int RadosObject::get_obj_attrs(RGWObjectCtx *rctx, optional_yield y, const DoutPrefixProvider *dpp, rgw_obj* target_obj)
{
RGWRados::Object op_target(store->getRados(), bucket->get_info(), *rctx, get_obj());
RGWRados::Object::Read read_op(&op_target);
return read_attrs(dpp, read_op, y, target_obj);
}
-int RGWRadosObject::modify_obj_attrs(RGWObjectCtx *rctx, const char *attr_name, bufferlist& attr_val, optional_yield y, const DoutPrefixProvider *dpp)
+int RadosObject::modify_obj_attrs(RGWObjectCtx *rctx, const char *attr_name, bufferlist& attr_val, optional_yield y, const DoutPrefixProvider *dpp)
{
rgw_obj target = get_obj();
int r = get_obj_attrs(rctx, y, dpp, &target);
return set_obj_attrs(dpp, rctx, &attrs, nullptr, y, &target);
}
-int RGWRadosObject::delete_obj_attrs(const DoutPrefixProvider *dpp, RGWObjectCtx *rctx, const char *attr_name, optional_yield y)
+int RadosObject::delete_obj_attrs(const DoutPrefixProvider *dpp, RGWObjectCtx *rctx, const char *attr_name, optional_yield y)
{
- RGWAttrs rmattr;
+ Attrs rmattr;
bufferlist bl;
set_atomic(rctx);
return set_obj_attrs(dpp, rctx, nullptr, &rmattr, y);
}
-int RGWRadosObject::copy_obj_data(RGWObjectCtx& rctx, RGWBucket* dest_bucket,
- RGWObject* dest_obj,
+int RadosObject::copy_obj_data(RGWObjectCtx& rctx, Bucket* dest_bucket,
+ Object* dest_obj,
uint16_t olh_epoch,
std::string* petag,
const DoutPrefixProvider *dpp,
optional_yield y)
{
- RGWAttrs attrset;
+ Attrs attrset;
RGWRados::Object op_target(store->getRados(), dest_bucket->get_info(), rctx, get_obj());
RGWRados::Object::Read read_op(&op_target);
real_time(), NULL, dpp, y);
}
-void RGWRadosObject::set_atomic(RGWObjectCtx *rctx) const
+void RadosObject::set_atomic(RGWObjectCtx *rctx) const
{
rgw_obj obj = get_obj();
store->getRados()->set_atomic(rctx, obj);
}
-void RGWRadosObject::set_prefetch_data(RGWObjectCtx *rctx)
+void RadosObject::set_prefetch_data(RGWObjectCtx *rctx)
{
rgw_obj obj = get_obj();
store->getRados()->set_prefetch_data(rctx, obj);
}
-bool RGWRadosObject::is_expired() {
+bool RadosObject::is_expired() {
auto iter = attrs.find(RGW_ATTR_DELETE_AT);
if (iter != attrs.end()) {
utime_t delete_at;
return false;
}
-void RGWRadosObject::gen_rand_obj_instance_name()
+void RadosObject::gen_rand_obj_instance_name()
{
store->getRados()->gen_rand_obj_instance_name(&key);
}
-void RGWRadosObject::raw_obj_to_obj(const rgw_raw_obj& raw_obj)
+void RadosObject::raw_obj_to_obj(const rgw_raw_obj& raw_obj)
{
rgw_obj tobj = get_obj();
RGWSI_Tier_RADOS::raw_obj_to_obj(get_bucket()->get_key(), raw_obj, &tobj);
set_key(tobj.key);
}
-void RGWRadosObject::get_raw_obj(rgw_raw_obj* raw_obj)
+void RadosObject::get_raw_obj(rgw_raw_obj* raw_obj)
{
store->getRados()->obj_to_raw((bucket->get_info()).placement_rule, get_obj(), raw_obj);
}
-int RGWRadosObject::omap_get_vals(const string& marker, uint64_t count,
+int RadosObject::omap_get_vals(const string& marker, uint64_t count,
std::map<string, bufferlist> *m,
bool *pmore, optional_yield y)
{
return sysobj.omap().get_vals(marker, count, m, pmore, y);
}
-int RGWRadosObject::omap_get_all(std::map<string, bufferlist> *m,
+int RadosObject::omap_get_all(std::map<string, bufferlist> *m,
optional_yield y)
{
auto obj_ctx = store->svc()->sysobj->init_obj_ctx();
return sysobj.omap().get_all(m, y);
}
-int RGWRadosObject::omap_get_vals_by_keys(const std::string& oid,
+int RadosObject::omap_get_vals_by_keys(const std::string& oid,
const std::set<std::string>& keys,
- RGWAttrs *vals)
+ Attrs *vals)
{
int ret;
rgw_raw_obj head_obj;
return cur_ioctx.omap_get_vals_by_keys(oid, keys, vals);
}
-int RGWRadosObject::omap_set_val_by_key(const std::string& key, bufferlist& val,
+int RadosObject::omap_set_val_by_key(const std::string& key, bufferlist& val,
bool must_exist, optional_yield y)
{
rgw_raw_obj raw_meta_obj;
return sysobj.omap().set_must_exist(must_exist).set(key, val, y);
}
-MPSerializer* RGWRadosObject::get_serializer(const std::string& lock_name)
+MPSerializer* RadosObject::get_serializer(const std::string& lock_name)
{
return new MPRadosSerializer(store, this, lock_name);
}
-int RGWRadosObject::transition(RGWObjectCtx& rctx,
- RGWBucket* bucket,
+int RadosObject::transition(RGWObjectCtx& rctx,
+ Bucket* bucket,
const rgw_placement_rule& placement_rule,
const real_time& mtime,
uint64_t olh_epoch,
return store->getRados()->transition_obj(rctx, bucket, *this, placement_rule, mtime, olh_epoch, dpp, y);
}
-int RGWRadosObject::get_max_chunk_size(const DoutPrefixProvider *dpp, rgw_placement_rule placement_rule, uint64_t *max_chunk_size, uint64_t *alignment)
+int RadosObject::get_max_chunk_size(const DoutPrefixProvider *dpp, rgw_placement_rule placement_rule, uint64_t *max_chunk_size, uint64_t *alignment)
{
return store->getRados()->get_max_chunk_size(placement_rule, get_obj(), max_chunk_size, dpp, alignment);
}
-void RGWRadosObject::get_max_aligned_size(uint64_t size, uint64_t alignment,
+void RadosObject::get_max_aligned_size(uint64_t size, uint64_t alignment,
uint64_t *max_size)
{
store->getRados()->get_max_aligned_size(size, alignment, max_size);
}
-bool RGWRadosObject::placement_rules_match(rgw_placement_rule& r1, rgw_placement_rule& r2)
+bool RadosObject::placement_rules_match(rgw_placement_rule& r1, rgw_placement_rule& r2)
{
rgw_obj obj;
rgw_pool p1, p2;
return p1 == p2;
}
-std::unique_ptr<RGWObject::ReadOp> RGWRadosObject::get_read_op(RGWObjectCtx *ctx)
+std::unique_ptr<Object::ReadOp> RadosObject::get_read_op(RGWObjectCtx *ctx)
{
- return std::unique_ptr<RGWObject::ReadOp>(new RGWRadosObject::RadosReadOp(this, ctx));
+ return std::unique_ptr<Object::ReadOp>(new RadosObject::RadosReadOp(this, ctx));
}
-RGWRadosObject::RadosReadOp::RadosReadOp(RGWRadosObject *_source, RGWObjectCtx *_rctx) :
+RadosObject::RadosReadOp::RadosReadOp(RadosObject *_source, RGWObjectCtx *_rctx) :
source(_source),
rctx(_rctx),
op_target(_source->store->getRados(),
parent_op(&op_target)
{ }
-int RGWRadosObject::RadosReadOp::prepare(optional_yield y, const DoutPrefixProvider *dpp)
+int RadosObject::RadosReadOp::prepare(optional_yield y, const DoutPrefixProvider *dpp)
{
uint64_t obj_size;
return ret;
}
-int RGWRadosObject::RadosReadOp::read(int64_t ofs, int64_t end, bufferlist& bl, optional_yield y, const DoutPrefixProvider *dpp)
+int RadosObject::RadosReadOp::read(int64_t ofs, int64_t end, bufferlist& bl, optional_yield y, const DoutPrefixProvider *dpp)
{
return parent_op.read(ofs, end, bl, y, dpp);
}
-int RGWRadosObject::RadosReadOp::get_manifest(const DoutPrefixProvider *dpp, RGWObjManifest **pmanifest,
+int RadosObject::RadosReadOp::get_manifest(const DoutPrefixProvider *dpp, RGWObjManifest **pmanifest,
optional_yield y)
{
return op_target.get_manifest(dpp, pmanifest, y);
}
-int RGWRadosObject::RadosReadOp::get_attr(const DoutPrefixProvider *dpp, const char *name, bufferlist& dest, optional_yield y)
+int RadosObject::RadosReadOp::get_attr(const DoutPrefixProvider *dpp, const char *name, bufferlist& dest, optional_yield y)
{
return parent_op.get_attr(dpp, name, dest, y);
}
-std::unique_ptr<RGWObject::DeleteOp> RGWRadosObject::get_delete_op(RGWObjectCtx *ctx)
+std::unique_ptr<Object::DeleteOp> RadosObject::get_delete_op(RGWObjectCtx *ctx)
{
- return std::unique_ptr<RGWObject::DeleteOp>(new RGWRadosObject::RadosDeleteOp(this, ctx));
+ return std::unique_ptr<Object::DeleteOp>(new RadosObject::RadosDeleteOp(this, ctx));
}
-RGWRadosObject::RadosDeleteOp::RadosDeleteOp(RGWRadosObject *_source, RGWObjectCtx *_rctx) :
+RadosObject::RadosDeleteOp::RadosDeleteOp(RadosObject *_source, RGWObjectCtx *_rctx) :
source(_source),
rctx(_rctx),
op_target(_source->store->getRados(),
parent_op(&op_target)
{ }
-int RGWRadosObject::RadosDeleteOp::delete_obj(const DoutPrefixProvider *dpp, optional_yield y)
+int RadosObject::RadosDeleteOp::delete_obj(const DoutPrefixProvider *dpp, optional_yield y)
{
parent_op.params.bucket_owner = params.bucket_owner.get_id();
parent_op.params.versioning_status = params.versioning_status;
return ret;
}
-int RGWRadosObject::delete_object(const DoutPrefixProvider *dpp, RGWObjectCtx* obj_ctx, optional_yield y)
+int RadosObject::delete_object(const DoutPrefixProvider *dpp, RGWObjectCtx* obj_ctx, optional_yield y)
{
RGWRados::Object del_target(store->getRados(), bucket->get_info(), *obj_ctx, get_obj());
RGWRados::Object::Delete del_op(&del_target);
return del_op.delete_obj(y, dpp);
}
-int RGWRadosObject::delete_obj_aio(const DoutPrefixProvider *dpp, RGWObjState *astate,
+int RadosObject::delete_obj_aio(const DoutPrefixProvider *dpp, RGWObjState *astate,
Completions* aio, bool keep_index_consistent,
optional_yield y)
{
raio->handles, keep_index_consistent, y);
}
-std::unique_ptr<RGWObject::StatOp> RGWRadosObject::get_stat_op(RGWObjectCtx *ctx)
+std::unique_ptr<Object::StatOp> RadosObject::get_stat_op(RGWObjectCtx *ctx)
{
- return std::unique_ptr<RGWObject::StatOp>(new RGWRadosObject::RadosStatOp(this, ctx));
+ return std::unique_ptr<Object::StatOp>(new RadosObject::RadosStatOp(this, ctx));
}
-RGWRadosObject::RadosStatOp::RadosStatOp(RGWRadosObject *_source, RGWObjectCtx *_rctx) :
+RadosObject::RadosStatOp::RadosStatOp(RadosObject *_source, RGWObjectCtx *_rctx) :
source(_source),
rctx(_rctx),
op_target(_source->store->getRados(),
parent_op(&op_target)
{ }
-int RGWRadosObject::RadosStatOp::stat_async()
+int RadosObject::RadosStatOp::stat_async()
{
return parent_op.stat_async();
}
-int RGWRadosObject::RadosStatOp::wait()
+int RadosObject::RadosStatOp::wait()
{
result.obj = source;
int ret = parent_op.wait();
return ret;
}
-int RGWRadosObject::copy_object(RGWObjectCtx& obj_ctx,
- RGWUser* user,
+int RadosObject::copy_object(RGWObjectCtx& obj_ctx,
+ User* user,
req_info *info,
const rgw_zone_id& source_zone,
- rgw::sal::RGWObject* dest_object,
- rgw::sal::RGWBucket* dest_bucket,
- rgw::sal::RGWBucket* src_bucket,
+ rgw::sal::Object* dest_object,
+ rgw::sal::Bucket* dest_bucket,
+ rgw::sal::Bucket* src_bucket,
const rgw_placement_rule& dest_placement,
ceph::real_time *src_mtime,
ceph::real_time *mtime,
const char *if_nomatch,
AttrsMod attrs_mod,
bool copy_if_newer,
- RGWAttrs& attrs,
+ Attrs& attrs,
RGWObjCategory category,
uint64_t olh_epoch,
boost::optional<ceph::real_time> delete_at,
y);
}
-int RGWRadosObject::RadosReadOp::iterate(const DoutPrefixProvider *dpp, int64_t ofs, int64_t end, RGWGetDataCB *cb, optional_yield y)
+int RadosObject::RadosReadOp::iterate(const DoutPrefixProvider *dpp, int64_t ofs, int64_t end, RGWGetDataCB *cb, optional_yield y)
{
return parent_op.iterate(dpp, ofs, end, cb, y);
}
-std::unique_ptr<RGWObject::WriteOp> RGWRadosObject::get_write_op(RGWObjectCtx* ctx)
+std::unique_ptr<Object::WriteOp> RadosObject::get_write_op(RGWObjectCtx* ctx)
{
- return std::unique_ptr<RGWObject::WriteOp>(new RGWRadosObject::RadosWriteOp(this, ctx));
+ return std::unique_ptr<Object::WriteOp>(new RadosObject::RadosWriteOp(this, ctx));
}
-RGWRadosObject::RadosWriteOp::RadosWriteOp(RGWRadosObject* _source, RGWObjectCtx* _rctx) :
+RadosObject::RadosWriteOp::RadosWriteOp(RadosObject* _source, RGWObjectCtx* _rctx) :
source(_source),
rctx(_rctx),
op_target(_source->store->getRados(),
parent_op(&op_target)
{ }
-int RGWRadosObject::RadosWriteOp::prepare(optional_yield y)
+int RadosObject::RadosWriteOp::prepare(optional_yield y)
{
op_target.set_versioning_disabled(params.versioning_disabled);
parent_op.meta.mtime = params.mtime;
return 0;
}
-int RGWRadosObject::RadosWriteOp::write_meta(const DoutPrefixProvider *dpp, uint64_t size, uint64_t accounted_size, optional_yield y)
+int RadosObject::RadosWriteOp::write_meta(const DoutPrefixProvider *dpp, uint64_t size, uint64_t accounted_size, optional_yield y)
{
int ret = parent_op.write_meta(dpp, size, accounted_size, *params.attrs, y);
params.canceled = parent_op.meta.canceled;
return ret;
}
-int RGWRadosObject::swift_versioning_restore(RGWObjectCtx* obj_ctx,
+int RadosObject::swift_versioning_restore(RGWObjectCtx* obj_ctx,
bool& restored,
const DoutPrefixProvider *dpp)
{
dpp);
}
-int RGWRadosObject::swift_versioning_copy(RGWObjectCtx* obj_ctx,
+int RadosObject::swift_versioning_copy(RGWObjectCtx* obj_ctx,
const DoutPrefixProvider *dpp,
optional_yield y)
{
y);
}
-MPRadosSerializer::MPRadosSerializer(RGWRadosStore* store, RGWRadosObject* obj, const std::string& lock_name) :
+MPRadosSerializer::MPRadosSerializer(RadosStore* store, RadosObject* obj, const std::string& lock_name) :
lock(lock_name)
{
rgw_pool meta_pool;
return ret;
}
-LCRadosSerializer::LCRadosSerializer(RGWRadosStore* store, const std::string& _oid, const std::string& lock_name, const std::string& cookie) :
+LCRadosSerializer::LCRadosSerializer(RadosStore* store, const std::string& _oid, const std::string& lock_name, const std::string& cookie) :
lock(lock_name), oid(_oid)
{
ioctx = &store->getRados()->lc_pool_ctx;
bool need_to_remove_head = false;
std::optional<rgw_raw_obj> raw_head;
- if (!rgw::sal::RGWObject::empty(head_obj.get())) {
+ if (!rgw::sal::Object::empty(head_obj.get())) {
raw_head.emplace();
head_obj->get_raw_obj(&*raw_head);
}
if (need_to_remove_head) {
ldpp_dout(dpp, 5) << "NOTE: we are going to process the head obj (" << *raw_head << ")" << dendl;
- std::unique_ptr<rgw::sal::RGWObject::DeleteOp> del_op = head_obj->get_delete_op(&obj_ctx);
+ std::unique_ptr<rgw::sal::Object::DeleteOp> del_op = head_obj->get_delete_op(&obj_ctx);
del_op->params.bucket_owner = bucket->get_acl_owner();
int r = del_op->delete_obj(dpp, y);
extern "C" {
-void *newRGWStore(void)
+void *newStore(void)
{
- rgw::sal::RGWRadosStore *store = new rgw::sal::RGWRadosStore();
+ rgw::sal::RadosStore *store = new rgw::sal::RadosStore();
if (store) {
RGWRados *rados = new RGWRados();
namespace rgw { namespace sal {
-class RGWRadosStore;
+class RadosStore;
class RadosCompletions : public Completions {
public:
virtual int drain() override;
};
-class RGWRadosUser : public RGWUser {
+class RadosUser : public User {
private:
- RGWRadosStore *store;
+ RadosStore *store;
public:
- RGWRadosUser(RGWRadosStore *_st, const rgw_user& _u) : RGWUser(_u), store(_st) { }
- RGWRadosUser(RGWRadosStore *_st, const RGWUserInfo& _i) : RGWUser(_i), store(_st) { }
- RGWRadosUser(RGWRadosStore *_st) : store(_st) { }
- RGWRadosUser(RGWRadosUser& _o) = default;
- RGWRadosUser() {}
-
- virtual std::unique_ptr<RGWUser> clone() override {
- return std::unique_ptr<RGWUser>(new RGWRadosUser(*this));
+ RadosUser(RadosStore *_st, const rgw_user& _u) : User(_u), store(_st) { }
+ RadosUser(RadosStore *_st, const RGWUserInfo& _i) : User(_i), store(_st) { }
+ RadosUser(RadosStore *_st) : store(_st) { }
+ RadosUser(RadosUser& _o) = default;
+ RadosUser() {}
+
+ virtual std::unique_ptr<User> clone() override {
+ return std::unique_ptr<User>(new RadosUser(*this));
}
int list_buckets(const DoutPrefixProvider *dpp, const std::string& marker, const std::string& end_marker,
- uint64_t max, bool need_stats, RGWBucketList& buckets,
+ uint64_t max, bool need_stats, BucketList& buckets,
optional_yield y) override;
- virtual RGWBucket* create_bucket(rgw_bucket& bucket, ceph::real_time creation_time) override;
- virtual int read_attrs(const DoutPrefixProvider *dpp, optional_yield y, RGWAttrs* uattrs, RGWObjVersionTracker* tracker) override;
+ virtual Bucket* create_bucket(rgw_bucket& bucket, ceph::real_time creation_time) override;
+ virtual int read_attrs(const DoutPrefixProvider *dpp, optional_yield y, Attrs* uattrs, RGWObjVersionTracker* tracker) override;
virtual int read_stats(optional_yield y, RGWStorageStats* stats,
ceph::real_time *last_stats_sync = nullptr,
ceph::real_time *last_stats_update = nullptr) override;
virtual int store_info(const DoutPrefixProvider *dpp, optional_yield y, const RGWUserCtl::PutParams& params = {}) override;
virtual int remove_info(const DoutPrefixProvider *dpp, optional_yield y, const RGWUserCtl::RemoveParams& params = {}) override;
- friend class RGWRadosBucket;
+ friend class RadosBucket;
};
-class RGWRadosObject : public RGWObject {
+class RadosObject : public Object {
private:
- RGWRadosStore *store;
+ RadosStore *store;
RGWAccessControlPolicy acls;
public:
struct RadosReadOp : public ReadOp {
private:
- RGWRadosObject* source;
+ RadosObject* source;
RGWObjectCtx* rctx;
RGWRados::Object op_target;
RGWRados::Object::Read parent_op;
public:
- RadosReadOp(RGWRadosObject *_source, RGWObjectCtx *_rctx);
+ RadosReadOp(RadosObject *_source, RGWObjectCtx *_rctx);
virtual int prepare(optional_yield y, const DoutPrefixProvider *dpp) override;
virtual int read(int64_t ofs, int64_t end, bufferlist& bl, optional_yield y, const DoutPrefixProvider *dpp) override;
struct RadosWriteOp : public WriteOp {
private:
- RGWRadosObject* source;
+ RadosObject* source;
RGWObjectCtx* rctx;
RGWRados::Object op_target;
RGWRados::Object::Write parent_op;
public:
- RadosWriteOp(RGWRadosObject* _source, RGWObjectCtx* _rctx);
+ RadosWriteOp(RadosObject* _source, RGWObjectCtx* _rctx);
virtual int prepare(optional_yield y) override;
virtual int write_meta(const DoutPrefixProvider *dpp, uint64_t size, uint64_t accounted_size, optional_yield y) override;
struct RadosDeleteOp : public DeleteOp {
private:
- RGWRadosObject* source;
+ RadosObject* source;
RGWObjectCtx* rctx;
RGWRados::Object op_target;
RGWRados::Object::Delete parent_op;
public:
- RadosDeleteOp(RGWRadosObject* _source, RGWObjectCtx* _rctx);
+ RadosDeleteOp(RadosObject* _source, RGWObjectCtx* _rctx);
virtual int delete_obj(const DoutPrefixProvider *dpp, optional_yield y) override;
};
struct RadosStatOp : public StatOp {
private:
- RGWRadosObject* source;
+ RadosObject* source;
RGWObjectCtx* rctx;
RGWRados::Object op_target;
RGWRados::Object::Stat parent_op;
public:
- RadosStatOp(RGWRadosObject* _source, RGWObjectCtx* _rctx);
+ RadosStatOp(RadosObject* _source, RGWObjectCtx* _rctx);
virtual int stat_async() override;
virtual int wait() override;
};
- RGWRadosObject() = default;
+ RadosObject() = default;
- RGWRadosObject(RGWRadosStore *_st, const rgw_obj_key& _k)
- : RGWObject(_k),
+ RadosObject(RadosStore *_st, const rgw_obj_key& _k)
+ : Object(_k),
store(_st),
acls() {
}
- RGWRadosObject(RGWRadosStore *_st, const rgw_obj_key& _k, RGWBucket* _b)
- : RGWObject(_k, _b),
+ RadosObject(RadosStore *_st, const rgw_obj_key& _k, Bucket* _b)
+ : Object(_k, _b),
store(_st),
acls() {
}
- RGWRadosObject(RGWRadosObject& _o) = default;
+ RadosObject(RadosObject& _o) = default;
virtual int delete_object(const DoutPrefixProvider *dpp, RGWObjectCtx* obj_ctx, optional_yield y) override;
virtual int delete_obj_aio(const DoutPrefixProvider *dpp, RGWObjState *astate, Completions* aio,
bool keep_index_consistent, optional_yield y) override;
- virtual int copy_object(RGWObjectCtx& obj_ctx, RGWUser* user,
+ virtual int copy_object(RGWObjectCtx& obj_ctx, User* user,
req_info *info, const rgw_zone_id& source_zone,
- rgw::sal::RGWObject* dest_object, rgw::sal::RGWBucket* dest_bucket,
- rgw::sal::RGWBucket* src_bucket,
+ rgw::sal::Object* dest_object, rgw::sal::Bucket* dest_bucket,
+ rgw::sal::Bucket* src_bucket,
const rgw_placement_rule& dest_placement,
ceph::real_time *src_mtime, ceph::real_time *mtime,
const ceph::real_time *mod_ptr, const ceph::real_time *unmod_ptr,
bool high_precision_time,
const char *if_match, const char *if_nomatch,
- AttrsMod attrs_mod, bool copy_if_newer, RGWAttrs& attrs,
+ AttrsMod attrs_mod, bool copy_if_newer, Attrs& attrs,
RGWObjCategory category, uint64_t olh_epoch,
boost::optional<ceph::real_time> delete_at,
string *version_id, string *tag, string *etag,
virtual void set_prefetch_data(RGWObjectCtx *rctx) override;
virtual int get_obj_state(const DoutPrefixProvider *dpp, RGWObjectCtx *rctx, RGWObjState **state, optional_yield y, bool follow_olh = true) override;
- virtual int set_obj_attrs(const DoutPrefixProvider *dpp, RGWObjectCtx* rctx, RGWAttrs* setattrs, RGWAttrs* delattrs, optional_yield y, rgw_obj* target_obj = NULL) override;
+ virtual int set_obj_attrs(const DoutPrefixProvider *dpp, RGWObjectCtx* rctx, Attrs* setattrs, Attrs* delattrs, optional_yield y, rgw_obj* target_obj = NULL) override;
virtual int get_obj_attrs(RGWObjectCtx *rctx, optional_yield y, const DoutPrefixProvider *dpp, rgw_obj* target_obj = NULL) override;
virtual int modify_obj_attrs(RGWObjectCtx *rctx, const char *attr_name, bufferlist& attr_val, optional_yield y, const DoutPrefixProvider *dpp) override;
virtual int delete_obj_attrs(const DoutPrefixProvider *dpp, RGWObjectCtx *rctx, const char *attr_name, optional_yield y) override;
- virtual int copy_obj_data(RGWObjectCtx& rctx, RGWBucket* dest_bucket, RGWObject* dest_obj, uint16_t olh_epoch, std::string* petag, const DoutPrefixProvider *dpp, optional_yield y) override;
+ virtual int copy_obj_data(RGWObjectCtx& rctx, Bucket* dest_bucket, Object* dest_obj, uint16_t olh_epoch, std::string* petag, const DoutPrefixProvider *dpp, optional_yield y) override;
virtual bool is_expired() override;
virtual void gen_rand_obj_instance_name() override;
virtual void raw_obj_to_obj(const rgw_raw_obj& raw_obj) override;
virtual void get_raw_obj(rgw_raw_obj* raw_obj) override;
- virtual std::unique_ptr<RGWObject> clone() override {
- return std::unique_ptr<RGWObject>(new RGWRadosObject(*this));
+ virtual std::unique_ptr<Object> clone() override {
+ return std::unique_ptr<Object>(new RadosObject(*this));
}
virtual MPSerializer* get_serializer(const std::string& lock_name) override;
virtual int transition(RGWObjectCtx& rctx,
- RGWBucket* bucket,
+ Bucket* bucket,
const rgw_placement_rule& placement_rule,
const real_time& mtime,
uint64_t olh_epoch,
optional_yield y) override;
virtual int omap_get_vals_by_keys(const std::string& oid,
const std::set<std::string>& keys,
- RGWAttrs *vals) override;
+ Attrs *vals) override;
virtual int omap_set_val_by_key(const std::string& key, bufferlist& val,
bool must_exist, optional_yield y) override;
int read_attrs(const DoutPrefixProvider *dpp, RGWRados::Object::Read &read_op, optional_yield y, rgw_obj *target_obj = nullptr);
};
-class RGWRadosBucket : public RGWBucket {
+class RadosBucket : public Bucket {
private:
- RGWRadosStore *store;
+ RadosStore *store;
RGWAccessControlPolicy acls;
public:
- RGWRadosBucket(RGWRadosStore *_st)
+ RadosBucket(RadosStore *_st)
: store(_st),
acls() {
}
- RGWRadosBucket(RGWRadosStore *_st, RGWUser* _u)
- : RGWBucket(_u),
+ RadosBucket(RadosStore *_st, User* _u)
+ : Bucket(_u),
store(_st),
acls() {
}
- RGWRadosBucket(RGWRadosStore *_st, const rgw_bucket& _b)
- : RGWBucket(_b),
+ RadosBucket(RadosStore *_st, const rgw_bucket& _b)
+ : Bucket(_b),
store(_st),
acls() {
}
- RGWRadosBucket(RGWRadosStore *_st, const RGWBucketEnt& _e)
- : RGWBucket(_e),
+ RadosBucket(RadosStore *_st, const RGWBucketEnt& _e)
+ : Bucket(_e),
store(_st),
acls() {
}
- RGWRadosBucket(RGWRadosStore *_st, const RGWBucketInfo& _i)
- : RGWBucket(_i),
+ RadosBucket(RadosStore *_st, const RGWBucketInfo& _i)
+ : Bucket(_i),
store(_st),
acls() {
}
- RGWRadosBucket(RGWRadosStore *_st, const rgw_bucket& _b, RGWUser* _u)
- : RGWBucket(_b, _u),
+ RadosBucket(RadosStore *_st, const rgw_bucket& _b, User* _u)
+ : Bucket(_b, _u),
store(_st),
acls() {
}
- RGWRadosBucket(RGWRadosStore *_st, const RGWBucketEnt& _e, RGWUser* _u)
- : RGWBucket(_e, _u),
+ RadosBucket(RadosStore *_st, const RGWBucketEnt& _e, User* _u)
+ : Bucket(_e, _u),
store(_st),
acls() {
}
- RGWRadosBucket(RGWRadosStore *_st, const RGWBucketInfo& _i, RGWUser* _u)
- : RGWBucket(_i, _u),
+ RadosBucket(RadosStore *_st, const RGWBucketInfo& _i, User* _u)
+ : Bucket(_i, _u),
store(_st),
acls() {
}
- ~RGWRadosBucket() { }
+ ~RadosBucket() { }
- virtual std::unique_ptr<RGWObject> get_object(const rgw_obj_key& k) override;
+ virtual std::unique_ptr<Object> get_object(const rgw_obj_key& k) override;
virtual int list(const DoutPrefixProvider *dpp, ListParams&, int, ListResults&, optional_yield y) override;
- RGWObject* create_object(const rgw_obj_key& key /* Attributes */) override;
+ Object* create_object(const rgw_obj_key& key /* Attributes */) override;
virtual int remove_bucket(const DoutPrefixProvider *dpp, bool delete_children, std::string prefix, std::string delimiter, bool forward_to_master, req_info* req_info, optional_yield y) override;
virtual RGWAccessControlPolicy& get_acl(void) override { return acls; }
virtual int set_acl(const DoutPrefixProvider *dpp, RGWAccessControlPolicy& acl, optional_yield y) override;
virtual int sync_user_stats(optional_yield y) override;
virtual int update_container_stats(const DoutPrefixProvider *dpp) override;
virtual int check_bucket_shards(const DoutPrefixProvider *dpp) override;
- virtual int link(const DoutPrefixProvider *dpp, RGWUser* new_user, optional_yield y, bool update_entrypoint, RGWObjVersionTracker* objv) override;
- virtual int unlink(const DoutPrefixProvider *dpp, RGWUser* new_user, optional_yield y, bool update_entrypoint = true) override;
- virtual int chown(const DoutPrefixProvider *dpp, RGWUser* new_user, RGWUser* old_user, optional_yield y, const std::string* marker = nullptr) override;
+ virtual int link(const DoutPrefixProvider *dpp, User* new_user, optional_yield y, bool update_entrypoint, RGWObjVersionTracker* objv) override;
+ virtual int unlink(const DoutPrefixProvider *dpp, User* new_user, optional_yield y, bool update_entrypoint = true) override;
+ virtual int chown(const DoutPrefixProvider *dpp, User* new_user, User* old_user, optional_yield y, const std::string* marker = nullptr) override;
virtual int put_instance_info(const DoutPrefixProvider *dpp, bool exclusive, ceph::real_time mtime) override;
virtual int remove_entrypoint(const DoutPrefixProvider *dpp, RGWObjVersionTracker* objv, optional_yield y) override;
virtual int remove_instance_info(const DoutPrefixProvider *dpp, RGWObjVersionTracker* objv, optional_yield y) override;
- virtual bool is_owner(RGWUser* user) override;
+ virtual bool is_owner(User* user) override;
virtual int check_empty(const DoutPrefixProvider *dpp, optional_yield y) override;
virtual int check_quota(RGWQuotaInfo& user_quota, RGWQuotaInfo& bucket_quota, uint64_t obj_size, optional_yield y, bool check_size_only = false) override;
- virtual int set_instance_attrs(const DoutPrefixProvider *dpp, RGWAttrs& attrs, optional_yield y) override;
+ virtual int set_instance_attrs(const DoutPrefixProvider *dpp, Attrs& attrs, optional_yield y) override;
virtual int try_refresh_info(const DoutPrefixProvider *dpp, ceph::real_time *pmtime) override;
virtual int read_usage(uint64_t start_epoch, uint64_t end_epoch, uint32_t max_entries,
bool *is_truncated, RGWUsageIter& usage_iter,
virtual int rebuild_index() override;
virtual int set_tag_timeout(uint64_t timeout) override;
virtual int purge_instance(const DoutPrefixProvider *dpp) override;
- virtual std::unique_ptr<RGWBucket> clone() override {
- return std::make_unique<RGWRadosBucket>(*this);
+ virtual std::unique_ptr<Bucket> clone() override {
+ return std::make_unique<RadosBucket>(*this);
}
- friend class RGWRadosStore;
+ friend class RadosStore;
};
class RadosZone : public Zone {
protected:
- RGWRadosStore* store;
+ RadosStore* store;
public:
- RadosZone(RGWRadosStore* _store) : store(_store) {}
+ RadosZone(RadosStore* _store) : store(_store) {}
~RadosZone() = default;
virtual const RGWZoneGroup& get_zonegroup() override;
virtual const string& get_current_period_id() override;
};
-class RGWRadosStore : public RGWStore {
+class RadosStore : public Store {
private:
RGWRados *rados;
RGWUserCtl *user_ctl;
RadosZone zone;
public:
- RGWRadosStore()
+ RadosStore()
: rados(nullptr), zone(this) {
}
- ~RGWRadosStore() {
+ ~RadosStore() {
delete rados;
}
- virtual std::unique_ptr<RGWUser> get_user(const rgw_user& u) override;
- virtual int get_user_by_access_key(const DoutPrefixProvider *dpp, const std::string& key, optional_yield y, std::unique_ptr<RGWUser>* user) override;
- virtual int get_user_by_email(const DoutPrefixProvider *dpp, const std::string& email, optional_yield y, std::unique_ptr<RGWUser>* user) override;
- virtual int get_user_by_swift(const DoutPrefixProvider *dpp, const std::string& user_str, optional_yield y, std::unique_ptr<RGWUser>* user) override;
- virtual std::unique_ptr<RGWObject> get_object(const rgw_obj_key& k) override;
- virtual int get_bucket(const DoutPrefixProvider *dpp, RGWUser* u, const rgw_bucket& b, std::unique_ptr<RGWBucket>* bucket, optional_yield y) override;
- virtual int get_bucket(RGWUser* u, const RGWBucketInfo& i, std::unique_ptr<RGWBucket>* bucket) override;
- virtual int get_bucket(const DoutPrefixProvider *dpp, RGWUser* u, const std::string& tenant, const std::string&name, std::unique_ptr<RGWBucket>* bucket, optional_yield y) override;
+ virtual std::unique_ptr<User> get_user(const rgw_user& u) override;
+ virtual int get_user_by_access_key(const DoutPrefixProvider *dpp, const std::string& key, optional_yield y, std::unique_ptr<User>* user) override;
+ virtual int get_user_by_email(const DoutPrefixProvider *dpp, const std::string& email, optional_yield y, std::unique_ptr<User>* user) override;
+ virtual int get_user_by_swift(const DoutPrefixProvider *dpp, const std::string& user_str, optional_yield y, std::unique_ptr<User>* user) override;
+ virtual std::unique_ptr<Object> get_object(const rgw_obj_key& k) override;
+ virtual int get_bucket(const DoutPrefixProvider *dpp, User* u, const rgw_bucket& b, std::unique_ptr<Bucket>* bucket, optional_yield y) override;
+ virtual int get_bucket(User* u, const RGWBucketInfo& i, std::unique_ptr<Bucket>* bucket) override;
+ virtual int get_bucket(const DoutPrefixProvider *dpp, User* u, const std::string& tenant, const std::string&name, std::unique_ptr<Bucket>* bucket, optional_yield y) override;
virtual int create_bucket(const DoutPrefixProvider *dpp,
- RGWUser& u, const rgw_bucket& b,
+ User& u, const rgw_bucket& b,
const std::string& zonegroup_id,
rgw_placement_rule& placement_rule,
std::string& swift_ver_location,
const RGWQuotaInfo * pquota_info,
const RGWAccessControlPolicy& policy,
- RGWAttrs& attrs,
+ Attrs& attrs,
RGWBucketInfo& info,
obj_version& ep_objv,
bool exclusive,
bool obj_lock_enabled,
bool *existed,
req_info& req_info,
- std::unique_ptr<RGWBucket>* bucket,
+ std::unique_ptr<Bucket>* bucket,
optional_yield y) override;
virtual bool is_meta_master() override;
- virtual int forward_request_to_master(RGWUser* user, obj_version *objv,
+ virtual int forward_request_to_master(User* user, obj_version *objv,
bufferlist& in_data, JSONParser *jp, req_info& info,
optional_yield y) override;
- virtual int defer_gc(const DoutPrefixProvider *dpp, RGWObjectCtx *rctx, RGWBucket* bucket, RGWObject* obj,
+ virtual int defer_gc(const DoutPrefixProvider *dpp, RGWObjectCtx *rctx, Bucket* bucket, Object* obj,
optional_yield y) override;
virtual Zone* get_zone() { return &zone; }
virtual std::string zone_unique_id(uint64_t unique_num) override;
virtual int cluster_stat(RGWClusterStat& stats) override;
virtual std::unique_ptr<Lifecycle> get_lifecycle(void) override;
virtual std::unique_ptr<Completions> get_completions(void) override;
- virtual std::unique_ptr<Notification> get_notification(rgw::sal::RGWObject* obj, struct req_state* s, rgw::notify::EventType event_type) override;
- virtual std::unique_ptr<GCChain> get_gc_chain(rgw::sal::RGWObject* obj) override;
- virtual std::unique_ptr<Writer> get_writer(Aio *aio, rgw::sal::RGWBucket* bucket,
- RGWObjectCtx& obj_ctx, std::unique_ptr<rgw::sal::RGWObject> _head_obj,
+ virtual std::unique_ptr<Notification> get_notification(rgw::sal::Object* obj, struct req_state* s, rgw::notify::EventType event_type) override;
+ virtual std::unique_ptr<GCChain> get_gc_chain(rgw::sal::Object* obj) override;
+ virtual std::unique_ptr<Writer> get_writer(Aio *aio, rgw::sal::Bucket* bucket,
+ RGWObjectCtx& obj_ctx, std::unique_ptr<rgw::sal::Object> _head_obj,
const DoutPrefixProvider *dpp, optional_yield y) override;
virtual RGWLC* get_rgwlc(void) override { return rados->get_lc(); }
virtual RGWCoroutinesManagerRegistry* get_cr_registry() override { return rados->get_cr_registry(); }
luarocks_path = path;
}
- /* Unique to RGWRadosStore */
+ /* Unique to RadosStore */
int get_obj_head_ioctx(const RGWBucketInfo& bucket_info, const rgw_obj& obj,
librados::IoCtx *ioctx);
librados::ObjectWriteOperation op;
public:
- MPRadosSerializer(RGWRadosStore* store, RGWRadosObject* obj, const std::string& lock_name);
+ MPRadosSerializer(RadosStore* store, RadosObject* obj, const std::string& lock_name);
virtual int try_lock(utime_t dur, optional_yield y) override;
virtual int unlock() override {
const std::string oid;
public:
- LCRadosSerializer(RGWRadosStore* store, const std::string& oid, const std::string& lock_name, const std::string& cookie);
+ LCRadosSerializer(RadosStore* store, const std::string& oid, const std::string& lock_name, const std::string& cookie);
virtual int try_lock(utime_t dur, optional_yield y) override;
virtual int unlock() override {
};
class RadosLifecycle : public Lifecycle {
- RGWRadosStore* store;
+ RadosStore* store;
public:
- RadosLifecycle(RGWRadosStore* _st) : store(_st) {}
+ RadosLifecycle(RadosStore* _st) : store(_st) {}
virtual int get_entry(const string& oid, const std::string& marker, LCEntry& entry) override;
virtual int get_next_entry(const string& oid, std::string& marker, LCEntry& entry) override;
};
class RadosNotification : public Notification {
- RGWRadosStore* store;
+ RadosStore* store;
rgw::notify::reservation_t res;
public:
- RadosNotification(RGWRadosStore* _store, RGWObject* _obj, req_state* _s, rgw::notify::EventType _type) : Notification(_obj, _type), store(_store), res(_store, _s, _obj) { }
+ RadosNotification(RadosStore* _store, Object* _obj, req_state* _s, rgw::notify::EventType _type) : Notification(_obj, _type), store(_store), res(_store, _s, _obj) { }
~RadosNotification() = default;
virtual int publish_reserve(RGWObjTags* obj_tags = nullptr) override;
class RadosGCChain : public GCChain {
protected:
- RGWRadosStore* store;
+ RadosStore* store;
cls_rgw_obj_chain chain;
public:
- RadosGCChain(RGWRadosStore* _store, RGWObject* _obj) : GCChain(_obj), store(_store) {}
+ RadosGCChain(RadosStore* _store, Object* _obj) : GCChain(_obj), store(_store) {}
~RadosGCChain() = default;
virtual void update(RGWObjManifest* manifest) override;
};
class RadosWriter : public Writer {
- rgw::sal::RGWRadosStore* store;
+ rgw::sal::RadosStore* store;
RGWSI_RADOS::Obj stripe_obj; // current stripe object
public:
- RadosWriter(Aio *aio, rgw::sal::RGWRadosStore* _store,
- rgw::sal::RGWBucket* bucket,
- RGWObjectCtx& obj_ctx, std::unique_ptr<rgw::sal::RGWObject> _head_obj,
+ RadosWriter(Aio *aio, rgw::sal::RadosStore* _store,
+ rgw::sal::Bucket* bucket,
+ RGWObjectCtx& obj_ctx, std::unique_ptr<rgw::sal::Object> _head_obj,
const DoutPrefixProvider *dpp, optional_yield y)
: Writer(aio, bucket, obj_ctx, std::move(_head_obj), dpp, y), store(_store)
{}
}
int AssumedRoleUser::generateAssumedRoleUser(CephContext* cct,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
const string& roleId,
const rgw::ARN& roleArn,
const string& roleSessionName)
int STSService::storeARN(const DoutPrefixProvider *dpp, string& arn, optional_yield y)
{
int ret = 0;
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(user_id);
+ std::unique_ptr<rgw::sal::User> user = store->get_user(user_id);
if ((ret = user->load_by_id(dpp, y)) < 0) {
return -ERR_NO_SUCH_ENTITY;
}
string assumeRoleId;
public:
int generateAssumedRoleUser( CephContext* cct,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
const string& roleId,
const rgw::ARN& roleArn,
const string& roleSessionName);
class STSService {
CephContext* cct;
- rgw::sal::RGWStore *store;
+ rgw::sal::Store *store;
rgw_user user_id;
RGWRole role;
rgw::auth::Identity* identity;
int storeARN(const DoutPrefixProvider *dpp, string& arn, optional_yield y);
public:
STSService() = default;
- STSService(CephContext* cct, rgw::sal::RGWStore *store, rgw_user user_id,
+ STSService(CephContext* cct, rgw::sal::Store *store, rgw_user user_id,
rgw::auth::Identity* identity)
: cct(cct), store(store), user_id(user_id), identity(identity) {}
std::tuple<int, RGWRole> getRoleInfo(const DoutPrefixProvider *dpp, const string& arn, optional_yield y);
string bucket_tenant;
if (!s->account_name.empty()) {
bool found = false;
- std::unique_ptr<rgw::sal::RGWUser> user;
+ std::unique_ptr<rgw::sal::User> user;
rgw_user uid(s->account_name);
if (uid.tenant.empty()) {
rgw_bucket b;
b.tenant = std::move(bucket_tenant);
b.name = std::move(bucket_name);
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
int ret = store->get_bucket(dpp, nullptr, b, &bucket, s->yield);
if (ret < 0) {
throw ret;
ldpp_dout(dpp, 20) << "temp url user (bucket owner): " << bucket->get_info().owner
<< dendl;
- std::unique_ptr<rgw::sal::RGWUser> user;
+ std::unique_ptr<rgw::sal::User> user;
user = store->get_user(bucket->get_info().owner);
if (user->load_by_id(dpp, s->yield) < 0) {
throw -EPERM;
ldpp_dout(dpp, 10) << "swift user=" << swift_user << dendl;
- std::unique_ptr<rgw::sal::RGWUser> user;
+ std::unique_ptr<rgw::sal::User> user;
ret = store->get_user_by_swift(dpp, swift_user, s->yield, &user);
if (ret < 0) {
ldpp_dout(dpp, 0) << "NOTICE: couldn't map swift user" << dendl;
return result_t::deny(-EPERM);
}
- std::unique_ptr<rgw::sal::RGWUser> user;
+ std::unique_ptr<rgw::sal::User> user;
ret = store->get_user_by_swift(dpp, swift_user, s->yield, &user);
if (ret < 0) {
throw ret;
s->prot_flags |= RGW_REST_SWIFT;
string user_str;
- std::unique_ptr<rgw::sal::RGWUser> user;
+ std::unique_ptr<rgw::sal::User> user;
bufferlist bl;
RGWAccessKey *swift_key;
map<string, RGWAccessKey>::iterator siter;
end_header(s);
}
-int RGWHandler_SWIFT_Auth::init(rgw::sal::RGWStore *store, struct req_state *state,
+int RGWHandler_SWIFT_Auth::init(rgw::sal::Store *store, struct req_state *state,
rgw::io::BasicClient *cio)
{
state->dialect = "swift-auth";
using result_t = rgw::auth::Engine::result_t;
CephContext* const cct;
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
const TempURLApplier::Factory* const apl_factory;
/* Helper methods. */
public:
TempURLEngine(CephContext* const cct,
- rgw::sal::RGWStore* _store ,
+ rgw::sal::Store* _store ,
const TempURLApplier::Factory* const apl_factory)
: cct(cct),
store(_store),
using result_t = rgw::auth::Engine::result_t;
CephContext* const cct;
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
const rgw::auth::TokenExtractor* const extractor;
const rgw::auth::LocalApplier::Factory* const apl_factory;
public:
SignedTokenEngine(CephContext* const cct,
- rgw::sal::RGWStore* _store,
+ rgw::sal::Store* _store,
const rgw::auth::TokenExtractor* const extractor,
const rgw::auth::LocalApplier::Factory* const apl_factory)
: cct(cct),
using result_t = rgw::auth::Engine::result_t;
CephContext* const cct;
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
const rgw::auth::TokenExtractor* const extractor;
const rgw::auth::LocalApplier::Factory* const apl_factory;
public:
ExternalTokenEngine(CephContext* const cct,
- rgw::sal::RGWStore* _store,
+ rgw::sal::Store* _store,
const rgw::auth::TokenExtractor* const extractor,
const rgw::auth::LocalApplier::Factory* const apl_factory)
: cct(cct),
public rgw::auth::RemoteApplier::Factory,
public rgw::auth::LocalApplier::Factory,
public rgw::auth::swift::TempURLApplier::Factory {
- rgw::sal::RGWStore* store;
+ rgw::sal::Store* store;
ImplicitTenants& implicit_tenant_context;
/* The engines. */
public:
DefaultStrategy(CephContext* const cct,
ImplicitTenants& implicit_tenant_context,
- rgw::sal::RGWStore* _store)
+ rgw::sal::Store* _store)
: store(_store),
implicit_tenant_context(implicit_tenant_context),
tempurl_engine(cct,
~RGWHandler_SWIFT_Auth() override {}
RGWOp *op_get() override;
- int init(rgw::sal::RGWStore *store, struct req_state *state, rgw::io::BasicClient *cio) override;
+ int init(rgw::sal::Store *store, struct req_state *state, rgw::io::BasicClient *cio) override;
int authorize(const DoutPrefixProvider *dpp, optional_yield y) override;
int postauth_init(optional_yield) override { return 0; }
int read_permissions(RGWOp *op, optional_yield) override { return 0; }
return this;
}
- RGWHandler_REST* get_handler(rgw::sal::RGWStore *store,
+ RGWHandler_REST* get_handler(rgw::sal::Store *store,
struct req_state*,
const rgw::auth::StrategyRegistry&,
const std::string&) override {
static string mdlog_sync_status_shard_prefix = "mdlog.sync-status.shard";
static string mdlog_sync_full_sync_index_prefix = "meta.full-sync.index";
-RGWSyncErrorLogger::RGWSyncErrorLogger(rgw::sal::RGWRadosStore *_store, const string &oid_prefix, int _num_shards) : store(_store), num_shards(_num_shards) {
+RGWSyncErrorLogger::RGWSyncErrorLogger(rgw::sal::RadosStore *_store, const string &oid_prefix, int _num_shards) : store(_store), num_shards(_num_shards) {
for (int i = 0; i < num_shards; i++) {
oids.push_back(get_shard_oid(oid_prefix, i));
}
return out << "meta sync: ";
}
-void RGWMetaSyncEnv::init(const DoutPrefixProvider *_dpp, CephContext *_cct, rgw::sal::RGWRadosStore *_store, RGWRESTConn *_conn,
+void RGWMetaSyncEnv::init(const DoutPrefixProvider *_dpp, CephContext *_cct, rgw::sal::RadosStore *_store, RGWRESTConn *_conn,
RGWAsyncRadosProcessor *_async_rados, RGWHTTPManager *_http_manager,
RGWSyncErrorLogger *_error_logger, RGWSyncTraceManager *_sync_tracer) {
dpp = _dpp;
}
class RGWAsyncReadMDLogEntries : public RGWAsyncRadosRequest {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
RGWMetadataLog *mdlog;
int shard_id;
int max_entries;
list<cls_log_entry> entries;
bool truncated;
- RGWAsyncReadMDLogEntries(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RGWRadosStore *_store,
+ RGWAsyncReadMDLogEntries(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RadosStore *_store,
RGWMetadataLog* mdlog, int _shard_id,
std::string _marker, int _max_entries)
: RGWAsyncRadosRequest(caller, cn), store(_store), mdlog(mdlog),
set_status("acquiring sync lock");
uint32_t lock_duration = cct->_conf->rgw_sync_lease_period;
string lock_name = "sync_lock";
- rgw::sal::RGWRadosStore *store = sync_env->store;
+ rgw::sal::RadosStore *store = sync_env->store;
lease_cr.reset(new RGWContinuousLeaseCR(sync_env->async_rados, store,
rgw_raw_obj(store->svc()->zone->get_zone_params().log_pool, sync_env->status_oid()),
lock_name, lock_duration, this));
}
yield {
set_status("writing sync status");
- rgw::sal::RGWRadosStore *store = sync_env->store;
+ rgw::sal::RadosStore *store = sync_env->store;
call(new RGWSimpleRadosWriteCR<rgw_meta_sync_info>(sync_env->async_rados, store->svc()->sysobj,
rgw_raw_obj(store->svc()->zone->get_zone_params().log_pool, sync_env->status_oid()),
status));
RGWMetadataLogInfo& info = shards_info[i];
marker.next_step_marker = info.marker;
marker.timestamp = info.last_update;
- rgw::sal::RGWRadosStore *store = sync_env->store;
+ rgw::sal::RadosStore *store = sync_env->store;
spawn(new RGWSimpleRadosWriteCR<rgw_meta_sync_marker>(sync_env->async_rados,
store->svc()->sysobj,
rgw_raw_obj(store->svc()->zone->get_zone_params().log_pool, sync_env->shard_obj_name(i)),
yield {
set_status("changing sync state: build full sync maps");
status.state = rgw_meta_sync_info::StateBuildingFullSyncMaps;
- rgw::sal::RGWRadosStore *store = sync_env->store;
+ rgw::sal::RadosStore *store = sync_env->store;
call(new RGWSimpleRadosWriteCR<rgw_meta_sync_info>(sync_env->async_rados, store->svc()->sysobj,
rgw_raw_obj(store->svc()->zone->get_zone_params().log_pool, sync_env->status_oid()),
status));
tn->log(20, SSTR("list metadata: section=" << *sections_iter << " key=" << *iter));
string s = *sections_iter + ":" + *iter;
int shard_id;
- rgw::sal::RGWRadosStore *store = sync_env->store;
+ rgw::sal::RadosStore *store = sync_env->store;
int ret = store->ctl()->meta.mgr->get_shard_id(*sections_iter, *iter, &shard_id);
if (ret < 0) {
tn->log(0, SSTR("ERROR: could not determine shard id for " << *sections_iter << ":" << *iter));
};
class RGWAsyncMetaStoreEntry : public RGWAsyncRadosRequest {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
string raw_key;
bufferlist bl;
const DoutPrefixProvider *dpp;
return 0;
}
public:
- RGWAsyncMetaStoreEntry(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RGWRadosStore *_store,
+ RGWAsyncMetaStoreEntry(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RadosStore *_store,
const string& _raw_key,
bufferlist& _bl,
const DoutPrefixProvider *dpp) : RGWAsyncRadosRequest(caller, cn), store(_store),
};
class RGWAsyncMetaRemoveEntry : public RGWAsyncRadosRequest {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
string raw_key;
const DoutPrefixProvider *dpp;
protected:
return 0;
}
public:
- RGWAsyncMetaRemoveEntry(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RGWRadosStore *_store,
+ RGWAsyncMetaRemoveEntry(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RadosStore *_store,
const string& _raw_key, const DoutPrefixProvider *dpp) : RGWAsyncRadosRequest(caller, cn), store(_store),
raw_key(_raw_key), dpp(dpp) {}
};
ldpp_dout(sync_env->dpp, 20) << __func__ << "(): updating marker marker_oid=" << marker_oid << " marker=" << new_marker << " realm_epoch=" << sync_marker.realm_epoch << dendl;
tn->log(20, SSTR("new marker=" << new_marker));
- rgw::sal::RGWRadosStore *store = sync_env->store;
+ rgw::sal::RadosStore *store = sync_env->store;
return new RGWSimpleRadosWriteCR<rgw_meta_sync_marker>(sync_env->async_rados,
store->svc()->sysobj,
rgw_raw_obj(store->svc()->zone->get_zone_params().log_pool, marker_oid),
yield {
uint32_t lock_duration = cct->_conf->rgw_sync_lease_period;
string lock_name = "sync_lock";
- rgw::sal::RGWRadosStore *store = sync_env->store;
+ rgw::sal::RadosStore *store = sync_env->store;
lease_cr.reset(new RGWContinuousLeaseCR(sync_env->async_rados, store,
rgw_raw_obj(pool, sync_env->shard_obj_name(shard_id)),
lock_name, lock_duration, this));
yield {
uint32_t lock_duration = cct->_conf->rgw_sync_lease_period;
string lock_name = "sync_lock";
- rgw::sal::RGWRadosStore *store = sync_env->store;
+ rgw::sal::RadosStore *store = sync_env->store;
lease_cr.reset( new RGWContinuousLeaseCR(sync_env->async_rados, store,
rgw_raw_obj(pool, sync_env->shard_obj_name(shard_id)),
lock_name, lock_duration, this));
}
RGWCoroutine *alloc_finisher_cr() override {
- rgw::sal::RGWRadosStore *store = sync_env->store;
+ rgw::sal::RadosStore *store = sync_env->store;
return new RGWSimpleRadosReadCR<rgw_meta_sync_marker>(sync_env->async_rados, store->svc()->sysobj,
rgw_raw_obj(pool, sync_env->shard_obj_name(shard_id)),
&sync_marker);
}
// return a cursor to the period at our sync position
-static RGWPeriodHistory::Cursor get_period_at(rgw::sal::RGWRadosStore* store,
+static RGWPeriodHistory::Cursor get_period_at(rgw::sal::RadosStore* store,
const rgw_meta_sync_info& info,
optional_yield y)
{
class RGWSyncTraceManager;
class RGWSyncErrorLogger {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
vector<string> oids;
int num_shards;
std::atomic<int64_t> counter = { 0 };
public:
- RGWSyncErrorLogger(rgw::sal::RGWRadosStore *_store, const string &oid_prefix, int _num_shards);
+ RGWSyncErrorLogger(rgw::sal::RadosStore *_store, const string &oid_prefix, int _num_shards);
RGWCoroutine *log_error_cr(const string& source_zone, const string& section, const string& name, uint32_t error_code, const string& message);
static string get_shard_oid(const string& oid_prefix, int shard_id);
struct RGWMetaSyncEnv {
const DoutPrefixProvider *dpp;
CephContext *cct{nullptr};
- rgw::sal::RGWRadosStore *store{nullptr};
+ rgw::sal::RadosStore *store{nullptr};
RGWRESTConn *conn{nullptr};
RGWAsyncRadosProcessor *async_rados{nullptr};
RGWHTTPManager *http_manager{nullptr};
RGWMetaSyncEnv() {}
- void init(const DoutPrefixProvider *_dpp, CephContext *_cct, rgw::sal::RGWRadosStore *_store, RGWRESTConn *_conn,
+ void init(const DoutPrefixProvider *_dpp, CephContext *_cct, rgw::sal::RadosStore *_store, RGWRESTConn *_conn,
RGWAsyncRadosProcessor *_async_rados, RGWHTTPManager *_http_manager,
RGWSyncErrorLogger *_error_logger, RGWSyncTraceManager *_sync_tracer);
class RGWRemoteMetaLog : public RGWCoroutinesManager {
const DoutPrefixProvider *dpp;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
RGWRESTConn *conn;
RGWAsyncRadosProcessor *async_rados;
RGWSyncTraceNodeRef tn;
public:
- RGWRemoteMetaLog(const DoutPrefixProvider *dpp, rgw::sal::RGWRadosStore *_store,
+ RGWRemoteMetaLog(const DoutPrefixProvider *dpp, rgw::sal::RadosStore *_store,
RGWAsyncRadosProcessor *async_rados,
RGWMetaSyncStatusManager *_sm)
: RGWCoroutinesManager(_store->ctx(), _store->getRados()->get_cr_registry()),
};
class RGWMetaSyncStatusManager : public DoutPrefixProvider {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
librados::IoCtx ioctx;
RGWRemoteMetaLog master_log;
vector<string> clone_markers;
public:
- RGWMetaSyncStatusManager(rgw::sal::RGWRadosStore *_store, RGWAsyncRadosProcessor *async_rados)
+ RGWMetaSyncStatusManager(rgw::sal::RadosStore *_store, RGWAsyncRadosProcessor *async_rados)
: store(_store), master_log(this, store, async_rados, this)
{}
int init();
}
int bucket_source_sync_checkpoint(const DoutPrefixProvider* dpp,
- rgw::sal::RGWRadosStore *store,
+ rgw::sal::RadosStore *store,
const RGWBucketInfo& bucket_info,
const RGWBucketInfo& source_bucket_info,
const rgw_sync_bucket_pipe& pipe,
} // anonymous namespace
int rgw_bucket_sync_checkpoint(const DoutPrefixProvider* dpp,
- rgw::sal::RGWRadosStore *store,
+ rgw::sal::RadosStore *store,
const RGWBucketSyncPolicyHandler& policy,
const RGWBucketInfo& info,
std::optional<rgw_zone_id> opt_source_zone,
#include "rgw_basic_types.h"
class DoutPrefixProvider;
-namespace rgw::sal { class RGWRadosStore; }
+namespace rgw::sal { class RadosStore; }
class RGWBucketInfo;
class RGWBucketSyncPolicyHandler;
// poll the bucket's sync status until it's caught up against all sync sources
int rgw_bucket_sync_checkpoint(const DoutPrefixProvider* dpp,
- rgw::sal::RGWRadosStore *store,
+ rgw::sal::RadosStore *store,
const RGWBucketSyncPolicyHandler& policy,
const RGWBucketInfo& info,
std::optional<rgw_zone_id> opt_source_zone,
return oid;
}
-static string obj_to_aws_path(rgw::sal::RGWObject* obj)
+static string obj_to_aws_path(rgw::sal::Object* obj)
{
string path = obj->get_bucket()->get_name() + "/" + get_key_oid(obj->get_key());
{
RGWDataSyncCtx *sc;
RGWRESTConn *conn;
- rgw::sal::RGWObject* src_obj;
+ rgw::sal::Object* src_obj;
RGWRESTConn::get_obj_params req_params;
rgw_sync_aws_src_obj_properties src_properties;
RGWCoroutine *_caller,
RGWDataSyncCtx *_sc,
RGWRESTConn *_conn,
- rgw::sal::RGWObject* _src_obj,
+ rgw::sal::Object* _src_obj,
const rgw_sync_aws_src_obj_properties& _src_properties) : RGWStreamReadHTTPResourceCRF(_cct, _env, _caller,
_sc->env->http_manager, _src_obj->get_key()),
sc(_sc), conn(_conn), src_obj(_src_obj),
RGWDataSyncCtx *sc;
rgw_sync_aws_src_obj_properties src_properties;
std::shared_ptr<AWSSyncConfig_Profile> target;
- rgw::sal::RGWObject* dest_obj;
+ rgw::sal::Object* dest_obj;
string etag;
public:
RGWAWSStreamPutCRF(CephContext *_cct,
RGWDataSyncCtx *_sc,
const rgw_sync_aws_src_obj_properties& _src_properties,
std::shared_ptr<AWSSyncConfig_Profile>& _target,
- rgw::sal::RGWObject* _dest_obj) : RGWStreamWriteHTTPResourceCRF(_cct, _env, _caller, _sc->env->http_manager),
+ rgw::sal::Object* _dest_obj) : RGWStreamWriteHTTPResourceCRF(_cct, _env, _caller, _sc->env->http_manager),
sc(_sc), src_properties(_src_properties), target(_target), dest_obj(_dest_obj) {
}
RGWDataSyncCtx *sc;
RGWRESTConn *source_conn;
std::shared_ptr<AWSSyncConfig_Profile> target;
- rgw::sal::RGWObject* src_obj;
- rgw::sal::RGWObject* dest_obj;
+ rgw::sal::Object* src_obj;
+ rgw::sal::Object* dest_obj;
rgw_sync_aws_src_obj_properties src_properties;
public:
RGWAWSStreamObjToCloudPlainCR(RGWDataSyncCtx *_sc,
RGWRESTConn *_source_conn,
- rgw::sal::RGWObject* _src_obj,
+ rgw::sal::Object* _src_obj,
const rgw_sync_aws_src_obj_properties& _src_properties,
std::shared_ptr<AWSSyncConfig_Profile> _target,
- rgw::sal::RGWObject* _dest_obj) : RGWCoroutine(_sc->cct),
+ rgw::sal::Object* _dest_obj) : RGWCoroutine(_sc->cct),
sc(_sc),
source_conn(_source_conn),
target(_target),
RGWDataSyncCtx *sc;
RGWRESTConn *source_conn;
std::shared_ptr<AWSSyncConfig_Profile> target;
- rgw::sal::RGWObject* src_obj;
- rgw::sal::RGWObject* dest_obj;
+ rgw::sal::Object* src_obj;
+ rgw::sal::Object* dest_obj;
rgw_sync_aws_src_obj_properties src_properties;
public:
RGWAWSStreamObjToCloudMultipartPartCR(RGWDataSyncCtx *_sc,
RGWRESTConn *_source_conn,
- rgw::sal::RGWObject* _src_obj,
+ rgw::sal::Object* _src_obj,
std::shared_ptr<AWSSyncConfig_Profile>& _target,
- rgw::sal::RGWObject* _dest_obj,
+ rgw::sal::Object* _dest_obj,
const rgw_sync_aws_src_obj_properties& _src_properties,
const string& _upload_id,
const rgw_sync_aws_multipart_part_info& _part_info,
class RGWAWSAbortMultipartCR : public RGWCoroutine {
RGWDataSyncCtx *sc;
RGWRESTConn *dest_conn;
- rgw::sal::RGWObject* dest_obj;
+ rgw::sal::Object* dest_obj;
string upload_id;
public:
RGWAWSAbortMultipartCR(RGWDataSyncCtx *_sc,
RGWRESTConn *_dest_conn,
- rgw::sal::RGWObject* _dest_obj,
+ rgw::sal::Object* _dest_obj,
const string& _upload_id) : RGWCoroutine(_sc->cct),
sc(_sc),
dest_conn(_dest_conn),
class RGWAWSInitMultipartCR : public RGWCoroutine {
RGWDataSyncCtx *sc;
RGWRESTConn *dest_conn;
- rgw::sal::RGWObject* dest_obj;
+ rgw::sal::Object* dest_obj;
uint64_t obj_size;
map<string, string> attrs;
public:
RGWAWSInitMultipartCR(RGWDataSyncCtx *_sc,
RGWRESTConn *_dest_conn,
- rgw::sal::RGWObject* _dest_obj,
+ rgw::sal::Object* _dest_obj,
uint64_t _obj_size,
const map<string, string>& _attrs,
string *_upload_id) : RGWCoroutine(_sc->cct),
class RGWAWSCompleteMultipartCR : public RGWCoroutine {
RGWDataSyncCtx *sc;
RGWRESTConn *dest_conn;
- rgw::sal::RGWObject* dest_obj;
+ rgw::sal::Object* dest_obj;
bufferlist out_bl;
public:
RGWAWSCompleteMultipartCR(RGWDataSyncCtx *_sc,
RGWRESTConn *_dest_conn,
- rgw::sal::RGWObject* _dest_obj,
+ rgw::sal::Object* _dest_obj,
string _upload_id,
const map<int, rgw_sync_aws_multipart_part_info>& _parts) : RGWCoroutine(_sc->cct),
sc(_sc),
class RGWAWSStreamAbortMultipartUploadCR : public RGWCoroutine {
RGWDataSyncCtx *sc;
RGWRESTConn *dest_conn;
- rgw::sal::RGWObject* dest_obj;
+ rgw::sal::Object* dest_obj;
const rgw_raw_obj status_obj;
string upload_id;
RGWAWSStreamAbortMultipartUploadCR(RGWDataSyncCtx *_sc,
RGWRESTConn *_dest_conn,
- rgw::sal::RGWObject* _dest_obj,
+ rgw::sal::Object* _dest_obj,
const rgw_raw_obj& _status_obj,
const string& _upload_id) : RGWCoroutine(_sc->cct), sc(_sc),
dest_conn(_dest_conn),
AWSSyncConfig& conf;
RGWRESTConn *source_conn;
std::shared_ptr<AWSSyncConfig_Profile> target;
- rgw::sal::RGWObject* src_obj;
- rgw::sal::RGWObject* dest_obj;
+ rgw::sal::Object* src_obj;
+ rgw::sal::Object* dest_obj;
uint64_t obj_size;
string src_etag;
rgw_bucket_sync_pipe& _sync_pipe,
AWSSyncConfig& _conf,
RGWRESTConn *_source_conn,
- rgw::sal::RGWObject* _src_obj,
+ rgw::sal::Object* _src_obj,
std::shared_ptr<AWSSyncConfig_Profile>& _target,
- rgw::sal::RGWObject* _dest_obj,
+ rgw::sal::Object* _dest_obj,
uint64_t _obj_size,
const rgw_sync_aws_src_obj_properties& _src_properties,
const rgw_rest_obj& _rest_obj) : RGWCoroutine(_sc->cct),
}
yield {
- rgw::sal::RGWRadosBucket bucket(sync_env->store, src_bucket);
- rgw::sal::RGWRadosObject src_obj(sync_env->store, key, &bucket);
+ rgw::sal::RadosBucket bucket(sync_env->store, src_bucket);
+ rgw::sal::RadosObject src_obj(sync_env->store, key, &bucket);
/* init output */
rgw_bucket target_bucket;
target_bucket.name = target_bucket_name; /* this is only possible because we only use bucket name for
uri resolution */
- rgw::sal::RGWRadosBucket dest_bucket(sync_env->store, target_bucket);
- rgw::sal::RGWRadosObject dest_obj(sync_env->store, rgw_obj_key(target_obj_name), &dest_bucket);
+ rgw::sal::RadosBucket dest_bucket(sync_env->store, target_bucket);
+ rgw::sal::RadosObject dest_obj(sync_env->store, rgw_obj_key(target_obj_name), &dest_bucket);
rgw_sync_aws_src_obj_properties src_properties;
};
-RGWHandler_REST* RGWRESTMgr_MDSearch_S3::get_handler(rgw::sal::RGWStore *store,
+RGWHandler_REST* RGWRESTMgr_MDSearch_S3::get_handler(rgw::sal::Store *store,
struct req_state* const s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix)
public:
explicit RGWRESTMgr_MDSearch_S3() {}
- RGWHandler_REST *get_handler(rgw::sal::RGWStore *store,
+ RGWHandler_REST *get_handler(rgw::sal::Store *store,
struct req_state* s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix) override;
public:
InitBucketLifecycleCR(RGWDataSyncCtx *_sc,
PSConfigRef& _conf,
- rgw::sal::RGWBucket* _bucket) : RGWCoroutine(_sc->cct),
+ rgw::sal::Bucket* _bucket) : RGWCoroutine(_sc->cct),
sc(_sc), sync_env(_sc->env),
conf(_conf) {
lc_config.bucket = _bucket;
void RGWPSCreateNotif_ObjStore::execute(optional_yield y)
{
- ps.emplace(static_cast<rgw::sal::RGWRadosStore*>(store), s->owner.get_id().tenant);
+ ps.emplace(static_cast<rgw::sal::RadosStore*>(store), s->owner.get_id().tenant);
auto b = ps->get_bucket(bucket_info.bucket);
op_ret = b->create_notification(topic_name, events, y);
return;
}
- ps.emplace(static_cast<rgw::sal::RGWRadosStore*>(store), s->owner.get_id().tenant);
+ ps.emplace(static_cast<rgw::sal::RadosStore*>(store), s->owner.get_id().tenant);
auto b = ps->get_bucket(bucket_info.bucket);
op_ret = b->remove_notification(topic_name, y);
if (op_ret < 0) {
void RGWPSListNotifs_ObjStore::execute(optional_yield y)
{
- ps.emplace(static_cast<rgw::sal::RGWRadosStore*>(store), s->owner.get_id().tenant);
+ ps.emplace(static_cast<rgw::sal::RadosStore*>(store), s->owner.get_id().tenant);
auto b = ps->get_bucket(bucket_info.bucket);
op_ret = b->get_topics(&result);
if (op_ret < 0) {
};
// factory for ceph specific PubSub REST handlers
-RGWHandler_REST* RGWRESTMgr_PubSub::get_handler(rgw::sal::RGWStore *store,
+RGWHandler_REST* RGWRESTMgr_PubSub::get_handler(rgw::sal::Store *store,
struct req_state* const s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix)
class RGWRESTMgr_PubSub : public RGWRESTMgr {
public:
- virtual RGWHandler_REST* get_handler(rgw::sal::RGWStore *store,
+ virtual RGWHandler_REST* get_handler(rgw::sal::Store *store,
struct req_state* s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix) override;
}
}
-RGWDataAccess::RGWDataAccess(rgw::sal::RGWStore *_store) : store(_store)
+RGWDataAccess::RGWDataAccess(rgw::sal::Store *_store) : store(_store)
{
}
int RGWDataAccess::Bucket::init(const DoutPrefixProvider *dpp, optional_yield y)
{
- std::unique_ptr<rgw::sal::RGWBucket> bucket;
+ std::unique_ptr<rgw::sal::Bucket> bucket;
int ret = sd->store->get_bucket(dpp, nullptr, tenant, name, &bucket, y);
if (ret < 0) {
return ret;
const DoutPrefixProvider *dpp,
optional_yield y)
{
- rgw::sal::RGWStore *store = sd->store;
+ rgw::sal::Store *store = sd->store;
CephContext *cct = store->ctx();
string tag;
rgw::BlockingAioThrottle aio(store->ctx()->_conf->rgw_put_obj_min_window_size);
RGWObjectCtx obj_ctx(store);
- std::unique_ptr<rgw::sal::RGWBucket> b;
+ std::unique_ptr<rgw::sal::Bucket> b;
store->get_bucket(NULL, bucket_info, &b);
- std::unique_ptr<rgw::sal::RGWObject> obj = b->get_object(key);
+ std::unique_ptr<rgw::sal::Object> obj = b->get_object(key);
auto& owner = bucket->policy.get_owner();
struct RGWObjVersionTracker;
class optional_yield;
namespace rgw { namespace sal {
- class RGWStore;
+ class Store;
} }
struct obj_version;
class RGWDataAccess
{
- rgw::sal::RGWStore *store;
+ rgw::sal::Store *store;
public:
- RGWDataAccess(rgw::sal::RGWStore *_store);
+ RGWDataAccess(rgw::sal::Store *_store);
class Object;
class Bucket;
store = NULL;
}
-void seed::init(struct req_state *p_req, rgw::sal::RGWStore *p_store)
+void seed::init(struct req_state *p_req, rgw::sal::Store *p_store)
{
s = p_req;
store = p_store;
}
-int seed::get_torrent_file(rgw::sal::RGWObject* object,
+int seed::get_torrent_file(rgw::sal::Object* object,
uint64_t &total_len,
ceph::bufferlist &bl_data,
rgw_obj &obj)
bufferlist bl; // bufflist ready to send
struct req_state *s{nullptr};
- rgw::sal::RGWStore *store{nullptr};
+ rgw::sal::Store *store{nullptr};
SHA1 h;
TorrentBencode dencode;
~seed();
int get_params();
- void init(struct req_state *p_req, rgw::sal::RGWStore *p_store);
- int get_torrent_file(rgw::sal::RGWObject* object,
+ void init(struct req_state *p_req, rgw::sal::Store *p_store);
+ int get_torrent_file(rgw::sal::Object* object,
uint64_t &total_len,
ceph::bufferlist &bl_data,
rgw_obj &obj);
/// rados watcher for bucket trim notifications
class BucketTrimWatcher : public librados::WatchCtx2 {
- rgw::sal::RGWRadosStore *const store;
+ rgw::sal::RadosStore *const store;
const rgw_raw_obj& obj;
rgw_rados_ref ref;
uint64_t handle{0};
boost::container::flat_map<TrimNotifyType, HandlerPtr> handlers;
public:
- BucketTrimWatcher(rgw::sal::RGWRadosStore *store, const rgw_raw_obj& obj,
+ BucketTrimWatcher(rgw::sal::RadosStore *store, const rgw_raw_obj& obj,
TrimCounters::Server *counters)
: store(store), obj(obj) {
handlers.emplace(NotifyTrimCounters, new TrimCounters::Handler(counters));
/// concurrent requests
class BucketTrimShardCollectCR : public RGWShardCollectCR {
static constexpr int MAX_CONCURRENT_SHARDS = 16;
- rgw::sal::RGWRadosStore *const store;
+ rgw::sal::RadosStore *const store;
const RGWBucketInfo& bucket_info;
const std::vector<std::string>& markers; //< shard markers to trim
size_t i{0}; //< index of current shard marker
public:
- BucketTrimShardCollectCR(rgw::sal::RGWRadosStore *store, const RGWBucketInfo& bucket_info,
+ BucketTrimShardCollectCR(rgw::sal::RadosStore *store, const RGWBucketInfo& bucket_info,
const std::vector<std::string>& markers)
: RGWShardCollectCR(store->ctx(), MAX_CONCURRENT_SHARDS),
store(store), bucket_info(bucket_info), markers(markers)
/// trim the bilog of all of the given bucket instance's shards
class BucketTrimInstanceCR : public RGWCoroutine {
- rgw::sal::RGWRadosStore *const store;
+ rgw::sal::RadosStore *const store;
RGWHTTPManager *const http;
BucketTrimObserver *const observer;
std::string bucket_instance;
std::vector<std::string> min_markers; //< min marker per shard
public:
- BucketTrimInstanceCR(rgw::sal::RGWRadosStore *store, RGWHTTPManager *http,
+ BucketTrimInstanceCR(rgw::sal::RadosStore *store, RGWHTTPManager *http,
BucketTrimObserver *observer,
const std::string& bucket_instance,
const DoutPrefixProvider *dpp)
/// trim each bucket instance while limiting the number of concurrent operations
class BucketTrimInstanceCollectCR : public RGWShardCollectCR {
- rgw::sal::RGWRadosStore *const store;
+ rgw::sal::RadosStore *const store;
RGWHTTPManager *const http;
BucketTrimObserver *const observer;
std::vector<std::string>::const_iterator bucket;
std::vector<std::string>::const_iterator end;
const DoutPrefixProvider *dpp;
public:
- BucketTrimInstanceCollectCR(rgw::sal::RGWRadosStore *store, RGWHTTPManager *http,
+ BucketTrimInstanceCollectCR(rgw::sal::RadosStore *store, RGWHTTPManager *http,
BucketTrimObserver *observer,
const std::vector<std::string>& buckets,
int max_concurrent,
};
class BucketTrimCR : public RGWCoroutine {
- rgw::sal::RGWRadosStore *const store;
+ rgw::sal::RadosStore *const store;
RGWHTTPManager *const http;
const BucketTrimConfig& config;
BucketTrimObserver *const observer;
static const std::string section; //< metadata section for bucket instances
public:
- BucketTrimCR(rgw::sal::RGWRadosStore *store, RGWHTTPManager *http,
+ BucketTrimCR(rgw::sal::RadosStore *store, RGWHTTPManager *http,
const BucketTrimConfig& config, BucketTrimObserver *observer,
const rgw_raw_obj& obj, const DoutPrefixProvider *dpp)
: RGWCoroutine(store->ctx()), store(store), http(http), config(config),
}
class BucketTrimPollCR : public RGWCoroutine {
- rgw::sal::RGWRadosStore *const store;
+ rgw::sal::RadosStore *const store;
RGWHTTPManager *const http;
const BucketTrimConfig& config;
BucketTrimObserver *const observer;
const DoutPrefixProvider *dpp;
public:
- BucketTrimPollCR(rgw::sal::RGWRadosStore *store, RGWHTTPManager *http,
+ BucketTrimPollCR(rgw::sal::RadosStore *store, RGWHTTPManager *http,
const BucketTrimConfig& config,
BucketTrimObserver *observer, const rgw_raw_obj& obj,
const DoutPrefixProvider *dpp)
class BucketTrimManager::Impl : public TrimCounters::Server,
public BucketTrimObserver {
public:
- rgw::sal::RGWRadosStore *const store;
+ rgw::sal::RadosStore *const store;
const BucketTrimConfig config;
const rgw_raw_obj status_obj;
/// protect data shared between data sync, trim, and watch/notify threads
std::mutex mutex;
- Impl(rgw::sal::RGWRadosStore *store, const BucketTrimConfig& config)
+ Impl(rgw::sal::RadosStore *store, const BucketTrimConfig& config)
: store(store), config(config),
status_obj(store->get_zone()->get_params().log_pool, BucketTrimStatus::oid),
counter(config.counter_size),
}
};
-BucketTrimManager::BucketTrimManager(rgw::sal::RGWRadosStore *store,
+BucketTrimManager::BucketTrimManager(rgw::sal::RadosStore *store,
const BucketTrimConfig& config)
: impl(new Impl(store, config))
{
namespace rgw {
namespace sal {
- class RGWRadosStore;
+ class RadosStore;
}
/// Interface to inform the trim process about which buckets are most active
class Impl;
std::unique_ptr<Impl> impl;
public:
- BucketTrimManager(sal::RGWRadosStore *store, const BucketTrimConfig& config);
+ BucketTrimManager(sal::RadosStore *store, const BucketTrimConfig& config);
~BucketTrimManager();
int init();
namespace {
class DatalogTrimImplCR : public RGWSimpleCoroutine {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
boost::intrusive_ptr<RGWAioCompletionNotifier> cn;
int shard;
std::string marker;
std::string* last_trim_marker;
public:
- DatalogTrimImplCR(rgw::sal::RGWRadosStore* store, int shard,
+ DatalogTrimImplCR(rgw::sal::RadosStore* store, int shard,
const std::string& marker, std::string* last_trim_marker)
: RGWSimpleCoroutine(store->ctx()), store(store), shard(shard),
marker(marker), last_trim_marker(last_trim_marker) {
class DataLogTrimCR : public RGWCoroutine {
using TrimCR = DatalogTrimImplCR;
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
RGWHTTPManager *http;
const int num_shards;
const std::string& zone_id; //< my zone id
int ret{0};
public:
- DataLogTrimCR(rgw::sal::RGWRadosStore *store, RGWHTTPManager *http,
+ DataLogTrimCR(rgw::sal::RadosStore *store, RGWHTTPManager *http,
int num_shards, std::vector<std::string>& last_trim)
: RGWCoroutine(store->ctx()), store(store), http(http),
num_shards(num_shards),
return 0;
}
-RGWCoroutine* create_admin_data_log_trim_cr(rgw::sal::RGWRadosStore *store,
+RGWCoroutine* create_admin_data_log_trim_cr(rgw::sal::RadosStore *store,
RGWHTTPManager *http,
int num_shards,
std::vector<std::string>& markers)
}
class DataLogTrimPollCR : public RGWCoroutine {
- rgw::sal::RGWRadosStore *store;
+ rgw::sal::RadosStore *store;
RGWHTTPManager *http;
const int num_shards;
const utime_t interval; //< polling interval
std::vector<std::string> last_trim; //< last trimmed marker per shard
public:
- DataLogTrimPollCR(rgw::sal::RGWRadosStore *store, RGWHTTPManager *http,
+ DataLogTrimPollCR(rgw::sal::RadosStore *store, RGWHTTPManager *http,
int num_shards, utime_t interval)
: RGWCoroutine(store->ctx()), store(store), http(http),
num_shards(num_shards), interval(interval),
return 0;
}
-RGWCoroutine* create_data_log_trim_cr(rgw::sal::RGWRadosStore *store,
+RGWCoroutine* create_data_log_trim_cr(rgw::sal::RadosStore *store,
RGWHTTPManager *http,
int num_shards, utime_t interval)
{
class RGWHTTPManager;
class utime_t;
namespace rgw { namespace sal {
- class RGWRadosStore;
+ class RadosStore;
} }
// DataLogTrimCR factory function
-extern RGWCoroutine* create_data_log_trim_cr(rgw::sal::RGWRadosStore *store,
+extern RGWCoroutine* create_data_log_trim_cr(rgw::sal::RadosStore *store,
RGWHTTPManager *http,
int num_shards, utime_t interval);
// factory function for datalog trim via radosgw-admin
-RGWCoroutine* create_admin_data_log_trim_cr(rgw::sal::RGWRadosStore *store,
+RGWCoroutine* create_admin_data_log_trim_cr(rgw::sal::RadosStore *store,
RGWHTTPManager *http,
int num_shards,
std::vector<std::string>& markers);
/// purge all log shards for the given mdlog
class PurgeLogShardsCR : public RGWShardCollectCR {
- rgw::sal::RGWRadosStore *const store;
+ rgw::sal::RadosStore *const store;
const RGWMetadataLog* mdlog;
const int num_shards;
rgw_raw_obj obj;
static constexpr int max_concurrent = 16;
public:
- PurgeLogShardsCR(rgw::sal::RGWRadosStore *store, const RGWMetadataLog* mdlog,
+ PurgeLogShardsCR(rgw::sal::RadosStore *store, const RGWMetadataLog* mdlog,
const rgw_pool& pool, int num_shards)
: RGWShardCollectCR(store->ctx(), max_concurrent),
store(store), mdlog(mdlog), num_shards(num_shards), obj(pool, "")
RGWSI_Zone *zone;
RGWSI_MDLog *mdlog;
} svc;
- rgw::sal::RGWRadosStore *const store;
+ rgw::sal::RadosStore *const store;
RGWMetadataManager *const metadata;
RGWObjVersionTracker objv;
Cursor cursor;
epoch_t *last_trim_epoch; //< update last trim on success
public:
- PurgePeriodLogsCR(rgw::sal::RGWRadosStore *store, epoch_t realm_epoch, epoch_t *last_trim)
+ PurgePeriodLogsCR(rgw::sal::RadosStore *store, epoch_t realm_epoch, epoch_t *last_trim)
: RGWCoroutine(store->ctx()), store(store), metadata(store->ctl()->meta.mgr),
realm_epoch(realm_epoch), last_trim_epoch(last_trim) {
svc.zone = store->svc()->zone;
/// construct a RGWRESTConn for each zone in the realm
template <typename Zonegroups>
-connection_map make_peer_connections(rgw::sal::RGWRadosStore *store,
+connection_map make_peer_connections(rgw::sal::RadosStore *store,
const Zonegroups& zonegroups)
{
connection_map connections;
struct TrimEnv {
const DoutPrefixProvider *dpp;
- rgw::sal::RGWRadosStore *const store;
+ rgw::sal::RadosStore *const store;
RGWHTTPManager *const http;
int num_shards;
const rgw_zone_id& zone;
Cursor current; //< cursor to current period
epoch_t last_trim_epoch{0}; //< epoch of last mdlog that was purged
- TrimEnv(const DoutPrefixProvider *dpp, rgw::sal::RGWRadosStore *store, RGWHTTPManager *http, int num_shards)
+ TrimEnv(const DoutPrefixProvider *dpp, rgw::sal::RadosStore *store, RGWHTTPManager *http, int num_shards)
: dpp(dpp), store(store), http(http), num_shards(num_shards),
zone(store->svc()->zone->zone_id()),
current(store->svc()->mdlog->get_period_history()->get_current())
/// last trim marker for each shard, only applies to current period's mdlog
std::vector<std::string> last_trim_markers;
- MasterTrimEnv(const DoutPrefixProvider *dpp, rgw::sal::RGWRadosStore *store, RGWHTTPManager *http, int num_shards)
+ MasterTrimEnv(const DoutPrefixProvider *dpp, rgw::sal::RadosStore *store, RGWHTTPManager *http, int num_shards)
: TrimEnv(dpp, store, http, num_shards),
last_trim_markers(num_shards)
{
/// last trim timestamp for each shard, only applies to current period's mdlog
std::vector<ceph::real_time> last_trim_timestamps;
- PeerTrimEnv(const DoutPrefixProvider *dpp, rgw::sal::RGWRadosStore *store, RGWHTTPManager *http, int num_shards)
+ PeerTrimEnv(const DoutPrefixProvider *dpp, rgw::sal::RadosStore *store, RGWHTTPManager *http, int num_shards)
: TrimEnv(dpp, store, http, num_shards),
last_trim_timestamps(num_shards)
{}
}
class MetaTrimPollCR : public RGWCoroutine {
- rgw::sal::RGWRadosStore *const store;
+ rgw::sal::RadosStore *const store;
const utime_t interval; //< polling interval
const rgw_raw_obj obj;
const std::string name{"meta_trim"}; //< lock name
virtual RGWCoroutine* alloc_cr() = 0;
public:
- MetaTrimPollCR(rgw::sal::RGWRadosStore *store, utime_t interval)
+ MetaTrimPollCR(rgw::sal::RadosStore *store, utime_t interval)
: RGWCoroutine(store->ctx()), store(store), interval(interval),
obj(store->svc()->zone->get_zone_params().log_pool, RGWMetadataLogHistory::oid),
cookie(RGWSimpleRadosLockCR::gen_random_cookie(cct))
return new MetaMasterTrimCR(env);
}
public:
- MetaMasterTrimPollCR(const DoutPrefixProvider *dpp, rgw::sal::RGWRadosStore *store, RGWHTTPManager *http,
+ MetaMasterTrimPollCR(const DoutPrefixProvider *dpp, rgw::sal::RadosStore *store, RGWHTTPManager *http,
int num_shards, utime_t interval)
: MetaTrimPollCR(store, interval),
env(dpp, store, http, num_shards)
return new MetaPeerTrimCR(env);
}
public:
- MetaPeerTrimPollCR(const DoutPrefixProvider *dpp, rgw::sal::RGWRadosStore *store, RGWHTTPManager *http,
+ MetaPeerTrimPollCR(const DoutPrefixProvider *dpp, rgw::sal::RadosStore *store, RGWHTTPManager *http,
int num_shards, utime_t interval)
: MetaTrimPollCR(store, interval),
env(dpp, store, http, num_shards)
{}
};
-RGWCoroutine* create_meta_log_trim_cr(const DoutPrefixProvider *dpp, rgw::sal::RGWRadosStore *store, RGWHTTPManager *http,
+RGWCoroutine* create_meta_log_trim_cr(const DoutPrefixProvider *dpp, rgw::sal::RadosStore *store, RGWHTTPManager *http,
int num_shards, utime_t interval)
{
if (store->svc()->zone->is_meta_master()) {
struct MetaMasterAdminTrimCR : private MasterTrimEnv, public MetaMasterTrimCR {
- MetaMasterAdminTrimCR(const DoutPrefixProvider *dpp, rgw::sal::RGWRadosStore *store, RGWHTTPManager *http, int num_shards)
+ MetaMasterAdminTrimCR(const DoutPrefixProvider *dpp, rgw::sal::RadosStore *store, RGWHTTPManager *http, int num_shards)
: MasterTrimEnv(dpp, store, http, num_shards),
MetaMasterTrimCR(*static_cast<MasterTrimEnv*>(this))
{}
};
struct MetaPeerAdminTrimCR : private PeerTrimEnv, public MetaPeerTrimCR {
- MetaPeerAdminTrimCR(const DoutPrefixProvider *dpp, rgw::sal::RGWRadosStore *store, RGWHTTPManager *http, int num_shards)
+ MetaPeerAdminTrimCR(const DoutPrefixProvider *dpp, rgw::sal::RadosStore *store, RGWHTTPManager *http, int num_shards)
: PeerTrimEnv(dpp, store, http, num_shards),
MetaPeerTrimCR(*static_cast<PeerTrimEnv*>(this))
{}
};
-RGWCoroutine* create_admin_meta_log_trim_cr(const DoutPrefixProvider *dpp, rgw::sal::RGWRadosStore *store,
+RGWCoroutine* create_admin_meta_log_trim_cr(const DoutPrefixProvider *dpp, rgw::sal::RadosStore *store,
RGWHTTPManager *http,
int num_shards)
{
class RGWHTTPManager;
class utime_t;
namespace rgw { namespace sal {
- class RGWRadosStore;
+ class RadosStore;
} }
// MetaLogTrimCR factory function
RGWCoroutine* create_meta_log_trim_cr(const DoutPrefixProvider *dpp,
- rgw::sal::RGWRadosStore *store,
+ rgw::sal::RadosStore *store,
RGWHTTPManager *http,
int num_shards, utime_t interval);
// factory function for mdlog trim via radosgw-admin
RGWCoroutine* create_admin_meta_log_trim_cr(const DoutPrefixProvider *dpp,
- rgw::sal::RGWRadosStore *store,
+ rgw::sal::RadosStore *store,
RGWHTTPManager *http,
int num_shards);
formatter->close_section(); // categories
}
-int RGWUsage::show(const DoutPrefixProvider *dpp, rgw::sal::RGWStore* store,
- rgw::sal::RGWUser* user , rgw::sal::RGWBucket* bucket,
+int RGWUsage::show(const DoutPrefixProvider *dpp, rgw::sal::Store* store,
+ rgw::sal::User* user , rgw::sal::Bucket* bucket,
uint64_t start_epoch, uint64_t end_epoch, bool show_log_entries,
bool show_log_sum,
map<string, bool> *categories, RGWFormatterFlusher& flusher)
return 0;
}
-int RGWUsage::trim(const DoutPrefixProvider *dpp, rgw::sal::RGWStore* store,
- rgw::sal::RGWUser* user , rgw::sal::RGWBucket* bucket,
+int RGWUsage::trim(const DoutPrefixProvider *dpp, rgw::sal::Store* store,
+ rgw::sal::User* user , rgw::sal::Bucket* bucket,
uint64_t start_epoch, uint64_t end_epoch)
{
if (bucket) {
}
}
-int RGWUsage::clear(rgw::sal::RGWStore* store)
+int RGWUsage::clear(rgw::sal::Store* store)
{
return store->clear_usage();
}
#include "rgw_formats.h"
#include "rgw_user.h"
-namespace rgw { namespace sal { class RGWStore; } }
+namespace rgw { namespace sal { class Store; } }
class RGWUsage
{
public:
- static int show(const DoutPrefixProvider *dpp, rgw::sal::RGWStore* store,
- rgw::sal::RGWUser* user , rgw::sal::RGWBucket* bucket,
+ static int show(const DoutPrefixProvider *dpp, rgw::sal::Store* store,
+ rgw::sal::User* user , rgw::sal::Bucket* bucket,
uint64_t start_epoch, uint64_t end_epoch, bool show_log_entries,
bool show_log_sum,
std::map<std::string, bool> *categories, RGWFormatterFlusher& flusher);
- static int trim(const DoutPrefixProvider *dpp, rgw::sal::RGWStore *store,
- rgw::sal::RGWUser* user , rgw::sal::RGWBucket* bucket,
+ static int trim(const DoutPrefixProvider *dpp, rgw::sal::Store *store,
+ rgw::sal::User* user , rgw::sal::Bucket* bucket,
uint64_t start_epoch, uint64_t end_epoch);
- static int clear(rgw::sal::RGWStore *store);
+ static int clear(rgw::sal::Store *store);
};
info.access_keys.clear();
}
-int rgw_user_sync_all_stats(const DoutPrefixProvider *dpp, rgw::sal::RGWStore* store,
- rgw::sal::RGWUser* user, optional_yield y)
+int rgw_user_sync_all_stats(const DoutPrefixProvider *dpp, rgw::sal::Store* store,
+ rgw::sal::User* user, optional_yield y)
{
- rgw::sal::RGWBucketList user_buckets;
+ rgw::sal::BucketList user_buckets;
CephContext *cct = store->ctx();
size_t max_entries = cct->_conf->rgw_list_buckets_max_chunk;
}
int rgw_user_get_all_buckets_stats(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
- rgw::sal::RGWUser* user,
+ rgw::sal::Store *store,
+ rgw::sal::User* user,
map<string, cls_user_bucket_entry>& buckets_usage_map,
optional_yield y)
{
int ret;
do {
- rgw::sal::RGWBucketList buckets;
+ rgw::sal::BucketList buckets;
ret = user->list_buckets(dpp, marker, string(), max_entries, false, buckets, y);
if (ret < 0) {
ldpp_dout(dpp, 0) << "failed to read user buckets: ret=" << ret << dendl;
return 0;
}
-RGWUserAdminOpState::RGWUserAdminOpState(rgw::sal::RGWStore* store)
+RGWUserAdminOpState::RGWUserAdminOpState(rgw::sal::Store* store)
{
user = store->get_user(rgw_user(RGW_USER_ANON_ID));
}
std::pair<std::string, RGWAccessKey> key_pair;
RGWAccessKey new_key;
- std::unique_ptr<rgw::sal::RGWUser> duplicate_check;
+ std::unique_ptr<rgw::sal::User> duplicate_check;
int key_type = op_state.get_key_type();
bool gen_access = op_state.will_gen_access();
init_default();
}
-int RGWUser::init(const DoutPrefixProvider *dpp, rgw::sal::RGWStore *storage,
+int RGWUser::init(const DoutPrefixProvider *dpp, rgw::sal::Store *storage,
RGWUserAdminOpState& op_state, optional_yield y)
{
init_default();
clear_populated();
}
-int RGWUser::init_storage(rgw::sal::RGWStore *storage)
+int RGWUser::init_storage(rgw::sal::Store *storage)
{
if (!storage) {
return -EINVAL;
access_key.clear();
}
- std::unique_ptr<rgw::sal::RGWUser> user;
+ std::unique_ptr<rgw::sal::User> user;
clear_populated();
{
int ret;
std::string subprocess_msg;
- rgw::sal::RGWUser* user = op_state.get_user();
+ rgw::sal::User* user = op_state.get_user();
if (!store) {
set_err_msg(err_msg, "couldn't initialize storage");
}
}
- std::unique_ptr<rgw::sal::RGWUser> old_user = store->get_user(op_state.get_user_info().user_id);
- std::unique_ptr<rgw::sal::RGWUser> new_user = store->get_user(op_state.get_new_uid());
+ std::unique_ptr<rgw::sal::User> old_user = store->get_user(op_state.get_user_info().user_id);
+ std::unique_ptr<rgw::sal::User> new_user = store->get_user(op_state.get_new_uid());
if (old_user->get_tenant() != new_user->get_tenant()) {
set_err_msg(err_msg, "users have to be under the same tenant namespace "
+ old_user->get_tenant() + " != " + new_user->get_tenant());
}
// create a stub user and write only the uid index and buckets object
- std::unique_ptr<rgw::sal::RGWUser> user;
+ std::unique_ptr<rgw::sal::User> user;
user = store->get_user(new_user->get_id());
RGWObjVersionTracker objv;
string marker;
CephContext *cct = store->ctx();
size_t max_buckets = cct->_conf->rgw_list_buckets_max_chunk;
- rgw::sal::RGWBucketList buckets;
+ rgw::sal::BucketList buckets;
do {
ret = old_user->list_buckets(dpp, marker, "", max_buckets, false, buckets, y);
int ret;
bool purge_data = op_state.will_purge_data();
- rgw::sal::RGWUser* user = op_state.get_user();
+ rgw::sal::User* user = op_state.get_user();
if (!op_state.has_existing_user()) {
set_err_msg(err_msg, "user does not exist");
return -ENOENT;
}
- rgw::sal::RGWBucketList buckets;
+ rgw::sal::BucketList buckets;
string marker;
CephContext *cct = store->ctx();
size_t max_buckets = cct->_conf->rgw_list_buckets_max_chunk;
std::string display_name = op_state.get_display_name();
RGWUserInfo user_info;
- std::unique_ptr<rgw::sal::RGWUser> duplicate_check;
+ std::unique_ptr<rgw::sal::User> duplicate_check;
// ensure that the user info has been populated or is populate-able
if (!op_state.has_existing_user() && !populated) {
__u8 suspended = op_state.get_suspension_status();
user_info.suspended = suspended;
- rgw::sal::RGWBucketList buckets;
+ rgw::sal::BucketList buckets;
if (user_id.empty()) {
set_err_msg(err_msg, "empty user id passed...aborting");
string marker;
CephContext *cct = store->ctx();
size_t max_buckets = cct->_conf->rgw_list_buckets_max_chunk;
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(user_id);
+ std::unique_ptr<rgw::sal::User> user = store->get_user(user_id);
do {
ret = user->list_buckets(dpp, marker, string(), max_buckets, false, buckets, y);
if (ret < 0) {
return 0;
}
-int RGWUserAdminOp_User::list(rgw::sal::RGWStore *store, RGWUserAdminOpState& op_state,
+int RGWUserAdminOp_User::list(rgw::sal::Store *store, RGWUserAdminOpState& op_state,
RGWFormatterFlusher& flusher)
{
RGWUser user;
}
int RGWUserAdminOp_User::info(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store, RGWUserAdminOpState& op_state,
+ rgw::sal::Store *store, RGWUserAdminOpState& op_state,
RGWFormatterFlusher& flusher,
optional_yield y)
{
RGWUserInfo info;
RGWUser user;
- std::unique_ptr<rgw::sal::RGWUser> ruser;
+ std::unique_ptr<rgw::sal::User> ruser;
int ret = user.init(dpp, store, op_state, y);
if (ret < 0)
}
int RGWUserAdminOp_User::create(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWUserAdminOpState& op_state,
RGWFormatterFlusher& flusher, optional_yield y)
{
}
int RGWUserAdminOp_User::modify(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWUserAdminOpState& op_state,
RGWFormatterFlusher& flusher, optional_yield y)
{
}
int RGWUserAdminOp_User::remove(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store, RGWUserAdminOpState& op_state,
+ rgw::sal::Store *store, RGWUserAdminOpState& op_state,
RGWFormatterFlusher& flusher, optional_yield y)
{
RGWUserInfo info;
}
int RGWUserAdminOp_Subuser::create(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWUserAdminOpState& op_state,
RGWFormatterFlusher& flusher,
optional_yield y)
}
int RGWUserAdminOp_Subuser::modify(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store, RGWUserAdminOpState& op_state,
+ rgw::sal::Store *store, RGWUserAdminOpState& op_state,
RGWFormatterFlusher& flusher, optional_yield y)
{
RGWUserInfo info;
}
int RGWUserAdminOp_Subuser::remove(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWUserAdminOpState& op_state,
RGWFormatterFlusher& flusher,
optional_yield y)
}
int RGWUserAdminOp_Key::create(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store, RGWUserAdminOpState& op_state,
+ rgw::sal::Store *store, RGWUserAdminOpState& op_state,
RGWFormatterFlusher& flusher,
optional_yield y)
{
}
int RGWUserAdminOp_Key::remove(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWUserAdminOpState& op_state,
RGWFormatterFlusher& flusher,
optional_yield y)
}
int RGWUserAdminOp_Caps::add(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWUserAdminOpState& op_state,
RGWFormatterFlusher& flusher, optional_yield y)
{
int RGWUserAdminOp_Caps::remove(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWUserAdminOpState& op_state,
RGWFormatterFlusher& flusher, optional_yield y)
{
class RGWGetUserStats_CB;
namespace rgw { namespace sal {
-class RGWStore;
+class Store;
} }
/**
};
WRITE_CLASS_ENCODER(RGWUID)
-extern int rgw_user_sync_all_stats(const DoutPrefixProvider *dpp, rgw::sal::RGWStore* store, rgw::sal::RGWUser* user, optional_yield y);
+extern int rgw_user_sync_all_stats(const DoutPrefixProvider *dpp, rgw::sal::Store* store, rgw::sal::User* user, optional_yield y);
extern int rgw_user_get_all_buckets_stats(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore* store, rgw::sal::RGWUser* user,
+ rgw::sal::Store* store, rgw::sal::User* user,
map<string, cls_user_bucket_entry>& buckets_usage_map, optional_yield y);
/**
*/
struct RGWUserAdminOpState {
// user attributes
- std::unique_ptr<rgw::sal::RGWUser> user;
+ std::unique_ptr<rgw::sal::User> user;
std::string user_email;
std::string display_name;
rgw_user new_user_id;
RGWQuotaInfo& get_user_quota() { return user_quota; }
set<string>& get_mfa_ids() { return mfa_ids; }
- rgw::sal::RGWUser* get_user() { return user.get(); }
+ rgw::sal::User* get_user() { return user.get(); }
const rgw_user& get_user_id();
std::string get_subuser() { return subuser; }
std::string get_access_key() { return id; }
std::string generate_subuser();
- RGWUserAdminOpState(rgw::sal::RGWStore* store);
+ RGWUserAdminOpState(rgw::sal::Store* store);
};
class RGWUser;
std::map<std::string, int, ltstr_nocase> key_type_map;
rgw_user user_id;
- rgw::sal::RGWStore *store{nullptr};
+ rgw::sal::Store *store{nullptr};
map<std::string, RGWAccessKey> *swift_keys{nullptr};
map<std::string, RGWAccessKey> *access_keys{nullptr};
RGWUser *user{nullptr};
rgw_user user_id;
- rgw::sal::RGWStore *store{nullptr};
+ rgw::sal::Store *store{nullptr};
bool subusers_allowed{false};
map<string, RGWSubUser> *subuser_map{nullptr};
private:
RGWUserInfo old_info;
- rgw::sal::RGWStore *store{nullptr};
+ rgw::sal::Store *store{nullptr};
rgw_user user_id;
bool info_stored{false};
public:
RGWUser();
- int init(const DoutPrefixProvider *dpp, rgw::sal::RGWStore *storage, RGWUserAdminOpState& op_state,
+ int init(const DoutPrefixProvider *dpp, rgw::sal::Store *storage, RGWUserAdminOpState& op_state,
optional_yield y);
- int init_storage(rgw::sal::RGWStore *storage);
+ int init_storage(rgw::sal::Store *storage);
int init(const DoutPrefixProvider *dpp, RGWUserAdminOpState& op_state, optional_yield y);
int init_members(RGWUserAdminOpState& op_state);
- rgw::sal::RGWStore *get_store() { return store; }
+ rgw::sal::Store *get_store() { return store; }
/* API Contracted Members */
RGWUserCapPool caps;
class RGWUserAdminOp_User
{
public:
- static int list(rgw::sal::RGWStore *store,
+ static int list(rgw::sal::Store *store,
RGWUserAdminOpState& op_state, RGWFormatterFlusher& flusher);
static int info(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWUserAdminOpState& op_state, RGWFormatterFlusher& flusher,
optional_yield y);
static int create(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWUserAdminOpState& op_state, RGWFormatterFlusher& flusher,
optional_yield y);
static int modify(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWUserAdminOpState& op_state, RGWFormatterFlusher& flusher, optional_yield y);
- static int remove(const DoutPrefixProvider *dpp, rgw::sal::RGWStore *store,
+ static int remove(const DoutPrefixProvider *dpp, rgw::sal::Store *store,
RGWUserAdminOpState& op_state, RGWFormatterFlusher& flusher, optional_yield y);
};
{
public:
static int create(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWUserAdminOpState& op_state, RGWFormatterFlusher& flusher,
optional_yield y);
static int modify(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWUserAdminOpState& op_state, RGWFormatterFlusher& flusher,
optional_yield y);
static int remove(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWUserAdminOpState& op_state, RGWFormatterFlusher& flusher,
optional_yield y);
};
class RGWUserAdminOp_Key
{
public:
- static int create(const DoutPrefixProvider *dpp, rgw::sal::RGWStore *store,
+ static int create(const DoutPrefixProvider *dpp, rgw::sal::Store *store,
RGWUserAdminOpState& op_state, RGWFormatterFlusher& flusher,
optional_yield y);
static int remove(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWUserAdminOpState& op_state, RGWFormatterFlusher& flusher,
optional_yield y);
};
{
public:
static int add(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWUserAdminOpState& op_state, RGWFormatterFlusher& flusher,
optional_yield y);
static int remove(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWUserAdminOpState& op_state, RGWFormatterFlusher& flusher,
optional_yield y);
};
realm_epoch++;
}
-static int read_sync_status(rgw::sal::RGWRadosStore *store, rgw_meta_sync_status *sync_status)
+static int read_sync_status(rgw::sal::RadosStore *store, rgw_meta_sync_status *sync_status)
{
// initialize a sync status manager to read the status
RGWMetaSyncStatusManager mgr(store, store->svc()->rados->get_async_processor());
return r;
}
-int RGWPeriod::update_sync_status(rgw::sal::RGWStore *store, /* for now */
+int RGWPeriod::update_sync_status(rgw::sal::Store *store, /* for now */
const RGWPeriod ¤t_period,
std::ostream& error_stream,
bool force_if_stale)
{
rgw_meta_sync_status status;
- int r = read_sync_status(static_cast<rgw::sal::RGWRadosStore*>(store), &status);
+ int r = read_sync_status(static_cast<rgw::sal::RadosStore*>(store), &status);
if (r < 0) {
ldout(cct, 0) << "period failed to read sync status: "
<< cpp_strerror(-r) << dendl;
}
int RGWPeriod::commit(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWRealm& realm, const RGWPeriod& current_period,
std::ostream& error_stream, optional_yield y,
bool force_if_stale)
const std::string get_period_oid_prefix() const;
// gather the metadata sync status for each shard; only for use on master zone
- int update_sync_status(rgw::sal::RGWStore *store,
+ int update_sync_status(rgw::sal::Store *store,
const RGWPeriod ¤t_period,
std::ostream& error_stream, bool force_if_stale);
// commit a staging period; only for use on master zone
int commit(const DoutPrefixProvider *dpp,
- rgw::sal::RGWStore *store,
+ rgw::sal::Store *store,
RGWRealm& realm, const RGWPeriod ¤t_period,
std::ostream& error_stream, optional_yield y,
bool force_if_stale = false);
TEST_F(IPPolicyTest, IPEnvironment) {
// Unfortunately RGWCivetWeb is too tightly tied to civetweb to test RGWCivetWeb::init_env.
RGWEnv rgw_env;
- rgw::sal::RGWRadosStore store;
- std::unique_ptr<rgw::sal::RGWUser> user = store.get_user(rgw_user());
+ rgw::sal::RadosStore store;
+ std::unique_ptr<rgw::sal::User> user = store.get_user(rgw_user());
rgw_env.set("REMOTE_ADDR", "192.168.1.1");
rgw_env.set("HTTP_HOST", "1.2.3.4");
req_state rgw_req_state(cct.get(), &rgw_env, 0);
}
};
-class TestRGWUser : public sal::RGWUser {
+class TestUser : public sal::User {
public:
- virtual std::unique_ptr<RGWUser> clone() override {
- return std::unique_ptr<RGWUser>(new TestRGWUser(*this));
+ virtual std::unique_ptr<User> clone() override {
+ return std::unique_ptr<User>(new TestUser(*this));
}
- virtual int list_buckets(const DoutPrefixProvider *dpp, const string&, const string&, uint64_t, bool, sal::RGWBucketList&, optional_yield y) override {
+ virtual int list_buckets(const DoutPrefixProvider *dpp, const string&, const string&, uint64_t, bool, sal::BucketList&, optional_yield y) override {
return 0;
}
- virtual sal::RGWBucket* create_bucket(rgw_bucket& bucket, ceph::real_time creation_time) override {
+ virtual sal::Bucket* create_bucket(rgw_bucket& bucket, ceph::real_time creation_time) override {
return nullptr;
}
- virtual int read_attrs(const DoutPrefixProvider *dpp, optional_yield y, sal::RGWAttrs* uattrs, RGWObjVersionTracker* tracker) override {
+ virtual int read_attrs(const DoutPrefixProvider *dpp, optional_yield y, sal::Attrs* uattrs, RGWObjVersionTracker* tracker) override {
return 0;
}
return 0;
}
- virtual ~TestRGWUser() = default;
+ virtual ~TestUser() = default;
};
class TestAccounter : public io::Accounter, public io::BasicClient {
b.name = "myname";
b.marker = "mymarker";
b.bucket_id = "myid";
- s.bucket.reset(new sal::RGWRadosBucket(nullptr, b));
+ s.bucket.reset(new sal::RadosBucket(nullptr, b));
const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, "put_obj", script);
ASSERT_EQ(rc, 0);
rgw_bucket b;
b.name = "my-bucket-name-is-fish";
- s.bucket.reset(new sal::RGWRadosBucket(nullptr, b));
+ s.bucket.reset(new sal::RadosBucket(nullptr, b));
const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, "put_obj", script);
ASSERT_EQ(rc, 0);
end
)";
- auto store = std::unique_ptr<sal::RGWRadosStore>(new sal::RGWRadosStore);
+ auto store = std::unique_ptr<sal::RadosStore>(new sal::RadosStore);
store->setRados(new RGWRados);
auto olog = std::unique_ptr<OpsLogSocket>(new OpsLogSocket(cct, 1024));
ASSERT_TRUE(olog->init(unix_socket_path));
b.name = "name";
b.marker = "marker";
b.bucket_id = "id";
- s.bucket.reset(new sal::RGWRadosBucket(nullptr, b));
+ s.bucket.reset(new sal::RadosBucket(nullptr, b));
s.bucket_name = "name";
s.enable_ops_log = true;
s.enable_usage_log = false;
- s.user.reset(new TestRGWUser());
+ s.user.reset(new TestUser());
TestAccounter ac;
s.cio = ∾
s.cct->_conf->rgw_ops_log_rados = false;