}
auto pos = s.find(':');
- if (pos == string::npos) {
+ if (pos == s.npos) {
return std::nullopt;
}
std::uint32_t _phs;
std::uint32_t _peo;
- auto r = get_meta(dpp, ioctx, oid, nullopt, &_info, &_phs, &_peo, tid, y);
+ auto r = get_meta(dpp, ioctx, oid, std::nullopt, &_info, &_phs, &_peo, tid, y);
if (r < 0) {
ldpp_dout(dpp, -1) << __PRETTY_FUNCTION__ << ":" << __LINE__
<< " get_meta failed: r=" << r << " tid=" << tid << dendl;
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
bool global_stop = false;
static void handle_sigterm(int signum)
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
bool operator==(const ACLPermission& lhs, const ACLPermission& rhs) {
return lhs.flags == rhs.flags;
}
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
- static void generate_test_instances(list<ACLPermission*>& o);
+ static void generate_test_instances(std::list<ACLPermission*>& o);
friend bool operator==(const ACLPermission& lhs, const ACLPermission& rhs);
friend bool operator!=(const ACLPermission& lhs, const ACLPermission& rhs);
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
- static void generate_test_instances(list<ACLGranteeType*>& o);
+ static void generate_test_instances(std::list<ACLGranteeType*>& o);
friend bool operator==(const ACLGranteeType& lhs, const ACLGranteeType& rhs);
friend bool operator!=(const ACLGranteeType& lhs, const ACLGranteeType& rhs);
protected:
ACLGranteeType type;
rgw_user id;
- string email;
+ std::string email;
mutable rgw_user email_id;
ACLPermission permission;
- string name;
+ std::string name;
ACLGroupTypeEnum group;
- string url_spec;
+ std::string url_spec;
public:
ACLGrant() : group(ACL_GROUP_NONE) {}
ACLPermission& get_permission() { return permission; }
const ACLPermission& get_permission() const { return permission; }
ACLGroupTypeEnum get_group() const { return group; }
- const string& get_referer() const { return url_spec; }
+ const std::string& get_referer() const { return url_spec; }
void encode(bufferlist& bl) const {
ENCODE_START(5, 3, bl);
encode(type, bl);
- string s;
+ std::string s;
id.to_str(s);
encode(s, bl);
- string uri;
+ std::string uri;
encode(uri, bl);
encode(email, bl);
encode(permission, bl);
void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(5, 3, 3, bl);
decode(type, bl);
- string s;
+ std::string s;
decode(s, bl);
id.from_str(s);
- string uri;
+ std::string uri;
decode(uri, bl);
decode(email, bl);
decode(permission, bl);
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
- static void generate_test_instances(list<ACLGrant*>& o);
+ static void generate_test_instances(std::list<ACLGrant*>& o);
- ACLGroupTypeEnum uri_to_group(string& uri);
+ ACLGroupTypeEnum uri_to_group(std::string& uri);
- void set_canon(const rgw_user& _id, const string& _name, const uint32_t perm) {
+ void set_canon(const rgw_user& _id, const std::string& _name, const uint32_t perm) {
type.set(ACL_TYPE_CANON_USER);
id = _id;
name = _name;
CephContext *cct;
/* FIXME: in the feature we should consider switching to uint32_t also
* in data structures. */
- map<string, int> acl_user_map;
- map<uint32_t, int> acl_group_map;
- list<ACLReferer> referer_list;
+ std::map<std::string, int> acl_user_map;
+ std::map<uint32_t, int> acl_group_map;
+ std::list<ACLReferer> referer_list;
ACLGrantMap grant_map;
void _add_grant(ACLGrant *grant);
public:
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
- static void generate_test_instances(list<RGWAccessControlList*>& o);
+ static void generate_test_instances(std::list<RGWAccessControlList*>& o);
void add_grant(ACLGrant *grant);
void remove_canon_user_grant(rgw_user& user_id);
ACLGrantMap& get_grant_map() { return grant_map; }
const ACLGrantMap& get_grant_map() const { return grant_map; }
- void create_default(const rgw_user& id, string name) {
+ void create_default(const rgw_user& id, std::string name) {
acl_user_map.clear();
acl_group_map.clear();
referer_list.clear();
{
protected:
rgw_user id;
- string display_name;
+ std::string display_name;
public:
ACLOwner() {}
ACLOwner(const rgw_user& _id) : id(_id) {}
void encode(bufferlist& bl) const {
ENCODE_START(3, 2, bl);
- string s;
+ std::string s;
id.to_str(s);
encode(s, bl);
encode(display_name, bl);
}
void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl);
- string s;
+ std::string s;
decode(s, bl);
id.from_str(s);
decode(display_name, bl);
}
void dump(Formatter *f) const;
void decode_json(JSONObj *obj);
- static void generate_test_instances(list<ACLOwner*>& o);
+ static void generate_test_instances(std::list<ACLOwner*>& o);
void set_id(const rgw_user& _id) { id = _id; }
- void set_name(const string& name) { display_name = name; }
+ void set_name(const std::string& name) { display_name = name; }
rgw_user& get_id() { return id; }
const rgw_user& get_id() const { return id; }
- string& get_display_name() { return display_name; }
- const string& get_display_name() const { return display_name; }
+ std::string& get_display_name() { return display_name; }
+ const std::string& get_display_name() const { return display_name; }
friend bool operator==(const ACLOwner& lhs, const ACLOwner& rhs);
friend bool operator!=(const ACLOwner& lhs, const ACLOwner& rhs);
};
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
- static void generate_test_instances(list<RGWAccessControlPolicy*>& o);
+ static void generate_test_instances(std::list<RGWAccessControlPolicy*>& o);
void decode_owner(bufferlist::const_iterator& bl) { // sometimes we only need that, should be faster
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
decode(owner, bl);
return owner;
}
- void create_default(const rgw_user& id, string& name) {
+ void create_default(const rgw_user& id, std::string& name) {
acl.create_default(id, name);
owner.set_id(id);
owner.set_name(name);
return acl;
}
- virtual bool compare_group_name(string& id, ACLGroupTypeEnum group) { return false; }
+ virtual bool compare_group_name(std::string& id, ACLGroupTypeEnum group) { return false; }
bool is_public(const DoutPrefixProvider *dpp) const;
friend bool operator==(const RGWAccessControlPolicy& lhs, const RGWAccessControlPolicy& rhs);
#define RGW_URI_ALL_USERS "http://acs.amazonaws.com/groups/global/AllUsers"
#define RGW_URI_AUTH_USERS "http://acs.amazonaws.com/groups/global/AuthenticatedUsers"
+using namespace std;
+
static string rgw_uri_all_users = RGW_URI_ALL_USERS;
static string rgw_uri_auth_users = RGW_URI_AUTH_USERS;
~ACLPermission_S3() override {}
bool xml_end(const char *el) override;
- void to_xml(ostream& out);
+ void to_xml(std::ostream& out);
};
class ACLGrantee_S3 : public ACLGrantee, public XMLObj
ACLGrant_S3() {}
~ACLGrant_S3() override {}
- void to_xml(CephContext *cct, ostream& out);
+ void to_xml(CephContext *cct, std::ostream& out);
bool xml_end(const char *el) override;
bool xml_start(const char *el, const char **attr);
- static ACLGroupTypeEnum uri_to_group(string& uri);
- static bool group_to_uri(ACLGroupTypeEnum group, string& uri);
+ static ACLGroupTypeEnum uri_to_group(std::string& uri);
+ static bool group_to_uri(ACLGroupTypeEnum group, std::string& uri);
};
class RGWAccessControlList_S3 : public RGWAccessControlList, public XMLObj
~RGWAccessControlList_S3() override {}
bool xml_end(const char *el) override;
- void to_xml(ostream& out);
+ void to_xml(std::ostream& out);
- int create_canned(ACLOwner& owner, ACLOwner& bucket_owner, const string& canned_acl);
+ int create_canned(ACLOwner& owner, ACLOwner& bucket_owner, const std::string& canned_acl);
int create_from_grants(std::list<ACLGrant>& grants);
};
~ACLOwner_S3() override {}
bool xml_end(const char *el) override;
- void to_xml(ostream& out);
+ void to_xml(std::ostream& out);
};
class RGWEnv;
bool xml_end(const char *el) override;
- void to_xml(ostream& out);
+ void to_xml(std::ostream& out);
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;
+ bool compare_group_name(std::string& id, ACLGroupTypeEnum group) override;
- virtual int create_canned(ACLOwner& _owner, ACLOwner& bucket_owner, const string& canned_acl) {
+ virtual int create_canned(ACLOwner& _owner, ACLOwner& bucket_owner, const std::string& canned_acl) {
RGWAccessControlList_S3& _acl = static_cast<RGWAccessControlList_S3 &>(acl);
if (_owner.get_id() == rgw_user("anonymous")) {
owner = bucket_owner;
#define SWIFT_GROUP_ALL_USERS ".r:*"
+using namespace std;
+
static int parse_list(const char* uid_list,
std::vector<std::string>& uids) /* out */
{
#define SECRET_KEY_LEN 40
#define PUBLIC_ID_LEN 20
+using namespace std;
+
static rgw::sal::Store* store = NULL;
static const DoutPrefixProvider* dpp() {
#include "rgw_common.h"
#include <regex>
+using namespace std;
+
namespace rgw {
namespace {
return boost::context::protected_fixedsize_stack{512*1024};
}
+using namespace std;
+
template <typename Stream>
class StreamIO : public rgw::asio::ClientIO {
CephContext* const cct;
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
namespace rgw {
namespace auth {
virtual uint32_t get_identity_type() const = 0;
/* Name of Account */
- virtual string get_acct_name() const = 0;
+ virtual std::string get_acct_name() const = 0;
/* Subuser of Account */
- virtual string get_subuser() const = 0;
+ virtual std::string get_subuser() const = 0;
- virtual string get_role_tenant() const { return ""; }
+ virtual std::string get_role_tenant() const { return ""; }
};
inline std::ostream& operator<<(std::ostream& out,
protected:
CephContext* const cct;
rgw::sal::Store* store;
- string role_session;
- string role_tenant;
+ std::string role_session;
+ std::string role_tenant;
rgw::web_idp::WebTokenClaims token_claims;
- string get_idp_url() const;
+ std::string get_idp_url() const;
void create_account(const DoutPrefixProvider* dpp,
const rgw_user& acct_user,
- const string& display_name,
+ const std::string& display_name,
RGWUserInfo& user_info) const; /* out */
public:
WebIdentityApplier( CephContext* const cct,
rgw::sal::Store* store,
- const string& role_session,
- const string& role_tenant,
+ const std::string& role_session,
+ const std::string& role_tenant,
const rgw::web_idp::WebTokenClaims& token_claims)
: cct(cct),
store(store),
return TYPE_WEB;
}
- string get_acct_name() const override {
+ std::string get_acct_name() const override {
return token_claims.user_name;
}
- string get_subuser() const override {
+ std::string get_subuser() const override {
return {};
}
virtual aplptr_t create_apl_web_identity( CephContext* cct,
const req_state* s,
- const string& role_session,
- const string& role_tenant,
+ const std::string& role_session,
+ const std::string& role_tenant,
const rgw::web_idp::WebTokenClaims& token) const = 0;
};
};
void to_str(std::ostream& out) const override;
void load_acct_info(const DoutPrefixProvider* dpp, RGWUserInfo& user_info) const override; /* out */
uint32_t get_identity_type() const override { return info.acct_type; }
- string get_acct_name() const override { return info.acct_name; }
- string get_subuser() const override { return {}; }
+ std::string get_acct_name() const override { return info.acct_name; }
+ std::string get_subuser() const override { return {}; }
struct Factory {
virtual ~Factory() {}
void to_str(std::ostream& out) const override;
void load_acct_info(const DoutPrefixProvider* dpp, RGWUserInfo& user_info) const override; /* out */
uint32_t get_identity_type() const override { return TYPE_RGW; }
- string get_acct_name() const override { return {}; }
- string get_subuser() const override { return subuser; }
+ std::string get_acct_name() const override { return {}; }
+ std::string get_subuser() const override { return subuser; }
struct Factory {
virtual ~Factory() {}
class RoleApplier : public IdentityApplier {
public:
struct Role {
- string id;
- string name;
- string tenant;
- vector<string> role_policies;
+ std::string id;
+ std::string name;
+ std::string tenant;
+ std::vector<std::string> role_policies;
} role;
protected:
const rgw_user user_id;
- string token_policy;
- string role_session_name;
- std::vector<string> token_claims;
- string token_issued_at;
+ std::string token_policy;
+ std::string role_session_name;
+ std::vector<std::string> token_claims;
+ std::string token_issued_at;
public:
RoleApplier(CephContext* const cct,
const Role& role,
const rgw_user& user_id,
- const string& token_policy,
- const string& role_session_name,
- const std::vector<string>& token_claims,
- const string& token_issued_at)
+ const std::string& token_policy,
+ const std::string& role_session_name,
+ const std::vector<std::string>& token_claims,
+ const std::string& token_issued_at)
: role(role),
user_id(user_id),
token_policy(token_policy),
void to_str(std::ostream& out) const override;
void load_acct_info(const DoutPrefixProvider* dpp, RGWUserInfo& user_info) const override; /* out */
uint32_t get_identity_type() const override { return TYPE_ROLE; }
- string get_acct_name() const override { return {}; }
- string get_subuser() const override { return {}; }
+ std::string get_acct_name() const override { return {}; }
+ std::string get_subuser() const override { return {}; }
void modify_request_state(const DoutPrefixProvider* dpp, req_state* s) const override;
- string get_role_tenant() const override { return role.tenant; }
+ std::string get_role_tenant() const override { return role.tenant; }
struct Factory {
virtual ~Factory() {}
const rgw_user& user_id,
const std::string& token_policy,
const std::string& role_session,
- const std::vector<string>& token_claims,
+ const std::vector<std::string>& token_claims,
const std::string& token_issued_at) const = 0;
};
};
return get_decoratee().get_identity_type();
}
- string get_acct_name() const override {
+ std::string get_acct_name() const override {
return get_decoratee().get_acct_name();
}
- string get_subuser() const override {
+ std::string get_subuser() const override {
return get_decoratee().get_subuser();
}
get_decoratee().to_str(out);
}
- string get_role_tenant() const override { /* in/out */
+ std::string get_role_tenant() const override { /* in/out */
return get_decoratee().get_role_tenant();
}
#define dout_subsys ceph_subsys_rgw
+using namespace std;
namespace rgw {
namespace auth {
token_envelope_t token;
std::string secret;
utime_t expires;
- list<std::string>::iterator lru_iter;
+ std::list<std::string>::iterator lru_iter;
};
const boost::intrusive_ptr<CephContext> cct;
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
static const auto signed_subresources = {
"acl",
"cors",
bool force_boto2_compat);
std::string gen_v4_canonical_headers(const req_info& info,
- const map<string, string>& extra_headers,
+ const std::map<std::string, std::string>& extra_headers,
string *signed_hdrs);
extern sha256_digest_t
#include "rgw_xml.h"
#include "common/ceph_json.h"
+using std::ostream;
using std::string;
using std::stringstream;
size_t pos = str.find('$');
if (pos != std::string::npos) {
tenant = str.substr(0, pos);
- string_view sv = str;
- string_view ns_id = sv.substr(pos + 1);
+ std::string_view sv = str;
+ std::string_view ns_id = sv.substr(pos + 1);
size_t ns_pos = ns_id.find('$');
if (ns_pos != std::string::npos) {
- ns = string(ns_id.substr(0, ns_pos));
- id = string(ns_id.substr(ns_pos + 1));
+ ns = std::string(ns_id.substr(0, ns_pos));
+ id = std::string(ns_id.substr(ns_pos + 1));
} else {
ns.clear();
- id = string(ns_id);
+ id = std::string(ns_id);
}
} else {
tenant.clear();
return idp_url;
}
- const string& get_role_session() const {
+ const std::string& get_role_session() const {
return u.id;
}
- const string& get_role() const {
+ const std::string& get_role() const {
return u.id;
}
#define BUCKET_TAG_TIMEOUT 30
+using namespace std;
+
// default number of entries to list with each bucket listing call
// (use marker to bridge between calls)
static constexpr size_t listing_max_entries = 1000;
#include "services/svc_bucket_sync.h"
// define as static when RGWBucket implementation completes
-extern void rgw_get_buckets_obj(const rgw_user& user_id, string& buckets_obj_id);
+extern void rgw_get_buckets_obj(const rgw_user& user_id, std::string& buckets_obj_id);
class RGWSI_Meta;
class RGWBucketMetadataHandler;
class RGWZone;
struct RGWZoneParams;
-extern int rgw_bucket_parse_bucket_instance(const string& bucket_instance, string *bucket_name, string *bucket_id, int *shard_id);
-extern int rgw_bucket_parse_bucket_key(CephContext *cct, const string& key,
+extern int rgw_bucket_parse_bucket_instance(const std::string& bucket_instance, std::string *bucket_name, std::string *bucket_id, int *shard_id);
+extern int rgw_bucket_parse_bucket_key(CephContext *cct, const std::string& key,
rgw_bucket* bucket, int *shard_id);
extern std::string rgw_make_bucket_entry_name(const std::string& tenant_name,
const std::string& bucket_name);
-extern void rgw_parse_url_bucket(const string& bucket,
- const string& auth_tenant,
- string &tenant_name, string &bucket_name);
+extern void rgw_parse_url_bucket(const std::string& bucket,
+ const std::string& auth_tenant,
+ std::string &tenant_name, std::string &bucket_name);
// this is used as a filter to RGWRados::cls_bucket_list_ordered; it
// conforms to the type declaration of RGWRados::check_filter_t.
-extern bool rgw_bucket_object_check_filter(const string& oid);
+extern bool rgw_bucket_object_check_filter(const std::string& oid);
void init_default_bucket_layout(CephContext *cct, rgw::BucketLayout& layout,
const RGWZone& zone,
struct RGWBucketCompleteInfo {
RGWBucketInfo info;
- map<string, bufferlist> attrs;
+ std::map<std::string, bufferlist> attrs;
void dump(Formatter *f) const;
void decode_json(JSONObj *obj);
class RGWBucketEntryMetadataObject : public RGWMetadataObject {
RGWBucketEntryPoint ep;
- map<string, bufferlist> attrs;
+ std::map<std::string, bufferlist> attrs;
public:
RGWBucketEntryMetadataObject(RGWBucketEntryPoint& _ep, const obj_version& v, real_time m) : ep(_ep) {
objv = v;
mtime = m;
set_pattrs (&attrs);
}
- RGWBucketEntryMetadataObject(RGWBucketEntryPoint& _ep, const obj_version& v, real_time m, std::map<string, bufferlist>&& _attrs) :
+ RGWBucketEntryMetadataObject(RGWBucketEntryPoint& _ep, const obj_version& v, real_time m, std::map<std::string, bufferlist>&& _attrs) :
ep(_ep), attrs(std::move(_attrs)) {
objv = v;
mtime = m;
return ep;
}
- map<string, bufferlist>& get_attrs() {
+ std::map<std::string, bufferlist>& get_attrs() {
return attrs;
}
};
/**
* Check if the user owns a bucket by the given name.
*/
- bool owns(string& name) {
- map<string, RGWBucketEnt>::iterator iter;
+ bool owns(std::string& name) {
+ std::map<std::string, RGWBucketEnt>::iterator iter;
iter = buckets.find(name);
return (iter != buckets.end());
}
/**
* Remove a bucket from the user's list by name.
*/
- void remove(const string& name) {
- map<string, RGWBucketEnt>::iterator iter;
+ void remove(const std::string& name) {
+ std::map<std::string, RGWBucketEnt>::iterator iter;
iter = buckets.find(name);
if (iter != buckets.end()) {
buckets.erase(iter);
/**
* Get the user's buckets as a map.
*/
- map<string, RGWBucketEnt>& get_buckets() { return buckets; }
+ std::map<std::string, RGWBucketEnt>& get_buckets() { return buckets; }
/**
* Cleanup data structure
bucket_stored = true;
}
- void set_bucket_id(const string& bi) {
+ void set_bucket_id(const std::string& bi) {
bucket_id = bi;
}
- const string& get_bucket_id() { return bucket_id; }
+ const std::string& get_bucket_id() { return bucket_id; }
bool will_fetch_stats() { return stat_buckets; }
bool will_fix_index() { return fix_index; }
int check_index(const DoutPrefixProvider *dpp,
RGWBucketAdminOpState& op_state,
- map<RGWObjCategory, RGWStorageStats>& existing_stats,
- map<RGWObjCategory, RGWStorageStats>& calculated_stats,
+ std::map<RGWObjCategory, RGWStorageStats>& existing_stats,
+ std::map<RGWObjCategory, RGWStorageStats>& calculated_stats,
std::string *err_msg = NULL);
- int chown(RGWBucketAdminOpState& op_state, const string& marker,
+ int chown(RGWBucketAdminOpState& op_state, const std::string& marker,
optional_yield y, const DoutPrefixProvider *dpp, std::string *err_msg = NULL);
int set_quota(RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp, std::string *err_msg = NULL);
int remove_object(const DoutPrefixProvider *dpp, RGWBucketAdminOpState& op_state, std::string *err_msg = NULL);
- int policy_bl_to_stream(bufferlist& bl, ostream& o);
+ int policy_bl_to_stream(bufferlist& bl, std::ostream& o);
int get_policy(RGWBucketAdminOpState& op_state, RGWAccessControlPolicy& policy, optional_yield y, const DoutPrefixProvider *dpp);
int sync(RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp, std::string *err_msg = NULL);
static int get_policy(rgw::sal::Store* store, RGWBucketAdminOpState& op_state,
RGWAccessControlPolicy& policy, const DoutPrefixProvider *dpp);
static int dump_s3_policy(rgw::sal::Store* store, RGWBucketAdminOpState& op_state,
- ostream& os, const DoutPrefixProvider *dpp);
+ std::ostream& os, const DoutPrefixProvider *dpp);
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 link(rgw::sal::Store* store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp, std::string *err_msg = NULL);
+ static int chown(rgw::sal::Store* store, RGWBucketAdminOpState& op_state, const std::string& marker, const DoutPrefixProvider *dpp, std::string *err_msg = NULL);
static int check_index(rgw::sal::Store* store, RGWBucketAdminOpState& op_state,
RGWFormatterFlusher& flusher, optional_yield y, const DoutPrefixProvider *dpp);
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::Store* 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, std::string *err_msg = NULL);
};
struct rgw_ep_info {
RGWBucketEntryPoint &ep;
- map<std::string, buffer::list>& attrs;
+ std::map<std::string, buffer::list>& attrs;
RGWObjVersionTracker ep_objv;
- rgw_ep_info(RGWBucketEntryPoint &ep, map<string, bufferlist>& attrs)
+ rgw_ep_info(RGWBucketEntryPoint &ep, std::map<std::string, bufferlist>& attrs)
: ep(ep), attrs(attrs) {}
};
struct GetParams {
RGWObjVersionTracker *objv_tracker{nullptr};
real_time *mtime{nullptr};
- map<string, bufferlist> *attrs{nullptr};
+ std::map<std::string, bufferlist> *attrs{nullptr};
rgw_cache_entry_info *cache_info{nullptr};
boost::optional<obj_version> refresh_version;
std::optional<RGWSI_MetaBackend_CtxParams> bectx_params;
return *this;
}
- GetParams& set_attrs(map<string, bufferlist> *_attrs) {
+ GetParams& set_attrs(std::map<std::string, bufferlist> *_attrs) {
attrs = _attrs;
return *this;
}
RGWObjVersionTracker *objv_tracker{nullptr};
ceph::real_time mtime;
bool exclusive{false};
- map<string, bufferlist> *attrs{nullptr};
+ std::map<std::string, bufferlist> *attrs{nullptr};
PutParams() {}
return *this;
}
- PutParams& set_attrs(map<string, bufferlist> *_attrs) {
+ PutParams& set_attrs(std::map<std::string, bufferlist> *_attrs) {
attrs = _attrs;
return *this;
}
struct BucketInstance {
struct GetParams {
real_time *mtime{nullptr};
- map<string, bufferlist> *attrs{nullptr};
+ std::map<std::string, bufferlist> *attrs{nullptr};
rgw_cache_entry_info *cache_info{nullptr};
boost::optional<obj_version> refresh_version;
RGWObjVersionTracker *objv_tracker{nullptr};
return *this;
}
- GetParams& set_attrs(map<string, bufferlist> *_attrs) {
+ GetParams& set_attrs(std::map<std::string, bufferlist> *_attrs) {
attrs = _attrs;
return *this;
}
nullptr: orig_info was not found (new bucket instance */
ceph::real_time mtime;
bool exclusive{false};
- map<string, bufferlist> *attrs{nullptr};
+ std::map<std::string, bufferlist> *attrs{nullptr};
RGWObjVersionTracker *objv_tracker{nullptr};
PutParams() {}
return *this;
}
- PutParams& set_attrs(map<string, bufferlist> *_attrs) {
+ PutParams& set_attrs(std::map<std::string, bufferlist> *_attrs) {
attrs = _attrs;
return *this;
}
int set_bucket_instance_attrs(RGWBucketInfo& bucket_info,
- map<string, bufferlist>& attrs,
+ std::map<std::string, bufferlist>& attrs,
RGWObjVersionTracker *objv_tracker,
optional_yield y,
const DoutPrefixProvider *dpp);
const rgw_user& user_id, const std::string& display_name,
const std::string& marker, optional_yield y, const DoutPrefixProvider *dpp);
- int read_buckets_stats(map<string, RGWBucketEnt>& m,
+ int read_buckets_stats(std::map<std::string, RGWBucketEnt>& m,
optional_yield y,
const DoutPrefixProvider *dpp);
RGWBucketInfo *orig_info,
bool exclusive, real_time mtime,
obj_version *pep_objv,
- map<string, bufferlist> *pattrs,
+ std::map<std::string, bufferlist> *pattrs,
bool create_entry_point,
optional_yield,
const DoutPrefixProvider *dpp);
};
-bool rgw_find_bucket_by_id(const DoutPrefixProvider *dpp, CephContext *cct, rgw::sal::Store* store, const string& marker,
- const string& bucket_id, rgw_bucket* bucket_out);
+bool rgw_find_bucket_by_id(const DoutPrefixProvider *dpp, CephContext *cct, rgw::sal::Store* store, const std::string& marker,
+ const std::string& bucket_id, rgw_bucket* bucket_out);
class ApplyServerSideEncryptionByDefault
{
- string kmsMasterKeyID;
- string sseAlgorithm;
+ std::string kmsMasterKeyID;
+ std::string sseAlgorithm;
public:
ApplyServerSideEncryptionByDefault(): kmsMasterKeyID(""), sseAlgorithm("") {};
- const string& kms_master_key_id() const {
+ const std::string& kms_master_key_id() const {
return kmsMasterKeyID;
}
- const string& sse_algorithm() const {
+ const std::string& sse_algorithm() const {
return sseAlgorithm;
}
public:
ServerSideEncryptionConfiguration(): bucketKeyEnabled(false) {};
- const string& kms_master_key_id() const {
+ const std::string& kms_master_key_id() const {
return applyServerSideEncryptionByDefault.kms_master_key_id();
}
- const string& sse_algorithm() const {
+ const std::string& sse_algorithm() const {
return applyServerSideEncryptionByDefault.sse_algorithm();
}
public:
RGWBucketEncryptionConfig(): rule_exist(false) {}
- const string& kms_master_key_id() const {
+ const std::string& kms_master_key_id() const {
return rule.kms_master_key_id();
}
- const string& sse_algorithm() const {
+ const std::string& sse_algorithm() const {
return rule.sse_algorithm();
}
#define dout_subsys ceph_subsys_rgw
+using namespace std;
ostream& operator<<(ostream& os, const rgw_sync_bucket_entity& e) {
os << "{b=" << rgw_sync_bucket_entities::bucket_key(e.bucket) << ",z=" << e.zone.value_or(rgw_zone_id()) << ",az=" << (int)e.all_zones << "}";
const std::vector<rgw_sync_bucket_pipes>& pipes,
CB filter_cb);
- pair<zb_pipe_map_t::const_iterator, zb_pipe_map_t::const_iterator> find_pipes(const zb_pipe_map_t& m,
+ std::pair<zb_pipe_map_t::const_iterator, zb_pipe_map_t::const_iterator> find_pipes(const zb_pipe_map_t& m,
const rgw_zone_id& zone,
std::optional<rgw_bucket> b) const;
/*
* find all relevant pipes in our zone that match {dest_bucket} <- {source_zone, source_bucket}
*/
- vector<rgw_sync_bucket_pipe> find_source_pipes(const rgw_zone_id& source_zone,
+ std::vector<rgw_sync_bucket_pipe> find_source_pipes(const rgw_zone_id& source_zone,
std::optional<rgw_bucket> source_bucket,
std::optional<rgw_bucket> dest_bucket) const;
* find all relevant pipes in other zones that pull from a specific
* source bucket in out zone {source_bucket} -> {dest_zone, dest_bucket}
*/
- vector<rgw_sync_bucket_pipe> find_dest_pipes(std::optional<rgw_bucket> source_bucket,
+ std::vector<rgw_sync_bucket_pipe> find_dest_pipes(std::optional<rgw_bucket> source_bucket,
const rgw_zone_id& dest_zone,
std::optional<rgw_bucket> dest_bucket) const;
/*
* find all relevant pipes from {source_zone, source_bucket} -> {dest_zone, dest_bucket}
*/
- vector<rgw_sync_bucket_pipe> find_pipes(const rgw_zone_id& source_zone,
+ std::vector<rgw_sync_bucket_pipe> find_pipes(const rgw_zone_id& source_zone,
std::optional<rgw_bucket> source_bucket,
const rgw_zone_id& dest_zone,
std::optional<rgw_bucket> dest_bucket) const;
std::list<rgw_sync_bucket_pipe> pipes;
public:
- using prefix_map_t = multimap<string, rgw_sync_bucket_pipe *>;
+ using prefix_map_t = std::multimap<std::string, rgw_sync_bucket_pipe *>;
- map<string, rgw_sync_bucket_pipe *> tag_refs;
+ std::map<std::string, rgw_sync_bucket_pipe *> tag_refs;
prefix_map_t prefix_refs;
void insert(const rgw_sync_bucket_pipe& pipe);
bool find_basic_info_without_tags(const rgw_obj_key& key,
std::optional<rgw_user> *user,
std::optional<rgw_user> *acl_translation,
- std::optional<string> *storage_class,
+ std::optional<std::string> *storage_class,
rgw_sync_pipe_params::Mode *mode,
bool *need_more_info) const;
bool find_obj_params(const rgw_obj_key& key,
const RGWObjTags::tag_map_t& tags,
rgw_sync_pipe_params *params) const;
- void scan_prefixes(std::vector<string> *prefixes) const;
+ void scan_prefixes(std::vector<std::string> *prefixes) const;
prefix_map_t::const_iterator prefix_begin() const {
return prefix_refs.begin();
bool find_basic_info_without_tags(const rgw_obj_key& key,
std::optional<rgw_user> *user,
std::optional<rgw_user> *acl_translation,
- std::optional<string> *storage_class,
+ std::optional<std::string> *storage_class,
rgw_sync_pipe_params::Mode *mode,
bool *need_more_info) const {
if (!rules) {
struct pipe_set {
std::map<endpoints_pair, pipe_rules_ref> rules;
- std::multimap<string, rgw_sync_bucket_pipe> pipe_map;
+ std::multimap<std::string, rgw_sync_bucket_pipe> pipe_map;
std::set<pipe_handler> handlers;
const RGWBucketSyncFlowManager *parent{nullptr};
- map<string, rgw_sync_group_pipe_map> flow_groups;
+ std::map<std::string, rgw_sync_group_pipe_map> flow_groups;
std::set<rgw_zone_id> all_zones;
};
-static inline ostream& operator<<(ostream& os, const RGWBucketSyncFlowManager::endpoints_pair& e) {
+static inline std::ostream& operator<<(std::ostream& os, const RGWBucketSyncFlowManager::endpoints_pair& e) {
os << e.dest << " -> " << e.source;
return os;
}
RGWSI_Bucket_Sync *bucket_sync_svc;
rgw_zone_id zone_id;
std::optional<RGWBucketInfo> bucket_info;
- std::optional<map<string, bufferlist> > bucket_attrs;
+ std::optional<std::map<std::string, bufferlist> > bucket_attrs;
std::optional<rgw_bucket> bucket;
std::unique_ptr<RGWBucketSyncFlowManager> flow_mgr;
rgw_sync_policy_info sync_policy;
RGWBucketSyncFlowManager::pipe_set source_pipes;
RGWBucketSyncFlowManager::pipe_set target_pipes;
- map<rgw_zone_id, RGWBucketSyncFlowManager::pipe_set> sources; /* source pipes by source zone id */
- map<rgw_zone_id, RGWBucketSyncFlowManager::pipe_set> targets; /* target pipes by target zone id */
+ std::map<rgw_zone_id, RGWBucketSyncFlowManager::pipe_set> sources; /* source pipes by source zone id */
+ std::map<rgw_zone_id, RGWBucketSyncFlowManager::pipe_set> targets; /* target pipes by target zone id */
std::set<rgw_zone_id> source_zones;
std::set<rgw_zone_id> target_zones;
RGWBucketSyncPolicyHandler(const RGWBucketSyncPolicyHandler *_parent,
const RGWBucketInfo& _bucket_info,
- map<string, bufferlist>&& _bucket_attrs);
+ std::map<std::string, bufferlist>&& _bucket_attrs);
RGWBucketSyncPolicyHandler(const RGWBucketSyncPolicyHandler *_parent,
const rgw_bucket& _bucket,
std::optional<rgw_zone_id> effective_zone = std::nullopt);
RGWBucketSyncPolicyHandler *alloc_child(const RGWBucketInfo& bucket_info,
- map<string, bufferlist>&& bucket_attrs) const;
+ std::map<std::string, bufferlist>&& bucket_attrs) const;
RGWBucketSyncPolicyHandler *alloc_child(const rgw_bucket& bucket,
std::optional<rgw_sync_policy_info> sync_policy) const;
void reflect(const DoutPrefixProvider *dpp, RGWBucketSyncFlowManager::pipe_set *psource_pipes,
RGWBucketSyncFlowManager::pipe_set *ptarget_pipes,
- map<rgw_zone_id, RGWBucketSyncFlowManager::pipe_set> *psources,
- map<rgw_zone_id, RGWBucketSyncFlowManager::pipe_set> *ptargets,
+ std::map<rgw_zone_id, RGWBucketSyncFlowManager::pipe_set> *psources,
+ std::map<rgw_zone_id, RGWBucketSyncFlowManager::pipe_set> *ptargets,
std::set<rgw_zone_id> *psource_zones,
std::set<rgw_zone_id> *ptarget_zones,
bool only_enabled) const;
return target_zones;
}
- const map<rgw_zone_id, RGWBucketSyncFlowManager::pipe_set>& get_sources() {
+ const std::map<rgw_zone_id, RGWBucketSyncFlowManager::pipe_set>& get_sources() {
return sources;
}
- multimap<rgw_zone_id, rgw_sync_bucket_pipe> get_all_sources() const;
- multimap<rgw_zone_id, rgw_sync_bucket_pipe> get_all_dests() const;
- multimap<rgw_zone_id, rgw_sync_bucket_pipe> get_all_dests_in_zone(const rgw_zone_id& zone_id) const;
+ std::multimap<rgw_zone_id, rgw_sync_bucket_pipe> get_all_sources() const;
+ std::multimap<rgw_zone_id, rgw_sync_bucket_pipe> get_all_dests() const;
+ std::multimap<rgw_zone_id, rgw_sync_bucket_pipe> get_all_dests_in_zone(const rgw_zone_id& zone_id) const;
- const map<rgw_zone_id, RGWBucketSyncFlowManager::pipe_set>& get_targets() {
+ const std::map<rgw_zone_id, RGWBucketSyncFlowManager::pipe_set>& get_targets() {
return targets;
}
return bucket_info;
}
- const std::optional<map<string, bufferlist> >& get_bucket_attrs() const {
+ const std::optional<std::map<std::string, bufferlist> >& get_bucket_attrs() const {
return bucket_attrs;
}
#define dout_subsys ceph_subsys_rgw
+using namespace std;
int ObjectCache::get(const DoutPrefixProvider *dpp, const string& name, ObjectCacheInfo& info, uint32_t mask, rgw_cache_entry_info *cache_info)
{
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
- static void generate_test_instances(list<ObjectMetaInfo*>& o);
+ static void generate_test_instances(std::list<ObjectMetaInfo*>& o);
};
WRITE_CLASS_ENCODER(ObjectMetaInfo)
uint32_t flags = 0;
uint64_t epoch = 0;
bufferlist data;
- map<string, bufferlist> xattrs;
- map<string, bufferlist> rm_xattrs;
+ std::map<std::string, bufferlist> xattrs;
+ std::map<std::string, bufferlist> rm_xattrs;
ObjectMetaInfo meta;
obj_version version = {};
ceph::coarse_mono_time time_added;
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
- static void generate_test_instances(list<ObjectCacheInfo*>& o);
+ static void generate_test_instances(std::list<ObjectCacheInfo*>& o);
};
WRITE_CLASS_ENCODER(ObjectCacheInfo)
rgw_raw_obj obj;
ObjectCacheInfo obj_info;
off_t ofs;
- string ns;
+ std::string ns;
RGWCacheNotifyInfo() : op(0), ofs(0) {}
DECODE_FINISH(ibl);
}
void dump(Formatter *f) const;
- static void generate_test_instances(list<RGWCacheNotifyInfo*>& o);
+ static void generate_test_instances(std::list<RGWCacheNotifyInfo*>& o);
};
WRITE_CLASS_ENCODER(RGWCacheNotifyInfo)
inline std::ostream& operator <<(std::ostream& m, const RGWCacheNotifyInfo& cni) {
class RGWChainedCache {
public:
virtual ~RGWChainedCache() {}
- virtual void chain_cb(const string& key, void *data) = 0;
- virtual void invalidate(const string& key) = 0;
+ virtual void chain_cb(const std::string& key, void *data) = 0;
+ virtual void invalidate(const std::string& key) = 0;
virtual void invalidate_all() = 0;
virtual void unregistered() {}
struct Entry {
RGWChainedCache *cache;
- const string& key;
+ const std::string& key;
void *data;
- Entry(RGWChainedCache *_c, const string& _k, void *_d) : cache(_c), key(_k), data(_d) {}
+ Entry(RGWChainedCache *_c, const std::string& _k, void *_d) : cache(_c), key(_k), data(_d) {}
};
};
struct ObjectCacheEntry {
ObjectCacheInfo info;
- std::list<string>::iterator lru_iter;
+ std::list<std::string>::iterator lru_iter;
uint64_t lru_promotion_ts;
uint64_t gen;
- std::vector<pair<RGWChainedCache *, string> > chained_entries;
+ std::vector<std::pair<RGWChainedCache *, std::string> > chained_entries;
ObjectCacheEntry() : lru_promotion_ts(0), gen(0) {}
};
class ObjectCache {
- std::unordered_map<string, ObjectCacheEntry> cache_map;
- std::list<string> lru;
+ std::unordered_map<std::string, ObjectCacheEntry> cache_map;
+ std::list<std::string> lru;
unsigned long lru_size;
unsigned long lru_counter;
unsigned long lru_window;
ceph::shared_mutex lock = ceph::make_shared_mutex("ObjectCache");
CephContext *cct;
- vector<RGWChainedCache *> chained_cache;
+ std::vector<RGWChainedCache *> chained_cache;
bool enabled;
ceph::timespan expiry;
- void touch_lru(const DoutPrefixProvider *dpp, const string& name, ObjectCacheEntry& entry,
- std::list<string>::iterator& lru_iter);
- void remove_lru(const string& name, std::list<string>::iterator& lru_iter);
+ void touch_lru(const DoutPrefixProvider *dpp, const std::string& name, ObjectCacheEntry& entry,
+ std::list<std::string>::iterator& lru_iter);
+ void remove_lru(const std::string& name, std::list<std::string>::iterator& lru_iter);
void invalidate_lru(ObjectCacheEntry& entry);
void do_invalidate_all();
public:
explicit RGWClientIOStream(RGWRestfulIO &s)
: RGWClientIOStreamBuf(s, 1, 2),
- istream(static_cast<RGWClientIOStreamBuf *>(this)) {
+ std::istream(static_cast<RGWClientIOStreamBuf *>(this)) {
}
};
{ ERR_INTERNAL_ERROR, {500, "ServiceFailure" }},
});
+using namespace std;
using namespace ceph::crypto;
rgw_err::
}
/** parse the received arguments */
int parse(const DoutPrefixProvider *dpp);
- void append(const std::string& name, const string& val);
+ void append(const std::string& name, const std::string& val);
/** Get the value for a specific argument parameter */
- const string& get(const std::string& name, bool *exists = NULL) const;
+ const std::string& get(const std::string& name, bool *exists = NULL) const;
boost::optional<const std::string&>
get_optional(const std::string& name) const;
int get_bool(const std::string& name, bool *val, bool *exists);
}
}; // RGWHTTPArgs
-const char *rgw_conf_get(const map<string, string, ltstr_nocase>& conf_map, const char *name, const char *def_val);
-int rgw_conf_get_int(const map<string, string, ltstr_nocase>& conf_map, const char *name, int def_val);
-bool rgw_conf_get_bool(const map<string, string, ltstr_nocase>& conf_map, const char *name, bool def_val);
+const char *rgw_conf_get(const std::map<std::string, std::string, ltstr_nocase>& conf_map, const char *name, const char *def_val);
+int rgw_conf_get_int(const std::map<std::string, std::string, ltstr_nocase>& conf_map, const char *name, int def_val);
+bool rgw_conf_get_bool(const std::map<std::string, std::string, ltstr_nocase>& conf_map, const char *name, bool def_val);
class RGWEnv;
};
class RGWEnv {
- std::map<string, string, ltstr_nocase> env_map;
+ std::map<std::string, std::string, ltstr_nocase> env_map;
RGWConf conf;
public:
void init(CephContext *cct);
bool exists(const char *name) const;
bool exists_prefix(const char *prefix) const;
void remove(const char *name);
- const std::map<string, string, ltstr_nocase>& get_map() const { return env_map; }
+ const std::map<std::string, std::string, ltstr_nocase>& get_map() const { return env_map; }
int get_enable_ops_log() const {
return conf.enable_ops_log;
}
class JSONObj;
struct RGWAccessKey {
- string id; // AccessKey
- string key; // SecretKey
- string subuser;
+ std::string id; // AccessKey
+ std::string key; // SecretKey
+ std::string subuser;
RGWAccessKey() {}
RGWAccessKey(std::string _id, std::string _key)
}
void dump(Formatter *f) const;
void dump_plain(Formatter *f) const;
- void dump(Formatter *f, const string& user, bool swift) const;
- static void generate_test_instances(list<RGWAccessKey*>& o);
+ void dump(Formatter *f, const std::string& user, bool swift) const;
+ static void generate_test_instances(std::list<RGWAccessKey*>& o);
void decode_json(JSONObj *obj);
void decode_json(JSONObj *obj, bool swift);
WRITE_CLASS_ENCODER(RGWAccessKey)
struct RGWSubUser {
- string name;
+ std::string name;
uint32_t perm_mask;
RGWSubUser() : perm_mask(0) {}
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
- void dump(Formatter *f, const string& user) const;
- static void generate_test_instances(list<RGWSubUser*>& o);
+ void dump(Formatter *f, const std::string& user) const;
+ static void generate_test_instances(std::list<RGWSubUser*>& o);
void decode_json(JSONObj *obj);
};
class RGWUserCaps
{
- map<string, uint32_t> caps;
+ std::map<std::string, uint32_t> caps;
- int get_cap(const string& cap, string& type, uint32_t *perm);
- int add_cap(const string& cap);
- int remove_cap(const string& cap);
+ int get_cap(const std::string& cap, std::string& type, uint32_t *perm);
+ int add_cap(const std::string& cap);
+ int remove_cap(const std::string& cap);
public:
- static int parse_cap_perm(const string& str, uint32_t *perm);
- int add_from_string(const string& str);
- int remove_from_string(const string& str);
+ static int parse_cap_perm(const std::string& str, uint32_t *perm);
+ int add_from_string(const std::string& str);
+ int remove_from_string(const std::string& str);
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
decode(caps, bl);
DECODE_FINISH(bl);
}
- int check_cap(const string& cap, uint32_t perm) const;
- bool is_valid_cap_type(const string& tp);
+ int check_cap(const std::string& cap, uint32_t perm) const;
+ bool is_valid_cap_type(const std::string& tp);
void dump(Formatter *f) const;
void dump(Formatter *f, const char *name) const;
TYPE_WEB=5,
};
-static string RGW_STORAGE_CLASS_STANDARD = "STANDARD";
+static std::string RGW_STORAGE_CLASS_STANDARD = "STANDARD";
struct rgw_placement_rule {
std::string name;
std::string storage_class;
rgw_placement_rule() {}
- rgw_placement_rule(const string& _n, const string& _sc) : name(_n), storage_class(_sc) {}
- rgw_placement_rule(const rgw_placement_rule& _r, const string& _sc) : name(_r.name) {
+ rgw_placement_rule(const std::string& _n, const std::string& _sc) : name(_n), storage_class(_sc) {}
+ rgw_placement_rule(const rgw_placement_rule& _r, const std::string& _sc) : name(_r.name) {
if (!_sc.empty()) {
storage_class = _sc;
} else {
storage_class.clear();
}
- void init(const string& n, const string& c) {
+ void init(const std::string& n, const std::string& c) {
name = n;
storage_class = c;
}
- static const string& get_canonical_storage_class(const string& storage_class) {
+ static const std::string& get_canonical_storage_class(const std::string& storage_class) {
if (storage_class.empty()) {
return RGW_STORAGE_CLASS_STANDARD;
}
return storage_class;
}
- const string& get_storage_class() const {
+ const std::string& get_storage_class() const {
return get_canonical_storage_class(storage_class);
}
void encode_json(const char *name, const rgw_placement_rule& val, ceph::Formatter *f);
void decode_json_obj(rgw_placement_rule& v, JSONObj *obj);
-inline ostream& operator<<(ostream& out, const rgw_placement_rule& rule) {
+inline std::ostream& operator<<(std::ostream& out, const rgw_placement_rule& rule) {
return out << rule.to_str();
}
struct RGWUserInfo
{
rgw_user user_id;
- string display_name;
- string user_email;
- map<string, RGWAccessKey> access_keys;
- map<string, RGWAccessKey> swift_keys;
- map<string, RGWSubUser> subusers;
+ std::string display_name;
+ std::string user_email;
+ std::map<std::string, RGWAccessKey> access_keys;
+ std::map<std::string, RGWAccessKey> swift_keys;
+ std::map<std::string, RGWSubUser> subusers;
__u8 suspended;
int32_t max_buckets;
uint32_t op_mask;
__u8 admin;
__u8 system;
rgw_placement_rule default_placement;
- list<string> placement_tags;
+ std::list<std::string> placement_tags;
RGWQuotaInfo bucket_quota;
- map<int, string> temp_url_keys;
+ std::map<int, std::string> temp_url_keys;
RGWQuotaInfo user_quota;
uint32_t type;
- set<string> mfa_ids;
- string assumed_role_arn;
+ std::set<std::string> mfa_ids;
+ std::string assumed_role_arn;
RGWUserInfo()
: suspended(0),
type(TYPE_NONE) {
}
- RGWAccessKey* get_key(const string& access_key) {
+ RGWAccessKey* get_key(const std::string& access_key) {
if (access_keys.empty())
return nullptr;
void encode(bufferlist& bl) const {
ENCODE_START(22, 9, bl);
encode((uint64_t)0, bl); // old auid
- string access_key;
- string secret_key;
+ std::string access_key;
+ std::string secret_key;
if (!access_keys.empty()) {
- map<string, RGWAccessKey>::const_iterator iter = access_keys.begin();
+ std::map<std::string, RGWAccessKey>::const_iterator iter = access_keys.begin();
const RGWAccessKey& k = iter->second;
access_key = k.id;
secret_key = k.key;
encode(secret_key, bl);
encode(display_name, bl);
encode(user_email, bl);
- string swift_name;
- string swift_key;
+ std::string swift_name;
+ std::string swift_key;
if (!swift_keys.empty()) {
- map<string, RGWAccessKey>::const_iterator iter = swift_keys.begin();
+ std::map<std::string, RGWAccessKey>::const_iterator iter = swift_keys.begin();
const RGWAccessKey& k = iter->second;
swift_name = k.id;
swift_key = k.key;
uint64_t old_auid;
decode(old_auid, bl);
}
- string access_key;
- string secret_key;
+ std::string access_key;
+ std::string secret_key;
decode(access_key, bl);
decode(secret_key, bl);
if (struct_v < 6) {
decode(display_name, bl);
decode(user_email, bl);
/* We populate swift_keys map later nowadays, but we have to decode. */
- string swift_name;
- string swift_key;
+ std::string swift_name;
+ std::string swift_key;
if (struct_v >= 3) decode(swift_name, bl);
if (struct_v >= 4) decode(swift_key, bl);
if (struct_v >= 5)
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
- static void generate_test_instances(list<RGWUserInfo*>& o);
+ static void generate_test_instances(std::list<RGWUserInfo*>& o);
void decode_json(JSONObj *obj);
};
rgw_raw_obj(const rgw_pool& _pool, const std::string& _oid) {
init(_pool, _oid);
}
- rgw_raw_obj(const rgw_pool& _pool, const std::string& _oid, const string& _loc) : loc(_loc) {
+ rgw_raw_obj(const rgw_pool& _pool, const std::string& _oid, const std::string& _loc) : loc(_loc) {
init(_pool, _oid);
}
};
WRITE_CLASS_ENCODER(rgw_raw_obj)
-inline ostream& operator<<(ostream& out, const rgw_raw_obj& o) {
+inline std::ostream& operator<<(std::ostream& out, const rgw_raw_obj& o) {
out << o.pool << ":" << o.oid;
return out;
}
void generate_new_write_ver(CephContext *cct);
};
-inline ostream& operator<<(ostream& out, const obj_version &v)
+inline std::ostream& operator<<(std::ostream& out, const obj_version &v)
{
out << v.tag << ":" << v.ver;
return out;
}
-inline ostream& operator<<(ostream& out, const RGWObjVersionTracker &ot)
+inline std::ostream& operator<<(std::ostream& out, const RGWObjVersionTracker &ot)
{
out << "{r=" << ot.read_version << ",w=" << ot.write_version << "}";
return out;
rgw_bucket bucket;
rgw_user owner;
uint32_t flags{0};
- string zonegroup;
+ std::string zonegroup;
ceph::real_time creation_time;
rgw_placement_rule placement_rule;
bool has_instance_obj{false};
RGWBucketWebsiteConf website_conf;
bool swift_versioning{false};
- string swift_ver_location;
+ std::string swift_ver_location;
- map<string, uint32_t> mdsearch_config;
+ std::map<std::string, uint32_t> mdsearch_config;
// resharding
cls_rgw_reshard_status reshard_status{cls_rgw_reshard_status::NOT_RESHARDING};
- string new_bucket_instance_id;
+ std::string new_bucket_instance_id;
RGWObjectLock obj_lock;
void decode(bufferlist::const_iterator& bl);
void dump(Formatter *f) const;
- static void generate_test_instances(list<RGWBucketInfo*>& o);
+ static void generate_test_instances(std::list<RGWBucketInfo*>& o);
void decode_json(JSONObj *obj);
void dump(Formatter *f) const;
void decode_json(JSONObj *obj);
- static void generate_test_instances(list<RGWBucketEntryPoint*>& o);
+ static void generate_test_instances(std::list<RGWBucketEntryPoint*>& o);
};
WRITE_CLASS_ENCODER(RGWBucketEntryPoint)
RGWHTTPArgs args;
meta_map_t x_meta_map;
- string host;
+ std::string host;
const char *method;
- string script_uri;
- string request_uri;
- string request_uri_aws4;
- string effective_uri;
- string request_params;
- string domain;
- string storage_class;
+ std::string script_uri;
+ std::string request_uri;
+ std::string request_uri_aws4;
+ std::string effective_uri;
+ std::string request_params;
+ std::string domain;
+ std::string storage_class;
req_info(CephContext *cct, const RGWEnv *env);
void rebuild_from(req_info& src);
typedef cls_rgw_obj_key rgw_obj_index_key;
struct rgw_obj_key {
- string name;
- string instance;
- string ns;
+ std::string name;
+ std::string instance;
+ std::string ns;
rgw_obj_key() {}
// cppcheck-suppress noExplicitConstructor
- rgw_obj_key(const string& n) : name(n) {}
- rgw_obj_key(const string& n, const string& i) : name(n), instance(i) {}
- rgw_obj_key(const string& n, const string& i, const string& _ns) : name(n), instance(i), ns(_ns) {}
+ rgw_obj_key(const std::string& n) : name(n) {}
+ rgw_obj_key(const std::string& n, const std::string& i) : name(n), instance(i) {}
+ rgw_obj_key(const std::string& n, const std::string& i, const std::string& _ns) : name(n), instance(i), ns(_ns) {}
rgw_obj_key(const rgw_obj_index_key& k) {
parse_index_key(k.name, &name, &ns);
instance = k.instance;
}
- static void parse_index_key(const string& key, string *name, string *ns) {
+ static void parse_index_key(const std::string& key, std::string *name, std::string *ns) {
if (key[0] != '_') {
*name = key;
ns->clear();
*ns = key.substr(1, pos -1);
}
- void set(const string& n) {
+ void set(const std::string& n) {
name = n;
instance.clear();
ns.clear();
}
- void set(const string& n, const string& i) {
+ void set(const std::string& n, const std::string& i) {
name = n;
instance = i;
ns.clear();
}
- void set(const string& n, const string& i, const string& _ns) {
+ void set(const std::string& n, const std::string& i, const std::string& _ns) {
name = n;
instance = i;
ns = _ns;
return true;
}
- void set_instance(const string& i) {
+ void set_instance(const std::string& i) {
instance = i;
}
- const string& get_instance() const {
+ const std::string& get_instance() const {
return instance;
}
return ns;
}
- string get_index_key_name() const {
+ std::string get_index_key_name() const {
if (ns.empty()) {
if (name.size() < 1 || name[0] != '_') {
return name;
}
- return string("_") + name;
+ return std::string("_") + name;
};
char buf[ns.size() + 16];
snprintf(buf, sizeof(buf), "_%s_", ns.c_str());
- return string(buf) + name;
+ return std::string(buf) + name;
};
void get_index_key(rgw_obj_index_key *key) const {
key->instance = instance;
}
- string get_loc() const {
+ std::string get_loc() const {
/*
* For backward compatibility. Older versions used to have object locator on all objects,
* however, the name was the effective object locator. This had the same effect as not
return name;
}
- return string();
+ return {};
}
bool empty() const {
return have_instance() && !have_null_instance();
}
- string get_oid() const {
+ std::string get_oid() const {
if (ns.empty() && !need_to_encode_instance()) {
if (name.size() < 1 || name[0] != '_') {
return name;
}
- return string("_") + name;
+ return std::string("_") + name;
}
- string oid = "_";
+ std::string oid = "_";
oid.append(ns);
if (need_to_encode_instance()) {
- oid.append(string(":") + instance);
+ oid.append(std::string(":") + instance);
}
oid.append("_");
oid.append(name);
return !(k < *this);
}
- static void parse_ns_field(string& ns, string& instance) {
+ static void parse_ns_field(std::string& ns, std::string& instance) {
int pos = ns.find(':');
if (pos >= 0) {
instance = ns.substr(pos + 1);
// takes an oid and parses out the namespace (ns), name, and
// instance
- static bool parse_raw_oid(const string& oid, rgw_obj_key *key) {
+ static bool parse_raw_oid(const std::string& oid, rgw_obj_key *key) {
key->instance.clear();
key->ns.clear();
if (oid[0] != '_') {
return false;
size_t pos = oid.find('_', 2); // oid must match ^_[^_].+$
- if (pos == string::npos)
+ if (pos == std::string::npos)
return false;
key->ns = oid.substr(1, pos - 1);
* and cuts down the name to the unmangled version. If it is not
* part of the given namespace, it returns false.
*/
- static bool oid_to_key_in_ns(const string& oid, rgw_obj_key *key, const string& ns) {
+ static bool oid_to_key_in_ns(const std::string& oid, rgw_obj_key *key, const std::string& ns) {
bool ret = parse_raw_oid(oid, key);
if (!ret) {
return ret;
}
/**
- * Given a mangled object name and an empty namespace string, this
- * function extracts the namespace into the string and sets the object
+ * Given a mangled object name and an empty namespace std::string, this
+ * function extracts the namespace into the std::string and sets the object
* name to be the unmangled version.
*
* It returns true after successfully doing so, or
* false if it fails.
*/
- static bool strip_namespace_from_name(string& name, string& ns, string& instance) {
+ static bool strip_namespace_from_name(std::string& name, std::string& ns, std::string& instance) {
ns.clear();
instance.clear();
if (name[0] != '_') {
}
size_t pos = name.find('_', 1);
- if (pos == string::npos) {
+ if (pos == std::string::npos) {
return false;
}
}
ns = name.substr(1, pos-1);
- name = name.substr(pos+1, string::npos);
+ name = name.substr(pos+1, std::string::npos);
parse_ns_field(ns, instance);
return true;
void dump(Formatter *f) const;
void decode_json(JSONObj *obj);
- string to_str() const {
+ std::string to_str() const {
if (instance.empty()) {
return name;
}
};
WRITE_CLASS_ENCODER(rgw_obj_key)
-inline ostream& operator<<(ostream& out, const rgw_obj_key &o) {
+inline std::ostream& operator<<(std::ostream& out, const rgw_obj_key &o) {
return out << o.to_str();
}
-inline ostream& operator<<(ostream& out, const rgw_obj_index_key &o) {
+inline std::ostream& operator<<(std::ostream& out, const rgw_obj_index_key &o) {
if (o.instance.empty()) {
return out << o.name;
} else {
struct req_init_state {
/* Keeps [[tenant]:]bucket until we parse the token. */
- string url_bucket;
- string src_bucket;
+ std::string url_bucket;
+ std::string src_bucket;
};
#include "rgw_auth.h"
bool content_started{false};
int format{0};
ceph::Formatter *formatter{nullptr};
- string decoded_uri;
- string relative_uri;
+ std::string decoded_uri;
+ std::string relative_uri;
const char *length{nullptr};
int64_t content_length{0};
- map<string, string> generic_attrs;
+ std::map<std::string, std::string> generic_attrs;
rgw_err err;
bool expect_cont{false};
uint64_t obj_size{0};
uint32_t perm_mask{0};
/* Set once when url_bucket is parsed and not violated thereafter. */
- string account_name;
+ std::string account_name;
- string bucket_tenant;
- string bucket_name;
+ std::string bucket_tenant;
+ std::string bucket_name;
std::unique_ptr<rgw::sal::Bucket> bucket;
std::unique_ptr<rgw::sal::Object> object;
- string src_tenant_name;
- string src_bucket_name;
+ std::string src_tenant_name;
+ std::string src_bucket_name;
std::unique_ptr<rgw::sal::Object> src_object;
ACLOwner bucket_owner;
ACLOwner owner;
- string zonegroup_name;
- string zonegroup_endpoint;
- string bucket_instance_id;
+ std::string zonegroup_name;
+ std::string zonegroup_endpoint;
+ std::string bucket_instance_id;
int bucket_instance_shard_id{-1};
- string redirect_zone_endpoint;
+ std::string redirect_zone_endpoint;
- string redirect;
+ std::string redirect;
real_time bucket_mtime;
std::map<std::string, ceph::bufferlist> bucket_attrs;
rgw::IAM::Environment env;
boost::optional<rgw::IAM::Policy> iam_policy;
boost::optional<PublicAccessBlockConfiguration> bucket_access_conf;
- vector<rgw::IAM::Policy> iam_user_policies;
+ std::vector<rgw::IAM::Policy> iam_user_policies;
/* Is the request made by an user marked as a system one?
* Being system user means we also have the admin status. */
bool system_request{false};
- string canned_acl;
+ std::string canned_acl;
bool has_acl_header{false};
bool local_source{false}; /* source is local */
/* Content-Disposition override for TempURL of Swift API. */
struct {
- string override;
- string fallback;
+ std::string override;
+ std::string fallback;
} content_disp;
- string host_id;
+ std::string host_id;
req_info info;
req_init_state init_state;
Clock::duration time_elapsed() const { return Clock::now() - time; }
RGWObjectCtx *obj_ctx{nullptr};
- string dialect;
- string req_id;
- string trans_id;
+ std::string dialect;
+ std::string req_id;
+ std::string trans_id;
uint64_t id;
RGWObjTags tagset;
optional_yield yield{null_yield};
//token claims from STS token for ops log (can be used for Keystone token also)
- std::vector<string> token_claims;
+ std::vector<std::string> token_claims;
- vector<rgw::IAM::Policy> session_policies;
+ std::vector<rgw::IAM::Policy> session_policies;
req_state(CephContext* _cct, RGWEnv* e, uint64_t id);
~req_state();
};
void set_req_state_err(struct req_state*, int);
-void set_req_state_err(struct req_state*, int, const string&);
+void set_req_state_err(struct req_state*, int, const std::string&);
void set_req_state_err(struct rgw_err&, int, const int);
void dump(struct req_state*);
ENCODE_START(7, 5, bl);
uint64_t s = size;
__u32 mt = ceph::real_clock::to_time_t(creation_time);
- string empty_str; // originally had the bucket name here, but we encode bucket later
+ std::string empty_str; // originally had the bucket name here, but we encode bucket later
encode(empty_str, bl);
encode(s, bl);
encode(mt, bl);
DECODE_START_LEGACY_COMPAT_LEN(7, 5, 5, bl);
__u32 mt;
uint64_t s;
- string empty_str; // backward compatibility
+ std::string empty_str; // backward compatibility
decode(empty_str, bl);
decode(s, bl);
decode(mt, bl);
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
- static void generate_test_instances(list<RGWBucketEnt*>& o);
+ static void generate_test_instances(std::list<RGWBucketEnt*>& o);
};
WRITE_CLASS_ENCODER(RGWBucketEnt)
bucket = b;
key.set(name);
}
- void init(const rgw_bucket& b, const std::string& name, const string& i, const string& n) {
+ void init(const rgw_bucket& b, const std::string& name, const std::string& i, const std::string& n) {
bucket = b;
key.set(name, i, n);
}
- void init_ns(const rgw_bucket& b, const std::string& name, const string& n) {
+ void init_ns(const rgw_bucket& b, const std::string& name, const std::string& n) {
bucket = b;
key.name = name;
key.instance.clear();
key = k;
}
- string get_oid() const {
+ std::string get_oid() const {
return key.get_oid();
}
- const string& get_hash_object() const {
+ const std::string& get_hash_object() const {
return index_hash_source.empty() ? key.name : index_hash_source;
}
void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(6, 3, 3, bl);
if (struct_v < 6) {
- string s;
+ std::string s;
decode(bucket.name, bl); /* bucket.name */
decode(s, bl); /* loc */
decode(key.ns, bl);
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
- static void generate_test_instances(list<rgw_obj*>& o);
+ static void generate_test_instances(std::list<rgw_obj*>& o);
bool operator==(const rgw_obj& o) const {
return (key == o.key) &&
WRITE_CLASS_ENCODER(rgw_obj)
struct rgw_cache_entry_info {
- string cache_locator;
+ std::string cache_locator;
uint64_t gen;
rgw_cache_entry_info() : gen(0) {}
};
-inline ostream& operator<<(ostream& out, const rgw_obj &o) {
+inline std::ostream& operator<<(std::ostream& out, const rgw_obj &o) {
return out << o.bucket.name << ":" << o.get_oid();
}
strcasecmp(s, "1") == 0);
}
-static inline void append_rand_alpha(CephContext *cct, const string& src, string& dest, int len)
+static inline void append_rand_alpha(CephContext *cct, const std::string& src, std::string& dest, int len)
{
dest = src;
char buf[len + 1];
const std::string& k,
const std::string& v);
-extern string rgw_string_unquote(const string& s);
-extern void parse_csv_string(const string& ival, vector<string>& ovals);
-extern int parse_key_value(string& in_str, string& key, string& val);
-extern int parse_key_value(string& in_str, const char *delim, string& key, string& val);
+extern std::string rgw_string_unquote(const std::string& s);
+extern void parse_csv_string(const std::string& ival, std::vector<std::string>& ovals);
+extern int parse_key_value(std::string& in_str, std::string& key, std::string& val);
+extern int parse_key_value(std::string& in_str, const char *delim, std::string& key, std::string& val);
-extern boost::optional<std::pair<std::string_view, std::string_view>>
+extern boost::optional<std::pair<std::string_view,std::string_view>>
parse_key_value(const std::string_view& in_str,
const std::string_view& delim);
-extern boost::optional<std::pair<std::string_view, std::string_view>>
+extern boost::optional<std::pair<std::string_view,std::string_view>>
parse_key_value(const std::string_view& in_str);
extern int parse_time(const char *time_str, real_time *time);
extern bool parse_rfc2616(const char *s, struct tm *t);
extern bool parse_iso8601(const char *s, struct tm *t, uint32_t *pns = NULL, bool extended_format = true);
-extern string rgw_trim_whitespace(const string& src);
+extern std::string rgw_trim_whitespace(const std::string& src);
extern std::string_view rgw_trim_whitespace(const std::string_view& src);
-extern string rgw_trim_quotes(const string& val);
+extern std::string rgw_trim_quotes(const std::string& val);
extern void rgw_to_iso8601(const real_time& t, char *dest, int buf_size);
-extern void rgw_to_iso8601(const real_time& t, string *dest);
+extern void rgw_to_iso8601(const real_time& t, std::string *dest);
extern std::string rgw_to_asctime(const utime_t& t);
struct perm_state_base {
/** Check if the req_state's user has the necessary permissions
* to do the requested action */
-rgw::IAM::Effect eval_identity_or_session_policies(const vector<rgw::IAM::Policy>& user_policies,
+rgw::IAM::Effect eval_identity_or_session_policies(const std::vector<rgw::IAM::Policy>& user_policies,
const rgw::IAM::Environment& env,
boost::optional<const rgw::auth::Identity&> id,
const uint64_t op,
bool verify_user_permission(const DoutPrefixProvider* dpp,
struct req_state * const s,
RGWAccessControlPolicy * const user_acl,
- const vector<rgw::IAM::Policy>& user_policies,
- const vector<rgw::IAM::Policy>& session_policies,
+ const std::vector<rgw::IAM::Policy>& user_policies,
+ const std::vector<rgw::IAM::Policy>& session_policies,
const rgw::ARN& res,
const uint64_t op);
bool verify_user_permission_no_policy(const DoutPrefixProvider* dpp,
RGWAccessControlPolicy * const user_acl,
RGWAccessControlPolicy * const bucket_acl,
const boost::optional<rgw::IAM::Policy>& bucket_policy,
- const vector<rgw::IAM::Policy>& identity_policies,
- const vector<rgw::IAM::Policy>& session_policies,
+ const std::vector<rgw::IAM::Policy>& identity_policies,
+ const std::vector<rgw::IAM::Policy>& session_policies,
const uint64_t op);
bool verify_bucket_permission(const DoutPrefixProvider* dpp, struct req_state * const s, const uint64_t op);
bool verify_bucket_permission_no_policy(
RGWAccessControlPolicy * const bucket_acl,
RGWAccessControlPolicy * const object_acl,
const boost::optional<rgw::IAM::Policy>& bucket_policy,
- const vector<rgw::IAM::Policy>& identity_policies,
- const vector<rgw::IAM::Policy>& session_policies,
+ const std::vector<rgw::IAM::Policy>& identity_policies,
+ const std::vector<rgw::IAM::Policy>& session_policies,
const uint64_t op);
extern bool verify_object_permission(const DoutPrefixProvider* dpp, struct req_state *s, uint64_t op);
extern bool verify_object_permission_no_policy(
const bool bypass_governance_mode);
/** Convert an input URL into a sane object name
- * by converting %-escaped strings into characters, etc*/
-extern void rgw_uri_escape_char(char c, string& dst);
+ * by converting %-escaped std::strings into characters, etc*/
+extern void rgw_uri_escape_char(char c, std::string& dst);
extern std::string url_decode(const std::string_view& src_str,
bool in_query = false);
-extern void url_encode(const std::string& src, string& dst,
+extern void url_encode(const std::string& src, std::string& dst,
bool encode_slash = true);
extern std::string url_encode(const std::string& src, bool encode_slash = true);
extern std::string url_remove_prefix(const std::string& url); // Removes hhtp, https and www from url
extern std::string calc_hash_sha256_close_stream(ceph::crypto::SHA256** phash);
extern std::string calc_hash_sha256_restart_stream(ceph::crypto::SHA256** phash);
-extern int rgw_parse_op_type_list(const string& str, uint32_t *perm);
+extern int rgw_parse_op_type_list(const std::string& str, uint32_t *perm);
static constexpr uint32_t MATCH_POLICY_ACTION = 0x01;
static constexpr uint32_t MATCH_POLICY_RESOURCE = 0x02;
extern bool match_policy(std::string_view pattern, std::string_view input,
uint32_t flag);
-extern string camelcase_dash_http_attr(const string& orig);
-extern string lowercase_dash_http_attr(const string& orig);
+extern std::string camelcase_dash_http_attr(const std::string& orig);
+extern std::string lowercase_dash_http_attr(const std::string& orig);
void rgw_setup_saved_curl_handles();
void rgw_release_all_curl_handles();
-static inline void rgw_escape_str(const string& s, char esc_char,
- char special_char, string *dest)
+static inline void rgw_escape_str(const std::string& s, char esc_char,
+ char special_char, std::string *dest)
{
const char *src = s.c_str();
char dest_buf[s.size() * 2 + 1];
*dest = dest_buf;
}
-static inline ssize_t rgw_unescape_str(const string& s, ssize_t ofs,
+static inline ssize_t rgw_unescape_str(const std::string& s, ssize_t ofs,
char esc_char, char special_char,
- string *dest)
+ std::string *dest)
{
const char *src = s.c_str();
char dest_buf[s.size() + 1];
}
*destp = '\0';
*dest = dest_buf;
- return string::npos;
+ return std::string::npos;
}
-static inline string rgw_bl_str(ceph::buffer::list& raw)
+static inline std::string rgw_bl_str(ceph::buffer::list& raw)
{
size_t len = raw.length();
- string s(raw.c_str(), len);
+ std::string s(raw.c_str(), len);
while (len && !s[len - 1]) {
--len;
s.resize(len);
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
int rgw_compression_info_from_attr(const bufferlist& attr,
bool& need_decompress,
RGWCompressionInfo& cs_info)
int rgw_compression_info_from_attr(const bufferlist& attr,
bool& need_decompress,
RGWCompressionInfo& cs_info);
-int rgw_compression_info_from_attrset(const map<string, bufferlist>& attrs,
+int rgw_compression_info_from_attrset(const std::map<std::string, bufferlist>& attrs,
bool& need_decompress,
RGWCompressionInfo& cs_info);
CompressorRef compressor;
RGWCompressionInfo* cs_info;
bool partial_content;
- vector<compression_block>::iterator first_block, last_block;
+ std::vector<compression_block>::iterator first_block, last_block;
off_t q_ofs, q_len;
uint64_t cur_ofs;
bufferlist waiting;
int process(bufferlist&& data, uint64_t logical_offset) override;
bool is_compressed() { return compressed; }
- vector<compression_block>& get_compression_blocks() { return blocks; }
+ std::vector<compression_block>& get_compression_blocks() { return blocks; }
boost::optional<int32_t> get_compressor_message() { return compressor_message; }
}; /* RGWPutObj_Compress */
WRITE_CLASS_ENCODER(compression_block)
struct RGWCompressionInfo {
- string compression_type;
+ std::string compression_type;
uint64_t orig_size;
boost::optional<int32_t> compressor_message;
- vector<compression_block> blocks;
+ std::vector<compression_block> blocks;
RGWCompressionInfo() : compression_type("none"), orig_size(0) {}
RGWCompressionInfo(const RGWCompressionInfo& cs_info) : compression_type(cs_info.compression_type),
#define dout_subsys ceph_subsys_rgw
#define dout_context g_ceph_context
+using namespace std;
class RGWCompletionManager::WaitContext : public Context {
RGWCompletionManager *manager;
rgw_io_id io_id;
void *user_info;
};
- list<io_completion> complete_reqs;
- set<rgw_io_id> complete_reqs_set;
+ std::list<io_completion> complete_reqs;
+ std::set<rgw_io_id> complete_reqs_set;
using NotifierRef = boost::intrusive_ptr<RGWAioCompletionNotifier>;
- set<NotifierRef> cns;
+ std::set<NotifierRef> cns;
ceph::mutex lock = ceph::make_mutex("RGWCompletionManager::lock");
ceph::condition_variable cond;
std::atomic<bool> going_down = { false };
- map<void *, void *> waiters;
+ std::map<void *, void *> waiters;
class WaitContext;
struct RGWCoroutinesEnv {
uint64_t run_context;
RGWCoroutinesManager *manager;
- list<RGWCoroutinesStack *> *scheduled_stacks;
+ std::list<RGWCoroutinesStack *> *scheduled_stacks;
RGWCoroutinesStack *stack;
RGWCoroutinesEnv() : run_context(0), manager(NULL), scheduled_stacks(NULL), stack(NULL) {}
};
struct rgw_spawned_stacks {
- vector<RGWCoroutinesStack *> entries;
+ std::vector<RGWCoroutinesStack *> entries;
rgw_spawned_stacks() {}
}
void inherit(rgw_spawned_stacks *source) {
- for (vector<RGWCoroutinesStack *>::iterator iter = source->entries.begin();
- iter != source->entries.end(); ++iter) {
- add_pending(*iter);
+ for (auto* entry : source->entries) {
+ add_pending(entry);
}
source->entries.clear();
}
struct StatusItem {
utime_t timestamp;
- string status;
+ std::string status;
- StatusItem(utime_t& t, const string& s) : timestamp(t), status(s) {}
+ StatusItem(utime_t& t, const std::string& s) : timestamp(t), status(s) {}
void dump(Formatter *f) const;
};
int max_history;
utime_t timestamp;
- stringstream status;
+ std::stringstream status;
explicit Status(CephContext *_cct) : cct(_cct), max_history(MAX_COROUTINE_HISTORY) {}
- deque<StatusItem> history;
+ std::deque<StatusItem> history;
- stringstream& set_status();
+ std::stringstream& set_status();
} status;
- stringstream description;
+ std::stringstream description;
protected:
bool _yield_ret;
rgw_spawned_stacks spawned;
- stringstream error_stream;
+ std::stringstream error_stream;
int set_state(int s, int ret = 0) {
retcode = ret;
void set_io_blocked(bool flag);
void reset_description() {
- description.str(string());
+ description.str(std::string());
}
- stringstream& set_description() {
+ std::stringstream& set_description() {
return description;
}
- stringstream& set_status() {
+ std::stringstream& set_status() {
return status.set_status();
}
- stringstream& set_status(const string& s) {
- stringstream& status = set_status();
+ std::stringstream& set_status(const std::string& s) {
+ std::stringstream& status = set_status();
status << s;
return status;
}
bool is_done() { return (state == RGWCoroutine_Done || state == RGWCoroutine_Error); }
bool is_error() { return (state == RGWCoroutine_Error); }
- stringstream& log_error() { return error_stream; }
- string error_str() {
+ std::stringstream& log_error() { return error_stream; }
+ std::string error_str() {
return error_stream.str();
}
void wait_for_child();
- virtual string to_str() const;
+ virtual std::string to_str() const;
RGWCoroutinesStack *get_stack() const {
return stack;
void io_complete(const rgw_io_id& io_id);
};
-ostream& operator<<(ostream& out, const RGWCoroutine& cr);
+std::ostream& operator<<(std::ostream& out, const RGWCoroutine& cr);
#define yield_until_true(x) \
do { \
template <class T>
class RGWConsumerCR : public RGWCoroutine {
- list<T> product;
+ std::list<T> product;
public:
explicit RGWConsumerCR(CephContext *_cct) : RGWCoroutine(_cct) {}
}
void receive(const T& p, bool wakeup = true);
- void receive(list<T>& l, bool wakeup = true);
+ void receive(std::list<T>& l, bool wakeup = true);
};
class RGWCoroutinesStack : public RefCountedObject {
RGWCoroutinesManager *ops_mgr;
- list<RGWCoroutine *> ops;
- list<RGWCoroutine *>::iterator pos;
+ std::list<RGWCoroutine *> ops;
+ std::list<RGWCoroutine *>::iterator pos;
rgw_spawned_stacks spawned;
RGWCoroutinesStack *preallocated_stack{nullptr};
- set<RGWCoroutinesStack *> blocked_by_stack;
- set<RGWCoroutinesStack *> blocking_stacks;
+ std::set<RGWCoroutinesStack *> blocked_by_stack;
+ std::set<RGWCoroutinesStack *> blocking_stacks;
- map<int64_t, rgw_io_id> io_finish_ids;
+ std::map<int64_t, rgw_io_id> io_finish_ids;
rgw_io_id io_blocked_id;
bool done_flag;
return retcode;
}
- string error_str();
+ std::string error_str();
void call(RGWCoroutine *next_op);
RGWCoroutinesStack *spawn(RGWCoroutine *next_op, bool wait);
};
template <class T>
-void RGWConsumerCR<T>::receive(list<T>& l, bool wakeup)
+void RGWConsumerCR<T>::receive(std::list<T>& l, bool wakeup)
{
product.splice(product.end(), l);
if (wakeup) {
class RGWCoroutinesManagerRegistry : public RefCountedObject, public AdminSocketHook {
CephContext *cct;
- set<RGWCoroutinesManager *> managers;
+ std::set<RGWCoroutinesManager *> managers;
ceph::shared_mutex lock =
ceph::make_shared_mutex("RGWCoroutinesRegistry::lock");
- string admin_command;
+ std::string admin_command;
public:
explicit RGWCoroutinesManagerRegistry(CephContext *_cct) : cct(_cct) {}
void add(RGWCoroutinesManager *mgr);
void remove(RGWCoroutinesManager *mgr);
- int hook_to_admin_command(const string& command);
+ int hook_to_admin_command(const std::string& command);
int call(std::string_view command, const cmdmap_t& cmdmap,
Formatter *f,
std::ostream& ss,
std::atomic<bool> going_down = { false };
std::atomic<int64_t> run_context_count = { 0 };
- map<uint64_t, set<RGWCoroutinesStack *> > run_contexts;
+ std::map<uint64_t, std::set<RGWCoroutinesStack *> > run_contexts;
std::atomic<int64_t> max_io_id = { 0 };
std::atomic<uint64_t> max_stack_id = { 0 };
RGWIOIDProvider io_id_provider;
- void handle_unblocked_stack(set<RGWCoroutinesStack *>& context_stacks, list<RGWCoroutinesStack *>& scheduled_stacks,
+ void handle_unblocked_stack(std::set<RGWCoroutinesStack *>& context_stacks, std::list<RGWCoroutinesStack *>& scheduled_stacks,
RGWCompletionManager::io_completion& io, int *waiting_count);
protected:
RGWCompletionManager *completion_mgr;
int ops_window;
- string id;
+ std::string id;
void put_completion_notifier(RGWAioCompletionNotifier *cn);
public:
}
virtual ~RGWCoroutinesManager();
- int run(const DoutPrefixProvider *dpp, list<RGWCoroutinesStack *>& ops);
+ int run(const DoutPrefixProvider *dpp, std::list<RGWCoroutinesStack *>& ops);
int run(const DoutPrefixProvider *dpp, RGWCoroutine *op);
void stop() {
bool expected = false;
void set_sleeping(RGWCoroutine *cr, bool flag);
void io_complete(RGWCoroutine *cr, const rgw_io_id& io_id);
- virtual string get_id();
+ virtual std::string get_id();
void dump(Formatter *f) const;
RGWIOIDProvider& get_io_id_provider() {
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
void RGWCORSRule::dump_origins() {
unsigned num_origins = allowed_origins.size();
dout(10) << "Allowed origins : " << num_origins << dendl;
- for(set<string>::iterator it = allowed_origins.begin();
- it != allowed_origins.end();
- ++it) {
- dout(10) << *it << "," << dendl;
+ for(auto& origin : allowed_origins) {
+ dout(10) << origin << "," << dendl;
}
}
uint32_t max_age;
uint8_t allowed_methods;
std::string id;
- std::set<string> allowed_hdrs; /* If you change this, you need to discard lowercase_allowed_hdrs */
- std::set<string> lowercase_allowed_hdrs; /* Not built until needed in RGWCORSRule::is_header_allowed */
- std::set<string> allowed_origins;
- std::list<string> exposable_hdrs;
+ std::set<std::string> allowed_hdrs; /* If you change this, you need to discard lowercase_allowed_hdrs */
+ std::set<std::string> lowercase_allowed_hdrs; /* Not built until needed in RGWCORSRule::is_header_allowed */
+ std::set<std::string> allowed_origins;
+ std::list<std::string> exposable_hdrs;
public:
RGWCORSRule() : max_age(CORS_MAX_AGE_INVALID),allowed_methods(0) {}
- RGWCORSRule(std::set<string>& o, std::set<string>& h,
- std::list<string>& e, uint8_t f, uint32_t a)
+ RGWCORSRule(std::set<std::string>& o, std::set<std::string>& h,
+ std::list<std::string>& e, uint8_t f, uint32_t a)
:max_age(a),
allowed_methods(f),
allowed_hdrs(h),
bool is_empty() {
return rules.empty();
}
- void get_origins_list(const char *origin, std::list<string>& origins);
+ void get_origins_list(const char *origin, std::list<std::string>& origins);
RGWCORSRule * host_name_rule(const char *origin);
void erase_host_name_rule(std::string& origin);
void dump();
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
void RGWCORSRule_S3::to_xml(XMLFormatter& f) {
~RGWCORSConfiguration_S3() override {}
bool xml_end(const char *el) override;
- void to_xml(ostream& out);
+ void to_xml(std::ostream& out);
};
class RGWCORSXMLParser_S3 : public RGWXMLParser
~RGWCORSConfiguration_SWIFT() {}
int create_update(const char *allow_origins, const char *allow_headers,
const char *expose_headers, const char *max_age) {
- set<string> o, h;
- list<string> e;
+ std::set<std::string> o, h;
+ std::list<std::string> e;
unsigned long a = CORS_MAX_AGE_INVALID;
uint8_t flags = RGW_CORS_ALL;
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
bool RGWAsyncRadosProcessor::RGWWQ::_enqueue(RGWAsyncRadosRequest *req) {
if (processor->is_going_down()) {
return false;
class RGWAsyncRadosProcessor {
- deque<RGWAsyncRadosRequest *> m_req_queue;
+ std::deque<RGWAsyncRadosRequest *> m_req_queue;
std::atomic<bool> going_down = { false };
protected:
CephContext *cct;
bool want_attrs, bool raw_attrs);
bufferlist bl;
- map<string, bufferlist> attrs;
+ std::map<std::string, bufferlist> attrs;
RGWObjVersionTracker objv_tracker;
};
const DoutPrefixProvider *dpp;
RGWSI_SysObj *svc;
rgw_raw_obj obj;
- map<string, bufferlist> attrs;
+ std::map<std::string, bufferlist> attrs;
protected:
int _send_request(const DoutPrefixProvider *dpp) override;
public:
RGWAsyncPutSystemObjAttrs(const DoutPrefixProvider *dpp, RGWCoroutine *caller, RGWAioCompletionNotifier *cn, RGWSI_SysObj *_svc,
RGWObjVersionTracker *_objv_tracker, const rgw_raw_obj& _obj,
- map<string, bufferlist> _attrs);
+ std::map<std::string, bufferlist> _attrs);
RGWObjVersionTracker objv_tracker;
};
class RGWAsyncLockSystemObj : public RGWAsyncRadosRequest {
rgw::sal::RadosStore* store;
rgw_raw_obj obj;
- string lock_name;
- string cookie;
+ std::string lock_name;
+ std::string cookie;
uint32_t duration_secs;
protected:
public:
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);
+ const std::string& _name, const std::string& _cookie, uint32_t _duration_secs);
};
class RGWAsyncUnlockSystemObj : public RGWAsyncRadosRequest {
rgw::sal::RadosStore* store;
rgw_raw_obj obj;
- string lock_name;
- string cookie;
+ std::string lock_name;
+ std::string cookie;
protected:
int _send_request(const DoutPrefixProvider *dpp) override;
public:
RGWAsyncUnlockSystemObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RadosStore* _store,
RGWObjVersionTracker *_objv_tracker, const rgw_raw_obj& _obj,
- const string& _name, const string& _cookie);
+ const std::string& _name, const std::string& _cookie);
};
template <class T>
RGWSI_SysObj *svc;
rgw_raw_obj obj;
- map<string, bufferlist> *pattrs;
+ std::map<std::string, bufferlist> *pattrs;
bool raw_attrs;
RGWObjVersionTracker* objv_tracker;
RGWAsyncGetSystemObj *req = nullptr;
public:
RGWSimpleRadosReadAttrsCR(const DoutPrefixProvider *_dpp, RGWAsyncRadosProcessor *_async_rados, RGWSI_SysObj *_svc,
- const rgw_raw_obj& _obj, map<string, bufferlist> *_pattrs,
+ const rgw_raw_obj& _obj, std::map<std::string, bufferlist> *_pattrs,
bool _raw_attrs, RGWObjVersionTracker* objv_tracker = nullptr)
: RGWSimpleCoroutine(_svc->ctx()),
dpp(_dpp),
RGWObjVersionTracker *objv_tracker;
rgw_raw_obj obj;
- map<string, bufferlist> attrs;
+ std::map<std::string, bufferlist> attrs;
RGWAsyncPutSystemObjAttrs *req = nullptr;
public:
RGWSimpleRadosWriteAttrsCR(const DoutPrefixProvider *_dpp,
RGWAsyncRadosProcessor *_async_rados,
RGWSI_SysObj *_svc, const rgw_raw_obj& _obj,
- map<string, bufferlist> _attrs,
+ std::map<std::string, bufferlist> _attrs,
RGWObjVersionTracker *objv_tracker = nullptr)
: RGWSimpleCoroutine(_svc->ctx()), dpp(_dpp), async_rados(_async_rados),
svc(_svc), objv_tracker(objv_tracker), obj(_obj),
class RGWRadosSetOmapKeysCR : public RGWSimpleCoroutine {
rgw::sal::RadosStore* store;
- map<string, bufferlist> entries;
+ std::map<std::string, bufferlist> entries;
rgw_rados_ref ref;
public:
RGWRadosSetOmapKeysCR(rgw::sal::RadosStore* _store,
const rgw_raw_obj& _obj,
- map<string, bufferlist>& _entries);
+ std::map<std::string, bufferlist>& _entries);
int send_request(const DoutPrefixProvider *dpp) override;
int request_complete() override;
using ResultPtr = std::shared_ptr<Result>;
RGWRadosGetOmapKeysCR(rgw::sal::RadosStore* _store, const rgw_raw_obj& _obj,
- const string& _marker, int _max_entries,
+ const std::string& _marker, int _max_entries,
ResultPtr result);
int send_request(const DoutPrefixProvider *dpp) override;
private:
rgw::sal::RadosStore* store;
rgw_raw_obj obj;
- string marker;
+ std::string marker;
int max_entries;
ResultPtr result;
boost::intrusive_ptr<RGWAioCompletionNotifier> cn;
using ResultPtr = std::shared_ptr<Result>;
RGWRadosGetOmapValsCR(rgw::sal::RadosStore* _store, const rgw_raw_obj& _obj,
- const string& _marker, int _max_entries,
+ const std::string& _marker, int _max_entries,
ResultPtr result);
int send_request(const DoutPrefixProvider *dpp) override;
private:
rgw::sal::RadosStore* store;
rgw_raw_obj obj;
- string marker;
+ std::string marker;
int max_entries;
ResultPtr result;
boost::intrusive_ptr<RGWAioCompletionNotifier> cn;
rgw_rados_ref ref;
- set<string> keys;
+ std::set<std::string> keys;
rgw_raw_obj obj;
public:
RGWRadosRemoveOmapKeysCR(rgw::sal::RadosStore* _store,
const rgw_raw_obj& _obj,
- const set<string>& _keys);
+ const std::set<std::string>& _keys);
int send_request(const DoutPrefixProvider *dpp) override;
class RGWSimpleRadosLockCR : public RGWSimpleCoroutine {
RGWAsyncRadosProcessor *async_rados;
rgw::sal::RadosStore* store;
- string lock_name;
- string cookie;
+ std::string lock_name;
+ std::string cookie;
uint32_t duration;
rgw_raw_obj obj;
public:
RGWSimpleRadosLockCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore* _store,
const rgw_raw_obj& _obj,
- const string& _lock_name,
- const string& _cookie,
+ const std::string& _lock_name,
+ const std::string& _cookie,
uint32_t _duration);
~RGWSimpleRadosLockCR() override {
request_cleanup();
class RGWSimpleRadosUnlockCR : public RGWSimpleCoroutine {
RGWAsyncRadosProcessor *async_rados;
rgw::sal::RadosStore* store;
- string lock_name;
- string cookie;
+ std::string lock_name;
+ std::string cookie;
rgw_raw_obj obj;
public:
RGWSimpleRadosUnlockCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore* _store,
const rgw_raw_obj& _obj,
- const string& _lock_name,
- const string& _cookie);
+ const std::string& _lock_name,
+ const std::string& _cookie);
~RGWSimpleRadosUnlockCR() override {
request_cleanup();
}
#define OMAP_APPEND_MAX_ENTRIES_DEFAULT 100
-class RGWOmapAppend : public RGWConsumerCR<string> {
+class RGWOmapAppend : public RGWConsumerCR<std::string> {
RGWAsyncRadosProcessor *async_rados;
rgw::sal::RadosStore* store;
bool going_down;
int num_pending_entries;
- list<string> pending_entries;
+ std::list<std::string> pending_entries;
- map<string, bufferlist> entries;
+ std::map<std::string, bufferlist> entries;
uint64_t window_size;
uint64_t total_entries;
uint64_t _window_size = OMAP_APPEND_MAX_ENTRIES_DEFAULT);
int operate(const DoutPrefixProvider *dpp) override;
void flush_pending();
- bool append(const string& s);
+ bool append(const std::string& s);
bool finish();
uint64_t get_total_entries() {
int num_shards;
- vector<RGWOmapAppend *> shards;
+ std::vector<RGWOmapAppend *> shards;
public:
- RGWShardedOmapCRManager(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore* _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 std::string& oid_prefix)
: async_rados(_async_rados),
store(_store), op(_op), num_shards(_num_shards) {
shards.reserve(num_shards);
}
}
- bool append(const string& entry, int shard_id) {
+ bool append(const std::string& entry, int shard_id) {
return shards[shard_id]->append(entry);
}
bool finish() {
bool success = true;
- for (vector<RGWOmapAppend *>::iterator iter = shards.begin(); iter != shards.end(); ++iter) {
- success &= ((*iter)->finish() && (!(*iter)->is_error()));
+ for (auto& append_op : shards) {
+ success &= (append_op->finish() && (!append_op->is_error()));
}
return success;
}
: RGWAsyncRadosRequest(caller, cn), store(_store), bucket(bucket), dpp(dpp) {}
RGWBucketInfo bucket_info;
- map<string, bufferlist> attrs;
+ std::map<std::string, bufferlist> attrs;
};
class RGWGetBucketInstanceInfoCR : public RGWSimpleCoroutine {
rgw::sal::RadosStore* store;
rgw_bucket bucket;
RGWBucketInfo *bucket_info;
- map<string, bufferlist> *pattrs;
+ std::map<std::string, bufferlist> *pattrs;
const DoutPrefixProvider *dpp;
RGWAsyncGetBucketInstanceInfo *req{nullptr};
// rgw_bucket constructor
RGWGetBucketInstanceInfoCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore* _store,
const rgw_bucket& _bucket, RGWBucketInfo *_bucket_info,
- map<string, bufferlist> *_pattrs, const DoutPrefixProvider *dpp)
+ std::map<std::string, bufferlist> *_pattrs, const DoutPrefixProvider *dpp)
: RGWSimpleCoroutine(_store->ctx()), async_rados(_async_rados), store(_store),
bucket(_bucket), bucket_info(_bucket_info), pattrs(_pattrs), dpp(dpp) {}
~RGWGetBucketInstanceInfoCR() override {
ceph::real_time *pmtime;
uint64_t *psize;
- string *petag;
- map<string, bufferlist> *pattrs;
- map<string, string> *pheaders;
+ std::string *petag;
+ std::map<std::string, bufferlist> *pattrs;
+ std::map<std::string, std::string> *pheaders;
protected:
int _send_request(const DoutPrefixProvider *dpp) override;
const rgw_obj_key& _key,
ceph::real_time *_pmtime,
uint64_t *_psize,
- string *_petag,
- map<string, bufferlist> *_pattrs,
- map<string, string> *_pheaders) : RGWAsyncRadosRequest(caller, cn), store(_store),
+ std::string *_petag,
+ std::map<std::string, bufferlist> *_pattrs,
+ std::map<std::string, std::string> *_pheaders) : RGWAsyncRadosRequest(caller, cn), store(_store),
source_zone(_source_zone),
src_bucket(_src_bucket),
key(_key),
ceph::real_time *pmtime;
uint64_t *psize;
- string *petag;
- map<string, bufferlist> *pattrs;
- map<string, string> *pheaders;
+ std::string *petag;
+ std::map<std::string, bufferlist> *pattrs;
+ std::map<std::string, std::string> *pheaders;
RGWAsyncStatRemoteObj *req;
const rgw_obj_key& _key,
ceph::real_time *_pmtime,
uint64_t *_psize,
- string *_petag,
- map<string, bufferlist> *_pattrs,
- map<string, string> *_pheaders) : RGWSimpleCoroutine(_store->ctx()), cct(_store->ctx()),
+ std::string *_petag,
+ std::map<std::string, bufferlist> *_pattrs,
+ std::map<std::string, std::string> *_pheaders) : RGWSimpleCoroutine(_store->ctx()), cct(_store->ctx()),
async_rados(_async_rados), store(_store),
source_zone(_source_zone),
src_bucket(_src_bucket),
RGWBucketInfo bucket_info;
rgw_obj_key key;
- string owner;
- string owner_display_name;
+ std::string owner;
+ std::string owner_display_name;
bool versioned;
uint64_t versioned_epoch;
- string marker_version_id;
+ std::string marker_version_id;
bool del_if_older;
ceph::real_time timestamp;
const rgw_zone_id& _source_zone,
RGWBucketInfo& _bucket_info,
const rgw_obj_key& _key,
- const string& _owner,
- const string& _owner_display_name,
+ const std::string& _owner,
+ const std::string& _owner_display_name,
bool _versioned,
uint64_t _versioned_epoch,
bool _delete_marker,
bool versioned;
uint64_t versioned_epoch;
bool delete_marker;
- string owner;
- string owner_display_name;
+ std::string owner;
+ std::string owner_display_name;
bool del_if_older;
real_time timestamp;
const rgw_obj_key& _key,
bool _versioned,
uint64_t _versioned_epoch,
- string *_owner,
- string *_owner_display_name,
+ std::string *_owner,
+ std::string *_owner_display_name,
bool _delete_marker,
real_time *_timestamp,
rgw_zone_set *_zones_trace) : RGWSimpleCoroutine(_store->ctx()), dpp(_dpp), cct(_store->ctx()),
const rgw_raw_obj obj;
- const string lock_name;
- const string cookie;
+ const std::string lock_name;
+ const std::string cookie;
int interval;
bool going_down{ false };
public:
RGWContinuousLeaseCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore* _store,
const rgw_raw_obj& _obj,
- const string& _lock_name, int _interval, RGWCoroutine *_caller)
+ const std::string& _lock_name, int _interval, RGWCoroutine *_caller)
: RGWCoroutine(_store->ctx()), async_rados(_async_rados), store(_store),
obj(_obj), lock_name(_lock_name),
cookie(RGWSimpleRadosLockCR::gen_random_cookie(cct)),
class RGWRadosTimelogAddCR : public RGWSimpleCoroutine {
const DoutPrefixProvider *dpp;
rgw::sal::RadosStore* store;
- list<cls_log_entry> entries;
+ std::list<cls_log_entry> entries;
- string oid;
+ std::string oid;
boost::intrusive_ptr<RGWAioCompletionNotifier> cn;
public:
- RGWRadosTimelogAddCR(const DoutPrefixProvider *dpp, rgw::sal::RadosStore* _store, const string& _oid,
+ RGWRadosTimelogAddCR(const DoutPrefixProvider *dpp, rgw::sal::RadosStore* _store, const std::string& _oid,
const cls_log_entry& entry);
int send_request(const DoutPrefixProvider *dpp) override;
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
RGWCRHTTPGetDataCB::RGWCRHTTPGetDataCB(RGWCoroutinesEnv *_env, RGWCoroutine *_cr, RGWHTTPStreamRWRequest *_req) : env(_env), cr(_cr), req(_req) {
io_id = req->get_io_id(RGWHTTPClient::HTTPCLIENT_IO_READ |RGWHTTPClient::HTTPCLIENT_IO_CONTROL);
req->set_in_cb(this);
struct rgw_rest_obj {
rgw_obj_key key;
uint64_t content_len;
- std::map<string, string> attrs;
- std::map<string, string> custom_attrs;
+ std::map<std::string, std::string> attrs;
+ std::map<std::string, std::string> custom_attrs;
RGWAccessControlPolicy acls;
void init(const rgw_obj_key& _key) {
protected:
RGWRESTConn *conn;
RGWHTTPManager *http_manager;
- string path;
+ std::string path;
param_vec_t params;
param_vec_t extra_headers;
public:
boost::intrusive_ptr<RGWRESTReadResource> http_op;
RGWReadRawRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn,
- RGWHTTPManager *_http_manager, const string& _path,
+ RGWHTTPManager *_http_manager, const std::string& _path,
rgw_http_param_pair *params, bufferlist *_result)
: RGWSimpleCoroutine(_cct), result(_result), conn(_conn), http_manager(_http_manager),
path(_path), params(make_param_list(params))
{}
RGWReadRawRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn,
- RGWHTTPManager *_http_manager, const string& _path,
+ RGWHTTPManager *_http_manager, const std::string& _path,
rgw_http_param_pair *params)
: RGWSimpleCoroutine(_cct), conn(_conn), http_manager(_http_manager),
path(_path), params(make_param_list(params))
{}
RGWReadRawRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn,
- RGWHTTPManager *_http_manager, const string& _path,
+ RGWHTTPManager *_http_manager, const std::string& _path,
rgw_http_param_pair *params, param_vec_t &hdrs)
: RGWSimpleCoroutine(_cct), conn(_conn), http_manager(_http_manager),
path(_path), params(make_param_list(params)),
{}
RGWReadRawRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn,
- RGWHTTPManager *_http_manager, const string& _path,
+ RGWHTTPManager *_http_manager, const std::string& _path,
rgw_http_param_pair *params,
std::map <std::string, std::string> *hdrs)
: RGWSimpleCoroutine(_cct), conn(_conn), http_manager(_http_manager),
T *result;
public:
RGWReadRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn,
- RGWHTTPManager *_http_manager, const string& _path,
+ RGWHTTPManager *_http_manager, const std::string& _path,
rgw_http_param_pair *params, T *_result)
: RGWReadRawRESTResourceCR(_cct, _conn, _http_manager, _path, params), result(_result)
{}
RGWReadRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn,
- RGWHTTPManager *_http_manager, const string& _path,
+ RGWHTTPManager *_http_manager, const std::string& _path,
rgw_http_param_pair *params,
std::map <std::string, std::string> *hdrs,
T *_result)
protected:
RGWRESTConn *conn;
RGWHTTPManager *http_manager;
- string method;
- string path;
+ std::string method;
+ std::string path;
param_vec_t params;
param_vec_t headers;
- map<string, string> *attrs;
+ std::map<std::string, std::string> *attrs;
T *result;
E *err_result;
bufferlist input_bl;
public:
RGWSendRawRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn,
RGWHTTPManager *_http_manager,
- const string& _method, const string& _path,
+ const std::string& _method, const std::string& _path,
rgw_http_param_pair *_params,
- map<string, string> *_attrs,
+ std::map<std::string, std::string> *_attrs,
bufferlist& _input, T *_result,
bool _send_content_length,
E *_err_result = nullptr)
RGWSendRawRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn,
RGWHTTPManager *_http_manager,
- const string& _method, const string& _path,
- rgw_http_param_pair *_params, map<string, string> *_attrs,
+ const std::string& _method, const std::string& _path,
+ rgw_http_param_pair *_params, std::map<std::string, std::string> *_attrs,
T *_result, E *_err_result = nullptr)
: RGWSimpleCoroutine(_cct), conn(_conn), http_manager(_http_manager),
method(_method), path(_path), params(make_param_list(_params)), headers(make_param_list(_attrs)), attrs(_attrs), result(_result),
public:
RGWSendRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn,
RGWHTTPManager *_http_manager,
- const string& _method, const string& _path,
- rgw_http_param_pair *_params, map<string, string> *_attrs,
+ const std::string& _method, const std::string& _path,
+ rgw_http_param_pair *_params, std::map<std::string, std::string> *_attrs,
S& _input, T *_result, E *_err_result = nullptr)
: RGWSendRawRESTResourceCR<T, E>(_cct, _conn, _http_manager, _method, _path, _params, _attrs, _result, _err_result) {
public:
RGWPostRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn,
RGWHTTPManager *_http_manager,
- const string& _path,
+ const std::string& _path,
rgw_http_param_pair *_params, S& _input,
T *_result, E *_err_result = nullptr)
: RGWSendRESTResourceCR<S, T, E>(_cct, _conn, _http_manager,
public:
RGWPutRawRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn,
RGWHTTPManager *_http_manager,
- const string& _path,
+ const std::string& _path,
rgw_http_param_pair *_params, bufferlist& _input,
T *_result, E *_err_result = nullptr)
: RGWSendRawRESTResourceCR<T, E>(_cct, _conn, _http_manager, "PUT", _path,
public:
RGWPostRawRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn,
RGWHTTPManager *_http_manager,
- const string& _path,
+ const std::string& _path,
rgw_http_param_pair *_params,
- map<string, string> * _attrs,
+ std::map<std::string, std::string> * _attrs,
bufferlist& _input,
T *_result, E *_err_result = nullptr)
: RGWSendRawRESTResourceCR<T, E>(_cct, _conn, _http_manager, "POST", _path,
public:
RGWPutRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn,
RGWHTTPManager *_http_manager,
- const string& _path,
+ const std::string& _path,
rgw_http_param_pair *_params, S& _input,
T *_result, E *_err_result = nullptr)
: RGWSendRESTResourceCR<S, T, E>(_cct, _conn, _http_manager,
RGWPutRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn,
RGWHTTPManager *_http_manager,
- const string& _path,
+ const std::string& _path,
rgw_http_param_pair *_params,
- map <string, string> *_attrs,
+ std::map<std::string, std::string> *_attrs,
S& _input, T *_result, E *_err_result = nullptr)
: RGWSendRESTResourceCR<S, T, E>(_cct, _conn, _http_manager,
"PUT", _path,
class RGWDeleteRESTResourceCR : public RGWSimpleCoroutine {
RGWRESTConn *conn;
RGWHTTPManager *http_manager;
- string path;
+ std::string path;
param_vec_t params;
boost::intrusive_ptr<RGWRESTDeleteResource> http_op;
public:
RGWDeleteRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn,
RGWHTTPManager *_http_manager,
- const string& _path,
+ const std::string& _path,
rgw_http_param_pair *_params)
: RGWSimpleCoroutine(_cct), conn(_conn), http_manager(_http_manager),
path(_path), params(make_param_list(_params))
public:
virtual int init(const DoutPrefixProvider *dpp) = 0;
virtual int read(bufferlist *data, uint64_t max, bool *need_retry) = 0; /* reentrant */
- virtual int decode_rest_obj(map<string, string>& headers, bufferlist& extra_data) = 0;
+ virtual int decode_rest_obj(std::map<std::string, std::string>& headers, bufferlist& extra_data) = 0;
virtual bool has_attrs() = 0;
- virtual void get_attrs(std::map<string, string> *attrs) = 0;
+ virtual void get_attrs(std::map<std::string, std::string> *attrs) = 0;
virtual ~RGWStreamReadResourceCRF() = default;
};
} range;
ceph::real_time mtime;
- string etag;
+ std::string etag;
public:
RGWStreamReadHTTPResourceCRF(CephContext *_cct,
int init(const DoutPrefixProvider *dpp) override;
int read(bufferlist *data, uint64_t max, bool *need_retry) override; /* reentrant */
- int decode_rest_obj(map<string, string>& headers, bufferlist& extra_data) override;
+ int decode_rest_obj(std::map<std::string, std::string>& headers, bufferlist& extra_data) override;
bool has_attrs() override;
- void get_attrs(std::map<string, string> *attrs) override;
+ void get_attrs(std::map<std::string, std::string> *attrs) override;
bool is_done();
virtual bool need_extra_data() { return false; }
struct multipart_info {
bool is_multipart{false};
- string upload_id;
+ std::string upload_id;
int part_num{0};
uint64_t part_size;
} multipart;
void write_drain_notify(uint64_t pending_size);
int drain_writes(bool *need_retry) override; /* reentrant */
- virtual void handle_headers(const std::map<string, string>& headers) {}
+ virtual void handle_headers(const std::map<std::string, std::string>& headers) {}
void set_req(RGWHTTPStreamRWRequest *r) {
req = r;
}
- void set_multipart(const string& upload_id, int part_num, uint64_t part_size) {
+ void set_multipart(const std::string& upload_id, int part_num, uint64_t part_size) {
multipart.is_multipart = true;
multipart.upload_id = upload_id;
multipart.part_num = part_num;
class RGWStreamSpliceCR : public RGWCoroutine {
CephContext *cct;
RGWHTTPManager *http_manager;
- string url;
+ std::string url;
std::shared_ptr<RGWStreamReadHTTPResourceCRF> in_crf;
std::shared_ptr<RGWStreamWriteHTTPResourceCRF> out_crf;
bufferlist bl;
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
template<>
int RGWUserCreateCR::Request::_send_request(const DoutPrefixProvider *dpp)
{
using RGWGetUserInfoCR = RGWSimpleAsyncCR<rgw_get_user_info_params, RGWUserInfo>;
struct rgw_get_bucket_info_params {
- string tenant;
- string bucket_name;
+ std::string tenant;
+ std::string bucket_name;
};
struct rgw_get_bucket_info_result {
using RGWGetBucketInfoCR = RGWSimpleAsyncCR<rgw_get_bucket_info_params, rgw_get_bucket_info_result>;
struct rgw_bucket_create_local_params {
- shared_ptr<RGWUserInfo> user_info;
+ std::shared_ptr<RGWUserInfo> user_info;
std::string bucket_name;
rgw_placement_rule placement_rule;
};
RGWDataAccess::BucketRef bucket;
rgw_obj_key key;
bufferlist data;
- map<string, bufferlist> attrs;
- std::optional<string> user_data;
+ std::map<std::string, bufferlist> attrs;
+ std::optional<std::string> user_data;
};
using RGWObjectSimplePutCR = RGWSimpleWriteOnlyAsyncCR<rgw_object_simple_put_params>;
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
using namespace rgw;
-
template<typename M>
class canonical_char_sorter {
private:
std::map<std::string,
std::string>& crypt_http_responses);
-static inline void set_attr(map<string, bufferlist>& attrs,
+static inline void set_attr(std::map<std::string, bufferlist>& attrs,
const char* key,
std::string_view value)
{
attrs[key] = std::move(bl);
}
-static inline std::string get_str_attribute(map<string, bufferlist>& attrs,
+static inline std::string get_str_attribute(std::map<std::string, bufferlist>& attrs,
const char *name)
{
auto iter = attrs.find(name);
#define dout_subsys ceph_subsys_rgw
-
+using namespace std;
int D3nCacheAioWriteRequest::d3n_prepare_libaio_write_op(bufferlist& bl, unsigned int len, string oid, string cache_location)
{
CephContext *cct;
uint64_t size;
time_t access_time;
- string address;
- string oid;
+ std::string address;
+ std::string oid;
bool complete;
struct D3nChunkDataInfo* lru_prev;
struct D3nChunkDataInfo* lru_next;
}
void dump(Formatter *f) const;
- static void generate_test_instances(list<D3nChunkDataInfo*>& o);
+ static void generate_test_instances(std::list<D3nChunkDataInfo*>& o);
};
struct D3nCacheAioWriteRequest {
- string oid;
+ std::string oid;
void *data;
int fd;
struct aiocb *cb;
CephContext *cct;
D3nCacheAioWriteRequest(CephContext *_cct) : cct(_cct) {}
- int d3n_prepare_libaio_write_op(bufferlist& bl, unsigned int len, string oid, string cache_location);
+ int d3n_prepare_libaio_write_op(bufferlist& bl, unsigned int len, std::string oid, std::string cache_location);
~D3nCacheAioWriteRequest() {
::close(fd);
struct D3nDataCache {
private:
- std::unordered_map <string, D3nChunkDataInfo*> d3n_cache_map;
- std::set<string> d3n_outstanding_write_list;
+ std::unordered_map<std::string, D3nChunkDataInfo*> d3n_cache_map;
+ std::set<std::string> d3n_outstanding_write_list;
std::mutex d3n_cache_lock;
std::mutex d3n_eviction_lock;
std::string cache_location;
- bool get(const string& oid, const off_t len);
- void put(bufferlist& bl, unsigned int len, string& obj_key);
+ bool get(const std::string& oid, const off_t len);
+ void put(bufferlist& bl, unsigned int len, std::string& obj_key);
int d3n_io_write(bufferlist& bl, unsigned int len, std::string oid);
int d3n_libaio_create_write_request(bufferlist& bl, unsigned int len, std::string oid);
void d3n_libaio_write_completion_cb(D3nCacheAioWriteRequest* c);
lsubdout(g_ceph_context, rgw_datacache, 30) << "D3nDataCache::" << __func__ << "(): is head object : " << is_head_obj << dendl;
librados::ObjectReadOperation op;
struct get_obj_data* d = static_cast<struct get_obj_data*>(arg);
- string oid, key;
+ std::string oid, key;
if (is_head_obj) {
// only when reading from the head object do we need to do the atomic test
#undef dout_prefix
#define dout_prefix (*_dout << "data sync: ")
+using namespace std;
+
static string datalog_sync_status_oid_prefix = "datalog.sync-status";
static string datalog_sync_status_shard_prefix = "datalog.sync-status.shard";
static string datalog_sync_full_sync_index_prefix = "data.full-sync.index";
rgw_bucket_shard dest_bs;
};
-inline ostream& operator<<(ostream& out, const rgw_bucket_sync_pair_info& p) {
+inline std::ostream& operator<<(std::ostream& out, const rgw_bucket_sync_pair_info& p) {
if (p.source_bs.bucket == p.dest_bs.bucket) {
return out << p.source_bs;
}
struct rgw_bucket_sync_pipe {
rgw_bucket_sync_pair_info info;
RGWBucketInfo source_bucket_info;
- map<string, bufferlist> source_bucket_attrs;
+ std::map<std::string, bufferlist> source_bucket_attrs;
RGWBucketInfo dest_bucket_info;
- map<string, bufferlist> dest_bucket_attrs;
+ std::map<std::string, bufferlist> dest_bucket_attrs;
RGWBucketSyncFlowManager::pipe_rules_ref& get_rules() {
return info.handler.rules;
}
};
-inline ostream& operator<<(ostream& out, const rgw_bucket_sync_pipe& p) {
+inline std::ostream& operator<<(std::ostream& out, const rgw_bucket_sync_pipe& p) {
return out << p.info;
}
}
void dump(Formatter *f) const {
- string s;
+ std::string s;
switch ((SyncState)state) {
case StateInit:
s = "init";
IncrementalSync = 1,
};
uint16_t state;
- string marker;
- string next_step_marker;
+ std::string marker;
+ std::string next_step_marker;
uint64_t total_entries;
uint64_t pos;
real_time timestamp;
struct rgw_data_sync_status {
rgw_data_sync_info sync_info;
- map<uint32_t, rgw_data_sync_marker> sync_markers;
+ std::map<uint32_t, rgw_data_sync_marker> sync_markers;
rgw_data_sync_status() {}
WRITE_CLASS_ENCODER(rgw_data_sync_status)
struct rgw_datalog_entry {
- string key;
+ std::string key;
ceph::real_time timestamp;
void decode_json(JSONObj *obj);
};
struct rgw_datalog_shard_data {
- string marker;
+ std::string marker;
bool truncated;
- vector<rgw_datalog_entry> entries;
+ std::vector<rgw_datalog_entry> entries;
void decode_json(JSONObj *obj);
};
class RGWDataSyncControlCR;
struct rgw_bucket_entry_owner {
- string id;
- string display_name;
+ std::string id;
+ std::string display_name;
rgw_bucket_entry_owner() {}
- rgw_bucket_entry_owner(const string& _id, const string& _display_name) : id(_id), display_name(_display_name) {}
+ rgw_bucket_entry_owner(const std::string& _id, const std::string& _display_name) : id(_id), display_name(_display_name) {}
void decode_json(JSONObj *obj);
};
counters = _counters;
}
- string shard_obj_name(int shard_id);
- string status_oid();
+ std::string shard_obj_name(int shard_id);
+ std::string status_oid();
};
struct RGWDataSyncCtx {
void finish();
int read_log_info(const DoutPrefixProvider *dpp, rgw_datalog_info *log_info);
- int read_source_log_shards_info(const DoutPrefixProvider *dpp, map<int, RGWDataChangesLogInfo> *shards_info);
- int read_source_log_shards_next(const DoutPrefixProvider *dpp, map<int, string> shard_markers, map<int, rgw_datalog_shard_data> *result);
+ int read_source_log_shards_info(const DoutPrefixProvider *dpp, std::map<int, RGWDataChangesLogInfo> *shards_info);
+ int read_source_log_shards_next(const DoutPrefixProvider *dpp, std::map<int, std::string> shard_markers, std::map<int, rgw_datalog_shard_data> *result);
int read_sync_status(const DoutPrefixProvider *dpp, rgw_data_sync_status *sync_status);
- int read_recovering_shards(const DoutPrefixProvider *dpp, const int num_shards, set<int>& recovering_shards);
- int read_shard_status(const DoutPrefixProvider *dpp, int shard_id, set<string>& lagging_buckets,set<string>& recovering_buckets, rgw_data_sync_marker* sync_marker, const int max_entries);
+ int read_recovering_shards(const DoutPrefixProvider *dpp, const int num_shards, std::set<int>& recovering_shards);
+ int read_shard_status(const DoutPrefixProvider *dpp, int shard_id, std::set<std::string>& lagging_buckets,std::set<std::string>& recovering_buckets, rgw_data_sync_marker* sync_marker, const int max_entries);
int init_sync_status(const DoutPrefixProvider *dpp, int num_shards);
int run_sync(const DoutPrefixProvider *dpp, int num_shards);
- void wakeup(int shard_id, set<string>& keys);
+ void wakeup(int shard_id, std::set<std::string>& keys);
};
class RGWDataSyncStatusManager : public DoutPrefixProvider {
RGWRemoteDataLog source_log;
- string source_status_oid;
- string source_shard_status_oid_prefix;
+ std::string source_status_oid;
+ std::string source_shard_status_oid_prefix;
- map<int, rgw_raw_obj> shard_objs;
+ std::map<int, rgw_raw_obj> shard_objs;
int num_shards;
int init(const DoutPrefixProvider *dpp);
void finalize();
- static string shard_obj_name(const rgw_zone_id& source_zone, int shard_id);
- static string sync_status_oid(const rgw_zone_id& source_zone);
+ static std::string shard_obj_name(const rgw_zone_id& source_zone, int shard_id);
+ static std::string sync_status_oid(const rgw_zone_id& source_zone);
int read_sync_status(const DoutPrefixProvider *dpp, rgw_data_sync_status *sync_status) {
return source_log.read_sync_status(dpp, sync_status);
}
- int read_recovering_shards(const DoutPrefixProvider *dpp, const int num_shards, set<int>& recovering_shards) {
+ int read_recovering_shards(const DoutPrefixProvider *dpp, const int num_shards, std::set<int>& recovering_shards) {
return source_log.read_recovering_shards(dpp, num_shards, recovering_shards);
}
- int read_shard_status(const DoutPrefixProvider *dpp, int shard_id, set<string>& lagging_buckets, set<string>& recovering_buckets, rgw_data_sync_marker *sync_marker, const int max_entries) {
+ int read_shard_status(const DoutPrefixProvider *dpp, int shard_id, std::set<std::string>& lagging_buckets, std::set<std::string>& recovering_buckets, rgw_data_sync_marker *sync_marker, const int max_entries) {
return source_log.read_shard_status(dpp, shard_id, lagging_buckets, recovering_buckets,sync_marker, max_entries);
}
int init_sync_status(const DoutPrefixProvider *dpp) { return source_log.init_sync_status(dpp, num_shards); }
int read_log_info(const DoutPrefixProvider *dpp, rgw_datalog_info *log_info) {
return source_log.read_log_info(dpp, log_info);
}
- int read_source_log_shards_info(const DoutPrefixProvider *dpp, map<int, RGWDataChangesLogInfo> *shards_info) {
+ int read_source_log_shards_info(const DoutPrefixProvider *dpp, std::map<int, RGWDataChangesLogInfo> *shards_info) {
return source_log.read_source_log_shards_info(dpp, shards_info);
}
- int read_source_log_shards_next(const DoutPrefixProvider *dpp, map<int, string> shard_markers, map<int, rgw_datalog_shard_data> *result) {
+ int read_source_log_shards_next(const DoutPrefixProvider *dpp, std::map<int, std::string> shard_markers, std::map<int, rgw_datalog_shard_data> *result) {
return source_log.read_source_log_shards_next(dpp, shard_markers, result);
}
int run(const DoutPrefixProvider *dpp) { return source_log.run_sync(dpp, num_shards); }
- void wakeup(int shard_id, set<string>& keys) { return source_log.wakeup(shard_id, keys); }
+ void wakeup(int shard_id, std::set<std::string>& keys) { return source_log.wakeup(shard_id, keys); }
void stop() {
source_log.finish();
}
rgw_bucket_shard_full_sync_marker() : count(0) {}
- void encode_attr(map<string, bufferlist>& attrs);
+ void encode_attr(std::map<std::string, bufferlist>& attrs);
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
WRITE_CLASS_ENCODER(rgw_bucket_shard_full_sync_marker)
struct rgw_bucket_shard_inc_sync_marker {
- string position;
+ std::string position;
ceph::real_time timestamp;
- void encode_attr(map<string, bufferlist>& attrs);
+ void encode_attr(std::map<std::string, bufferlist>& attrs);
void encode(bufferlist& bl) const {
ENCODE_START(2, 1, bl);
rgw_bucket_shard_full_sync_marker full_marker;
rgw_bucket_shard_inc_sync_marker inc_marker;
- void decode_from_attrs(CephContext *cct, map<string, bufferlist>& attrs);
- void encode_all_attrs(map<string, bufferlist>& attrs);
- void encode_state_attr(map<string, bufferlist>& attrs);
+ void decode_from_attrs(CephContext *cct, std::map<std::string, bufferlist>& attrs);
+ void encode_all_attrs(std::map<std::string, bufferlist>& attrs);
+ void encode_state_attr(std::map<std::string, bufferlist>& attrs);
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
WRITE_CLASS_ENCODER(rgw_bucket_shard_sync_info)
struct rgw_bucket_index_marker_info {
- string bucket_ver;
- string master_ver;
- string max_marker;
+ std::string bucket_ver;
+ std::string master_ver;
+ std::string max_marker;
bool syncstopped{false};
void decode_json(JSONObj *obj) {
RGWRESTConn *conn{nullptr};
rgw_zone_id source_zone;
- vector<rgw_bucket_sync_pair_info> sync_pairs;
+ std::vector<rgw_bucket_sync_pair_info> sync_pairs;
RGWDataSyncCtx sc;
rgw_bucket_shard_sync_info init_status;
rgw_bucket dest_bucket;
- vector<RGWRemoteBucketManager *> source_mgrs;
+ std::vector<RGWRemoteBucketManager *> source_mgrs;
- string source_status_oid;
- string source_shard_status_oid_prefix;
+ std::string source_status_oid;
+ std::string source_shard_status_oid_prefix;
- map<int, rgw_bucket_shard_sync_info> sync_status;
+ std::map<int, rgw_bucket_shard_sync_info> sync_status;
rgw_raw_obj status_obj;
int num_shards;
int init(const DoutPrefixProvider *dpp);
- map<int, rgw_bucket_shard_sync_info>& get_sync_status() { return sync_status; }
+ std::map<int, rgw_bucket_shard_sync_info>& get_sync_status() { return sync_status; }
int init_sync_status(const DoutPrefixProvider *dpp);
- 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,
+ static std::string status_oid(const rgw_zone_id& source_zone, const rgw_bucket_sync_pair_info& bs);
+ static std::string obj_status_oid(const rgw_bucket_sync_pipe& sync_pipe,
const rgw_zone_id& source_zone, const rgw::sal::Object* obj); /* specific source obj sync status,
can be used by sync modules */
return r;
}
std::string_view max_marker() const override {
- return "99999999"sv;
+ return "99999999";
}
int is_empty(const DoutPrefixProvider *dpp) override {
for (auto shard = 0u; shard < oids.size(); ++shard) {
fifo.meta(dpp, m, null_yield);
auto p = m.head_part_num;
if (p < 0) {
- info->marker = ""s;
+ info->marker = "";
info->last_update = ceph::real_clock::zero();
return 0;
}
const int num_shards;
std::string get_prefix() {
auto prefix = cct->_conf->rgw_data_log_obj_prefix;
- return prefix.empty() ? prefix : "data_log"s;
+ return prefix.empty() ? prefix : "data_log";
}
std::string metadata_log_oid() {
- return get_prefix() + "generations_metadata"s;
+ return get_prefix() + "generations_metadata";
}
std::string prefix;
#include "common/Formatter.h"
+using namespace std;
+
static string shadow_ns = RGW_OBJ_NS_SHADOW;
static void init_bucket(rgw_bucket *b, const char *t, const char *n, const char *dp, const char *ip, const char *m, const char *id)
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
void RGWEnv::init(CephContext *cct)
{
conf.init(cct);
#include "common/ceph_json.h"
#include "rgw_es_query.h"
+using namespace std;
int main(int argc, char *argv[])
{
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
bool pop_front(list<string>& l, string *s)
{
if (l.empty()) {
#include "rgw_string.h"
class ESQueryStack {
- list<string> l;
- list<string>::iterator iter;
+ std::list<std::string> l;
+ std::list<std::string>::iterator iter;
public:
- explicit ESQueryStack(list<string>& src) {
+ explicit ESQueryStack(std::list<std::string>& src) {
assign(src);
}
ESQueryStack() {}
- void assign(list<string>& src) {
+ void assign(std::list<std::string>& src) {
l.swap(src);
iter = l.begin();
}
- bool peek(string *dest) {
+ bool peek(std::string *dest) {
if (done()) {
return false;
}
return true;
}
- bool pop(string *dest) {
+ bool pop(std::string *dest) {
bool valid = peek(dest);
if (!valid) {
return false;
};
class ESInfixQueryParser {
- string query;
+ std::string query;
int size;
const char *str;
int pos{0};
- list<string> args;
+ std::list<std::string> args;
void skip_whitespace(const char *str, int size, int& pos);
bool get_next_token(bool (*filter)(char));
bool parse_close_bracket();
public:
- explicit ESInfixQueryParser(const string& _query) : query(_query), size(query.size()), str(query.c_str()) {}
- bool parse(list<string> *result);
+ explicit ESInfixQueryParser(const std::string& _query) : query(_query), size(query.size()), str(query.c_str()) {}
+ bool parse(std::list<std::string> *result);
};
class ESQueryNode;
ES_ENTITY_DATE = 3,
};
- map<string, EntityType> m;
+ std::map<std::string, EntityType> m;
- explicit ESEntityTypeMap(map<string, EntityType>& _m) : m(_m) {}
+ explicit ESEntityTypeMap(std::map<std::string, EntityType>& _m) : m(_m) {}
- bool find(const string& entity, EntityType *ptype) {
+ bool find(const std::string& entity, EntityType *ptype) {
auto i = m.find(entity);
if (i != m.end()) {
*ptype = i->second;
ESQueryStack stack;
ESQueryNode *query_root{nullptr};
- string custom_prefix;
+ std::string custom_prefix;
- bool convert(list<string>& infix, string *perr);
+ bool convert(std::list<std::string>& infix, std::string *perr);
- list<pair<string, string> > eq_conds;
+ std::list<std::pair<std::string, std::string> > eq_conds;
ESEntityTypeMap *generic_type_map{nullptr};
ESEntityTypeMap *custom_type_map{nullptr};
- map<string, string, ltstr_nocase> *field_aliases = nullptr;
- set<string> *restricted_fields = nullptr;
+ std::map<std::string, std::string, ltstr_nocase> *field_aliases = nullptr;
+ std::set<std::string> *restricted_fields = nullptr;
public:
- ESQueryCompiler(const string& query, list<pair<string, string> > *prepend_eq_conds, const string& _custom_prefix) : parser(query), custom_prefix(_custom_prefix) {
+ ESQueryCompiler(const std::string& query,
+ std::list<std::pair<std::string, std::string> > *prepend_eq_conds,
+ const std::string& _custom_prefix)
+ : parser(query), custom_prefix(_custom_prefix) {
if (prepend_eq_conds) {
eq_conds = std::move(*prepend_eq_conds);
}
}
~ESQueryCompiler();
- bool compile(string *perr);
+ bool compile(std::string *perr);
void dump(Formatter *f) const;
void set_generic_type_map(ESEntityTypeMap *entity_map) {
ESEntityTypeMap *get_generic_type_map() {
return generic_type_map;
}
- const string& get_custom_prefix() { return custom_prefix; }
+ const std::string& get_custom_prefix() { return custom_prefix; }
void set_custom_type_map(ESEntityTypeMap *entity_map) {
custom_type_map = entity_map;
return custom_type_map;
}
- void set_field_aliases(map<string, string, ltstr_nocase> *fa) {
+ void set_field_aliases(std::map<std::string, std::string, ltstr_nocase> *fa) {
field_aliases = fa;
}
- string unalias_field(const string& field) {
+ std::string unalias_field(const std::string& field) {
if (!field_aliases) {
return field;
}
return i->second;
}
- void set_restricted_fields(set<string> *rf) {
+ void set_restricted_fields(std::set<std::string> *rf) {
restricted_fields = rf;
}
- bool is_restricted(const string& f) {
+ bool is_restricted(const std::string& f) {
return (restricted_fields && restricted_fields->find(f) != restricted_fields->end());
}
};
protected:
CephContext* cct;
MD5 hash;
- string calculated_etag;
+ std::string calculated_etag;
public:
ETagVerifier(CephContext* cct_, rgw::sal::DataProcessor *next)
: Pipe(next), cct(cct_) {}
virtual void calculate_etag() = 0;
- string get_calculated_etag() { return calculated_etag;}
+ std::string get_calculated_etag() { return calculated_etag;}
}; /* ETagVerifier */
#define dout_subsys ceph_subsys_rgw
+using namespace std;
using namespace rgw;
namespace rgw {
}
directory* get_directory() {
- return get<directory>(&variant_type);
+ return boost::get<directory>(&variant_type);
}
size_t get_size() const { return state.size; }
}
bool eof() {
+ using boost::get;
+
if (unlikely(cct->_conf->subsys.should_gather(ceph_subsys_rgw, 15))) {
bool is_offset =
unlikely(! get<const char*>(&offset)) ||
class DirIterator
{
- vector<rgw_bucket_dir_entry>& objs;
- vector<rgw_bucket_dir_entry>::iterator obj_iter;
+ std::vector<rgw_bucket_dir_entry>& objs;
+ std::vector<rgw_bucket_dir_entry>::iterator obj_iter;
- map<string, bool>& common_prefixes;
- map<string, bool>::iterator cp_iter;
+ std::map<std::string, bool>& common_prefixes;
+ std::map<string, bool>::iterator cp_iter;
boost::optional<std::string_view> obj_sref;
boost::optional<std::string_view> cp_sref;
public:
- DirIterator(vector<rgw_bucket_dir_entry>& objs,
- map<string, bool>& common_prefixes)
+ DirIterator(std::vector<rgw_bucket_dir_entry>& objs,
+ std::map<string, bool>& common_prefixes)
: objs(objs), common_prefixes(common_prefixes), _skip_cp(false)
{
obj_iter = objs.begin();
return cp_sref.get();
}
- vector<rgw_bucket_dir_entry>::iterator& get_obj_iter() {
+ std::vector<rgw_bucket_dir_entry>::iterator& get_obj_iter() {
return obj_iter;
}
- map<string, bool>::iterator& get_cp_iter() {
+ std::map<string, bool>::iterator& get_cp_iter() {
return cp_iter;
}
}
bool eof() {
+ using boost::get;
+
if (unlikely(cct->_conf->subsys.should_gather(ceph_subsys_rgw, 15))) {
bool is_offset =
unlikely(! get<const char*>(&offset)) ||
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
RGWFormatter_Plain::RGWFormatter_Plain(const bool ukv)
: use_kv(ukv)
{
void output_header() override {};
void output_footer() override {};
void enable_line_break() override {};
- void flush(ostream& os) override;
+ void flush(std::ostream& os) override;
void reset() override;
void open_array_section(std::string_view name) override;
};
class RGWStreamFlusher : public RGWFormatterFlusher {
- ostream& os;
+ std::ostream& os;
protected:
void do_flush() override {
formatter->flush(os);
}
public:
- RGWStreamFlusher(Formatter *f, ostream& _os) : RGWFormatterFlusher(f), os(_os) {}
+ RGWStreamFlusher(Formatter *f, std::ostream& _os) : RGWFormatterFlusher(f), os(_os) {}
};
class RGWNullFlusher : public RGWFormatterFlusher {
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
int RGWFrontendConfig::parse_config(const string& config,
std::multimap<string, string>& config_map)
{
void set_default_config(RGWFrontendConfig& def_conf);
- std::optional<string> get_val(const std::string& key);
+ std::optional<std::string> get_val(const std::string& key);
bool get_val(const std::string& key,
const std::string& def_val,
pprocess = pp;
- string uid_str;
+ std::string uid_str;
conf->get_val("uid", "", &uid_str);
if (uid_str.empty()) {
derr << "ERROR: uid param must be specified for loadgen frontend"
return ret;
}
- map<string, RGWAccessKey>::iterator aiter = user->get_info().access_keys.begin();
+ auto aiter = user->get_info().access_keys.begin();
if (aiter == user->get_info().access_keys.end()) {
derr << "ERROR: user has no S3 access keys set" << dendl;
return -EINVAL;
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
using namespace librados;
static string gc_oid_prefix = "gc";
CephContext *cct;
RGWRados *store;
int max_objs;
- string *obj_names;
+ std::string *obj_names;
std::atomic<bool> down_flag = { false };
static constexpr uint64_t seed = 8675309;
- int tag_index(const string& tag);
+ int tag_index(const std::string& tag);
class GCWorker : public Thread {
const DoutPrefixProvider *dpp;
stop_processor();
finalize();
}
- vector<bool> transitioned_objects_cache;
- int send_chain(cls_rgw_obj_chain& chain, const string& tag);
+ std::vector<bool> transitioned_objects_cache;
+ int send_chain(cls_rgw_obj_chain& chain, const std::string& tag);
// asynchronously defer garbage collection on an object that's still being read
- int async_defer_chain(const string& tag, const cls_rgw_obj_chain& info);
+ int async_defer_chain(const std::string& tag, const cls_rgw_obj_chain& info);
// callback for when async_defer_chain() fails with ECANCELED
void on_defer_canceled(const cls_rgw_gc_obj_info& info);
- int remove(int index, const std::vector<string>& tags, librados::AioCompletion **pc);
+ int remove(int index, const std::vector<std::string>& tags, librados::AioCompletion **pc);
int remove(int index, int num_entries);
void initialize(CephContext *_cct, RGWRados *_store);
void finalize();
- int list(int *index, string& marker, uint32_t max, bool expired_only, std::list<cls_rgw_gc_obj_info>& result, bool *truncated, bool& processing_queue);
+ int list(int *index, std::string& marker, uint32_t max, bool expired_only, std::list<cls_rgw_gc_obj_info>& result, bool *truncated, bool& processing_queue);
void list_init(int *index) { *index = 0; }
int process(int index, int process_max_secs, bool expired_only,
RGWGCIOManager& io_manager);
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
RGWHTTPManager *rgw_http_manager;
struct RGWCurlHandle;
#include <atomic>
-using param_pair_t = pair<string, string>;
-using param_vec_t = vector<param_pair_t>;
+using param_pair_t = std::pair<std::string, std::string>;
+using param_vec_t = std::vector<param_pair_t>;
void rgw_http_client_init(CephContext *cct);
void rgw_http_client_cleanup();
bool verify_ssl; // Do not validate self signed certificates, default to false
- string ca_path;
+ std::string ca_path;
- string client_cert;
+ std::string client_cert;
- string client_key;
+ std::string client_key;
std::atomic<unsigned> stopped { 0 };
protected:
CephContext *cct;
- string method;
- string url;
+ std::string method;
+ std::string url;
- string protocol;
- string host;
- string resource_prefix;
+ std::string protocol;
+ std::string host;
+ std::string resource_prefix;
size_t send_len{0};
virtual ~RGWHTTPClient();
explicit RGWHTTPClient(CephContext *cct,
- const string& _method,
- const string& _url);
+ const std::string& _method,
+ const std::string& _url);
std::ostream& gen_prefix(std::ostream& out) const override;
- void append_header(const string& name, const string& val) {
- headers.push_back(pair<string, string>(name, val));
+ void append_header(const std::string& name, const std::string& val) {
+ headers.push_back(std::pair<std::string, std::string>(name, val));
}
void set_send_length(size_t len) {
rgw_http_req_data *get_req_data() { return req_data; }
- string to_str();
+ std::string to_str();
int get_req_retcode();
- void set_url(const string& _url) {
+ void set_url(const std::string& _url) {
url = _url;
}
- void set_method(const string& _method) {
+ void set_method(const std::string& _method) {
method = _method;
}
return user_info;
}
- void set_ca_path(const string& _ca_path) {
+ void set_ca_path(const std::string& _ca_path) {
ca_path = _ca_path;
}
- void set_client_cert(const string& _client_cert) {
+ void set_client_cert(const std::string& _client_cert) {
client_cert = _client_cert;
}
- void set_client_key(const string& _client_key) {
+ void set_client_key(const std::string& _client_key) {
client_key = _client_key;
}
};
typedef std::set<header_name_t, ltstr_nocase> header_spec_t;
RGWHTTPHeadersCollector(CephContext * const cct,
- const string& method,
- const string& url,
+ const std::string& method,
+ const std::string& url,
const header_spec_t &relevant_headers)
: RGWHTTPClient(cct, method, url),
relevant_headers(relevant_headers) {
public:
RGWHTTPTransceiver(CephContext * const cct,
- const string& method,
- const string& url,
+ const std::string& method,
+ const std::string& url,
bufferlist * const read_bl,
const header_spec_t intercept_headers = {})
: RGWHTTPHeadersCollector(cct, method, url, intercept_headers),
}
RGWHTTPTransceiver(CephContext * const cct,
- const string& method,
- const string& url,
+ const std::string& method,
+ const std::string& url,
bufferlist * const read_bl,
const bool verify_ssl,
const header_spec_t intercept_headers = {})
std::atomic<unsigned> is_stopped { 0 };
ceph::shared_mutex reqs_lock = ceph::make_shared_mutex("RGWHTTPManager::reqs_lock");
- map<uint64_t, rgw_http_req_data *> reqs;
- list<rgw_http_req_data *> unregistered_reqs;
- list<set_state> reqs_change_state;
- map<uint64_t, rgw_http_req_data *> complete_reqs;
+ std::map<uint64_t, rgw_http_req_data *> reqs;
+ std::list<rgw_http_req_data *> unregistered_reqs;
+ std::list<set_state> reqs_change_state;
+ std::map<uint64_t, rgw_http_req_data *> complete_reqs;
int64_t num_reqs = 0;
int64_t max_threaded_req = 0;
int thread_pipe[2];
}
using std::bitset;
+using std::dec;
using std::find;
+using std::hex;
using std::int64_t;
using std::move;
using std::pair;
Effect eval_conditions(const Environment& e) const;
};
-std::ostream& operator <<(ostream& m, const Statement& s);
+std::ostream& operator <<(std::ostream& m, const Statement& s);
struct PolicyParseException : public std::exception {
rapidjson::ParseResult pr;
Effect eval_conditions(const Environment& e) const;
template <typename F>
- bool has_conditional(const string& conditional, F p) const {
+ bool has_conditional(const std::string& conditional, F p) const {
for (const auto&s: statements){
if (std::any_of(s.conditions.begin(), s.conditions.end(),
[&](const Condition& c) { return c.has_key_p(conditional, p);}))
return false;
}
- bool has_conditional(const string& c) const {
+ bool has_conditional(const std::string& c) const {
return has_conditional(c, Condition::ci_equal_to());
}
- bool has_partial_conditional(const string& c) const {
+ bool has_partial_conditional(const std::string& c) const {
return has_conditional(c, Condition::ci_starts_with());
}
};
-std::ostream& operator <<(ostream& m, const Policy& p);
+std::ostream& operator <<(std::ostream& m, const Policy& p);
bool is_public(const Policy& p);
}
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
void encode_json(const char *name, const obj_version& v, Formatter *f)
{
f->open_object_section(name);
#define dout_subsys ceph_subsys_rgw
+using namespace std;
void dump_array(JSONObj *obj)
{
#define dout_subsys ceph_subsys_rgw
#define PKI_ANS1_PREFIX "MII"
+using namespace std;
+
bool rgw_is_pki_token(const string& token)
{
return token.compare(0, sizeof(PKI_ANS1_PREFIX) - 1, PKI_ANS1_PREFIX) == 0;
#include <atomic>
-bool rgw_is_pki_token(const string& token);
-void rgw_get_token_id(const string& token, string& token_id);
-static inline std::string rgw_get_token_id(const string& token)
+bool rgw_is_pki_token(const std::string& token);
+void rgw_get_token_id(const std::string& token, std::string& token_id);
+static inline std::string rgw_get_token_id(const std::string& token)
{
std::string token_id;
rgw_get_token_id(token, token_id);
class RGWKeystoneHTTPTransceiver : public RGWHTTPTransceiver {
public:
RGWKeystoneHTTPTransceiver(CephContext * const cct,
- const string& method,
- const string& url,
+ const std::string& method,
+ const std::string& url,
bufferlist * const token_body_bl)
: RGWHTTPTransceiver(cct, method, url, token_body_bl,
cct->_conf->rgw_keystone_verify_ssl,
public:
class Domain {
public:
- string id;
- string name;
+ std::string id;
+ std::string name;
void decode_json(JSONObj *obj);
};
class Project {
public:
Domain domain;
- string id;
- string name;
+ std::string id;
+ std::string name;
void decode_json(JSONObj *obj);
};
class Token {
public:
Token() : expires(0) { }
- string id;
+ std::string id;
time_t expires;
Project tenant_v2;
void decode_json(JSONObj *obj);
class Role {
public:
- string id;
- string name;
+ std::string id;
+ std::string name;
void decode_json(JSONObj *obj);
};
class User {
public:
- string id;
- string name;
+ std::string id;
+ std::string name;
Domain domain;
- list<Role> roles_v2;
+ std::list<Role> roles_v2;
void decode_json(JSONObj *obj);
};
Token token;
Project project;
User user;
- list<Role> roles;
+ std::list<Role> roles;
void decode_v3(JSONObj* obj);
void decode_v2(JSONObj* obj);
const std::string& get_project_name() const {return project.name;};
const std::string& get_user_id() const {return user.id;};
const std::string& get_user_name() const {return user.name;};
- bool has_role(const string& r) const;
+ bool has_role(const std::string& r) const;
bool expired() const {
const uint64_t now = ceph_clock_now().sec();
return now >= static_cast<uint64_t>(get_expires());
class TokenCache {
struct token_entry {
TokenEnvelope token;
- list<string>::iterator lru_iter;
+ std::list<std::string>::iterator lru_iter;
};
std::atomic<bool> down_flag = { false };
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
using namespace rgw;
#ifndef FORTEST_VIRTUAL
* \return
*/
int make_actual_key_from_kms(CephContext *cct,
- map<string, bufferlist>& attrs,
+ std::map<std::string, bufferlist>& attrs,
std::string& actual_key);
int reconstitute_actual_key_from_kms(CephContext *cct,
- map<string, bufferlist>& attrs,
+ std::map<std::string, bufferlist>& attrs,
std::string& actual_key);
/**
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
const char* LC_STATUS[] = {
"UNINITIAL",
"PROCESSING",
#define HASH_PRIME 7877
#define MAX_ID_LEN 255
-static string lc_oid_prefix = "lc";
-static string lc_index_lock_name = "lc_process";
+static std::string lc_oid_prefix = "lc";
+static std::string lc_index_lock_name = "lc_process";
extern const char* LC_STATUS[];
class LCExpiration
{
protected:
- string days;
+ std::string days;
//At present only current object has expiration date
- string date;
+ std::string date;
public:
LCExpiration() {}
- LCExpiration(const string& _days, const string& _date) : days(_days), date(_date) {}
+ LCExpiration(const std::string& _days, const std::string& _date) : days(_days), date(_date) {}
void encode(bufferlist& bl) const {
ENCODE_START(3, 2, bl);
}
void dump(Formatter *f) const;
// static void generate_test_instances(list<ACLOwner*>& o);
- void set_days(const string& _days) { days = _days; }
- string get_days_str() const {
+ void set_days(const std::string& _days) { days = _days; }
+ std::string get_days_str() const {
return days;
}
int get_days() const {return atoi(days.c_str()); }
bool has_days() const {
return !days.empty();
}
- void set_date(const string& _date) { date = _date; }
- string get_date() const {
+ void set_date(const std::string& _date) { date = _date; }
+ std::string get_date() const {
return date;
}
bool has_date() const {
class LCTransition
{
protected:
- string days;
- string date;
- string storage_class;
+ std::string days;
+ std::string date;
+ std::string storage_class;
public:
int get_days() const {
return atoi(days.c_str());
}
- string get_date() const {
+ std::string get_date() const {
return date;
}
- string get_storage_class() const {
+ std::string get_storage_class() const {
return storage_class;
}
class LCRule
{
protected:
- string id;
- string prefix;
- string status;
+ std::string id;
+ std::string prefix;
+ std::string status;
LCExpiration expiration;
LCExpiration noncur_expiration;
LCExpiration mp_expiration;
LCFilter filter;
- map<string, LCTransition> transitions;
- map<string, LCTransition> noncur_transitions;
+ std::map<std::string, LCTransition> transitions;
+ std::map<std::string, LCTransition> noncur_transitions;
bool dm_expiration = false;
public:
LCRule(){};
~LCRule(){};
- const string& get_id() const {
+ const std::string& get_id() const {
return id;
}
- const string& get_status() const {
+ const std::string& get_status() const {
return status;
}
status = (flag ? "Enabled" : "Disabled");
}
- const string& get_prefix() const {
+ const std::string& get_prefix() const {
return prefix;
}
return dm_expiration;
}
- const map<string, LCTransition>& get_transitions() const {
+ const std::map<std::string, LCTransition>& get_transitions() const {
return transitions;
}
- const map<string, LCTransition>& get_noncur_transitions() const {
+ const std::map<std::string, LCTransition>& get_noncur_transitions() const {
return noncur_transitions;
}
- void set_id(const string& _id) {
+ void set_id(const std::string& _id) {
id = _id;
}
- void set_prefix(const string& _prefix) {
+ void set_prefix(const std::string& _prefix) {
prefix = _prefix;
}
- void set_status(const string& _status) {
+ void set_status(const std::string& _status) {
status = _status;
}
{
int days;
boost::optional<ceph::real_time> date;
- string storage_class;
+ std::string storage_class;
transition_action() : days(0) {}
void dump(Formatter *f) const {
if (!date) {
/* XXX why not LCRule? */
struct lc_op
{
- string id;
+ std::string id;
bool status{false};
bool dm_expiration{false};
int expiration{0};
int mp_expiration{0};
boost::optional<ceph::real_time> expiration_date;
boost::optional<RGWObjTags> obj_tags;
- map<string, transition_action> transitions;
- map<string, transition_action> noncur_transitions;
+ std::map<std::string, transition_action> transitions;
+ std::map<std::string, transition_action> noncur_transitions;
/* ctors are nice */
lc_op() = delete;
{
protected:
CephContext *cct;
- multimap<string, lc_op> prefix_map;
- multimap<string, LCRule> rule_map;
+ std::multimap<std::string, lc_op> prefix_map;
+ std::multimap<std::string, LCRule> rule_map;
bool _add_rule(const LCRule& rule);
bool has_same_action(const lc_op& first, const lc_op& second);
public:
virtual ~RGWLifecycleConfiguration() {}
-// int get_perm(string& id, int perm_mask);
+// int get_perm(std::string& id, int perm_mask);
// int get_group_perm(ACLGroupTypeEnum group, int perm_mask);
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
decode(rule_map, bl);
- multimap<string, LCRule>::iterator iter;
+ std::multimap<std::string, LCRule>::iterator iter;
for (iter = rule_map.begin(); iter != rule_map.end(); ++iter) {
LCRule& rule = iter->second;
_add_rule(rule);
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
- static void generate_test_instances(list<RGWLifecycleConfiguration*>& o);
+ static void generate_test_instances(std::list<RGWLifecycleConfiguration*>& o);
void add_rule(const LCRule& rule);
bool valid();
- multimap<string, LCRule>& get_rule_map() { return rule_map; }
- multimap<string, lc_op>& get_prefix_map() { return prefix_map; }
+ std::multimap<std::string, LCRule>& get_rule_map() { return rule_map; }
+ std::multimap<std::string, lc_op>& get_prefix_map() { return prefix_map; }
/*
- void create_default(string id, string name) {
+ void create_default(std::string id, std::string name) {
ACLGrant grant;
grant.set_canon(id, name, RGW_PERM_FULL_CONTROL);
add_grant(&grant);
rgw::sal::Store* store;
std::unique_ptr<rgw::sal::Lifecycle> sal_lc;
int max_objs{0};
- string *obj_names{nullptr};
+ std::string *obj_names{nullptr};
std::atomic<bool> down_flag = { false };
- string cookie;
+ std::string cookie;
public:
bool if_already_run_today(time_t start_date);
bool expired_session(time_t started);
time_t thread_stop_at();
- int list_lc_progress(string& marker, uint32_t max_entries,
- vector<rgw::sal::Lifecycle::LCEntry>&, int& index);
+ int list_lc_progress(std::string& marker, uint32_t max_entries,
+ std::vector<rgw::sal::Lifecycle::LCEntry>&, int& index);
int bucket_lc_prepare(int index, LCWorker* worker);
- int bucket_lc_process(string& shard_id, LCWorker* worker, time_t stop_at,
+ int bucket_lc_process(std::string& shard_id, LCWorker* worker, time_t stop_at,
bool once);
int bucket_lc_post(int index, int max_lock_sec,
rgw::sal::Lifecycle::LCEntry& entry, int& result, LCWorker* worker);
private:
int handle_multipart_expiration(rgw::sal::Bucket* target,
- const multimap<string, lc_op>& prefix_map,
+ const std::multimap<std::string, lc_op>& prefix_map,
LCWorker* worker, time_t stop_at, bool once);
};
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
static bool check_date(const string& _date)
{
boost::optional<ceph::real_time> date = ceph::from_iso_8601(_date);
bool dm_expiration{false};
public:
LCExpiration_S3() {}
- LCExpiration_S3(string _days, string _date, bool _dm_expiration) : LCExpiration(_days, _date), dm_expiration(_dm_expiration) {}
+ LCExpiration_S3(std::string _days, std::string _date, bool _dm_expiration) : LCExpiration(_days, _date), dm_expiration(_dm_expiration) {}
void dump_xml(Formatter *f) const;
void decode_xml(XMLObj *obj);
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
std::string parse_rgw_ldap_bindpw(CephContext* ctx)
{
string ldap_bindpw;
std::ostream& gen_prefix(std::ostream& out) const { return out << "lib rgw: "; }
int init();
- int init(vector<const char *>& args);
+ int init(std::vector<const char *>& args);
int stop();
};
lsubdout(g_ceph_context, rgw, 10)
<< __func__ << " enqueue request req="
- << hex << req << dec << dendl;
+ << std::hex << req << std::dec << dendl;
req_throttle.get(1);
req_wq.queue(req);
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
void RGWLoadGenRequestEnv::set_date(utime_t& tm)
{
date_str = rgw_to_asctime(tm);
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
extern void signal_shutdown();
void RGWLoadGenProcess::checkpoint()
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
static void set_param_str(struct req_state *s, const char *name, string& str)
{
const char *p = s->info.env->get(name);
rgw_user object_owner;
rgw_user bucket_owner;
- string bucket;
+ std::string bucket;
Clock::time_point time;
- string remote_addr;
- string user;
+ std::string remote_addr;
+ std::string user;
rgw_obj_key obj;
- string op;
- string uri;
- string http_status;
- string error_code;
+ std::string op;
+ std::string uri;
+ std::string http_status;
+ std::string error_code;
uint64_t bytes_sent = 0;
uint64_t bytes_received = 0;
uint64_t obj_size = 0;
Clock::duration total_time{};
- string user_agent;
- string referrer;
- string bucket_id;
+ std::string user_agent;
+ std::string referrer;
+ std::string bucket_id;
headers_map x_headers;
- string trans_id;
- std::vector<string> token_claims;
+ std::string trans_id;
+ std::vector<std::string> token_claims;
uint32_t identity_type;
void encode(bufferlist &bl) const {
DECODE_FINISH(p);
}
void dump(ceph::Formatter *f) const;
- static void generate_test_instances(list<rgw_log_entry*>& o);
+ static void generate_test_instances(std::list<rgw_log_entry*>& o);
};
WRITE_CLASS_ENCODER(rgw_log_entry)
class RGWREST;
int rgw_log_op(rgw::sal::Store* store, RGWREST* const rest, struct req_state* s,
- const string& op_name, OpsLogSocket* olog);
+ const std::string& op_name, OpsLogSocket* olog);
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,
#include "rgw_tools.h"
#include "cls_fifo_legacy.h"
+using namespace std::chrono_literals;
namespace cb = ceph::buffer;
static constexpr auto dout_subsys = ceph_subsys_rgw;
rados::cls::fifo::info info;
uint32_t part_header_size = 0, part_entry_overhead = 0;
- auto r = rgw::cls::fifo::get_meta(dpp, ioctx, oid, nullopt, &info,
+ auto r = rgw::cls::fifo::get_meta(dpp, ioctx, oid, std::nullopt, &info,
&part_header_size, &part_entry_overhead,
0, y, true);
if (r == -ENOENT) continue;
inline std::pair<uint64_t, std::string_view>
cursorgen(std::string_view cursor_) {
if (cursor_.empty()) {
- return { 0, ""sv };
+ return { 0, "" };
}
std::string_view cursor = cursor_;
if (cursor[0] != 'G') {
int remove_package(const DoutPrefixProvider *dpp, rgw::sal::Store* store, optional_yield y, const std::string& package_name) {
librados::ObjectWriteOperation op;
size_t pos = package_name.find(" ");
- if (pos != string::npos) {
+ if (pos != package_name.npos) {
// remove specfic version of the the package
op.omap_rm_keys(std::set<std::string>({package_name}));
auto ret = rgw_rados_operate(dpp, *(static_cast<rgw::sal::RadosStore*>(store)->getRados()->get_lc_pool_ctx()),
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
namespace {
TracepointProvider::Traits rgw_op_tracepoint_traits("librgw_op_tp.so",
"rgw_op_tracing");
#define META_LOG_OBJ_PREFIX "meta.log."
struct RGWMetadataLogInfo {
- string marker;
+ std::string marker;
real_time last_update;
void dump(Formatter *f) const;
class RGWMetadataLog {
CephContext *cct;
- const string prefix;
+ const std::string prefix;
struct Svc {
RGWSI_Zone *zone{nullptr};
}
RWLock lock;
- set<int> modified_shards;
+ std::set<int> modified_shards;
void mark_modified(int shard_id);
public:
}
- void get_shard_oid(int id, string& oid) const {
+ void get_shard_oid(int id, std::string& oid) const {
char buf[16];
snprintf(buf, sizeof(buf), "%d", id);
oid = prefix + buf;
}
- int add_entry(const DoutPrefixProvider *dpp, const string& hash_key, const string& section, const string& key, bufferlist& bl);
- int get_shard_id(const string& hash_key, int *shard_id);
- int store_entries_in_shard(const DoutPrefixProvider *dpp, list<cls_log_entry>& entries, int shard_id, librados::AioCompletion *completion);
+ int add_entry(const DoutPrefixProvider *dpp, const std::string& hash_key, const std::string& section, const std::string& key, bufferlist& bl);
+ int get_shard_id(const std::string& hash_key, int *shard_id);
+ int store_entries_in_shard(const DoutPrefixProvider *dpp, std::list<cls_log_entry>& entries, int shard_id, librados::AioCompletion *completion);
struct LogListCtx {
int cur_shard;
- string marker;
+ std::string marker;
real_time from_time;
real_time end_time;
- string cur_oid;
+ std::string cur_oid;
bool done;
};
void init_list_entries(int shard_id, const real_time& from_time,
- const real_time& end_time, const string& marker,
+ const real_time& end_time, const std::string& marker,
void **handle);
void complete_list_entries(void *handle);
int list_entries(const DoutPrefixProvider *dpp,
void *handle,
int max_entries,
- list<cls_log_entry>& entries,
- string *out_marker,
+ std::list<cls_log_entry>& entries,
+ std::string *out_marker,
bool *truncated);
- int trim(const DoutPrefixProvider *dpp, int shard_id, const real_time& from_time, const real_time& end_time, const string& start_marker, const string& end_marker);
+ int trim(const DoutPrefixProvider *dpp, int shard_id, const real_time& from_time, const real_time& end_time, const std::string& start_marker, const std::string& end_marker);
int get_info(const DoutPrefixProvider *dpp, int shard_id, RGWMetadataLogInfo *info);
int get_info_async(const DoutPrefixProvider *dpp, int shard_id, RGWMetadataLogInfoCompletion *completion);
- int lock_exclusive(const DoutPrefixProvider *dpp, int shard_id, timespan duration, string&zone_id, string& owner_id);
- int unlock(const DoutPrefixProvider *dpp, int shard_id, string& zone_id, string& owner_id);
+ int lock_exclusive(const DoutPrefixProvider *dpp, int shard_id, timespan duration, std::string&zone_id, std::string& owner_id);
+ int unlock(const DoutPrefixProvider *dpp, int shard_id, std::string& zone_id, std::string& owner_id);
- int update_shards(list<int>& shards);
+ int update_shards(std::list<int>& shards);
- void read_clear_modified(set<int> &modified);
+ void read_clear_modified(std::set<int> &modified);
};
struct LogStatusDump {
IncrementalSync = 1,
};
uint16_t state;
- string marker;
- string next_step_marker;
+ std::string marker;
+ std::string next_step_marker;
uint64_t total_entries;
uint64_t pos;
real_time timestamp;
struct rgw_meta_sync_status {
rgw_meta_sync_info sync_info;
- map<uint32_t, rgw_meta_sync_marker> sync_markers;
+ std::map<uint32_t, rgw_meta_sync_marker> sync_markers;
rgw_meta_sync_status() {}
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
const std::string RGWMetadataLogHistory::oid = "meta.history";
void LogStatusDump::dump(Formatter *f) const {
protected:
obj_version objv;
ceph::real_time mtime;
- std::map<string, bufferlist> *pattrs{nullptr};
+ std::map<std::string, bufferlist> *pattrs{nullptr};
public:
RGWMetadataObject() {}
virtual ~RGWMetadataObject() {}
obj_version& get_version();
real_time& get_mtime() { return mtime; }
- void set_pattrs(std::map<string, bufferlist> *_pattrs) {
+ void set_pattrs(std::map<std::string, bufferlist> *_pattrs) {
pattrs = _pattrs;
}
- std::map<string, bufferlist> *get_pattrs() {
+ std::map<std::string, bufferlist> *get_pattrs() {
return pattrs;
}
public:
RGWMetadataHandler() {}
virtual ~RGWMetadataHandler() {}
- virtual string get_type() = 0;
+ virtual std::string get_type() = 0;
void base_init(CephContext *_cct) {
cct = _cct;
virtual RGWMetadataObject *get_meta_obj(JSONObj *jo, const obj_version& objv, const ceph::real_time& mtime) = 0;
- virtual int get(string& entry, RGWMetadataObject **obj, optional_yield, const DoutPrefixProvider *dpp) = 0;
- virtual int put(string& entry,
+ virtual int get(std::string& entry, RGWMetadataObject **obj, optional_yield, const DoutPrefixProvider *dpp) = 0;
+ virtual int put(std::string& entry,
RGWMetadataObject *obj,
RGWObjVersionTracker& objv_tracker,
optional_yield,
const DoutPrefixProvider *dpp,
RGWMDLogSyncType type,
bool from_remote_zone) = 0;
- virtual int remove(string& entry, RGWObjVersionTracker& objv_tracker, optional_yield, const DoutPrefixProvider *dpp) = 0;
+ virtual int remove(std::string& entry, RGWObjVersionTracker& objv_tracker, optional_yield, const DoutPrefixProvider *dpp) = 0;
- virtual int mutate(const string& entry,
+ virtual int mutate(const std::string& entry,
const ceph::real_time& mtime,
RGWObjVersionTracker *objv_tracker,
optional_yield y,
RGWMDLogStatus op_type,
std::function<int()> f) = 0;
- virtual int list_keys_init(const DoutPrefixProvider *dpp, const string& marker, void **phandle) = 0;
- virtual int list_keys_next(const DoutPrefixProvider *dpp, void *handle, int max, list<string>& keys, bool *truncated) = 0;
+ virtual int list_keys_init(const DoutPrefixProvider *dpp, const std::string& marker, void **phandle) = 0;
+ virtual int list_keys_next(const DoutPrefixProvider *dpp, void *handle, int max, std::list<std::string>& keys, bool *truncated) = 0;
virtual void list_keys_complete(void *handle) = 0;
- virtual string get_marker(void *handle) = 0;
+ virtual std::string get_marker(void *handle) = 0;
- virtual int get_shard_id(const string& entry, int *shard_id) {
+ virtual int get_shard_id(const std::string& entry, int *shard_id) {
*shard_id = 0;
return 0;
}
protected:
RGWSI_MetaBackend_Handler *be_handler;
- virtual int do_get(RGWSI_MetaBackend_Handler::Op *op, string& entry, RGWMetadataObject **obj, optional_yield y, const DoutPrefixProvider *dpp) = 0;
- virtual int do_put(RGWSI_MetaBackend_Handler::Op *op, string& entry, RGWMetadataObject *obj,
+ virtual int do_get(RGWSI_MetaBackend_Handler::Op *op, std::string& entry, RGWMetadataObject **obj, optional_yield y, const DoutPrefixProvider *dpp) = 0;
+ virtual int do_put(RGWSI_MetaBackend_Handler::Op *op, std::string& entry, RGWMetadataObject *obj,
RGWObjVersionTracker& objv_tracker, optional_yield y,
const DoutPrefixProvider *dpp, RGWMDLogSyncType type,
bool from_remote_zone) = 0;
virtual int do_put_operate(Put *put_op, const DoutPrefixProvider *dpp);
- virtual int do_remove(RGWSI_MetaBackend_Handler::Op *op, string& entry, RGWObjVersionTracker& objv_tracker, optional_yield y, const DoutPrefixProvider *dpp) = 0;
+ virtual int do_remove(RGWSI_MetaBackend_Handler::Op *op, std::string& entry, RGWObjVersionTracker& objv_tracker, optional_yield y, const DoutPrefixProvider *dpp) = 0;
public:
RGWMetadataHandler_GenericMetaBE() {}
protected:
RGWMetadataHandler_GenericMetaBE *handler;
RGWSI_MetaBackend_Handler::Op *op;
- string& entry;
+ std::string& entry;
RGWMetadataObject *obj;
RGWObjVersionTracker& objv_tracker;
RGWMDLogSyncType apply_type;
}
public:
Put(RGWMetadataHandler_GenericMetaBE *_handler, RGWSI_MetaBackend_Handler::Op *_op,
- string& _entry, RGWMetadataObject *_obj,
+ std::string& _entry, RGWMetadataObject *_obj,
RGWObjVersionTracker& _objv_tracker, optional_yield _y,
RGWMDLogSyncType _type, bool from_remote_zone);
}
};
- int get(string& entry, RGWMetadataObject **obj, optional_yield, const DoutPrefixProvider *dpp) override;
- int put(string& entry, RGWMetadataObject *obj, RGWObjVersionTracker& objv_tracker, optional_yield, const DoutPrefixProvider *dpp, RGWMDLogSyncType type, bool from_remote_zone) override;
- int remove(string& entry, RGWObjVersionTracker& objv_tracker, optional_yield, const DoutPrefixProvider *dpp) override;
+ int get(std::string& entry, RGWMetadataObject **obj, optional_yield, const DoutPrefixProvider *dpp) override;
+ int put(std::string& entry, RGWMetadataObject *obj, RGWObjVersionTracker& objv_tracker, optional_yield, const DoutPrefixProvider *dpp, RGWMDLogSyncType type, bool from_remote_zone) override;
+ int remove(std::string& entry, RGWObjVersionTracker& objv_tracker, optional_yield, const DoutPrefixProvider *dpp) override;
- int mutate(const string& entry,
+ int mutate(const std::string& entry,
const ceph::real_time& mtime,
RGWObjVersionTracker *objv_tracker,
optional_yield y,
RGWMDLogStatus op_type,
std::function<int()> f) override;
- int get_shard_id(const string& entry, int *shard_id) override;
+ int get_shard_id(const std::string& entry, int *shard_id) override;
int list_keys_init(const DoutPrefixProvider *dpp, const std::string& marker, void **phandle) override;
- int list_keys_next(const DoutPrefixProvider *dpp, void *handle, int max, std::list<string>& keys, bool *truncated) override;
+ int list_keys_next(const DoutPrefixProvider *dpp, void *handle, int max, std::list<std::string>& keys, bool *truncated) override;
void list_keys_complete(void *handle) override;
std::string get_marker(void *handle) override;
CephContext *cct;
RGWSI_Meta *meta_svc;
- map<string, RGWMetadataHandler *> handlers;
+ std::map<std::string, RGWMetadataHandler *> handlers;
std::unique_ptr<RGWMetadataTopHandler> md_top_handler;
- int find_handler(const string& metadata_key, RGWMetadataHandler **handler, string& entry);
+ int find_handler(const std::string& metadata_key, RGWMetadataHandler **handler, std::string& entry);
int register_handler(RGWMetadataHandler *handler);
public:
RGWMetadataManager(RGWSI_Meta *_meta_svc);
~RGWMetadataManager();
- RGWMetadataHandler *get_handler(const string& type);
+ RGWMetadataHandler *get_handler(const std::string& type);
- int get(string& metadata_key, Formatter *f, optional_yield y, const DoutPrefixProvider *dpp);
- int put(string& metadata_key, bufferlist& bl, optional_yield y,
+ int get(std::string& metadata_key, Formatter *f, optional_yield y, const DoutPrefixProvider *dpp);
+ int put(std::string& metadata_key, bufferlist& bl, optional_yield y,
const DoutPrefixProvider *dpp,
RGWMDLogSyncType sync_mode,
bool from_remote_zone,
obj_version *existing_version = NULL);
- int remove(string& metadata_key, optional_yield y, const DoutPrefixProvider *dpp);
+ int remove(std::string& metadata_key, optional_yield y, const DoutPrefixProvider *dpp);
- int mutate(const string& metadata_key,
+ int mutate(const std::string& metadata_key,
const ceph::real_time& mtime,
RGWObjVersionTracker *objv_tracker,
optional_yield y,
RGWMDLogStatus op_type,
std::function<int()> f);
- int list_keys_init(const DoutPrefixProvider *dpp, const string& section, void **phandle);
- int list_keys_init(const DoutPrefixProvider *dpp, const string& section, const string& marker, void **phandle);
- int list_keys_next(const DoutPrefixProvider *dpp, void *handle, int max, list<string>& keys, bool *truncated);
+ int list_keys_init(const DoutPrefixProvider *dpp, const std::string& section, void **phandle);
+ int list_keys_init(const DoutPrefixProvider *dpp, const std::string& section, const std::string& marker, void **phandle);
+ int list_keys_next(const DoutPrefixProvider *dpp, void *handle, int max, std::list<std::string>& keys, bool *truncated);
void list_keys_complete(void *handle);
- string get_marker(void *handle);
+ std::string get_marker(void *handle);
void dump_log_entry(cls_log_entry& entry, Formatter *f);
- void get_sections(list<string>& sections);
+ void get_sections(std::list<std::string>& sections);
- void parse_metadata_key(const string& metadata_key, string& type, string& entry);
+ void parse_metadata_key(const std::string& metadata_key, std::string& type, std::string& entry);
- int get_shard_id(const string& section, const string& key, int *shard_id);
+ int get_shard_id(const std::string& section, const std::string& key, int *shard_id);
};
class RGWMetadataHandlerPut_SObj : public RGWMetadataHandler_GenericMetaBE::Put
public:
RGWMetadataHandlerPut_SObj(RGWMetadataHandler_GenericMetaBE *handler, RGWSI_MetaBackend_Handler::Op *op,
- string& entry, RGWMetadataObject *obj, RGWObjVersionTracker& objv_tracker,
+ std::string& entry, RGWMetadataObject *obj, RGWObjVersionTracker& objv_tracker,
optional_yield y,
RGWMDLogSyncType type, bool from_remote_zone);
~RGWMetadataHandlerPut_SObj();
#define dout_subsys ceph_subsys_rgw
-
+using namespace std;
bool RGWMultiPart::xml_end(const char *el)
{
uint32_t num;
uint64_t size;
uint64_t accounted_size{0};
- string etag;
+ std::string etag;
ceph::real_time modified;
RGWObjManifest manifest;
RGWCompressionInfo cs_info;
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
- static void generate_test_instances(list<RGWUploadPartInfo*>& o);
+ static void generate_test_instances(std::list<RGWUploadPartInfo*>& o);
};
WRITE_CLASS_ENCODER(RGWUploadPartInfo)
~RGWMultiCompleteUpload() override {}
bool xml_end(const char *el) override;
- std::map<int, string> parts;
+ std::map<int, std::string> parts;
};
class RGWMultiPart : public XMLObj
{
- string etag;
+ std::string etag;
int num;
public:
RGWMultiPart() : num(0) {}
~RGWMultiPart() override {}
bool xml_end(const char *el) override;
- string& get_etag() { return etag; }
+ std::string& get_etag() { return etag; }
int get_num() { return num; }
};
virtual ~RGWMultiXMLParser() override;
};
-extern bool is_v2_upload_id(const string& upload_id);
+extern bool is_v2_upload_id(const std::string& upload_id);
#endif
#define dout_subsys ceph_subsys_rgw
-
+using namespace std;
bool RGWMultiDelObject::xml_end(const char *el)
{
class RGWMultiDelObject : public XMLObj
{
- string key;
- string version_id;
+ std::string key;
+ std::string version_id;
public:
RGWMultiDelObject() {}
~RGWMultiDelObject() override {}
bool xml_end(const char *el) override;
- const string& get_key() { return key; }
- const string& get_version_id() { return version_id; }
+ const std::string& get_key() { return key; }
+ const std::string& get_version_id() { return version_id; }
};
class RGWMultiDelKey : public XMLObj
#define dout_subsys ceph_subsys_rgw
-
+using namespace std;
+
int main(int argc, char **argv) {
RGWMultiXMLParser parser;
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
int RGWObjManifest::generator::create_next(uint64_t ofs)
{
if (ofs < last_ofs) /* only going forward */
uint64_t start_ofs;
uint64_t part_size; /* each part size, 0 if there's no part size, meaning it's unlimited */
uint64_t stripe_max_size; /* underlying obj max size */
- string override_prefix;
+ std::string override_prefix;
RGWObjManifestRule() : start_part_num(0), start_ofs(0), part_size(0), stripe_max_size(0) {}
RGWObjManifestRule(uint32_t _start_part_num, uint64_t _start_ofs, uint64_t _part_size, uint64_t _stripe_max_size) :
class RGWObjManifest {
protected:
bool explicit_objs{false}; /* really old manifest? */
- map<uint64_t, RGWObjManifestPart> objs;
+ std::map<uint64_t, RGWObjManifestPart> objs;
uint64_t obj_size{0};
rgw_placement_rule head_placement_rule;
uint64_t max_head_size{0};
- string prefix;
+ std::string prefix;
rgw_bucket_placement tail_placement; /* might be different than the original bucket,
as object might have been copied across pools */
- map<uint64_t, RGWObjManifestRule> rules;
+ std::map<uint64_t, RGWObjManifestRule> rules;
- string tail_instance; /* tail object's instance */
+ std::string tail_instance; /* tail object's instance */
void convert_to_explicit(const DoutPrefixProvider *dpp, const RGWZoneGroup& zonegroup, const RGWZoneParams& zone_params);
int append_explicit(const DoutPrefixProvider *dpp, RGWObjManifest& m, const RGWZoneGroup& zonegroup, const RGWZoneParams& zone_params);
- void append_rules(RGWObjManifest& m, map<uint64_t, RGWObjManifestRule>::iterator& iter, string *override_prefix);
+ void append_rules(RGWObjManifest& m, std::map<uint64_t, RGWObjManifestRule>::iterator& iter, std::string *override_prefix);
public:
return *this;
}
- map<uint64_t, RGWObjManifestPart>& get_explicit_objs() {
+ std::map<uint64_t, RGWObjManifestPart>& get_explicit_objs() {
return objs;
}
- void set_explicit(uint64_t _size, map<uint64_t, RGWObjManifestPart>& _objs) {
+ void set_explicit(uint64_t _size, std::map<uint64_t, RGWObjManifestPart>& _objs) {
explicit_objs = true;
objs.swap(_objs);
set_obj_size(_size);
}
void get_implicit_location(uint64_t cur_part_id, uint64_t cur_stripe, uint64_t ofs,
- string *override_prefix, rgw_obj_select *location) const;
+ std::string *override_prefix, rgw_obj_select *location) const;
void set_trivial_rule(uint64_t tail_ofs, uint64_t stripe_max_size) {
RGWObjManifestRule rule(0, tail_ofs, 0, stripe_max_size);
} else {
explicit_objs = true;
if (!objs.empty()) {
- map<uint64_t, RGWObjManifestPart>::iterator iter = objs.begin();
+ std::map<uint64_t, RGWObjManifestPart>::iterator iter = objs.begin();
obj = iter->second.loc;
head_size = iter->second.size;
max_head_size = head_size;
}
void dump(Formatter *f) const;
- static void generate_test_instances(list<RGWObjManifest*>& o);
+ static void generate_test_instances(std::list<RGWObjManifest*>& o);
int append(const DoutPrefixProvider *dpp, RGWObjManifest& m, const RGWZoneGroup& zonegroup,
const RGWZoneParams& zone_params);
return head_placement_rule;
}
- void set_prefix(const string& _p) {
+ void set_prefix(const std::string& _p) {
prefix = _p;
}
- const string& get_prefix() const {
+ const std::string& get_prefix() const {
return prefix;
}
- void set_tail_instance(const string& _ti) {
+ void set_tail_instance(const std::string& _ti) {
tail_instance = _ti;
}
- const string& get_tail_instance() const {
+ const std::string& get_tail_instance() const {
return tail_instance;
}
int cur_part_id = 0;
int cur_stripe = 0;
- string cur_override_prefix;
+ std::string cur_override_prefix;
rgw_obj_select location;
- map<uint64_t, RGWObjManifestRule>::const_iterator rule_iter;
- map<uint64_t, RGWObjManifestRule>::const_iterator next_rule_iter;
- map<uint64_t, RGWObjManifestPart>::const_iterator explicit_iter;
+ std::map<uint64_t, RGWObjManifestRule>::const_iterator rule_iter;
+ std::map<uint64_t, RGWObjManifestRule>::const_iterator next_rule_iter;
+ std::map<uint64_t, RGWObjManifestPart>::const_iterator explicit_iter;
void update_explicit_pos();
int cur_part_id;
int cur_stripe;
uint64_t cur_stripe_size;
- string cur_oid;
+ std::string cur_oid;
- string oid_prefix;
+ std::string oid_prefix;
rgw_obj_select cur_obj;
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
static string objexp_lock_name = "gc_process";
static string objexp_hint_get_shardname(int shard_num)
#include "rgw_sal.h"
#include "rgw_sal_rados.h"
+using namespace std;
+
class RGWSI_RADOS;
class RGWSI_Zone;
class RGWBucketInfo;
//
#include "rgw_object_lock.h"
+using namespace std;
+
void DefaultRetention::decode_xml(XMLObj *obj) {
RGWXMLDecoder::decode_xml("Mode", mode, obj, true);
if (mode.compare("GOVERNANCE") != 0 && mode.compare("COMPLIANCE") != 0) {
class DefaultRetention
{
protected:
- string mode;
+ std::string mode;
int days;
int years;
return years;
}
- string get_mode() const {
+ std::string get_mode() const {
return mode;
}
return defaultRetention.get_years();
}
- string get_mode() const {
+ std::string get_mode() const {
return defaultRetention.get_mode();
}
return rule.get_years();
}
- string get_mode() const {
+ std::string get_mode() const {
return rule.get_mode();
}
class RGWObjectRetention
{
protected:
- string mode;
+ std::string mode;
ceph::real_time retain_until_date;
public:
RGWObjectRetention() {}
- RGWObjectRetention(string _mode, ceph::real_time _date): mode(_mode), retain_until_date(_date) {}
+ RGWObjectRetention(std::string _mode, ceph::real_time _date): mode(_mode), retain_until_date(_date) {}
- void set_mode(string _mode) {
+ void set_mode(std::string _mode) {
mode = _mode;
}
- string get_mode() const {
+ std::string get_mode() const {
return mode;
}
class RGWObjectLegalHold
{
protected:
- string status;
+ std::string status;
public:
RGWObjectLegalHold() {}
- RGWObjectLegalHold(string _status): status(_status) {}
- void set_status(string _status) {
+ RGWObjectLegalHold(std::string _status): status(_status) {}
+ void set_status(std::string _status) {
status = _status;
}
- string get_status() const {
+ std::string get_status() const {
return status;
}
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
namespace rgw { namespace sal {
const string RGWOIDCProvider::oidc_url_oid_prefix = "oidc_url.";
std::string arn;
std::string creation_date;
std::string tenant;
- vector<std::string> client_ids;
- vector<std::string> thumbprints;
+ std::vector<std::string> client_ids;
+ std::vector<std::string> thumbprints;
int get_tenant_url_from_arn(std::string& tenant, std::string& url);
virtual int store_url(const DoutPrefixProvider *dpp, const std::string& url, bool exclusive, optional_yield y) = 0;
RGWOIDCProvider(std::string provider_url,
std::string tenant,
- vector<std::string> client_ids,
- vector<std::string> thumbprints)
+ std::vector<std::string> client_ids,
+ std::vector<std::string> thumbprints)
: provider_url(std::move(provider_url)),
tenant(std::move(tenant)),
client_ids(std::move(client_ids)),
const std::string& get_provider_url() const { return provider_url; }
const std::string& get_arn() const { return arn; }
const std::string& get_create_date() const { return creation_date; }
- const vector<std::string>& get_client_ids() const { return client_ids;}
- const vector<std::string>& get_thumbprints() const { return thumbprints; }
+ const std::vector<std::string>& get_client_ids() const { return client_ids;}
+ const std::vector<std::string>& get_thumbprints() const { return thumbprints; }
int create(const DoutPrefixProvider *dpp, bool exclusive, optional_yield y);
virtual int delete_obj(const DoutPrefixProvider *dpp, optional_yield y) = 0;
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
using namespace librados;
using ceph::crypto::MD5;
using boost::optional;
CephContext *cct,
rgw::sal::Store* store,
RGWBucketInfo& bucket_info,
- map<string, bufferlist>& bucket_attrs,
+ std::map<std::string, bufferlist>& bucket_attrs,
RGWAccessControlPolicy *policy,
optional_yield y);
virtual int authorize(const DoutPrefixProvider* dpp, optional_yield y) = 0;
virtual int postauth_init(optional_yield y) = 0;
virtual int error_handler(int err_no, std::string* error_content, optional_yield y);
- virtual void dump(const string& code, const string& message) const {}
+ virtual void dump(const std::string& code, const std::string& message) const {}
virtual bool supports_quota() {
return true;
this->dialect_handler = dialect_handler;
}
int read_bucket_cors();
- bool generate_cors_headers(string& origin, string& method, string& headers, string& exp_headers, unsigned *max_age);
+ bool generate_cors_headers(std::string& origin, std::string& method, std::string& headers, std::string& exp_headers, unsigned *max_age);
virtual int verify_params() { return 0; }
virtual bool prefetch_data() { return false; }
virtual uint32_t op_mask() { return 0; }
- virtual int error_handler(int err_no, string *error_content, optional_yield y);
+ virtual int error_handler(int err_no, std::string *error_content, optional_yield y);
// implements DoutPrefixProvider
std::ostream& gen_prefix(std::ostream& out) const override;
bool skip_decrypt{false};
utime_t gc_invalidate_time;
bool is_slo;
- string lo_etag;
+ std::string lo_etag;
bool rgwx_stat; /* extended rgw stat operation */
- string version_id;
+ std::string version_id;
// compression attrs
RGWCompressionInfo cs_info;
}
bool verify_permission(RGWBucketInfo& binfo,
- map<string, bufferlist>& battrs,
+ std::map<std::string, bufferlist>& battrs,
ACLOwner& bucket_owner /* out */,
optional_yield y);
bool delete_single(const acct_path_t& path, optional_yield y);
dmc::client_id dmclock_client() override { return dmc::client_id::data; }
};
-inline ostream& operator<<(ostream& out, const RGWBulkDelete::acct_path_t &o) {
+inline std::ostream& operator<<(std::ostream& out, const RGWBulkDelete::acct_path_t &o) {
return out << o.bucket_name << "/" << o.obj_key;
}
class RGWGetUsage : public RGWOp {
protected:
bool sent_data;
- string start_date;
- string end_date;
+ std::string start_date;
+ std::string end_date;
int show_log_entries;
int show_log_sum;
- map<string, bool> categories;
- map<rgw_user_bucket, rgw_usage_log_entry> usage;
- map<string, rgw_usage_log_entry> summary_map;
- map<string, cls_user_bucket_entry> buckets_usage;
+ std::map<std::string, bool> categories;
+ std::map<rgw_user_bucket, rgw_usage_log_entry> usage;
+ std::map<std::string, rgw_usage_log_entry> summary_map;
+ std::map<std::string, cls_user_bucket_entry> buckets_usage;
cls_user_header header;
RGWStorageStats stats;
public:
class RGWListBucket : public RGWOp {
protected:
- string prefix;
+ std::string prefix;
rgw_obj_key marker;
rgw_obj_key next_marker;
rgw_obj_key end_marker;
- string max_keys;
- string delimiter;
- string encoding_type;
+ std::string max_keys;
+ std::string delimiter;
+ std::string encoding_type;
bool list_versions;
int max;
- vector<rgw_bucket_dir_entry> objs;
- map<string, bool> common_prefixes;
+ std::vector<rgw_bucket_dir_entry> objs;
+ std::map<std::string, bool> common_prefixes;
int default_max;
bool is_truncated;
class RGWCreateBucket : public RGWOp {
protected:
RGWAccessControlPolicy policy;
- string location_constraint;
+ std::string location_constraint;
rgw_placement_rule placement_rule;
RGWBucketInfo info;
obj_version ep_objv;
bool obj_lock_enabled;
RGWCORSConfiguration cors_config;
boost::optional<std::string> swift_ver_location;
- map<string, buffer::list> attrs;
- set<string> rmattr_names;
+ std::map<std::string, buffer::list> attrs;
+ std::set<std::string> rmattr_names;
bufferlist in_data;
};
struct rgw_slo_entry {
- string path;
- string etag;
+ std::string path;
+ std::string etag;
uint64_t size_bytes;
rgw_slo_entry() : size_bytes(0) {}
WRITE_CLASS_ENCODER(rgw_slo_entry)
struct RGWSLOInfo {
- vector<rgw_slo_entry> entries;
+ std::vector<rgw_slo_entry> entries;
uint64_t total_size;
/* in memory only */
std::string copy_source;
const char *copy_source_range;
RGWBucketInfo copy_source_bucket_info;
- string copy_source_tenant_name;
- string copy_source_bucket_name;
- string copy_source_object_name;
- string copy_source_version_id;
+ std::string copy_source_tenant_name;
+ std::string copy_source_bucket_name;
+ std::string copy_source_object_name;
+ std::string copy_source_version_id;
off_t copy_source_range_fst;
off_t copy_source_range_lst;
- string etag;
+ std::string etag;
bool chunked_upload;
RGWAccessControlPolicy policy;
std::unique_ptr <RGWObjTags> obj_tags;
rgw::sal::Attrs attrs;
ceph::real_time mtime;
uint64_t olh_epoch;
- string version_id;
+ std::string version_id;
bufferlist bl_aux;
- map<string, string> crypt_http_responses;
- string user_data;
+ std::map<std::string, std::string> crypt_http_responses;
+ std::string user_data;
std::string multipart_upload_id;
std::string multipart_part_str;
/* this is for cases when copying data from other object */
virtual int get_decrypt_filter(std::unique_ptr<RGWGetObj_Filter>* filter,
RGWGetObj_Filter* cb,
- map<string, bufferlist>& attrs,
+ std::map<std::string, bufferlist>& attrs,
bufferlist* manifest_bl) {
*filter = nullptr;
return 0;
off_t ofs;
const char *supplied_md5_b64;
const char *supplied_etag;
- string etag;
+ std::string etag;
RGWAccessControlPolicy policy;
- map<string, bufferlist> attrs;
+ std::map<std::string, bufferlist> attrs;
boost::optional<ceph::real_time> delete_at;
/* Must be called after get_data() or the result is undefined. */
virtual int get_params(optional_yield y) = 0;
void send_response() override = 0;
- virtual void filter_out_temp_url(map<string, bufferlist>& add_attrs,
- const set<string>& rmattr_names,
- map<int, string>& temp_url_keys);
+ virtual void filter_out_temp_url(std::map<std::string, bufferlist>& add_attrs,
+ const std::set<std::string>& rmattr_names,
+ std::map<int, std::string>& temp_url_keys);
const char* name() const override { return "put_account_metadata"; }
RGWOpType get_type() override { return RGW_OP_PUT_METADATA_ACCOUNT; }
uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
class RGWPutMetadataBucket : public RGWOp {
protected:
rgw::sal::Attrs attrs;
- set<string> rmattr_names;
+ std::set<std::string> rmattr_names;
bool has_policy, has_cors;
uint32_t policy_rw_mask;
RGWAccessControlPolicy policy;
protected:
bool delete_marker;
bool multipart_delete;
- string version_id;
+ std::string version_id;
ceph::real_time unmod_since; /* if unmodified since */
bool no_precondition_error;
std::unique_ptr<RGWBulkDelete::Deleter> deleter;
ceph::real_time *mod_ptr;
ceph::real_time *unmod_ptr;
rgw::sal::Attrs attrs;
- string src_tenant_name, src_bucket_name, src_obj_name;
+ std::string src_tenant_name, src_bucket_name, src_obj_name;
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::string dest_tenant_name, dest_bucket_name, dest_obj_name;
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;
- string source_zone;
- string etag;
+ std::string source_zone;
+ std::string etag;
off_t last_ofs;
- string version_id;
+ std::string version_id;
uint64_t olh_epoch;
boost::optional<ceph::real_time> delete_at;
}
static bool parse_copy_location(const std::string_view& src,
- string& bucket_name,
+ std::string& bucket_name,
rgw_obj_key& object,
struct req_state *s);
class RGWGetACLs : public RGWOp {
protected:
- string acls;
+ std::string acls;
public:
RGWGetACLs() {}
void pre_exec() override;
void execute(optional_yield y) override;
- virtual int get_policy_from_state(rgw::sal::Store* store, struct req_state *s, stringstream& ss) { return 0; }
+ virtual int get_policy_from_state(rgw::sal::Store* store, struct req_state *s, std::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"; }
protected:
bufferlist data;
const char *content_md5;
- string cookie;
+ std::string cookie;
public:
RGWPutLC() {
void pre_exec() override;
void execute(optional_yield y) override;
-// virtual int get_policy_from_state(RGWRados* store, struct req_state *s, stringstream& ss) { return 0; }
+// virtual int get_policy_from_state(RGWRados* store, struct req_state *s, std::stringstream& ss) { return 0; }
virtual int get_params(optional_yield y) = 0;
void send_response() override = 0;
const char* name() const override { return "put_lifecycle"; }
int verify_permission(optional_yield y) override {return 0;}
int validate_cors_request(RGWCORSConfiguration *cc);
void execute(optional_yield y) override;
- void get_response_params(string& allowed_hdrs, string& exp_hdrs, unsigned *max_age);
+ void get_response_params(std::string& allowed_hdrs, std::string& exp_hdrs, unsigned *max_age);
void send_response() override = 0;
const char* name() const override { return "options_cors"; }
RGWOpType get_type() override { return RGW_OP_OPTIONS_CORS; }
class RGWInitMultipart : public RGWOp {
protected:
- string upload_id;
+ std::string upload_id;
RGWAccessControlPolicy policy;
ceph::real_time mtime;
const char* name() const override { return "init_multipart"; }
RGWOpType get_type() override { return RGW_OP_INIT_MULTIPART; }
uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
- virtual int prepare_encryption(map<string, bufferlist>& attrs) { return 0; }
+ virtual int prepare_encryption(std::map<std::string, bufferlist>& attrs) { return 0; }
};
class RGWCompleteMultipart : public RGWOp {
protected:
- string upload_id;
- string etag;
- string version_id;
+ std::string upload_id;
+ std::string etag;
+ std::string version_id;
bufferlist data;
rgw::sal::MPSerializer* serializer;
class RGWListMultipart : public RGWOp {
protected:
- string upload_id;
+ std::string upload_id;
std::unique_ptr<rgw::sal::MultipartUpload> upload;
int max_parts;
int marker;
class RGWListBucketMultiparts : public RGWOp {
protected:
- string prefix;
- string marker_meta;
- string marker_key;
- string marker_upload_id;
- string next_marker_key;
- string next_marker_upload_id;
+ std::string prefix;
+ std::string marker_meta;
+ std::string marker_key;
+ std::string marker_upload_id;
+ std::string next_marker_key;
+ std::string next_marker_upload_id;
int max_uploads;
- string delimiter;
- vector<std::unique_ptr<rgw::sal::MultipartUpload>> uploads;
- map<string, bool> common_prefixes;
+ std::string delimiter;
+ std::vector<std::unique_ptr<rgw::sal::MultipartUpload>> uploads;
+ std::map<std::string, bool> common_prefixes;
bool is_truncated;
int default_max;
bool encode_url {false};
virtual void send_status() = 0;
virtual void begin_response() = 0;
virtual void send_partial_response(rgw_obj_key& key, bool delete_marker,
- const string& marker_version_id, int ret) = 0;
+ const std::string& marker_version_id, int ret) = 0;
virtual void end_response() = 0;
const char* name() const override { return "multi_object_delete"; }
RGWOpType get_type() override { return RGW_OP_DELETE_MULTI_OBJ; }
struct req_state *s, bool prefetch_data, optional_yield y);
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,
- const string& tenant);
+extern std::vector<rgw::IAM::Policy> get_iam_user_policy_from_attr(CephContext* cct,
+ std::map<std::string, bufferlist>& attrs,
+ const std::string& tenant);
inline int get_system_versioning_params(req_state *s,
uint64_t *olh_epoch,
- string *version_id)
+ std::string *version_id)
{
if (!s->system_request) {
return 0;
}
if (olh_epoch) {
- string epoch_str = s->info.args.get(RGW_SYS_PARAM_PREFIX "versioned-epoch");
+ std::string epoch_str = s->info.args.get(RGW_SYS_PARAM_PREFIX "versioned-epoch");
if (!epoch_str.empty()) {
- string err;
+ std::string err;
*olh_epoch = strict_strtol(epoch_str.c_str(), 10, &err);
if (!err.empty()) {
ldpp_subdout(s, rgw, 0) << "failed to parse versioned-epoch param"
} /* rgw_get_request_metadata */
inline void encode_delete_at_attr(boost::optional<ceph::real_time> delete_at,
- map<string, bufferlist>& attrs)
+ std::map<std::string, bufferlist>& attrs)
{
if (delete_at == boost::none) {
return;
attrs[RGW_ATTR_DELETE_AT] = delatbl;
} /* encode_delete_at_attr */
-inline void encode_obj_tags_attr(RGWObjTags* obj_tags, map<string, bufferlist>& attrs)
+inline void encode_obj_tags_attr(RGWObjTags* obj_tags, std::map<std::string, bufferlist>& attrs)
{
if (obj_tags == nullptr){
// we assume the user submitted a tag format which we couldn't parse since
}
inline int encode_dlo_manifest_attr(const char * const dlo_manifest,
- map<string, bufferlist>& attrs)
+ std::map<std::string, bufferlist>& attrs)
{
- string dm = dlo_manifest;
+ std::string dm = dlo_manifest;
- if (dm.find('/') == string::npos) {
+ if (dm.find('/') == std::string::npos) {
return -EINVAL;
}
return 0;
} /* encode_dlo_manifest_attr */
-inline void complete_etag(MD5& hash, string *etag)
+inline void complete_etag(MD5& hash, std::string *etag)
{
char etag_buf[CEPH_CRYPTO_MD5_DIGESTSIZE];
char etag_buf_str[CEPH_CRYPTO_MD5_DIGESTSIZE * 2 + 16];
class RGWSetAttrs : public RGWOp {
protected:
- map<std::string, buffer::list> attrs;
+ std::map<std::string, buffer::list> attrs;
public:
RGWSetAttrs() {}
};
inline int parse_value_and_bound(
- const string &input,
+ const std::string &input,
int &output,
const long lower_bound,
const long upper_bound,
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
int rgw_opa_authorize(RGWOp *& op,
req_state * const s)
{
#define DEFAULT_NUM_SHARDS 64
+using namespace std;
+
static string obj_fingerprint(const string& oid, const char *force_ns = NULL)
{
ssize_t pos = oid.find('_');
struct RGWOrphanSearchStage {
RGWOrphanSearchStageId stage;
int shard;
- string marker;
+ std::string marker;
RGWOrphanSearchStage() : stage(ORPHAN_SEARCH_STAGE_UNKNOWN), shard(0) {}
explicit RGWOrphanSearchStage(RGWOrphanSearchStageId _stage) : stage(_stage), shard(0) {}
- RGWOrphanSearchStage(RGWOrphanSearchStageId _stage, int _shard, const string& _marker) : stage(_stage), shard(_shard), marker(_marker) {}
+ RGWOrphanSearchStage(RGWOrphanSearchStageId _stage, int _shard, const std::string& _marker) : stage(_stage), shard(_shard), marker(_marker) {}
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
WRITE_CLASS_ENCODER(RGWOrphanSearchStage)
struct RGWOrphanSearchInfo {
- string job_name;
+ std::string job_name;
rgw_pool pool;
uint16_t num_shards;
utime_t start_time;
void decode(bufferlist::const_iterator& bl) {
DECODE_START(2, bl);
decode(job_name, bl);
- string s;
+ std::string s;
decode(s, bl);
pool.from_str(s);
decode(num_shards, bl);
rgw::sal::Store* store;
librados::IoCtx ioctx;
- string oid;
+ std::string oid;
public:
explicit RGWOrphanStore(rgw::sal::Store* _store) : store(_store), oid(RGW_ORPHAN_INDEX_OID) {}
int init(const DoutPrefixProvider *dpp);
- int read_job(const string& job_name, RGWOrphanSearchState& state);
- int write_job(const string& job_name, const RGWOrphanSearchState& state);
- int remove_job(const string& job_name);
- int list_jobs(map<string,RGWOrphanSearchState> &job_list);
+ int read_job(const std::string& job_name, RGWOrphanSearchState& state);
+ int write_job(const std::string& job_name, const RGWOrphanSearchState& state);
+ int remove_job(const std::string& job_name);
+ int list_jobs(std::map<std::string,RGWOrphanSearchState> &job_list);
- int store_entries(const DoutPrefixProvider *dpp, const string& oid, const map<string, bufferlist>& entries);
- int read_entries(const string& oid, const string& marker, map<string, bufferlist> *entries, bool *truncated);
+ int store_entries(const DoutPrefixProvider *dpp, const std::string& oid, const std::map<std::string, bufferlist>& entries);
+ int read_entries(const std::string& oid, const std::string& marker, std::map<std::string, bufferlist> *entries, bool *truncated);
};
RGWOrphanSearchInfo search_info;
RGWOrphanSearchStage search_stage;
- map<int, string> all_objs_index;
- map<int, string> buckets_instance_index;
- map<int, string> linked_objs_index;
+ std::map<int, std::string> all_objs_index;
+ std::map<int, std::string> buckets_instance_index;
+ std::map<int, std::string> linked_objs_index;
- string index_objs_prefix;
+ std::string index_objs_prefix;
uint16_t max_concurrent_ios;
uint64_t stale_secs;
bool detailed_mode;
struct log_iter_info {
- string oid;
- list<string>::iterator cur;
- list<string>::iterator end;
+ std::string oid;
+ std::list<std::string>::iterator cur;
+ std::list<std::string>::iterator end;
};
- int log_oids(const DoutPrefixProvider *dpp, map<int, string>& log_shards, map<int, list<string> >& oids);
+ int log_oids(const DoutPrefixProvider *dpp, std::map<int, std::string>& log_shards, std::map<int, std::list<std::string> >& oids);
#define RGW_ORPHANSEARCH_HASH_PRIME 7877
- int orphan_shard(const string& str) {
+ int orphan_shard(const std::string& str) {
return ceph_str_hash_linux(str.c_str(), str.size()) % RGW_ORPHANSEARCH_HASH_PRIME % search_info.num_shards;
}
- int handle_stat_result(const DoutPrefixProvider *dpp, map<int, list<string> >& oids, rgw::sal::Object::StatOp::Result& result);
- int pop_and_handle_stat_op(const DoutPrefixProvider *dpp, map<int, list<string> >& oids, std::deque<std::unique_ptr<rgw::sal::Object::StatOp>>& ops);
+ int handle_stat_result(const DoutPrefixProvider *dpp, std::map<int, std::list<std::string> >& oids, rgw::sal::Object::StatOp::Result& result);
+ int pop_and_handle_stat_op(const DoutPrefixProvider *dpp, std::map<int, std::list<std::string> >& oids, std::deque<std::unique_ptr<rgw::sal::Object::StatOp>>& ops);
- int remove_index(map<int, string>& index);
+ int remove_index(std::map<int, std::string>& index);
public:
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) {}
return orphan_store.write_job(search_info.job_name, state);
}
- int init(const DoutPrefixProvider *dpp, const string& job_name, RGWOrphanSearchInfo *info, bool _detailed_mode=false);
+ int init(const DoutPrefixProvider *dpp, const std::string& job_name, RGWOrphanSearchInfo *info, bool _detailed_mode=false);
- int create(const string& job_name, int num_shards);
+ int create(const std::string& job_name, int num_shards);
int build_all_oids_index(const DoutPrefixProvider *dpp);
int build_buckets_instance_index(const DoutPrefixProvider *dpp);
- int build_linked_oids_for_bucket(const DoutPrefixProvider *dpp, const string& bucket_instance_id, map<int, list<string> >& oids);
+ int build_linked_oids_for_bucket(const DoutPrefixProvider *dpp, const std::string& bucket_instance_id, std::map<int, std::list<std::string> >& oids);
int build_linked_oids_index(const DoutPrefixProvider *dpp);
int compare_oid_indexes(const DoutPrefixProvider *dpp);
rgw::sal::Object::StatOp::Result& result,
std::string& bucket_name,
rgw_obj_key& obj_key,
- std::set<string>& obj_oids);
+ std::set<std::string>& obj_oids);
int pop_and_handle_stat_op(const DoutPrefixProvider *dpp,
RGWObjectCtx& obj_ctx,
std::deque<std::unique_ptr<rgw::sal::Object::StatOp>>& ops);
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
class RGWPolicyCondition {
protected:
string v1;
std::map<std::string, std::string, ltstr_nocase> vars;
public:
- void add_var(const string& name, const string& value);
- bool get_var(const string& name, string& val);
- bool get_value(const string& s, string& val, std::map<std::string, bool, ltstr_nocase>& checked_vars);
- bool match_policy_vars(map<string, bool, ltstr_nocase>& policy_vars, string& err_msg);
+ void add_var(const std::string& name, const std::string& value);
+ bool get_var(const std::string& name, std::string& val);
+ bool get_value(const std::string& s, std::string& val, std::map<std::string, bool, ltstr_nocase>& checked_vars);
+ bool match_policy_vars(std::map<std::string, bool, ltstr_nocase>& policy_vars, std::string& err_msg);
};
class RGWPolicyCondition;
class RGWPolicy {
uint64_t expires;
- string expiration_str;
+ std::string expiration_str;
std::list<RGWPolicyCondition *> conditions;
- std::list<pair<std::string, std::string> > var_checks;
+ std::list<std::pair<std::string, std::string> > var_checks;
std::map<std::string, bool, ltstr_nocase> checked_vars;
public:
RGWPolicy() : expires(0), min_length(0), max_length(LLONG_MAX) {}
~RGWPolicy();
- int set_expires(const string& e);
+ int set_expires(const std::string& e);
void set_var_checked(const std::string& var) {
checked_vars[var] = true;
}
- int add_condition(const std::string& op, const std::string& first, const std::string& second, string& err_msg);
+ int add_condition(const std::string& op, const std::string& first, const std::string& second, std::string& err_msg);
void add_simple_check(const std::string& var, const std::string& value) {
- var_checks.push_back(pair<string, string>(var, value));
+ var_checks.emplace_back(var, value);
}
- int check(RGWPolicyEnv *env, string& err_msg);
- int from_json(bufferlist& bl, string& err_msg);
+ int check(RGWPolicyEnv *env, std::string& err_msg);
+ int from_json(bufferlist& bl, std::string& err_msg);
};
#endif
#define dout_subsys ceph_subsys_rgw
+using namespace std;
using rgw::dmclock::Scheduler;
void RGWProcess::RGWWQ::_dump_queue()
class RGWRequest;
class RGWProcess {
- deque<RGWRequest*> m_req_queue;
+ std::deque<RGWRequest*> m_req_queue;
protected:
CephContext *cct;
rgw::sal::Store* store;
void run() override;
void checkpoint();
void handle_request(const DoutPrefixProvider *dpp, RGWRequest* req) override;
- void gen_request(const string& method, const string& resource,
+ void gen_request(const std::string& method, const std::string& resource,
int content_length, std::atomic<bool>* fail_flag);
void set_access_key(RGWAccessKey& key) { access_key = key; }
}
-ostream& operator<< (ostream& os, const PublicAccessBlockConfiguration& access_conf)
+std::ostream& operator<< (std::ostream& os, const PublicAccessBlockConfiguration& access_conf)
{
os << std::boolalpha
<< "BlockPublicAcls: " << access_conf.block_public_acls() << std::endl
void dump_xml(Formatter *f) const;
};
WRITE_CLASS_ENCODER(PublicAccessBlockConfiguration)
-ostream& operator<< (ostream& os, const PublicAccessBlockConfiguration& access_conf);
+std::ostream& operator<< (std::ostream& os, const PublicAccessBlockConfiguration& access_conf);
#define dout_subsys ceph_subsys_rgw
+using namespace std;
void set_event_id(std::string& id, const std::string& hash, const utime_t& ts) {
char buf[64];
const auto len = snprintf(buf, sizeof(buf), "%010ld.%06ld.%s", (long)ts.sec(), (long)ts.usec(), hash.c_str());
DECODE_FINISH(bl);
}
- string to_str() const {
+ std::string to_str() const {
return user.tenant + "/" + name;
}
void encode(bufferlist& bl) const {
ENCODE_START(3, 1, bl);
encode(topic, bl);
- // events are stored as a vector of strings
+ // events are stored as a vector of std::strings
std::vector<std::string> tmp_events;
const auto converter = s3_id.empty() ? rgw::notify::to_ceph_string : rgw::notify::to_string;
std::transform(events.begin(), events.end(), std::back_inserter(tmp_events), converter);
void decode(bufferlist::const_iterator& bl) {
DECODE_START(3, bl);
decode(topic, bl);
- // events are stored as a vector of strings
+ // events are stored as a vector of std::strings
events.clear();
std::vector<std::string> tmp_events;
decode(tmp_events, bl);
return pubsub_oid_prefix + tenant + ".bucket." + bucket.name + "/" + bucket.marker;
}
- std::string sub_meta_oid(const string& name) const {
+ std::string sub_meta_oid(const std::string& name) const {
return pubsub_oid_prefix + tenant + ".sub." + name;
}
// for S3 compliant notifications the version with: s3_filter and notif_name should be used
// return -ENOENT if the topic does not exists
// return 0 on success, error code otherwise
- int create_notification(const DoutPrefixProvider *dpp, const string& topic_name, const rgw::notify::EventTypeList& events, optional_yield y);
- int create_notification(const DoutPrefixProvider *dpp, const string& topic_name, const rgw::notify::EventTypeList& events, OptionalFilter s3_filter, const std::string& notif_name, optional_yield y);
+ int create_notification(const DoutPrefixProvider *dpp, const std::string& topic_name, const rgw::notify::EventTypeList& events, optional_yield y);
+ int create_notification(const DoutPrefixProvider *dpp, const std::string& topic_name, const rgw::notify::EventTypeList& events, OptionalFilter s3_filter, const std::string& notif_name, optional_yield y);
// remove a topic and filter from bucket
// if the topic does not exists on the bucket it is a no-op (considered success)
// return -ENOENT if the topic does not exists
// return 0 on success, error code otherwise
- int remove_notification(const DoutPrefixProvider *dpp, const string& topic_name, optional_yield y);
+ int remove_notification(const DoutPrefixProvider *dpp, const std::string& topic_name, optional_yield y);
// remove all notifications (and autogenerated topics) associated with the bucket
// return 0 on success or if no topic was associated with the bucket, error code otherwise
int remove_notifications(const DoutPrefixProvider *dpp, optional_yield y);
virtual ~Sub() = default;
- int subscribe(const DoutPrefixProvider *dpp, const string& topic_name, const rgw_pubsub_sub_dest& dest, optional_yield y,
+ int subscribe(const DoutPrefixProvider *dpp, const std::string& topic_name, const rgw_pubsub_sub_dest& dest, optional_yield y,
const std::string& s3_id="");
- int unsubscribe(const DoutPrefixProvider *dpp, const string& topic_name, optional_yield y);
+ int unsubscribe(const DoutPrefixProvider *dpp, const std::string& topic_name, optional_yield y);
int get_conf(rgw_pubsub_sub_config* result);
static const int DEFAULT_MAX_EVENTS = 100;
// followint virtual methods should only be called in derived
- virtual int list_events(const DoutPrefixProvider *dpp, const string& marker, int max_events) {ceph_assert(false);}
- virtual int remove_event(const DoutPrefixProvider *dpp, const string& event_id) {ceph_assert(false);}
+ virtual int list_events(const DoutPrefixProvider *dpp, const std::string& marker, int max_events) {ceph_assert(false);}
+ virtual int remove_event(const DoutPrefixProvider *dpp, const std::string& event_id) {ceph_assert(false);}
virtual void dump(Formatter* f) const {ceph_assert(false);}
};
} list;
public:
- SubWithEvents(RGWPubSub *_ps, const string& _sub) : Sub(_ps, _sub) {}
+ SubWithEvents(RGWPubSub *_ps, const std::string& _sub) : Sub(_ps, _sub) {}
virtual ~SubWithEvents() = default;
- int list_events(const DoutPrefixProvider *dpp, const string& marker, int max_events) override;
- int remove_event(const DoutPrefixProvider *dpp, const string& event_id) override;
+ int list_events(const DoutPrefixProvider *dpp, const std::string& marker, int max_events) override;
+ int remove_event(const DoutPrefixProvider *dpp, const std::string& event_id) override;
void dump(Formatter* f) const override;
};
return std::make_shared<Bucket>(this, bucket);
}
- SubRef get_sub(const string& sub) {
+ SubRef get_sub(const std::string& sub) {
return std::make_shared<Sub>(this, sub);
}
- SubRef get_sub_with_events(const string& sub) {
+ SubRef get_sub_with_events(const std::string& sub) {
auto tmpsub = Sub(this, sub);
rgw_pubsub_sub_config conf;
if (tmpsub.get_conf(&conf) < 0) {
void get_meta_obj(rgw_raw_obj *obj) const;
void get_bucket_meta_obj(const rgw_bucket& bucket, rgw_raw_obj *obj) const;
- void get_sub_meta_obj(const string& name, rgw_raw_obj *obj) const;
+ void get_sub_meta_obj(const std::string& name, rgw_raw_obj *obj) const;
// get all topics (per tenant, if used)) and populate them into "result"
// return 0 on success or if no topics exist, error code otherwise
// get a topic with its subscriptions by its name and populate it into "result"
// return -ENOENT if the topic does not exists
// return 0 on success, error code otherwise
- int get_topic(const string& name, rgw_pubsub_topic_subs *result);
+ int get_topic(const std::string& name, rgw_pubsub_topic_subs *result);
// get a topic with by its name and populate it into "result"
// return -ENOENT if the topic does not exists
// return 0 on success, error code otherwise
- int get_topic(const string& name, rgw_pubsub_topic *result);
+ int get_topic(const std::string& name, rgw_pubsub_topic *result);
// create a topic with a name only
// if the topic already exists it is a no-op (considered success)
// return 0 on success, error code otherwise
- int create_topic(const DoutPrefixProvider *dpp, const string& name, optional_yield y);
+ int create_topic(const DoutPrefixProvider *dpp, const std::string& name, optional_yield y);
// create a topic with push destination information and ARN
// if the topic already exists the destination and ARN values may be updated (considered succsess)
// return 0 on success, error code otherwise
- int create_topic(const DoutPrefixProvider *dpp, const string& name, const rgw_pubsub_sub_dest& dest, const std::string& arn, const std::string& opaque_data, optional_yield y);
+ int create_topic(const DoutPrefixProvider *dpp, const std::string& name, const rgw_pubsub_sub_dest& dest, const std::string& arn, const std::string& opaque_data, optional_yield y);
// remove a topic according to its name
// if the topic does not exists it is a no-op (considered success)
// return 0 on success, error code otherwise
- int remove_topic(const DoutPrefixProvider *dpp, const string& name, optional_yield y);
+ int remove_topic(const DoutPrefixProvider *dpp, const std::string& name, optional_yield y);
};
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
namespace rgw::putobj {
int HeadObjectProcessor::process(bufferlist&& data, uint64_t logical_offset)
uint64_t position;
uint64_t cur_size;
uint64_t *cur_accounted_size;
- string cur_etag;
+ std::string cur_etag;
const std::string unique_tag;
RGWObjManifest *cur_manifest;
unique_tag(unique_tag), cur_manifest(nullptr)
{}
int prepare(optional_yield y) override;
- int complete(size_t accounted_size, const string& etag,
+ int complete(size_t accounted_size, const std::string& etag,
ceph::real_time *mtime, ceph::real_time set_mtime,
- map<string, bufferlist>& attrs, ceph::real_time delete_at,
- const char *if_match, const char *if_nomatch, const string *user_data,
+ std::map<std::string, bufferlist>& attrs, ceph::real_time delete_at,
+ const char *if_match, const char *if_nomatch, const std::string *user_data,
rgw_zone_set *zones_trace, bool *canceled,
optional_yield y) override;
};
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
struct RGWQuotaCacheStats {
RGWStorageStats stats;
#define RGW_OBJ_NS_MULTIPART "multipart"
#define RGW_OBJ_NS_SHADOW "shadow"
-static inline void prepend_bucket_marker(const rgw_bucket& bucket, const string& orig_oid, string& oid)
+static inline void prepend_bucket_marker(const rgw_bucket& bucket, const std::string& orig_oid, std::string& oid)
{
if (bucket.marker.empty() || orig_oid.empty()) {
oid = orig_oid;
}
}
-static inline void get_obj_bucket_and_oid_loc(const rgw_obj& obj, string& oid, string& locator)
+static inline void get_obj_bucket_and_oid_loc(const rgw_obj& obj, std::string& oid, std::string& locator)
{
const rgw_bucket& bucket = obj.bucket;
prepend_bucket_marker(bucket, obj.get_oid(), oid);
- const string& loc = obj.key.get_loc();
+ const std::string& loc = obj.key.get_loc();
if (!loc.empty()) {
prepend_bucket_marker(bucket, loc, locator);
} else {
}
}
-int rgw_policy_from_attrset(const DoutPrefixProvider *dpp, CephContext *cct, map<string, bufferlist>& attrset, RGWAccessControlPolicy *policy);
+int rgw_policy_from_attrset(const DoutPrefixProvider *dpp,
+ CephContext *cct,
+ std::map<std::string, bufferlist>& attrset,
+ RGWAccessControlPolicy *policy);
struct RGWOLHInfo {
rgw_obj target;
decode(removed, bl);
DECODE_FINISH(bl);
}
- static void generate_test_instances(list<RGWOLHInfo*>& o);
+ static void generate_test_instances(std::list<RGWOLHInfo*>& o);
void dump(Formatter *f) const;
};
WRITE_CLASS_ENCODER(RGWOLHInfo)
WRITE_CLASS_ENCODER(RGWOLHPendingInfo)
struct RGWUsageBatch {
- map<ceph::real_time, rgw_usage_log_entry> m;
+ std::map<ceph::real_time, rgw_usage_log_entry> m;
void insert(ceph::real_time& t, rgw_usage_log_entry& entry, bool *account) {
bool exists = m.find(t) != m.end();
uint64_t epoch{0};
bufferlist obj_tag;
bufferlist tail_tag;
- string write_tag;
+ std::string write_tag;
bool fake_tag{false};
std::optional<RGWObjManifest> manifest;
- string shadow_obj;
+ std::string shadow_obj;
bool has_data{false};
bufferlist data;
bool prefetch_data{false};
RGWObjVersionTracker objv_tracker;
- map<string, bufferlist> attrset;
+ std::map<std::string, bufferlist> attrset;
RGWObjState();
RGWObjState(const RGWObjState& rhs);
~RGWObjState();
- bool get_attr(string name, bufferlist& dest) {
- map<string, bufferlist>::iterator iter = attrset.find(name);
+ bool get_attr(std::string name, bufferlist& dest) {
+ auto iter = attrset.find(name);
if (iter != attrset.end()) {
dest = iter->second;
return true;
const rgw_obj_key& source_key,
const RGWBucketInfo& dest_bucket_info,
std::optional<rgw_placement_rule> dest_placement_rule,
- const map<string, bufferlist>& obj_attrs,
+ const std::map<std::string, bufferlist>& obj_attrs,
std::optional<rgw_user> *poverride_owner,
const rgw_placement_rule **prule) = 0;
};
const rgw_obj_key& source_key,
const RGWBucketInfo& dest_bucket_info,
std::optional<rgw_placement_rule> dest_placement_rule,
- const map<string, bufferlist>& obj_attrs,
+ const std::map<std::string, bufferlist>& obj_attrs,
std::optional<rgw_user> *poverride_owner,
const rgw_placement_rule **prule) override;
};
RGWObjVersionTracker objv_tracker;
- map<string, bufferlist> attrset;
+ std::map<std::string, bufferlist> attrset;
RGWRawObjState() {}
RGWRawObjState(const RGWRawObjState& rhs) : obj (rhs.obj) {
has_attrs = rhs.has_attrs;
};
struct objexp_hint_entry {
- string tenant;
- string bucket_name;
- string bucket_id;
+ std::string tenant;
+ std::string bucket_name;
+ std::string bucket_id;
rgw_obj_key obj_key;
ceph::real_time exp_time;
}
void dump(Formatter *f) const;
- static void generate_test_instances(list<objexp_hint_entry*>& o);
+ static void generate_test_instances(std::list<objexp_hint_entry*>& o);
};
WRITE_CLASS_ENCODER(objexp_hint_entry)
struct bucket_info_entry {
RGWBucketInfo info;
real_time mtime;
- map<string, bufferlist> attrs;
+ std::map<std::string, bufferlist> attrs;
};
struct tombstone_entry;
RGWDataNotifier *data_notifier;
RGWMetaSyncProcessorThread *meta_sync_processor_thread;
RGWSyncTraceManager *sync_tracer = nullptr;
- map<rgw_zone_id, RGWDataSyncProcessorThread *> data_sync_processor_threads;
+ std::map<rgw_zone_id, RGWDataSyncProcessorThread *> data_sync_processor_threads;
boost::optional<rgw::BucketTrimManager> bucket_trim;
RGWSyncLogTrimThread *sync_log_trimmer{nullptr};
librados::ObjectOperation& op, RGWObjState **state, optional_yield y);
int update_placement_map();
- int store_bucket_info(RGWBucketInfo& info, map<string, bufferlist> *pattrs, RGWObjVersionTracker *objv_tracker, bool exclusive);
+ int store_bucket_info(RGWBucketInfo& info, std::map<std::string, bufferlist> *pattrs, RGWObjVersionTracker *objv_tracker, bool exclusive);
void remove_rgw_head_obj(librados::ObjectWriteOperation& op);
- void cls_obj_check_prefix_exist(librados::ObjectOperation& op, const string& prefix, bool fail_if_exist);
+ void cls_obj_check_prefix_exist(librados::ObjectOperation& op, const std::string& prefix, bool fail_if_exist);
void cls_obj_check_mtime(librados::ObjectOperation& op, const real_time& mtime, bool high_precision_time, RGWCheckMTimeType type);
protected:
CephContext *cct;
* AmazonS3 errors contain a HostId string, but is an opaque base64 blob; we
* try to be more transparent. This has a wrapper so we can update it when zonegroup/zone are changed.
*/
- string host_id;
+ std::string host_id;
RGWReshard *reshard;
std::shared_ptr<RGWReshardWait> reshard_wait;
int get_raw_obj_ref(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, rgw_rados_ref *ref);
- int list_raw_objects_init(const DoutPrefixProvider *dpp, const rgw_pool& pool, const string& marker, RGWListRawObjsCtx *ctx);
- int list_raw_objects_next(const DoutPrefixProvider *dpp, const string& prefix_filter, int max,
- RGWListRawObjsCtx& ctx, list<string>& oids,
+ int list_raw_objects_init(const DoutPrefixProvider *dpp, const rgw_pool& pool, const std::string& marker, RGWListRawObjsCtx *ctx);
+ int list_raw_objects_next(const DoutPrefixProvider *dpp, const std::string& prefix_filter, int max,
+ RGWListRawObjsCtx& ctx, std::list<std::string>& oids,
bool *is_truncated);
- int list_raw_objects(const DoutPrefixProvider *dpp, const rgw_pool& pool, const string& prefix_filter, int max,
- RGWListRawObjsCtx& ctx, list<string>& oids,
+ int list_raw_objects(const DoutPrefixProvider *dpp, const rgw_pool& pool, const std::string& prefix_filter, int max,
+ RGWListRawObjsCtx& ctx, std::list<std::string>& oids,
bool *is_truncated);
- string list_raw_objs_get_cursor(RGWListRawObjsCtx& ctx);
+ std::string list_raw_objs_get_cursor(RGWListRawObjsCtx& ctx);
CephContext *ctx() { return cct; }
/** do all necessary setup of the storage device */
int initialize(const DoutPrefixProvider *dpp);
void finalize();
- int register_to_service_map(const DoutPrefixProvider *dpp, const string& daemon_type, const map<string, string>& meta);
+ int register_to_service_map(const DoutPrefixProvider *dpp, const std::string& daemon_type, const std::map<std::string, std::string>& meta);
int update_service_map(const DoutPrefixProvider *dpp, std::map<std::string, std::string>&& status);
/// list logs
- int log_list_init(const DoutPrefixProvider *dpp, const string& prefix, RGWAccessHandle *handle);
- int log_list_next(RGWAccessHandle handle, string *name);
+ int log_list_init(const DoutPrefixProvider *dpp, const std::string& prefix, RGWAccessHandle *handle);
+ int log_list_next(RGWAccessHandle handle, std::string *name);
/// remove log
- int log_remove(const DoutPrefixProvider *dpp, const string& name);
+ int log_remove(const DoutPrefixProvider *dpp, const std::string& name);
/// show log
- int log_show_init(const DoutPrefixProvider *dpp, const string& name, RGWAccessHandle *handle);
+ int log_show_init(const DoutPrefixProvider *dpp, const std::string& name, RGWAccessHandle *handle);
int log_show_next(const DoutPrefixProvider *dpp, RGWAccessHandle handle, rgw_log_entry *entry);
// log bandwidth info
- int log_usage(const DoutPrefixProvider *dpp, map<rgw_user_bucket, RGWUsageBatch>& usage_info);
- int read_usage(const DoutPrefixProvider *dpp, const rgw_user& user, const string& bucket_name, uint64_t start_epoch, uint64_t end_epoch,
- uint32_t max_entries, bool *is_truncated, RGWUsageIter& read_iter, map<rgw_user_bucket,
+ int log_usage(const DoutPrefixProvider *dpp, std::map<rgw_user_bucket, RGWUsageBatch>& usage_info);
+ int read_usage(const DoutPrefixProvider *dpp, const rgw_user& user, const std::string& bucket_name, uint64_t start_epoch, uint64_t end_epoch,
+ uint32_t max_entries, bool *is_truncated, RGWUsageIter& read_iter, std::map<rgw_user_bucket,
rgw_usage_log_entry>& usage);
- int trim_usage(const DoutPrefixProvider *dpp, const rgw_user& user, const string& bucket_name, uint64_t start_epoch, uint64_t end_epoch);
+ int trim_usage(const DoutPrefixProvider *dpp, const rgw_user& user, const std::string& bucket_name, uint64_t start_epoch, uint64_t end_epoch);
int clear_usage(const DoutPrefixProvider *dpp);
int create_pool(const DoutPrefixProvider *dpp, const rgw_pool& pool);
- void create_bucket_id(string *bucket_id);
+ void create_bucket_id(std::string *bucket_id);
bool get_obj_data_pool(const rgw_placement_rule& placement_rule, const rgw_obj& obj, rgw_pool *pool);
bool obj_to_raw(const rgw_placement_rule& placement_rule, const rgw_obj& obj, rgw_raw_obj *raw_obj);
int create_bucket(const RGWUserInfo& owner, rgw_bucket& bucket,
- const string& zonegroup_id,
+ const std::string& zonegroup_id,
const rgw_placement_rule& placement_rule,
- const string& swift_ver_location,
+ const std::string& swift_ver_location,
const RGWQuotaInfo * pquota_info,
- map<std::string,bufferlist>& attrs,
+ std::map<std::string,bufferlist>& attrs,
RGWBucketInfo& bucket_info,
obj_version *pobjv,
obj_version *pep_objv,
int get_state(const DoutPrefixProvider *dpp, RGWObjState **pstate, bool follow_olh, optional_yield y, bool assume_noent = false);
void invalidate_state();
- int prepare_atomic_modification(const DoutPrefixProvider *dpp, librados::ObjectWriteOperation& op, bool reset_obj, const string *ptag,
+ int prepare_atomic_modification(const DoutPrefixProvider *dpp, librados::ObjectWriteOperation& op, bool reset_obj, const std::string *ptag,
const char *ifmatch, const char *ifnomatch, bool removal_op, bool modify_tail, optional_yield y);
int complete_atomic_modification(const DoutPrefixProvider *dpp);
RGWRados::Object *source;
struct GetObjState {
- map<rgw_pool, librados::IoCtx> io_ctxs;
+ std::map<rgw_pool, librados::IoCtx> io_ctxs;
rgw_pool cur_pool;
librados::IoCtx *cur_ioctx{nullptr};
rgw_obj obj;
struct Params {
ceph::real_time *lastmod;
uint64_t *obj_size;
- map<string, bufferlist> *attrs;
+ std::map<std::string, bufferlist> *attrs;
rgw_obj *target_obj;
Params() : lastmod(nullptr), obj_size(nullptr), attrs(nullptr),
struct MetaParams {
ceph::real_time *mtime;
- map<std::string, bufferlist>* rmattrs;
+ std::map<std::string, bufferlist>* rmattrs;
const bufferlist *data;
RGWObjManifest *manifest;
- const string *ptag;
- list<rgw_obj_index_key> *remove_objs;
+ const std::string *ptag;
+ std::list<rgw_obj_index_key> *remove_objs;
ceph::real_time set_mtime;
rgw_user owner;
RGWObjCategory category;
std::optional<uint64_t> olh_epoch;
ceph::real_time delete_at;
bool canceled;
- const string *user_data;
+ const std::string *user_data;
rgw_zone_set *zones_trace;
bool modify_tail;
bool completeMultipart;
int _do_write_meta(const DoutPrefixProvider *dpp,
uint64_t size, uint64_t accounted_size,
- map<std::string, bufferlist>& attrs,
+ std::map<std::string, bufferlist>& attrs,
bool modify_tail, bool assume_noent,
void *index_op, optional_yield y);
int write_meta(const DoutPrefixProvider *dpp, uint64_t size, uint64_t accounted_size,
- map<std::string, bufferlist>& attrs, optional_yield y);
+ std::map<std::string, bufferlist>& attrs, optional_yield y);
int write_data(const char *data, uint64_t ofs, uint64_t len, bool exclusive);
const req_state* get_req_state() {
return (req_state *)target->get_ctx().get_private();
int versioning_status; // versioning flags defined in enum RGWBucketFlags
ACLOwner obj_owner; // needed for creation of deletion marker
uint64_t olh_epoch;
- string marker_version_id;
+ std::string marker_version_id;
uint32_t bilog_flags;
- list<rgw_obj_index_key> *remove_objs;
+ std::list<rgw_obj_index_key> *remove_objs;
ceph::real_time expiration_time;
ceph::real_time unmod_since;
ceph::real_time mtime; /* for setting delete marker mtime */
struct DeleteResult {
bool delete_marker;
- string version_id;
+ std::string version_id;
DeleteResult() : delete_marker(false) {}
} result;
std::optional<RGWObjManifest> manifest;
uint64_t size{0};
struct timespec mtime {};
- map<string, bufferlist> attrs;
+ std::map<std::string, bufferlist> attrs;
} result;
struct State {
rgw_bucket& get_bucket() { return bucket; }
RGWBucketInfo& get_bucket_info() { return bucket_info; }
- int update_bucket_id(const string& new_bucket_id, const DoutPrefixProvider *dpp);
+ int update_bucket_id(const std::string& new_bucket_id, const DoutPrefixProvider *dpp);
int get_shard_id() { return shard_id; }
void set_shard_id(int id) {
class UpdateIndex {
RGWRados::Bucket *target;
- string optag;
+ std::string optag;
rgw_obj obj;
uint16_t bilog_flags{0};
BucketShard bs;
zones_trace = _zones_trace;
}
- int prepare(const DoutPrefixProvider *dpp, RGWModifyOp, const string *write_tag, optional_yield y);
+ int prepare(const DoutPrefixProvider *dpp, RGWModifyOp, const std::string *write_tag, optional_yield y);
int complete(const DoutPrefixProvider *dpp, int64_t poolid, uint64_t epoch, uint64_t size,
uint64_t accounted_size, ceph::real_time& ut,
- const string& etag, const string& content_type,
- const string& storage_class,
+ const std::string& etag, const std::string& content_type,
+ const std::string& storage_class,
bufferlist *acl_bl, RGWObjCategory category,
- list<rgw_obj_index_key> *remove_objs, const string *user_data = nullptr, bool appendable = false);
+ std::list<rgw_obj_index_key> *remove_objs, const std::string *user_data = nullptr, bool appendable = false);
int complete_del(const DoutPrefixProvider *dpp,
int64_t poolid, uint64_t epoch,
ceph::real_time& removed_mtime, /* mtime of removed object */
- list<rgw_obj_index_key> *remove_objs);
+ std::list<rgw_obj_index_key> *remove_objs);
int cancel(const DoutPrefixProvider *dpp);
- const string *get_optag() { return &optag; }
+ const std::string *get_optag() { return &optag; }
bool is_prepared() { return prepared; }
}; // class UpdateIndex
int list_objects_ordered(const DoutPrefixProvider *dpp,
int64_t max,
- vector<rgw_bucket_dir_entry> *result,
- map<string, bool> *common_prefixes,
+ std::vector<rgw_bucket_dir_entry> *result,
+ std::map<std::string, bool> *common_prefixes,
bool *is_truncated,
optional_yield y);
int list_objects_unordered(const DoutPrefixProvider *dpp,
int64_t max,
- vector<rgw_bucket_dir_entry> *result,
- map<string, bool> *common_prefixes,
+ std::vector<rgw_bucket_dir_entry> *result,
+ std::map<std::string, bool> *common_prefixes,
bool *is_truncated,
optional_yield y);
public:
struct Params {
- string prefix;
- string delim;
+ std::string prefix;
+ std::string delim;
rgw_obj_key marker;
rgw_obj_key end_marker;
- string ns;
+ std::string ns;
bool enforce_ns;
RGWAccessListFilter *filter;
bool list_versions;
explicit List(RGWRados::Bucket *_target) : target(_target) {}
int list_objects(const DoutPrefixProvider *dpp, int64_t max,
- vector<rgw_bucket_dir_entry> *result,
- map<string, bool> *common_prefixes,
+ std::vector<rgw_bucket_dir_entry> *result,
+ std::map<std::string, bool> *common_prefixes,
bool *is_truncated,
optional_yield y) {
if (params.allow_unordered) {
const DoutPrefixProvider *dpp); /* in/out */
int copy_obj_to_remote_dest(const DoutPrefixProvider *dpp,
RGWObjState *astate,
- map<string, bufferlist>& src_attrs,
+ std::map<std::string, bufferlist>& src_attrs,
RGWRados::Object::Read& read_op,
const rgw_user& user_id,
rgw::sal::Object* dest_obj,
bool high_precision_time,
const char *if_match,
const char *if_nomatch,
- map<string, bufferlist> *pattrs,
- map<string, string> *pheaders,
- string *version_id,
- string *ptag,
- string *petag);
+ std::map<std::string, bufferlist> *pattrs,
+ std::map<std::string, std::string> *pheaders,
+ std::string *version_id,
+ std::string *ptag,
+ std::string *petag);
int fetch_remote_obj(RGWObjectCtx& obj_ctx,
const rgw_user& user_id,
RGWObjCategory category,
std::optional<uint64_t> olh_epoch,
ceph::real_time delete_at,
- string *ptag,
- string *petag,
+ std::string *ptag,
+ std::string *petag,
void (*progress_cb)(off_t, void *),
void *progress_data,
const DoutPrefixProvider *dpp,
const char *if_nomatch,
AttrsMod attrs_mod,
bool copy_if_newer,
- map<std::string, bufferlist>& attrs,
+ std::map<std::string, bufferlist>& attrs,
RGWObjCategory category,
uint64_t olh_epoch,
ceph::real_time delete_at,
- string *version_id,
- string *ptag,
- string *petag,
+ std::string *version_id,
+ std::string *ptag,
+ std::string *petag,
void (*progress_cb)(off_t, void *),
void *progress_data,
const DoutPrefixProvider *dpp,
rgw::sal::Object* dest_obj,
ceph::real_time *mtime,
ceph::real_time set_mtime,
- map<string, bufferlist>& attrs,
+ std::map<std::string, bufferlist>& attrs,
uint64_t olh_epoch,
ceph::real_time delete_at,
- string *petag,
+ std::string *petag,
const DoutPrefixProvider *dpp,
optional_yield y);
*/
int delete_bucket(RGWBucketInfo& bucket_info, RGWObjVersionTracker& objv_tracker, optional_yield y, const DoutPrefixProvider *dpp, bool check_empty = true);
- void wakeup_meta_sync_shards(set<int>& shard_ids);
- void wakeup_data_sync_shards(const DoutPrefixProvider *dpp, const rgw_zone_id& source_zone, map<int, set<string> >& shard_ids);
+ void wakeup_meta_sync_shards(std::set<int>& shard_ids);
+ void wakeup_data_sync_shards(const DoutPrefixProvider *dpp,
+ const rgw_zone_id& source_zone,
+ std::map<int, std::set<std::string> >& shard_ids);
RGWMetaSyncStatusManager* get_meta_sync_manager();
RGWDataSyncStatusManager* get_data_sync_manager(const rgw_zone_id& source_zone);
int set_attr(const DoutPrefixProvider *dpp, void *ctx, const RGWBucketInfo& bucket_info, rgw_obj& obj, const char *name, bufferlist& bl);
int set_attrs(const DoutPrefixProvider *dpp, void *ctx, const RGWBucketInfo& bucket_info, rgw_obj& obj,
- map<string, bufferlist>& attrs,
- map<string, bufferlist>* rmattrs,
+ std::map<std::string, bufferlist>& attrs,
+ std::map<std::string, bufferlist>* rmattrs,
optional_yield y);
int get_obj_state(const DoutPrefixProvider *dpp, RGWObjectCtx *rctx, const RGWBucketInfo& bucket_info, const rgw_obj& obj, RGWObjState **state,
int raw_obj_stat(const DoutPrefixProvider *dpp,
rgw_raw_obj& obj, uint64_t *psize, ceph::real_time *pmtime, uint64_t *epoch,
- map<string, bufferlist> *attrs, bufferlist *first_chunk,
+ std::map<std::string, bufferlist> *attrs, bufferlist *first_chunk,
RGWObjVersionTracker *objv_tracker, optional_yield y);
int obj_operate(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const rgw_obj& obj, librados::ObjectWriteOperation *op);
const RGWBucketInfo& bucket_info,
std::function<int(BucketShard *)> call);
int block_while_resharding(RGWRados::BucketShard *bs,
- string *new_bucket_id,
+ std::string *new_bucket_id,
const RGWBucketInfo& bucket_info,
optional_yield y,
const DoutPrefixProvider *dpp);
void bucket_index_guard_olh_op(const DoutPrefixProvider *dpp, RGWObjState& olh_state, librados::ObjectOperation& op);
- int olh_init_modification(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjState& state, const rgw_obj& olh_obj, string *op_tag);
- int olh_init_modification_impl(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjState& state, const rgw_obj& olh_obj, string *op_tag);
+ int olh_init_modification(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjState& state, const rgw_obj& olh_obj, std::string *op_tag);
+ int olh_init_modification_impl(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjState& state, const rgw_obj& olh_obj, std::string *op_tag);
int bucket_index_link_olh(const DoutPrefixProvider *dpp,
const RGWBucketInfo& bucket_info, RGWObjState& olh_state,
const rgw_obj& obj_instance, bool delete_marker,
- const string& op_tag, struct rgw_bucket_dir_entry_meta *meta,
+ const std::string& op_tag, struct rgw_bucket_dir_entry_meta *meta,
uint64_t olh_epoch,
ceph::real_time unmod_since, bool high_precision_time,
rgw_zone_set *zones_trace = nullptr,
bool log_data_change = false);
- int bucket_index_unlink_instance(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const rgw_obj& obj_instance, const string& op_tag, const string& olh_tag, uint64_t olh_epoch, rgw_zone_set *zones_trace = nullptr);
+ int bucket_index_unlink_instance(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const rgw_obj& obj_instance, const std::string& op_tag, const std::string& olh_tag, uint64_t olh_epoch, rgw_zone_set *zones_trace = nullptr);
int bucket_index_read_olh_log(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjState& state, const rgw_obj& obj_instance, uint64_t ver_marker,
- map<uint64_t, vector<rgw_bucket_olh_log_entry> > *log, bool *is_truncated);
+ std::map<uint64_t, std::vector<rgw_bucket_olh_log_entry> > *log, bool *is_truncated);
int bucket_index_trim_olh_log(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjState& obj_state, const rgw_obj& obj_instance, uint64_t ver);
int bucket_index_clear_olh(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjState& state, const rgw_obj& obj_instance);
int apply_olh_log(const DoutPrefixProvider *dpp, RGWObjectCtx& ctx, RGWObjState& obj_state, const RGWBucketInfo& bucket_info, const rgw_obj& obj,
- bufferlist& obj_tag, map<uint64_t, vector<rgw_bucket_olh_log_entry> >& log,
+ bufferlist& obj_tag, std::map<uint64_t, std::vector<rgw_bucket_olh_log_entry> >& log,
uint64_t *plast_ver, rgw_zone_set *zones_trace = nullptr);
int update_olh(const DoutPrefixProvider *dpp, RGWObjectCtx& obj_ctx, RGWObjState *state, const RGWBucketInfo& bucket_info, const rgw_obj& obj, rgw_zone_set *zones_trace = nullptr);
int set_olh(const DoutPrefixProvider *dpp, RGWObjectCtx& obj_ctx, const RGWBucketInfo& bucket_info, const rgw_obj& target_obj, bool delete_marker, rgw_bucket_dir_entry_meta *meta,
int unlink_obj_instance(const DoutPrefixProvider *dpp, RGWObjectCtx& obj_ctx, RGWBucketInfo& bucket_info, const rgw_obj& target_obj,
uint64_t olh_epoch, optional_yield y, rgw_zone_set *zones_trace = nullptr);
- void check_pending_olh_entries(const DoutPrefixProvider *dpp, map<string, bufferlist>& pending_entries, map<string, bufferlist> *rm_pending_entries);
- int remove_olh_pending_entries(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjState& state, const rgw_obj& olh_obj, map<string, bufferlist>& pending_attrs);
+ void check_pending_olh_entries(const DoutPrefixProvider *dpp, std::map<std::string, bufferlist>& pending_entries, std::map<std::string, bufferlist> *rm_pending_entries);
+ int remove_olh_pending_entries(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjState& state, const rgw_obj& olh_obj, std::map<std::string, bufferlist>& pending_attrs);
int follow_olh(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjectCtx& ctx, RGWObjState *state, const rgw_obj& olh_obj, rgw_obj *target);
int get_olh(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const rgw_obj& obj, RGWOLHInfo *olh);
void gen_rand_obj_instance_name(rgw_obj_key *target_key);
void gen_rand_obj_instance_name(rgw_obj *target);
- int update_containers_stats(map<string, RGWBucketEnt>& m, const DoutPrefixProvider *dpp);
+ int update_containers_stats(std::map<std::string, RGWBucketEnt>& m, const DoutPrefixProvider *dpp);
int append_async(const DoutPrefixProvider *dpp, rgw_raw_obj& obj, size_t size, bufferlist& bl);
public:
rctx->set_prefetch_data(obj);
}
int decode_policy(const DoutPrefixProvider *dpp, bufferlist& bl, ACLOwner *owner);
- int get_bucket_stats(const DoutPrefixProvider *dpp, RGWBucketInfo& bucket_info, int shard_id, string *bucket_ver, string *master_ver,
- map<RGWObjCategory, RGWStorageStats>& stats, string *max_marker, bool* syncstopped = NULL);
+ int get_bucket_stats(const DoutPrefixProvider *dpp, RGWBucketInfo& bucket_info, int shard_id, std::string *bucket_ver, std::string *master_ver,
+ std::map<RGWObjCategory, RGWStorageStats>& stats, std::string *max_marker, bool* syncstopped = NULL);
int get_bucket_stats_async(const DoutPrefixProvider *dpp, RGWBucketInfo& bucket_info, int shard_id, RGWGetBucketStats_CB *cb);
- int put_bucket_instance_info(RGWBucketInfo& info, bool exclusive, ceph::real_time mtime, map<string, bufferlist> *pattrs, const DoutPrefixProvider *dpp);
+ int put_bucket_instance_info(RGWBucketInfo& info, bool exclusive, ceph::real_time mtime, std::map<std::string, bufferlist> *pattrs, const DoutPrefixProvider *dpp);
/* xxx dang obj_ctx -> svc */
- int get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const string& meta_key, RGWBucketInfo& info, ceph::real_time *pmtime, map<string, bufferlist> *pattrs, optional_yield y, const DoutPrefixProvider *dpp);
- int get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const rgw_bucket& bucket, RGWBucketInfo& info, ceph::real_time *pmtime, map<string, bufferlist> *pattrs, optional_yield y, const DoutPrefixProvider *dpp);
+ int get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const std::string& meta_key, RGWBucketInfo& info, ceph::real_time *pmtime, std::map<std::string, bufferlist> *pattrs, optional_yield y, const DoutPrefixProvider *dpp);
+ int get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const rgw_bucket& bucket, RGWBucketInfo& info, ceph::real_time *pmtime, std::map<std::string, bufferlist> *pattrs, optional_yield y, const DoutPrefixProvider *dpp);
- static void make_bucket_entry_name(const string& tenant_name, const string& bucket_name, string& bucket_entry);
+ static void make_bucket_entry_name(const std::string& tenant_name, const std::string& bucket_name, std::string& bucket_entry);
int get_bucket_info(RGWServices *svc,
- const string& tenant_name, const string& bucket_name,
+ const std::string& tenant_name, const std::string& bucket_name,
RGWBucketInfo& info,
ceph::real_time *pmtime, optional_yield y,
- const DoutPrefixProvider *dpp, map<string, bufferlist> *pattrs = NULL);
+ const DoutPrefixProvider *dpp, std::map<std::string, bufferlist> *pattrs = NULL);
// Returns 0 on successful refresh. Returns error code if there was
// an error or the version stored on the OSD is the same as that
int try_refresh_bucket_info(RGWBucketInfo& info,
ceph::real_time *pmtime,
const DoutPrefixProvider *dpp,
- map<string, bufferlist> *pattrs = nullptr);
+ std::map<std::string, bufferlist> *pattrs = nullptr);
int put_linked_bucket_info(RGWBucketInfo& info, bool exclusive, ceph::real_time mtime, obj_version *pep_objv,
- map<string, bufferlist> *pattrs, bool create_entry_point,
+ std::map<std::string, bufferlist> *pattrs, bool create_entry_point,
const DoutPrefixProvider *dpp);
- int cls_obj_prepare_op(const DoutPrefixProvider *dpp, BucketShard& bs, RGWModifyOp op, string& tag, rgw_obj& obj, uint16_t bilog_flags, optional_yield y, rgw_zone_set *zones_trace = nullptr);
- int cls_obj_complete_op(BucketShard& bs, const rgw_obj& obj, RGWModifyOp op, string& tag, int64_t pool, uint64_t epoch,
- rgw_bucket_dir_entry& ent, RGWObjCategory category, list<rgw_obj_index_key> *remove_objs, uint16_t bilog_flags, rgw_zone_set *zones_trace = nullptr);
- int cls_obj_complete_add(BucketShard& bs, const rgw_obj& obj, string& tag, int64_t pool, uint64_t epoch, rgw_bucket_dir_entry& ent,
- RGWObjCategory category, list<rgw_obj_index_key> *remove_objs, uint16_t bilog_flags, rgw_zone_set *zones_trace = nullptr);
- int cls_obj_complete_del(BucketShard& bs, string& tag, int64_t pool, uint64_t epoch, rgw_obj& obj,
- ceph::real_time& removed_mtime, list<rgw_obj_index_key> *remove_objs, uint16_t bilog_flags, rgw_zone_set *zones_trace = nullptr);
- int cls_obj_complete_cancel(BucketShard& bs, string& tag, rgw_obj& obj, uint16_t bilog_flags, rgw_zone_set *zones_trace = nullptr);
+ int cls_obj_prepare_op(const DoutPrefixProvider *dpp, BucketShard& bs, RGWModifyOp op, std::string& tag, rgw_obj& obj, uint16_t bilog_flags, optional_yield y, rgw_zone_set *zones_trace = nullptr);
+ int cls_obj_complete_op(BucketShard& bs, const rgw_obj& obj, RGWModifyOp op, std::string& tag, int64_t pool, uint64_t epoch,
+ rgw_bucket_dir_entry& ent, RGWObjCategory category, std::list<rgw_obj_index_key> *remove_objs, uint16_t bilog_flags, rgw_zone_set *zones_trace = nullptr);
+ int cls_obj_complete_add(BucketShard& bs, const rgw_obj& obj, std::string& tag, int64_t pool, uint64_t epoch, rgw_bucket_dir_entry& ent,
+ RGWObjCategory category, std::list<rgw_obj_index_key> *remove_objs, uint16_t bilog_flags, rgw_zone_set *zones_trace = nullptr);
+ int cls_obj_complete_del(BucketShard& bs, std::string& tag, int64_t pool, uint64_t epoch, rgw_obj& obj,
+ ceph::real_time& removed_mtime, std::list<rgw_obj_index_key> *remove_objs, uint16_t bilog_flags, rgw_zone_set *zones_trace = nullptr);
+ int cls_obj_complete_cancel(BucketShard& bs, std::string& tag, rgw_obj& obj, uint16_t bilog_flags, rgw_zone_set *zones_trace = nullptr);
int cls_obj_set_bucket_tag_timeout(const DoutPrefixProvider *dpp, RGWBucketInfo& bucket_info, uint64_t timeout);
using ent_map_t =
RGWBucketInfo& bucket_info,
const int shard_id,
const rgw_obj_index_key& start_after,
- const string& prefix,
- const string& delimiter,
+ const std::string& prefix,
+ const std::string& delimiter,
const uint32_t num_entries,
const bool list_versions,
const uint16_t exp_factor, // 0 means ignore
RGWBucketInfo& bucket_info,
int shard_id,
const rgw_obj_index_key& start_after,
- const string& prefix,
+ const std::string& prefix,
uint32_t num_entries,
bool list_versions,
- vector<rgw_bucket_dir_entry>& ent_list,
+ std::vector<rgw_bucket_dir_entry>& ent_list,
bool *is_truncated,
rgw_obj_index_key *last_entry,
optional_yield y,
check_filter_t = nullptr);
- int cls_bucket_head(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, int shard_id, vector<rgw_bucket_dir_header>& headers, map<int, string> *bucket_instance_ids = NULL);
+ int cls_bucket_head(const DoutPrefixProvider *dpp,
+ const RGWBucketInfo& bucket_info,
+ int shard_id,
+ std::vector<rgw_bucket_dir_header>& headers,
+ std::map<int, std::string> *bucket_instance_ids = NULL);
int cls_bucket_head_async(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, int shard_id, RGWGetDirHeader_CB *ctx, int *num_aio);
int bi_get_instance(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const rgw_obj& obj, rgw_bucket_dir_entry *dirent);
void bi_put(librados::ObjectWriteOperation& op, BucketShard& bs, rgw_cls_bi_entry& entry);
int bi_put(BucketShard& bs, rgw_cls_bi_entry& entry);
int bi_put(const DoutPrefixProvider *dpp, rgw_bucket& bucket, rgw_obj& obj, rgw_cls_bi_entry& entry);
- int bi_list(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, int shard_id, const string& filter_obj, const string& marker, uint32_t max, list<rgw_cls_bi_entry> *entries, bool *is_truncated);
- int bi_list(BucketShard& bs, const string& filter_obj, const string& marker, uint32_t max, list<rgw_cls_bi_entry> *entries, bool *is_truncated);
- int bi_list(const DoutPrefixProvider *dpp, rgw_bucket& bucket, const string& obj_name, const string& marker, uint32_t max,
- list<rgw_cls_bi_entry> *entries, bool *is_truncated);
+ int bi_list(const DoutPrefixProvider *dpp,
+ const RGWBucketInfo& bucket_info,
+ int shard_id,
+ const std::string& filter_obj,
+ const std::string& marker,
+ uint32_t max,
+ std::list<rgw_cls_bi_entry> *entries,
+ bool *is_truncated);
+ int bi_list(BucketShard& bs, const std::string& filter_obj, const std::string& marker, uint32_t max, std::list<rgw_cls_bi_entry> *entries, bool *is_truncated);
+ int bi_list(const DoutPrefixProvider *dpp, rgw_bucket& bucket, const std::string& obj_name, const std::string& marker, uint32_t max,
+ std::list<rgw_cls_bi_entry> *entries, bool *is_truncated);
int bi_remove(const DoutPrefixProvider *dpp, BucketShard& bs);
- int cls_obj_usage_log_add(const DoutPrefixProvider *dpp, const string& oid, rgw_usage_log_info& info);
- int cls_obj_usage_log_read(const DoutPrefixProvider *dpp, const string& oid, const string& user, const string& bucket, uint64_t start_epoch,
- uint64_t end_epoch, uint32_t max_entries, string& read_iter, map<rgw_user_bucket,
- rgw_usage_log_entry>& usage, bool *is_truncated);
- int cls_obj_usage_log_trim(const DoutPrefixProvider *dpp, const string& oid, const string& user, const string& bucket, uint64_t start_epoch,
+ int cls_obj_usage_log_add(const DoutPrefixProvider *dpp, const std::string& oid, rgw_usage_log_info& info);
+ int cls_obj_usage_log_read(const DoutPrefixProvider *dpp, const std::string& oid, const std::string& user, const std::string& bucket, uint64_t start_epoch,
+ uint64_t end_epoch, uint32_t max_entries, std::string& read_iter,
+ std::map<rgw_user_bucket, rgw_usage_log_entry>& usage, bool *is_truncated);
+ int cls_obj_usage_log_trim(const DoutPrefixProvider *dpp, const std::string& oid, const std::string& user, const std::string& bucket, uint64_t start_epoch,
uint64_t end_epoch);
- int cls_obj_usage_log_clear(const DoutPrefixProvider *dpp, string& oid);
+ int cls_obj_usage_log_clear(const DoutPrefixProvider *dpp, std::string& oid);
- int get_target_shard_id(const rgw::bucket_index_normal_layout& layout, const string& obj_key, int *shard_id);
+ int get_target_shard_id(const rgw::bucket_index_normal_layout& layout, const std::string& obj_key, int *shard_id);
- int lock_exclusive(const rgw_pool& pool, const string& oid, ceph::timespan& duration, rgw_zone_id& zone_id, string& owner_id);
- int unlock(const rgw_pool& pool, const string& oid, rgw_zone_id& zone_id, string& owner_id);
+ int lock_exclusive(const rgw_pool& pool, const std::string& oid, ceph::timespan& duration, rgw_zone_id& zone_id, std::string& owner_id);
+ int unlock(const rgw_pool& pool, const std::string& oid, rgw_zone_id& zone_id, std::string& owner_id);
void update_gc_chain(const DoutPrefixProvider *dpp, rgw_obj& head_obj, RGWObjManifest& manifest, cls_rgw_obj_chain *chain);
- int send_chain_to_gc(cls_rgw_obj_chain& chain, const string& tag);
- void delete_objs_inline(const DoutPrefixProvider *dpp, cls_rgw_obj_chain& chain, const string& tag);
- int gc_operate(const DoutPrefixProvider *dpp, string& oid, librados::ObjectWriteOperation *op);
+ int send_chain_to_gc(cls_rgw_obj_chain& chain, const std::string& tag);
+ void delete_objs_inline(const DoutPrefixProvider *dpp, cls_rgw_obj_chain& chain, const std::string& tag);
+ int gc_operate(const DoutPrefixProvider *dpp, std::string& oid, librados::ObjectWriteOperation *op);
int gc_aio_operate(const std::string& oid, librados::AioCompletion *c,
librados::ObjectWriteOperation *op);
- int gc_operate(const DoutPrefixProvider *dpp, string& oid, librados::ObjectReadOperation *op, bufferlist *pbl);
+ int gc_operate(const DoutPrefixProvider *dpp, std::string& oid, librados::ObjectReadOperation *op, bufferlist *pbl);
- int list_gc_objs(int *index, string& marker, uint32_t max, bool expired_only, std::list<cls_rgw_gc_obj_info>& result, bool *truncated, bool& processing_queue);
+ int list_gc_objs(int *index, std::string& marker, uint32_t max, bool expired_only, std::list<cls_rgw_gc_obj_info>& result, bool *truncated, bool& processing_queue);
int process_gc(bool expired_only);
bool process_expire_objects(const DoutPrefixProvider *dpp);
int defer_gc(const DoutPrefixProvider *dpp, void *ctx, const RGWBucketInfo& bucket_info, const rgw_obj& obj, optional_yield y);
int process_lc();
- int list_lc_progress(string& marker, uint32_t max_entries,
- vector<rgw::sal::Lifecycle::LCEntry>& progress_map, int& index);
+ int list_lc_progress(std::string& marker, uint32_t max_entries,
+ std::vector<rgw::sal::Lifecycle::LCEntry>& progress_map, int& index);
int bucket_check_index(const DoutPrefixProvider *dpp, RGWBucketInfo& bucket_info,
- map<RGWObjCategory, RGWStorageStats> *existing_stats,
- map<RGWObjCategory, RGWStorageStats> *calculated_stats);
+ std::map<RGWObjCategory, RGWStorageStats> *existing_stats,
+ std::map<RGWObjCategory, RGWStorageStats> *calculated_stats);
int bucket_rebuild_index(const DoutPrefixProvider *dpp, RGWBucketInfo& bucket_info);
int bucket_set_reshard(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const cls_rgw_bucket_instance_entry& entry);
- int remove_objs_from_index(const DoutPrefixProvider *dpp, RGWBucketInfo& bucket_info, list<rgw_obj_index_key>& oid_list);
+ int remove_objs_from_index(const DoutPrefixProvider *dpp, RGWBucketInfo& bucket_info, std::list<rgw_obj_index_key>& oid_list);
int move_rados_obj(const DoutPrefixProvider *dpp,
librados::IoCtx& src_ioctx,
- const string& src_oid, const string& src_locator,
+ const std::string& src_oid, const std::string& src_locator,
librados::IoCtx& dst_ioctx,
- const string& dst_oid, const string& dst_locator);
+ const std::string& dst_oid, const std::string& dst_locator);
int fix_head_obj_locator(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, bool copy_obj, bool remove_bad, rgw_obj_key& key);
int fix_tail_obj_locator(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, rgw_obj_key& key, bool fix, bool *need_fix, optional_yield y);
librados::Rados* get_rados_handle();
- int delete_raw_obj_aio(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, list<librados::AioCompletion *>& handles);
+ int delete_raw_obj_aio(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, std::list<librados::AioCompletion *>& handles);
int delete_obj_aio(const DoutPrefixProvider *dpp, const rgw_obj& obj, RGWBucketInfo& info, RGWObjState *astate,
- list<librados::AioCompletion *>& handles, bool keep_index_consistent,
+ std::list<librados::AioCompletion *>& handles, bool keep_index_consistent,
optional_yield y);
private:
* ctx: context object to use for the iteration
* Returns: 0 on success, -ERR# otherwise.
*/
- int pool_iterate_begin(const DoutPrefixProvider *dpp, const rgw_pool& pool, const string& cursor, RGWPoolIterCtx& ctx);
+ int pool_iterate_begin(const DoutPrefixProvider *dpp, const rgw_pool& pool, const std::string& cursor, RGWPoolIterCtx& ctx);
/**
* Get pool iteration position
* ctx: context object to use for the iteration
- * Returns: string representation of position
+ * Returns: std::string representation of position
*/
- string pool_iterate_get_cursor(RGWPoolIterCtx& ctx);
+ std::string pool_iterate_get_cursor(RGWPoolIterCtx& ctx);
/**
* Iterate over pool return object names, use optional filter
* filter: if not NULL, will be used to filter returned objects
* Returns: 0 on success, -ERR# otherwise.
*/
- int pool_iterate(const DoutPrefixProvider *dpp, RGWPoolIterCtx& ctx, uint32_t num, vector<rgw_bucket_dir_entry>& objs,
+ int pool_iterate(const DoutPrefixProvider *dpp, RGWPoolIterCtx& ctx, uint32_t num,
+ std::vector<rgw_bucket_dir_entry>& objs,
bool *is_truncated, RGWAccessListFilter *filter);
uint64_t next_bucket_id();
}
D3nGetObjData d3n_get_data;
- atomic_bool d3n_bypass_cache_write{false};
+ std::atomic_bool d3n_bypass_cache_write{false};
int flush(rgw::AioResultList&& results);
}; /* RGWRequest */
struct RGWLoadGenRequest : public RGWRequest {
- string method;
- string resource;
+ std::string method;
+ std::string resource;
int content_length;
std::atomic<bool>* fail_flag = nullptr;
-RGWLoadGenRequest(uint64_t req_id, const string& _m, const string& _r, int _cl,
+RGWLoadGenRequest(uint64_t req_id, const std::string& _m, const std::string& _r, int _cl,
std::atomic<bool> *ff)
: RGWRequest(req_id), method(_m), resource(_r), content_length(_cl),
fail_flag(ff) {}
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
const string reshard_oid_prefix = "reshard.";
const string reshard_lock_name = "reshard_process";
const string bucket_instance_lock_name = "bucket_instance_lock";
rgw::sal::RadosStore* store;
RGWBucketInfo bucket_info;
- std::map<string, bufferlist> bucket_attrs;
+ std::map<std::string, bufferlist> bucket_attrs;
RGWBucketReshardLock reshard_lock;
RGWBucketReshardLock* outer_reshard_lock;
RGWBucketInfo& new_bucket_info,
int max_entries,
bool verbose,
- ostream *os,
+ std::ostream *os,
Formatter *formatter,
const DoutPrefixProvider *dpp);
public:
// manage
RGWBucketReshard(rgw::sal::RadosStore* _store,
const RGWBucketInfo& _bucket_info,
- const std::map<string, bufferlist>& _bucket_attrs,
+ const std::map<std::string, bufferlist>& _bucket_attrs,
RGWBucketReshardLock* _outer_reshard_lock);
int execute(int num_shards, int max_op_entries,
const DoutPrefixProvider *dpp,
- bool verbose = false, ostream *out = nullptr,
+ bool verbose = false, std::ostream *out = nullptr,
Formatter *formatter = nullptr,
RGWReshard *reshard_log = nullptr);
int get_status(const DoutPrefixProvider *dpp, std::list<cls_rgw_bucket_instance_entry> *status);
static int set_resharding_status(const DoutPrefixProvider *dpp,
rgw::sal::RadosStore* store,
const RGWBucketInfo& bucket_info,
- const string& new_instance_id,
+ const std::string& new_instance_id,
int32_t num_shards,
cls_rgw_reshard_status status);
- int set_resharding_status(const DoutPrefixProvider *dpp, const string& new_instance_id,
+ int set_resharding_status(const DoutPrefixProvider *dpp, const std::string& new_instance_id,
int32_t num_shards,
cls_rgw_reshard_status status) {
return set_resharding_status(dpp, store, bucket_info,
private:
rgw::sal::RadosStore* store;
- string lock_name;
+ std::string lock_name;
rados::cls::lock::Lock instance_lock;
int num_logshards;
bool verbose;
- ostream *out;
+ std::ostream *out;
Formatter *formatter;
- void get_logshard_oid(int shard_num, string *shard);
+ void get_logshard_oid(int shard_num, std::string *shard);
protected:
class ReshardWorker : public Thread, public DoutPrefixProvider {
CephContext *cct;
ReshardWorker *worker = nullptr;
std::atomic<bool> down_flag = { false };
- string get_logshard_key(const string& tenant, const string& bucket_name);
- void get_bucket_logshard_oid(const string& tenant, const string& bucket_name, string *oid);
+ std::string get_logshard_key(const std::string& tenant, const std::string& bucket_name);
+ void get_bucket_logshard_oid(const std::string& tenant, const std::string& bucket_name, std::string *oid);
public:
- RGWReshard(rgw::sal::RadosStore* _store, bool _verbose = false, ostream *_out = nullptr, Formatter *_formatter = nullptr);
+ RGWReshard(rgw::sal::RadosStore* _store, bool _verbose = false, std::ostream *_out = nullptr, Formatter *_formatter = nullptr);
int add(const DoutPrefixProvider *dpp, cls_rgw_reshard_entry& entry);
int update(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const RGWBucketInfo& new_bucket_info);
int get(const DoutPrefixProvider *dpp, cls_rgw_reshard_entry& entry);
int remove(const DoutPrefixProvider *dpp, cls_rgw_reshard_entry& entry);
- int list(const DoutPrefixProvider *dpp, int logshard_num, string& marker, uint32_t max, std::list<cls_rgw_reshard_entry>& entries, bool *is_truncated);
- int clear_bucket_resharding(const DoutPrefixProvider *dpp, const string& bucket_instance_oid, cls_rgw_reshard_entry& entry);
+ int list(const DoutPrefixProvider *dpp, int logshard_num, std::string& marker, uint32_t max, std::list<cls_rgw_reshard_entry>& entries, bool *is_truncated);
+ int clear_bucket_resharding(const DoutPrefixProvider *dpp, const std::string& bucket_instance_oid, cls_rgw_reshard_entry& entry);
/* reshard thread */
int process_single_logshard(int logshard_num, const DoutPrefixProvider *dpp);
#define dout_subsys ceph_subsys_rgw
+using namespace std;
RGWResolver::~RGWResolver() {
}
public:
~RGWResolver();
RGWResolver();
- int resolve_cname(const string& hostname, string& cname, bool *found);
+ int resolve_cname(const std::string& hostname, std::string& cname, bool *found);
};
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
struct rgw_http_status_code {
int code;
const char *name;
class RESTArgs {
public:
- static int get_string(struct req_state *s, const string& name,
- const string& def_val, string *val,
+ static int get_string(struct req_state *s, const std::string& name,
+ const std::string& def_val, std::string *val,
bool *existed = NULL);
- static int get_uint64(struct req_state *s, const string& name,
+ static int get_uint64(struct req_state *s, const std::string& name,
uint64_t def_val, uint64_t *val, bool *existed = NULL);
- static int get_int64(struct req_state *s, const string& name,
+ static int get_int64(struct req_state *s, const std::string& name,
int64_t def_val, int64_t *val, bool *existed = NULL);
- static int get_uint32(struct req_state *s, const string& name,
+ static int get_uint32(struct req_state *s, const std::string& name,
uint32_t def_val, uint32_t *val, bool *existed = NULL);
- static int get_int32(struct req_state *s, const string& name,
+ static int get_int32(struct req_state *s, const std::string& name,
int32_t def_val, int32_t *val, bool *existed = NULL);
- static int get_time(struct req_state *s, const string& name,
+ static int get_time(struct req_state *s, const std::string& name,
const utime_t& def_val, utime_t *val,
bool *existed = NULL);
- static int get_epoch(struct req_state *s, const string& name,
+ static int get_epoch(struct req_state *s, const std::string& name,
uint64_t def_val, uint64_t *epoch,
bool *existed = NULL);
- static int get_bool(struct req_state *s, const string& name, bool def_val,
+ static int get_bool(struct req_state *s, const std::string& name, bool def_val,
bool *val, bool *existed = NULL);
};
RGWHandler_REST() {}
~RGWHandler_REST() override {}
- static int validate_bucket_name(const string& bucket);
- static int validate_object_name(const string& object);
+ static int validate_bucket_name(const std::string& bucket);
+ static int validate_object_name(const std::string& object);
static int reallocate_formatter(struct req_state *s, int type);
int init_permissions(RGWOp* op, optional_yield y) override;
mgr.put_handler(handler);
}
- void register_resource(string resource, RGWRESTMgr *m,
+ void register_resource(std::string resource, RGWRESTMgr *m,
bool register_empty = false) {
if (!register_empty && resource.empty())
return;
static constexpr int64_t NO_CONTENT_LENGTH = -1;
static constexpr int64_t CHUNKED_TRANSFER_ENCODING = -2;
-extern void dump_errno(int http_ret, string& out);
-extern void dump_errno(const struct rgw_err &err, string& out);
+extern void dump_errno(int http_ret, std::string& out);
+extern void dump_errno(const struct rgw_err &err, std::string& out);
extern void dump_errno(struct req_state *s);
extern void dump_errno(struct req_state *s, int http_ret);
extern void end_header(struct req_state *s,
bool force_no_error = false);
extern void dump_start(struct req_state *s);
extern void list_all_buckets_start(struct req_state *s);
-extern void dump_owner(struct req_state *s, const rgw_user& id, string& name,
+extern void dump_owner(struct req_state *s, const rgw_user& id, std::string& name,
const char *section = NULL);
extern void dump_header(struct req_state* s,
const std::string_view& name,
extern void dump_time(struct req_state *s, const char *name, real_time *t);
extern std::string dump_time_to_str(const real_time& t);
extern void dump_bucket_from_state(struct req_state *s);
-extern void dump_redirect(struct req_state *s, const string& redirect);
+extern void dump_redirect(struct req_state *s, const std::string& redirect);
extern bool is_valid_url(const char *url);
extern void dump_access_control(struct req_state *s, const char *origin,
const char *meth,
#define dout_subsys ceph_subsys_rgw
+using namespace std;
class RGWOp_Bucket_Info : public RGWRESTOp {
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
int RGWHTTPSimpleRequest::get_status()
{
int retcode = get_req_retcode();
using unique_lock = std::unique_lock<std::mutex>;
std::mutex out_headers_lock;
- map<string, string> out_headers;
+ std::map<std::string, std::string> out_headers;
param_vec_t params;
bufferlist::iterator *send_iter;
size_t max_response; /* we need this as we don't stream out response */
bufferlist response;
- virtual int handle_header(const string& name, const string& val);
- void get_params_str(map<string, string>& extra_args, string& dest);
+ virtual int handle_header(const std::string& name, const std::string& val);
+ void get_params_str(std::map<std::string, std::string>& extra_args, std::string& dest);
public:
- RGWHTTPSimpleRequest(CephContext *_cct, const string& _method, const string& _url,
+ RGWHTTPSimpleRequest(CephContext *_cct, const std::string& _method, const std::string& _url,
param_vec_t *_headers, param_vec_t *_params) : RGWHTTPClient(_cct, _method, _url),
http_status(0), status(0),
send_iter(NULL),
bufferlist& get_response() { return response; }
- void get_out_headers(map<string, string> *pheaders); /* modifies out_headers */
+ void get_out_headers(std::map<std::string, std::string> *pheaders); /* modifies out_headers */
int get_http_status() { return http_status; }
int get_status();
class RGWRESTSimpleRequest : public RGWHTTPSimpleRequest {
std::optional<std::string> api_name;
public:
- RGWRESTSimpleRequest(CephContext *_cct, const string& _method, const string& _url,
+ RGWRESTSimpleRequest(CephContext *_cct, const std::string& _method, const std::string& _url,
param_vec_t *_headers, param_vec_t *_params,
std::optional<std::string> _api_name) : RGWHTTPSimpleRequest(_cct, _method, _url, _headers, _params), api_name(_api_name) {}
CephContext *cct;
RGWEnv *new_env;
req_info *new_info;
- string region;
- string service;
- string method;
- string url;
- string resource;
+ std::string region;
+ std::string service;
+ std::string method;
+ std::string url;
+ std::string resource;
public:
RGWRESTGenerateHTTPHeaders(CephContext *_cct, RGWEnv *_env, req_info *_info);
- void init(const string& method, const string& host,
- const string& resource_prefix, const string& url,
- const string& resource, const param_vec_t& params,
- std::optional<string> api_name);
- void set_extra_headers(const map<string, string>& extra_headers);
- int set_obj_attrs(const DoutPrefixProvider *dpp, map<string, bufferlist>& rgw_attrs);
- void set_http_attrs(const map<string, string>& http_attrs);
+ void init(const std::string& method, const std::string& host,
+ const std::string& resource_prefix, const std::string& url,
+ const std::string& resource, const param_vec_t& params,
+ std::optional<std::string> api_name);
+ void set_extra_headers(const std::map<std::string, std::string>& extra_headers);
+ int set_obj_attrs(const DoutPrefixProvider *dpp, std::map<std::string, bufferlist>& rgw_attrs);
+ void set_http_attrs(const std::map<std::string, std::string>& http_attrs);
void set_policy(RGWAccessControlPolicy& policy);
int sign(const DoutPrefixProvider *dpp, RGWAccessKey& key, const bufferlist *opt_content);
- const string& get_url() { return url; }
+ const std::string& get_url() { return url; }
};
class RGWHTTPStreamRWRequest : public RGWHTTPSimpleRequest {
protected:
bufferlist outbl;
- int handle_header(const string& name, const string& val) override;
+ int handle_header(const std::string& name, const std::string& val) override;
public:
int send_data(void *ptr, size_t len, bool *pause) override;
int receive_data(void *ptr, size_t len, bool *pause) override;
}
};
- RGWHTTPStreamRWRequest(CephContext *_cct, const string& _method, const string& _url,
+ RGWHTTPStreamRWRequest(CephContext *_cct, const std::string& _method, const std::string& _url,
param_vec_t *_headers, param_vec_t *_params) : RGWHTTPSimpleRequest(_cct, _method, _url, _headers, _params) {
}
- RGWHTTPStreamRWRequest(CephContext *_cct, const string& _method, const string& _url, ReceiveCB *_cb,
+ RGWHTTPStreamRWRequest(CephContext *_cct, const std::string& _method, const std::string& _url, ReceiveCB *_cb,
param_vec_t *_headers, param_vec_t *_params) : RGWHTTPSimpleRequest(_cct, _method, _url, _headers, _params),
cb(_cb) {
}
void finish_write();
int complete_request(optional_yield y,
- string *etag = nullptr,
+ std::string *etag = nullptr,
real_time *mtime = nullptr,
uint64_t *psize = nullptr,
- map<string, string> *pattrs = nullptr,
- map<string, string> *pheaders = nullptr);
+ std::map<std::string, std::string> *pattrs = nullptr,
+ std::map<std::string, std::string> *pheaders = nullptr);
};
class RGWRESTStreamRWRequest : public RGWHTTPStreamRWRequest {
req_info new_info;
protected:
- std::optional<string> api_name;
+ std::optional<std::string> api_name;
HostStyle host_style;
public:
- RGWRESTStreamRWRequest(CephContext *_cct, const string& _method, const string& _url, RGWHTTPStreamRWRequest::ReceiveCB *_cb,
+ RGWRESTStreamRWRequest(CephContext *_cct, const std::string& _method, const std::string& _url, RGWHTTPStreamRWRequest::ReceiveCB *_cb,
param_vec_t *_headers, param_vec_t *_params,
std::optional<std::string> _api_name, HostStyle _host_style = PathStyle) :
RGWHTTPStreamRWRequest(_cct, _method, _url, _cb, _headers, _params),
}
virtual ~RGWRESTStreamRWRequest() override {}
- int send_prepare(const DoutPrefixProvider *dpp, RGWAccessKey *key, map<string, string>& extra_headers, const string& resource, bufferlist *send_data = nullptr /* optional input data */);
- int send_prepare(const DoutPrefixProvider *dpp, RGWAccessKey& key, map<string, string>& extra_headers, const rgw_obj& obj);
+ int send_prepare(const DoutPrefixProvider *dpp, RGWAccessKey *key, std::map<std::string, std::string>& extra_headers, const std::string& resource, bufferlist *send_data = nullptr /* optional input data */);
+ int send_prepare(const DoutPrefixProvider *dpp, RGWAccessKey& key, std::map<std::string, std::string>& extra_headers, const rgw_obj& obj);
int send(RGWHTTPManager *mgr);
- int send_request(const DoutPrefixProvider *dpp, RGWAccessKey& key, map<string, string>& extra_headers, const rgw_obj& obj, RGWHTTPManager *mgr);
- int send_request(const DoutPrefixProvider *dpp, RGWAccessKey *key, map<string, string>& extra_headers, const string& resource, RGWHTTPManager *mgr, bufferlist *send_data = nullptr /* optional input data */);
+ int send_request(const DoutPrefixProvider *dpp, RGWAccessKey& key, std::map<std::string, std::string>& extra_headers, const rgw_obj& obj, RGWHTTPManager *mgr);
+ int send_request(const DoutPrefixProvider *dpp, RGWAccessKey *key, std::map<std::string, std::string>& extra_headers, const std::string& resource, RGWHTTPManager *mgr, bufferlist *send_data = nullptr /* optional input data */);
void add_params(param_vec_t *params);
private:
- int do_send_prepare(const DoutPrefixProvider *dpp, RGWAccessKey *key, map<string, string>& extra_headers, const string& resource, bufferlist *send_data = nullptr /* optional input data */);
+ int do_send_prepare(const DoutPrefixProvider *dpp, RGWAccessKey *key, std::map<std::string, std::string>& extra_headers, const std::string& resource, bufferlist *send_data = nullptr /* optional input data */);
};
class RGWRESTStreamReadRequest : public RGWRESTStreamRWRequest {
public:
- RGWRESTStreamReadRequest(CephContext *_cct, const string& _url, ReceiveCB *_cb, param_vec_t *_headers,
+ RGWRESTStreamReadRequest(CephContext *_cct, const std::string& _url, ReceiveCB *_cb, param_vec_t *_headers,
param_vec_t *_params, std::optional<std::string> _api_name,
HostStyle _host_style = PathStyle) : RGWRESTStreamRWRequest(_cct, "GET", _url, _cb, _headers, _params, _api_name, _host_style) {}
};
class RGWRESTStreamHeadRequest : public RGWRESTStreamRWRequest {
public:
- RGWRESTStreamHeadRequest(CephContext *_cct, const string& _url, ReceiveCB *_cb, param_vec_t *_headers,
+ RGWRESTStreamHeadRequest(CephContext *_cct, const std::string& _url, ReceiveCB *_cb, param_vec_t *_headers,
param_vec_t *_params, std::optional<std::string> _api_name) : RGWRESTStreamRWRequest(_cct, "HEAD", _url, _cb, _headers, _params, _api_name) {}
};
class RGWRESTStreamS3PutObj : public RGWHTTPStreamRWRequest {
- std::optional<string> api_name;
+ std::optional<std::string> api_name;
HostStyle host_style;
RGWGetDataCB *out_cb;
RGWEnv new_env;
req_info new_info;
RGWRESTGenerateHTTPHeaders headers_gen;
public:
- RGWRESTStreamS3PutObj(CephContext *_cct, const string& _method, const string& _url, param_vec_t *_headers,
+ RGWRESTStreamS3PutObj(CephContext *_cct, const std::string& _method, const std::string& _url, param_vec_t *_headers,
param_vec_t *_params, std::optional<std::string> _api_name,
HostStyle _host_style) : RGWHTTPStreamRWRequest(_cct, _method, _url, nullptr, _headers, _params),
api_name(_api_name), host_style(_host_style),
~RGWRESTStreamS3PutObj() override;
void send_init(rgw::sal::Object* obj);
- void send_ready(const DoutPrefixProvider *dpp, RGWAccessKey& key, map<string, bufferlist>& rgw_attrs);
- void send_ready(const DoutPrefixProvider *dpp, RGWAccessKey& key, const map<string, string>& http_attrs,
+ void send_ready(const DoutPrefixProvider *dpp, RGWAccessKey& key, std::map<std::string, bufferlist>& rgw_attrs);
+ void send_ready(const DoutPrefixProvider *dpp, RGWAccessKey& key, const std::map<std::string, std::string>& http_attrs,
RGWAccessControlPolicy& policy);
void send_ready(const DoutPrefixProvider *dpp, RGWAccessKey& key);
- void put_obj_init(const DoutPrefixProvider *dpp, RGWAccessKey& key, rgw::sal::Object* obj, map<string, bufferlist>& attrs);
+ void put_obj_init(const DoutPrefixProvider *dpp, RGWAccessKey& key, rgw::sal::Object* obj, std::map<std::string, bufferlist>& attrs);
RGWGetDataCB *get_out_cb() { return out_cb; }
};
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
void RGWOp_ZoneGroupMap_Get::execute(optional_yield y) {
op_ret = zonegroup_map.read(this, g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, y);
if (op_ret < 0) {
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
RGWRESTConn::RGWRESTConn(CephContext *_cct, RGWSI_Zone *zone_svc,
const string& _remote_id,
const list<string>& remote_endpoints,
inline void append_param_list(param_vec_t& params, const rgw_http_param_pair* pp)
{
while (pp && pp->key) {
- string k = pp->key;
- string v = (pp->val ? pp->val : "");
+ std::string k = pp->key;
+ std::string v = (pp->val ? pp->val : "");
params.emplace_back(make_pair(std::move(k), std::move(v)));
++pp;
}
}
-// copy a null-terminated rgw_http_param_pair list into a list of string pairs
+// copy a null-terminated rgw_http_param_pair list into a list of std::string pairs
inline param_vec_t make_param_list(const rgw_http_param_pair* pp)
{
param_vec_t params;
return params;
}
-inline param_vec_t make_param_list(const map<string, string> *pp)
+inline param_vec_t make_param_list(const std::map<std::string, std::string> *pp)
{
param_vec_t params;
if (!pp) {
class RGWRESTConn
{
CephContext *cct;
- vector<string> endpoints;
+ std::vector<std::string> endpoints;
RGWAccessKey key;
- string self_zone_group;
- string remote_id;
- std::optional<string> api_name;
+ std::string self_zone_group;
+ std::string remote_id;
+ std::optional<std::string> api_name;
HostStyle host_style;
std::atomic<int64_t> counter = { 0 };
RGWRESTConn(CephContext *_cct,
RGWSI_Zone *zone_svc,
- const string& _remote_id,
- const list<string>& endpoints,
- std::optional<string> _api_name,
+ const std::string& _remote_id,
+ const std::list<std::string>& endpoints,
+ std::optional<std::string> _api_name,
HostStyle _host_style = PathStyle);
RGWRESTConn(CephContext *_cct,
rgw::sal::Store* store,
- const string& _remote_id,
- const list<string>& endpoints,
- std::optional<string> _api_name,
+ const std::string& _remote_id,
+ const std::list<std::string>& endpoints,
+ std::optional<std::string> _api_name,
HostStyle _host_style = PathStyle);
RGWRESTConn(CephContext *_cct,
RGWSI_Zone *zone_svc,
- const string& _remote_id,
- const list<string>& endpoints,
+ const std::string& _remote_id,
+ const std::list<std::string>& endpoints,
RGWAccessKey _cred,
- std::optional<string> _api_name,
+ std::optional<std::string> _api_name,
HostStyle _host_style = PathStyle);
RGWRESTConn(CephContext *_cct,
rgw::sal::Store* store,
- const string& _remote_id,
- const list<string>& endpoints,
+ const std::string& _remote_id,
+ const std::list<std::string>& endpoints,
RGWAccessKey _cred,
- std::optional<string> _api_name,
+ std::optional<std::string> _api_name,
HostStyle _host_style = PathStyle);
// custom move needed for atomic
RGWRESTConn& operator=(RGWRESTConn&& other);
virtual ~RGWRESTConn() = default;
- int get_url(string& endpoint);
- string get_url();
- const string& get_self_zonegroup() {
+ int get_url(std::string& endpoint);
+ std::string get_url();
+ const std::string& get_self_zonegroup() {
return self_zone_group;
}
- const string& get_remote_id() {
+ const std::string& get_remote_id() {
return remote_id;
}
RGWAccessKey& get_key() {
return key;
}
- std::optional<string> get_api_name() const {
+ std::optional<std::string> get_api_name() const {
return api_name;
}
}
size_t get_endpoint_count() const { return endpoints.size(); }
- virtual void populate_params(param_vec_t& params, const rgw_user *uid, const string& zonegroup);
+ virtual void populate_params(param_vec_t& params, const rgw_user *uid, const std::string& zonegroup);
/* sync request */
int forward(const DoutPrefixProvider *dpp, const rgw_user& uid, req_info& info, obj_version *objv, size_t max_response, bufferlist *inbl, bufferlist *outbl, optional_yield y);
/* async requests */
int put_obj_send_init(rgw::sal::Object* obj, const rgw_http_param_pair *extra_params, RGWRESTStreamS3PutObj **req);
int put_obj_async_init(const DoutPrefixProvider *dpp, const rgw_user& uid, rgw::sal::Object* obj,
- map<string, bufferlist>& attrs, RGWRESTStreamS3PutObj **req);
- int complete_request(RGWRESTStreamS3PutObj *req, string& etag,
+ std::map<std::string, bufferlist>& attrs, RGWRESTStreamS3PutObj **req);
+ int complete_request(RGWRESTStreamS3PutObj *req, std::string& etag,
ceph::real_time *mtime, optional_yield y);
struct get_obj_params {
const ceph::real_time *unmod_ptr{nullptr};
bool high_precision_time{true};
- string etag;
+ std::string etag;
uint32_t mod_zone_id{0};
uint64_t mod_pg_ver{0};
bool prepend_metadata, bool get_op, bool rgwx_stat, bool sync_manifest,
bool skip_decrypt, bool send, RGWHTTPStreamRWRequest::ReceiveCB *cb, RGWRESTStreamRWRequest **req);
int complete_request(RGWRESTStreamRWRequest *req,
- string *etag,
+ std::string *etag,
ceph::real_time *mtime,
uint64_t *psize,
- map<string, string> *pattrs,
- map<string, string> *pheaders,
+ std::map<std::string, std::string> *pattrs,
+ std::map<std::string, std::string> *pheaders,
optional_yield y);
int get_resource(const DoutPrefixProvider *dpp,
- const string& resource,
+ const std::string& resource,
param_vec_t *extra_params,
- map<string, string>* extra_headers,
+ std::map<std::string, std::string>* extra_headers,
bufferlist& bl,
bufferlist *send_data,
RGWHTTPManager *mgr,
optional_yield y);
template <class T>
- int get_json_resource(const DoutPrefixProvider *dpp, const string& resource, param_vec_t *params,
+ int get_json_resource(const DoutPrefixProvider *dpp, const std::string& resource, param_vec_t *params,
bufferlist *in_data, optional_yield y, T& t);
template <class T>
- int get_json_resource(const DoutPrefixProvider *dpp, const string& resource, param_vec_t *params,
+ int get_json_resource(const DoutPrefixProvider *dpp, const std::string& resource, param_vec_t *params,
optional_yield y, T& t);
template <class T>
- int get_json_resource(const DoutPrefixProvider *dpp, const string& resource, const rgw_http_param_pair *pp,
+ int get_json_resource(const DoutPrefixProvider *dpp, const std::string& resource, const rgw_http_param_pair *pp,
optional_yield y, T& t);
private:
- void populate_zonegroup(param_vec_t& params, const string& zonegroup) {
+ void populate_zonegroup(param_vec_t& params, const std::string& zonegroup) {
if (!zonegroup.empty()) {
params.push_back(param_pair_t(RGW_SYS_PARAM_PREFIX "zonegroup", zonegroup));
}
}
void populate_uid(param_vec_t& params, const rgw_user *uid) {
if (uid) {
- string uid_str = uid->to_str();
+ std::string uid_str = uid->to_str();
if (!uid->empty()){
params.push_back(param_pair_t(RGW_SYS_PARAM_PREFIX "uid", uid_str));
}
public:
- 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) :
+ S3RESTConn(CephContext *_cct, RGWSI_Zone *svc_zone, const std::string& _remote_id, const std::list<std::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::Store* 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 std::string& _remote_id, const std::list<std::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):
+ S3RESTConn(CephContext *_cct, RGWSI_Zone *svc_zone, const std::string& _remote_id, const std::list<std::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::Store* 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 std::string& _remote_id, const std::list<std::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;
- void populate_params(param_vec_t& params, const rgw_user *uid, const string& zonegroup) override {
+ void populate_params(param_vec_t& params, const rgw_user *uid, const std::string& zonegroup) override {
// do not populate any params in S3 REST Connection.
return;
}
template<class T>
-int RGWRESTConn::get_json_resource(const DoutPrefixProvider *dpp, const string& resource, param_vec_t *params,
+int RGWRESTConn::get_json_resource(const DoutPrefixProvider *dpp, const std::string& resource, param_vec_t *params,
bufferlist *in_data, optional_yield y, T& t)
{
bufferlist bl;
}
template<class T>
-int RGWRESTConn::get_json_resource(const DoutPrefixProvider *dpp, const string& resource, param_vec_t *params,
+int RGWRESTConn::get_json_resource(const DoutPrefixProvider *dpp, const std::string& resource, param_vec_t *params,
optional_yield y, T& t)
{
return get_json_resource(dpp, resource, params, nullptr, y, t);
}
template<class T>
-int RGWRESTConn::get_json_resource(const DoutPrefixProvider *dpp, const string& resource, const rgw_http_param_pair *pp,
+int RGWRESTConn::get_json_resource(const DoutPrefixProvider *dpp, const std::string& resource, const rgw_http_param_pair *pp,
optional_yield y, T& t)
{
param_vec_t params = make_param_list(pp);
class RGWRESTReadResource : public RefCountedObject, public RGWIOProvider {
CephContext *cct;
RGWRESTConn *conn;
- string resource;
+ std::string resource;
param_vec_t params;
- map<string, string> headers;
+ std::map<std::string, std::string> headers;
bufferlist bl;
RGWStreamIntoBufferlist cb;
public:
RGWRESTReadResource(RGWRESTConn *_conn,
- const string& _resource,
+ const std::string& _resource,
const rgw_http_param_pair *pp,
param_vec_t *extra_headers,
RGWHTTPManager *_mgr);
RGWRESTReadResource(RGWRESTConn *_conn,
- const string& _resource,
+ const std::string& _resource,
param_vec_t& _params,
param_vec_t *extra_headers,
RGWHTTPManager *_mgr);
int aio_read(const DoutPrefixProvider *dpp);
- string to_str() {
+ std::string to_str() {
return req.to_str();
}
class RGWRESTSendResource : public RefCountedObject, public RGWIOProvider {
CephContext *cct;
RGWRESTConn *conn;
- string method;
- string resource;
+ std::string method;
+ std::string resource;
param_vec_t params;
- map<string, string> headers;
+ std::map<std::string, std::string> headers;
bufferlist bl;
RGWStreamIntoBufferlist cb;
public:
RGWRESTSendResource(RGWRESTConn *_conn,
- const string& _method,
- const string& _resource,
+ const std::string& _method,
+ const std::string& _resource,
const rgw_http_param_pair *pp,
param_vec_t *extra_headers,
RGWHTTPManager *_mgr);
RGWRESTSendResource(RGWRESTConn *_conn,
- const string& _method,
- const string& _resource,
+ const std::string& _method,
+ const std::string& _resource,
param_vec_t& params,
param_vec_t *extra_headers,
RGWHTTPManager *_mgr);
int aio_send(const DoutPrefixProvider *dpp, bufferlist& bl);
- string to_str() {
+ std::string to_str() {
return req.to_str();
}
class RGWRESTPostResource : public RGWRESTSendResource {
public:
RGWRESTPostResource(RGWRESTConn *_conn,
- const string& _resource,
+ const std::string& _resource,
const rgw_http_param_pair *pp,
param_vec_t *extra_headers,
RGWHTTPManager *_mgr) : RGWRESTSendResource(_conn, "POST", _resource,
pp, extra_headers, _mgr) {}
RGWRESTPostResource(RGWRESTConn *_conn,
- const string& _resource,
+ const std::string& _resource,
param_vec_t& params,
param_vec_t *extra_headers,
RGWHTTPManager *_mgr) : RGWRESTSendResource(_conn, "POST", _resource,
class RGWRESTPutResource : public RGWRESTSendResource {
public:
RGWRESTPutResource(RGWRESTConn *_conn,
- const string& _resource,
+ const std::string& _resource,
const rgw_http_param_pair *pp,
param_vec_t *extra_headers,
RGWHTTPManager *_mgr) : RGWRESTSendResource(_conn, "PUT", _resource,
pp, extra_headers, _mgr) {}
RGWRESTPutResource(RGWRESTConn *_conn,
- const string& _resource,
+ const std::string& _resource,
param_vec_t& params,
param_vec_t *extra_headers,
RGWHTTPManager *_mgr) : RGWRESTSendResource(_conn, "PUT", _resource,
class RGWRESTDeleteResource : public RGWRESTSendResource {
public:
RGWRESTDeleteResource(RGWRESTConn *_conn,
- const string& _resource,
+ const std::string& _resource,
const rgw_http_param_pair *pp,
param_vec_t *extra_headers,
RGWHTTPManager *_mgr) : RGWRESTSendResource(_conn, "DELETE", _resource,
pp, extra_headers, _mgr) {}
RGWRESTDeleteResource(RGWRESTConn *_conn,
- const string& _resource,
+ const std::string& _resource,
param_vec_t& params,
param_vec_t *extra_headers,
RGWHTTPManager *_mgr) : RGWRESTSendResource(_conn, "DELETE", _resource,
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
void RGWHandler_REST_IAM::rgw_iam_parse_input()
{
if (post_body.size() > 0) {
class RGWHandler_REST_IAM : public RGWHandler_REST {
const rgw::auth::StrategyRegistry& auth_registry;
- const string& post_body;
+ const std::string& post_body;
RGWOp *op_post() override;
void rgw_iam_parse_input();
public:
static int init_from_header(struct req_state *s, int default_formatter, bool configurable_format);
- RGWHandler_REST_IAM(const rgw::auth::StrategyRegistry& auth_registry, const string& post_body="")
+ RGWHandler_REST_IAM(const rgw::auth::StrategyRegistry& auth_registry,
+ const std::string& post_body="")
: RGWHandler_REST(),
auth_registry(auth_registry),
post_body(post_body) {}
#define LOG_CLASS_LIST_MAX_ENTRIES (1000)
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
void RGWOp_MDLog_List::execute(optional_yield y) {
string period = s->info.args.get("period");
string shard = s->info.args.get("id");
return check_caps(s->user->get_caps());
}
void send_response() override;
- virtual void send_response(list<rgw_bi_log_entry>& entries, string& marker);
+ virtual void send_response(std::list<rgw_bi_log_entry>& entries, std::string& marker);
virtual void send_response_end();
void execute(optional_yield y) override;
const char* name() const override {
};
class RGWOp_BILog_Info : public RGWRESTOp {
- string bucket_ver;
- string master_ver;
- string max_marker;
+ std::string bucket_ver;
+ std::string master_ver;
+ std::string max_marker;
bool syncstopped;
public:
RGWOp_BILog_Info() : bucket_ver(), master_ver(), syncstopped(false) {}
};
class RGWOp_MDLog_List : public RGWRESTOp {
- list<cls_log_entry> entries;
- string last_marker;
+ std::list<cls_log_entry> entries;
+ std::string last_marker;
bool truncated;
public:
RGWOp_MDLog_List() : truncated(false) {}
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
static inline void frame_metadata_key(req_state *s, string& out) {
bool exists;
string key = s->info.args.get("key", &exists);
class RGWOp_Metadata_Put : public RGWRESTOp {
int get_data(bufferlist& bl);
- string update_status;
+ std::string update_status;
obj_version ondisk_version;
public:
RGWOp_Metadata_Put() {}
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
int RGWRestOIDCProvider::verify_permission(optional_yield y)
{
if (s->auth.identity->is_anonymous()) {
class RGWRestOIDCProvider : public RGWRESTOp {
protected:
- vector<string> client_ids;
- vector<string> thumbprints;
- string provider_url; //'iss' field in JWT
- string provider_arn;
+ std::vector<std::string> client_ids;
+ std::vector<std::string> thumbprints;
+ std::string provider_url; //'iss' field in JWT
+ std::string provider_arn;
public:
int verify_permission(optional_yield y) override;
void send_response() override;
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
static const char* AWS_SNS_NS("https://sns.amazonaws.com/doc/2010-03-31/");
// command (AWS compliant):
// delete a topic
class RGWPSDeleteTopicOp : public RGWDefaultResponseOp {
protected:
- string topic_name;
+ std::string topic_name;
std::optional<RGWPubSub> ps;
virtual int get_params() = 0;
class RGWPSCreateNotifOp : public RGWDefaultResponseOp {
protected:
std::optional<RGWPubSub> ps;
- string bucket_name;
+ std::string bucket_name;
RGWBucketInfo bucket_info;
virtual int get_params() = 0;
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
// reject 'period push' if we would have to fetch too many intermediate periods
static const uint32_t PERIOD_HISTORY_FETCH_MAX = 64;
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
int RGWRestRole::verify_permission(optional_yield y)
{
if (s->auth.identity->is_anonymous()) {
class RGWRestRole : public RGWRESTOp {
protected:
- string role_name;
- string role_path;
- string trust_policy;
- string policy_name;
- string perm_policy;
- string path_prefix;
- string max_session_duration;
+ std::string role_name;
+ std::string role_path;
+ std::string trust_policy;
+ std::string policy_name;
+ std::string perm_policy;
+ std::string path_prefix;
+ std::string max_session_duration;
std::unique_ptr<rgw::sal::RGWRole> _role;
public:
int verify_permission(optional_yield y) override;
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
using namespace rgw;
using namespace ceph::crypto;
-using std::get;
-
void list_all_buckets_start(struct req_state *s)
{
s->formatter->open_array_section_in_ns("ListAllMyBucketsResult", XMLNS_AWS_S3);
bool fetchOwner;
bool start_after_exist;
bool continuation_token_exist;
- string startAfter;
- string continuation_token;
+ std::string startAfter;
+ std::string continuation_token;
public:
RGWListBucket_ObjStore_S3v2() : fetchOwner(false) {
}
rgw::sal::DataProcessor *cb) override;
int get_decrypt_filter(std::unique_ptr<RGWGetObj_Filter>* filter,
RGWGetObj_Filter* cb,
- map<string, bufferlist>& attrs,
+ std::map<std::string, bufferlist>& attrs,
bufferlist* manifest_bl) override;
};
std::string content_type;
RGWPolicyEnv env;
RGWPolicy post_policy;
- map<string, string> crypt_http_responses;
+ std::map<std::string, std::string> crypt_http_responses;
const rgw::auth::StrategyRegistry* auth_registry_ptr = nullptr;
RGWPutACLs_ObjStore_S3() {}
~RGWPutACLs_ObjStore_S3() override {}
- int get_policy_from_state(rgw::sal::Store* store, struct req_state *s, stringstream& ss) override;
+ int get_policy_from_state(rgw::sal::Store* store, struct req_state *s, std::stringstream& ss) override;
void send_response() override;
int get_params(optional_yield y) override;
};
int get_params(optional_yield y) override;
void send_response() override;
- int prepare_encryption(map<string, bufferlist>& attrs) override;
+ int prepare_encryption(std::map<std::string, bufferlist>& attrs) override;
};
class RGWCompleteMultipart_ObjStore_S3 : public RGWCompleteMultipart_ObjStore {
void send_status() override;
void begin_response() override;
void send_partial_response(rgw_obj_key& key, bool delete_marker,
- const string& marker_version_id, int ret) override;
+ const std::string& marker_version_id, int ret) override;
void end_response() override;
};
}
~RGWHandler_Auth_S3() override = default;
- static int validate_bucket_name(const string& bucket);
- static int validate_object_name(const string& bucket);
+ static int validate_bucket_name(const std::string& bucket);
+ static int validate_object_name(const std::string& bucket);
int init(rgw::sal::Store* store,
struct req_state *s,
return (num_periods == 3);
}
-inline int valid_s3_object_name(const string& name) {
+inline int valid_s3_object_name(const std::string& name) {
if (name.size() > 1024) {
return -ERR_INVALID_OBJECT_NAME;
}
return 0;
}
-inline int valid_s3_bucket_name(const string& name, bool relaxed=false)
+inline int valid_s3_bucket_name(const std::string& name, bool relaxed=false)
{
// This function enforces Amazon's spec for bucket names.
// (The requirements, not the recommendations.)
RGWOp *op_copy() override { return NULL; }
RGWOp *op_options() override { return NULL; }
- int serve_errordoc(const DoutPrefixProvider *dpp, int http_ret, const string &errordoc_key, optional_yield y);
+ int serve_errordoc(const DoutPrefixProvider *dpp, int http_ret, const std::string &errordoc_key, optional_yield y);
public:
using RGWHandler_REST_S3::RGWHandler_REST_S3;
~RGWHandler_REST_S3Website() override = default;
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 error_handler(int err_no, std::string *error_content, optional_yield y) override;
};
class RGWHandler_REST_Service_S3Website : public RGWHandler_REST_S3Website {
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
namespace rgw::auth::sts {
bool
bool is_applicable(const std::string& token) const noexcept;
- bool is_client_id_valid(vector<string>& client_ids, const string& client_id) const;
+ bool is_client_id_valid(std::vector<std::string>& client_ids, const std::string& client_id) const;
- bool is_cert_valid(const vector<string>& thumbprints, const string& cert) const;
+ bool is_cert_valid(const std::vector<std::string>& thumbprints, const std::string& cert) const;
- std::unique_ptr<rgw::sal::RGWOIDCProvider> get_provider(const DoutPrefixProvider *dpp, const string& role_arn, const string& iss) const;
+ std::unique_ptr<rgw::sal::RGWOIDCProvider> get_provider(const DoutPrefixProvider *dpp, const std::string& role_arn, const std::string& iss) const;
- std::string get_role_tenant(const string& role_arn) const;
+ std::string get_role_tenant(const std::string& role_arn) const;
- std::string get_cert_url(const string& iss, const DoutPrefixProvider *dpp,optional_yield y) const;
+ std::string get_cert_url(const std::string& iss, const DoutPrefixProvider *dpp,optional_yield y) const;
boost::optional<WebTokenEngine::token_t>
get_from_jwt(const DoutPrefixProvider* dpp, const std::string& token, const req_state* const s, optional_yield y) const;
- void validate_signature (const DoutPrefixProvider* dpp, const jwt::decoded_jwt& decoded, const string& algorithm, const string& iss, const vector<string>& thumbprints, optional_yield y) const;
+ void validate_signature (const DoutPrefixProvider* dpp, const jwt::decoded_jwt& decoded, const std::string& algorithm, const std::string& iss, const std::vector<std::string>& thumbprints, optional_yield y) const;
result_t authenticate(const DoutPrefixProvider* dpp,
const std::string& token,
aplptr_t create_apl_web_identity( CephContext* cct,
const req_state* s,
- const string& role_session,
- const string& role_tenant,
+ const std::string& role_session,
+ const std::string& role_tenant,
const rgw::web_idp::WebTokenClaims& token) const override {
auto apl = rgw::auth::add_sysreq(cct, store, s,
rgw::auth::WebIdentityApplier(cct, store, role_session, role_tenant, token));
class RGWSTSAssumeRoleWithWebIdentity : public RGWREST_STS {
protected:
- string duration;
- string providerId;
- string policy;
- string roleArn;
- string roleSessionName;
- string sub;
- string aud;
- string iss;
+ std::string duration;
+ std::string providerId;
+ std::string policy;
+ std::string roleArn;
+ std::string roleSessionName;
+ std::string sub;
+ std::string aud;
+ std::string iss;
public:
RGWSTSAssumeRoleWithWebIdentity() = default;
void execute(optional_yield y) override;
class RGWSTSAssumeRole : public RGWREST_STS {
protected:
- string duration;
- string externalId;
- string policy;
- string roleArn;
- string roleSessionName;
- string serialNumber;
- string tokenCode;
+ std::string duration;
+ std::string externalId;
+ std::string policy;
+ std::string roleArn;
+ std::string roleSessionName;
+ std::string serialNumber;
+ std::string tokenCode;
public:
RGWSTSAssumeRole() = default;
void execute(optional_yield y) override;
class RGWSTSGetSessionToken : public RGWREST_STS {
protected:
- string duration;
- string serialNumber;
- string tokenCode;
+ std::string duration;
+ std::string serialNumber;
+ std::string tokenCode;
public:
RGWSTSGetSessionToken() = default;
void execute(optional_yield y) override;
class RGWHandler_REST_STS : public RGWHandler_REST {
const rgw::auth::StrategyRegistry& auth_registry;
- const string& post_body;
+ const std::string& post_body;
RGWOp *op_post() override;
void rgw_sts_parse_input();
public:
static int init_from_header(struct req_state *s, int default_formatter, bool configurable_format);
- RGWHandler_REST_STS(const rgw::auth::StrategyRegistry& auth_registry, const string& post_body="")
+ RGWHandler_REST_STS(const rgw::auth::StrategyRegistry& auth_registry, const std::string& post_body="")
: RGWHandler_REST(),
auth_registry(auth_registry),
post_body(post_body) {}
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
int RGWListBuckets_ObjStore_SWIFT::get_params(optional_yield y)
{
prefix = s->info.args.get("prefix");
};
class RGWListBucket_ObjStore_SWIFT : public RGWListBucket_ObjStore {
- string path;
+ std::string path;
public:
RGWListBucket_ObjStore_SWIFT() {
default_max = 10000;
};
class RGWStatAccount_ObjStore_SWIFT : public RGWStatAccount_ObjStore {
- map<string, bufferlist> attrs;
+ std::map<std::string, bufferlist> attrs;
public:
RGWStatAccount_ObjStore_SWIFT() {
}
};
class RGWPutObj_ObjStore_SWIFT : public RGWPutObj_ObjStore {
- string lo_etag;
+ std::string lo_etag;
public:
RGWPutObj_ObjStore_SWIFT() {}
~RGWPutObj_ObjStore_SWIFT() override {}
struct info
{
bool is_admin_info;
- function<void (Formatter&, const ConfigProxy&, rgw::sal::Store*)> list_data;
+ std::function<void (Formatter&, const ConfigProxy&, rgw::sal::Store*)> list_data;
};
- static const vector<pair<string, struct info>> swift_info;
+ static const std::vector<std::pair<std::string, struct info>> swift_info;
public:
RGWInfo_ObjStore_SWIFT() {}
~RGWInfo_ObjStore_SWIFT() override {}
}
~RGWHandler_REST_SWIFT() override = default;
- int validate_bucket_name(const string& bucket);
+ int validate_bucket_name(const std::string& bucket);
int init(rgw::sal::Store* store, struct req_state *s, rgw::io::BasicClient *cio) override;
int authorize(const DoutPrefixProvider *dpp, optional_yield y) override;
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
class RGWOp_Usage_Get : public RGWRESTOp {
public:
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
class RGWOp_User_List : public RGWRESTOp {
public:
#define dout_subsys ceph_subsys_rgw
+using namespace std;
using rgw::IAM::Policy;
void RGWRestUserPolicy::dump(Formatter *f) const
class RGWRestUserPolicy : public RGWRESTOp {
protected:
static constexpr int MAX_POLICY_NAME_LEN = 128;
- string policy_name;
- string user_name;
- string policy;
+ std::string policy_name;
+ std::string user_name;
+ std::string policy;
bool validate_input();
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
namespace rgw { namespace sal {
const string RGWRole::role_name_oid_prefix = "role_names.";
std::string arn;
std::string creation_date;
std::string trust_policy;
- map<std::string, std::string> perm_policy_map;
+ std::map<std::string, std::string> perm_policy_map;
std::string tenant;
uint64_t max_session_duration;
int update(const DoutPrefixProvider *dpp, optional_yield y);
void update_trust_policy(std::string& trust_policy);
void set_perm_policy(const std::string& policy_name, const std::string& perm_policy);
- vector<std::string> get_role_policy_names();
+ std::vector<std::string> get_role_policy_names();
int get_role_policy(const DoutPrefixProvider* dpp, const std::string& policy_name, std::string& perm_policy);
int delete_policy(const DoutPrefixProvider* dpp, const std::string& policy_name);
void dump(Formatter *f) const;
class RGWGetBucketStats_CB : public RefCountedObject {
protected:
rgw_bucket bucket;
- map<RGWObjCategory, RGWStorageStats>* stats;
+ std::map<RGWObjCategory, RGWStorageStats>* stats;
public:
explicit RGWGetBucketStats_CB(const rgw_bucket& _bucket) : bucket(_bucket), stats(NULL) {}
~RGWGetBucketStats_CB() override {}
virtual void handle_response(int r) = 0;
- virtual void set_response(map<RGWObjCategory, RGWStorageStats>* _stats) {
+ virtual void set_response(std::map<RGWObjCategory, RGWStorageStats>* _stats) {
stats = _stats;
}
};
virtual void get_raw_obj(const rgw_placement_rule& placement_rule, const rgw_obj& obj, rgw_raw_obj* raw_obj) = 0;
virtual int get_raw_chunk_size(const DoutPrefixProvider* dpp, const rgw_raw_obj& obj, uint64_t* chunk_size) = 0;
- virtual int log_usage(const DoutPrefixProvider *dpp, map<rgw_user_bucket, RGWUsageBatch>& usage_info) = 0;
+ virtual int log_usage(const DoutPrefixProvider *dpp, std::map<rgw_user_bucket, RGWUsageBatch>& usage_info) = 0;
virtual int log_op(const DoutPrefixProvider *dpp, std::string& oid, bufferlist& bl) = 0;
virtual int register_to_service_map(const DoutPrefixProvider *dpp, const std::string& daemon_type,
- const map<std::string, std::string>& meta) = 0;
+ const std::map<std::string, std::string>& meta) = 0;
virtual void get_quota(RGWQuotaInfo& bucket_quota, RGWQuotaInfo& user_quota) = 0;
- virtual int set_buckets_enabled(const DoutPrefixProvider* dpp, vector<rgw_bucket>& buckets, bool enabled) = 0;
+ virtual int set_buckets_enabled(const DoutPrefixProvider* dpp, std::vector<rgw_bucket>& buckets, bool enabled) = 0;
virtual uint64_t get_new_req_id() = 0;
virtual int get_sync_policy_handler(const DoutPrefixProvider* dpp,
std::optional<rgw_zone_id> zone,
RGWBucketSyncPolicyHandlerRef* phandler,
optional_yield y) = 0;
virtual RGWDataSyncStatusManager* get_data_sync_manager(const rgw_zone_id& source_zone) = 0;
- virtual void wakeup_meta_sync_shards(set<int>& shard_ids) = 0;
- virtual void wakeup_data_sync_shards(const DoutPrefixProvider *dpp, const rgw_zone_id& source_zone, map<int, set<std::string> >& shard_ids) = 0;
+ virtual void wakeup_meta_sync_shards(std::set<int>& shard_ids) = 0;
+ virtual void wakeup_data_sync_shards(const DoutPrefixProvider *dpp, const rgw_zone_id& source_zone, std::map<int, std::set<std::string> >& shard_ids) = 0;
virtual int clear_usage(const DoutPrefixProvider *dpp) = 0;
virtual int read_all_usage(const DoutPrefixProvider *dpp, 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) = 0;
+ std::map<rgw_user_bucket, rgw_usage_log_entry>& usage) = 0;
virtual int trim_all_usage(const DoutPrefixProvider *dpp, uint64_t start_epoch, uint64_t end_epoch) = 0;
virtual int get_config_key_val(std::string name, bufferlist* bl) = 0;
virtual int meta_list_keys_init(const DoutPrefixProvider *dpp, const std::string& section, const std::string& marker, void** phandle) = 0;
- virtual int meta_list_keys_next(const DoutPrefixProvider *dpp, void* handle, int max, list<std::string>& keys, bool* truncated) = 0;
+ virtual int meta_list_keys_next(const DoutPrefixProvider *dpp, void* handle, int max, std::list<std::string>& keys, bool* truncated) = 0;
virtual void meta_list_keys_complete(void* handle) = 0;
virtual std::string meta_get_marker(void* handle) = 0;
virtual int meta_remove(const DoutPrefixProvider* dpp, std::string& metadata_key, optional_yield y) = 0;
optional_yield y,
const std::string& path_prefix,
const std::string& tenant,
- vector<std::unique_ptr<RGWRole>>& roles) = 0;
+ std::vector<std::unique_ptr<RGWRole>>& roles) = 0;
virtual std::unique_ptr<RGWOIDCProvider> get_oidc_provider() = 0;
virtual int get_oidc_providers(const DoutPrefixProvider *dpp,
const std::string& tenant,
- vector<std::unique_ptr<RGWOIDCProvider>>& providers) = 0;
+ std::vector<std::unique_ptr<RGWOIDCProvider>>& providers) = 0;
virtual std::unique_ptr<MultipartUpload> get_multipart_upload(Bucket* bucket, const std::string& oid, std::optional<std::string> upload_id=std::nullopt, ceph::real_time mtime=real_clock::now()) = 0;
virtual std::unique_ptr<Writer> get_append_writer(const DoutPrefixProvider *dpp,
optional_yield y,
virtual int complete_flush_stats(const DoutPrefixProvider *dpp, optional_yield y) = 0;
virtual int read_usage(const DoutPrefixProvider *dpp, 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) = 0;
+ std::map<rgw_user_bucket, rgw_usage_log_entry>& usage) = 0;
virtual int trim_usage(const DoutPrefixProvider *dpp, uint64_t start_epoch, uint64_t end_epoch) = 0;
virtual RGWObjVersionTracker& get_version_tracker() { return objv_tracker; }
virtual Attrs& get_attrs() { return attrs; }
/* dang temporary; will be removed when User is complete */
RGWUserInfo& get_info() { return info; }
- friend inline ostream& operator<<(ostream& out, const User& u) {
+ friend inline std::ostream& operator<<(std::ostream& out, const User& u) {
out << u.info.user_id;
return out;
}
- friend inline ostream& operator<<(ostream& out, const User* u) {
+ friend inline std::ostream& operator<<(std::ostream& out, const User* u) {
if (!u)
out << "<NULL>";
else
return out;
}
- friend inline ostream& operator<<(ostream& out, const std::unique_ptr<User>& p) {
+ friend inline std::ostream& operator<<(std::ostream& out, const std::unique_ptr<User>& p) {
out << p.get();
return out;
}
int shard_id{RGW_NO_SHARD};
};
struct ListResults {
- vector<rgw_bucket_dir_entry> objs;
- map<std::string, bool> common_prefixes;
+ std::vector<rgw_bucket_dir_entry> objs;
+ std::map<std::string, bool> common_prefixes;
bool is_truncated{false};
rgw_obj_key next_marker;
};
virtual int try_refresh_info(const DoutPrefixProvider* dpp, ceph::real_time* pmtime) = 0;
virtual int read_usage(const DoutPrefixProvider *dpp, 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) = 0;
+ std::map<rgw_user_bucket, rgw_usage_log_entry>& usage) = 0;
virtual int trim_usage(const DoutPrefixProvider *dpp, uint64_t start_epoch, uint64_t end_epoch) = 0;
virtual int remove_objs_from_index(const DoutPrefixProvider *dpp, std::list<rgw_obj_index_key>& objs_to_unlink) = 0;
virtual int check_index(const DoutPrefixProvider *dpp, std::map<RGWObjCategory, RGWStorageStats>& existing_stats, std::map<RGWObjCategory, RGWStorageStats>& calculated_stats) = 0;
virtual std::unique_ptr<Bucket> clone() = 0;
virtual int list_multiparts(const DoutPrefixProvider *dpp,
- const string& prefix,
- string& marker,
- const string& delim,
+ const std::string& prefix,
+ std::string& marker,
+ const std::string& delim,
const int& max_uploads,
- vector<std::unique_ptr<MultipartUpload>>& uploads,
- map<string, bool> *common_prefixes,
+ std::vector<std::unique_ptr<MultipartUpload>>& uploads,
+ std::map<std::string, bool> *common_prefixes,
bool *is_truncated) = 0;
virtual int abort_multiparts(const DoutPrefixProvider *dpp,
CephContext *cct,
- string& prefix, string& delim) = 0;
+ std::string& prefix, std::string& delim) = 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 Bucket& b) {
+ friend inline std::ostream& operator<<(std::ostream& out, const Bucket& b) {
out << b.info.bucket;
return out;
}
- friend inline ostream& operator<<(ostream& out, const Bucket* b) {
+ friend inline std::ostream& operator<<(std::ostream& out, const Bucket* b) {
if (!b)
out << "<NULL>";
else
return out;
}
- friend inline ostream& operator<<(ostream& out, const std::unique_ptr<Bucket>& p) {
+ friend inline std::ostream& operator<<(std::ostream& out, const std::unique_ptr<Bucket>& p) {
out << p.get();
return out;
}
return *this;
};
- map<std::string, std::unique_ptr<Bucket>>& get_buckets() { return buckets; }
+ std::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<Bucket> bucket) {
uint64_t olh_epoch{0};
std::string marker_version_id;
uint32_t bilog_flags{0};
- list<rgw_obj_index_key>* remove_objs{nullptr};
+ std::list<rgw_obj_index_key>* remove_objs{nullptr};
ceph::real_time expiration_time;
ceph::real_time unmod_since;
ceph::real_time mtime;
const std::string &get_instance() const { return key.instance; }
bool have_instance(void) { return key.have_instance(); }
- friend inline ostream& operator<<(ostream& out, const Object& o) {
+ friend inline std::ostream& operator<<(std::ostream& out, const Object& o) {
if (o.bucket)
out << o.bucket << ":";
out << o.key;
return out;
}
- friend inline ostream& operator<<(ostream& out, const Object* o) {
+ friend inline std::ostream& operator<<(std::ostream& out, const Object* o) {
if (!o)
out << "<NULL>";
else
out << *o;
return out;
}
- friend inline ostream& operator<<(ostream& out, const std::unique_ptr<Object>& p) {
+ friend inline std::ostream& operator<<(std::ostream& out, const std::unique_ptr<Object>& p) {
out << p.get();
return out;
}
RGWObjectCtx* obj_ctx) = 0;
virtual int complete(const DoutPrefixProvider* dpp, CephContext* cct,
std::string& etag, RGWObjManifest& manifest,
- map<int, string>& part_etags,
- list<rgw_obj_index_key>& remove_objs,
+ std::map<int, std::string>& part_etags,
+ std::list<rgw_obj_index_key>& remove_objs,
uint64_t& accounted_size, bool& compressed,
RGWCompressionInfo& cs_info, off_t& ofs) = 0;
uint64_t part_num,
const std::string& part_num_str) = 0;
- friend inline ostream& operator<<(ostream& out, const MultipartUpload& u) {
+ friend inline std::ostream& operator<<(std::ostream& out, const MultipartUpload& u) {
out << u.get_meta();
if (!u.get_upload_id().empty())
out << ":" << u.get_upload_id();
return out;
}
- friend inline ostream& operator<<(ostream& out, const MultipartUpload* u) {
+ friend inline std::ostream& operator<<(std::ostream& out, const MultipartUpload* u) {
if (!u)
out << "<NULL>";
else
out << *u;
return out;
}
- friend inline ostream& operator<<(ostream& out, const
+ friend inline std::ostream& operator<<(std::ostream& out, const
std::unique_ptr<MultipartUpload>& p) {
out << p.get();
return out;
virtual int get_next_entry(const std::string& oid, std::string& marker, LCEntry& entry) = 0;
virtual int set_entry(const std::string& oid, const LCEntry& entry) = 0;
virtual int list_entries(const std::string& oid, const std::string& marker,
- uint32_t max_entries, vector<LCEntry>& entries) = 0;
+ uint32_t max_entries, std::vector<LCEntry>& entries) = 0;
virtual int rm_entry(const std::string& oid, const LCEntry& entry) = 0;
virtual int get_head(const std::string& oid, LCHead& head) = 0;
virtual int put_head(const std::string& oid, const LCHead& head) = 0;
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
static string mp_ns = RGW_OBJ_NS_MULTIPART;
namespace rgw::sal {
virtual int complete_flush_stats(const DoutPrefixProvider *dpp, optional_yield y) override;
virtual int read_usage(const DoutPrefixProvider *dpp, 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) override;
+ std::map<rgw_user_bucket, rgw_usage_log_entry>& usage) override;
virtual int trim_usage(const DoutPrefixProvider *dpp, uint64_t start_epoch, uint64_t end_epoch) override;
virtual int load_user(const DoutPrefixProvider* dpp, optional_yield y) override;
virtual int try_refresh_info(const DoutPrefixProvider* dpp, ceph::real_time* pmtime) override;
virtual int read_usage(const DoutPrefixProvider *dpp, 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) override;
+ std::map<rgw_user_bucket, rgw_usage_log_entry>& usage) override;
virtual int trim_usage(const DoutPrefixProvider *dpp, uint64_t start_epoch, uint64_t end_epoch) override;
virtual int remove_objs_from_index(const DoutPrefixProvider *dpp, std::list<rgw_obj_index_key>& objs_to_unlink) override;
virtual int check_index(const DoutPrefixProvider *dpp, std::map<RGWObjCategory, RGWStorageStats>& existing_stats, std::map<RGWObjCategory, RGWStorageStats>& calculated_stats) override;
return std::make_unique<RadosBucket>(*this);
}
virtual int list_multiparts(const DoutPrefixProvider *dpp,
- const string& prefix,
- string& marker,
- const string& delim,
+ const std::string& prefix,
+ std::string& marker,
+ const std::string& delim,
const int& max_uploads,
- vector<std::unique_ptr<MultipartUpload>>& uploads,
- map<string, bool> *common_prefixes,
+ std::vector<std::unique_ptr<MultipartUpload>>& uploads,
+ std::map<std::string, bool> *common_prefixes,
bool *is_truncated) override;
virtual int abort_multiparts(const DoutPrefixProvider *dpp,
CephContext *cct,
- string& prefix, string& delim) override;
+ std::string& prefix, std::string& delim) override;
private:
int link(const DoutPrefixProvider* dpp, User* new_user, optional_yield y, bool update_entrypoint = true, RGWObjVersionTracker* objv = nullptr);
virtual void get_raw_obj(const rgw_placement_rule& placement_rule, const rgw_obj& obj, rgw_raw_obj* raw_obj) override;
virtual int get_raw_chunk_size(const DoutPrefixProvider* dpp, const rgw_raw_obj& obj, uint64_t* chunk_size) override;
- virtual int log_usage(const DoutPrefixProvider *dpp, map<rgw_user_bucket, RGWUsageBatch>& usage_info) override;
+ virtual int log_usage(const DoutPrefixProvider *dpp, std::map<rgw_user_bucket, RGWUsageBatch>& usage_info) override;
virtual int log_op(const DoutPrefixProvider *dpp, std::string& oid, bufferlist& bl) override;
virtual int register_to_service_map(const DoutPrefixProvider *dpp, const std::string& daemon_type,
- const map<std::string, std::string>& meta) override;
+ const std::map<std::string, std::string>& meta) override;
virtual void get_quota(RGWQuotaInfo& bucket_quota, RGWQuotaInfo& user_quota) override;
- virtual int set_buckets_enabled(const DoutPrefixProvider* dpp, vector<rgw_bucket>& buckets, bool enabled) override;
+ virtual int set_buckets_enabled(const DoutPrefixProvider* dpp, std::vector<rgw_bucket>& buckets, bool enabled) override;
virtual uint64_t get_new_req_id() override { return rados->get_new_req_id(); }
virtual int get_sync_policy_handler(const DoutPrefixProvider* dpp,
std::optional<rgw_zone_id> zone,
RGWBucketSyncPolicyHandlerRef* phandler,
optional_yield y) override;
virtual RGWDataSyncStatusManager* get_data_sync_manager(const rgw_zone_id& source_zone) override;
- virtual void wakeup_meta_sync_shards(set<int>& shard_ids) override { rados->wakeup_meta_sync_shards(shard_ids); }
- virtual void wakeup_data_sync_shards(const DoutPrefixProvider *dpp, const rgw_zone_id& source_zone, map<int, set<std::string> >& shard_ids) override { rados->wakeup_data_sync_shards(dpp, source_zone, shard_ids); }
+ virtual void wakeup_meta_sync_shards(std::set<int>& shard_ids) override { rados->wakeup_meta_sync_shards(shard_ids); }
+ virtual void wakeup_data_sync_shards(const DoutPrefixProvider *dpp, const rgw_zone_id& source_zone, std::map<int, std::set<std::string> >& shard_ids) override { rados->wakeup_data_sync_shards(dpp, source_zone, shard_ids); }
virtual int clear_usage(const DoutPrefixProvider *dpp) override { return rados->clear_usage(dpp); }
virtual int read_all_usage(const DoutPrefixProvider *dpp, 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) override;
+ std::map<rgw_user_bucket, rgw_usage_log_entry>& usage) override;
virtual int trim_all_usage(const DoutPrefixProvider *dpp, uint64_t start_epoch, uint64_t end_epoch) override;
virtual int get_config_key_val(std::string name, bufferlist* bl) override;
virtual int meta_list_keys_init(const DoutPrefixProvider *dpp, const std::string& section, const std::string& marker, void** phandle) override;
- virtual int meta_list_keys_next(const DoutPrefixProvider *dpp, void* handle, int max, list<std::string>& keys, bool* truncated) override;
+ virtual int meta_list_keys_next(const DoutPrefixProvider *dpp, void* handle, int max, std::list<std::string>& keys, bool* truncated) override;
virtual void meta_list_keys_complete(void* handle) override;
virtual std::string meta_get_marker(void* handle) override;
virtual int meta_remove(const DoutPrefixProvider* dpp, std::string& metadata_key, optional_yield y) override;
virtual const RGWSyncModuleInstanceRef& get_sync_module() { return rados->get_sync_module(); }
virtual std::string get_host_id() { return rados->host_id; }
virtual std::unique_ptr<LuaScriptManager> get_lua_script_manager() override;
- virtual std::unique_ptr<RGWRole> get_role(string name,
- string tenant,
- string path="",
- string trust_policy="",
- string max_session_duration_str="") override;
+ virtual std::unique_ptr<RGWRole> get_role(std::string name,
+ std::string tenant,
+ std::string path="",
+ std::string trust_policy="",
+ std::string max_session_duration_str="") override;
virtual std::unique_ptr<RGWRole> get_role(std::string id) override;
virtual int get_roles(const DoutPrefixProvider *dpp,
optional_yield y,
const std::string& path_prefix,
const std::string& tenant,
- vector<std::unique_ptr<RGWRole>>& roles) override;
+ std::vector<std::unique_ptr<RGWRole>>& roles) override;
virtual std::unique_ptr<RGWOIDCProvider> get_oidc_provider() override;
virtual int get_oidc_providers(const DoutPrefixProvider *dpp,
const std::string& tenant,
- vector<std::unique_ptr<RGWOIDCProvider>>& providers) override;
+ std::vector<std::unique_ptr<RGWOIDCProvider>>& providers) override;
virtual std::unique_ptr<MultipartUpload> get_multipart_upload(Bucket* bucket, const std::string& oid, std::optional<std::string> upload_id=std::nullopt, ceph::real_time mtime=real_clock::now()) override;
virtual std::unique_ptr<Writer> get_append_writer(const DoutPrefixProvider *dpp,
optional_yield y,
RGWObjectCtx* obj_ctx) override;
virtual int complete(const DoutPrefixProvider* dpp, CephContext* cct,
std::string& etag, RGWObjManifest& manifest,
- map<int, string>& part_etags,
- list<rgw_obj_index_key>& remove_objs,
+ std::map<int, std::string>& part_etags,
+ std::list<rgw_obj_index_key>& remove_objs,
uint64_t& accounted_size, bool& compressed,
RGWCompressionInfo& cs_info, off_t& ofs) override;
virtual int get_info(const DoutPrefixProvider *dpp, optional_yield y, RGWObjectCtx* obj_ctx, rgw_placement_rule** rule, rgw::sal::Attrs* attrs = nullptr) override;
virtual int get_next_entry(const std::string& oid, std::string& marker, LCEntry& entry) override;
virtual int set_entry(const std::string& oid, const LCEntry& entry) override;
virtual int list_entries(const std::string& oid, const std::string& marker,
- uint32_t max_entries, vector<LCEntry>& entries) override;
+ uint32_t max_entries, std::vector<LCEntry>& entries) override;
virtual int rm_entry(const std::string& oid, const LCEntry& entry) override;
virtual int get_head(const std::string& oid, LCHead& head) override;
virtual int put_head(const std::string& oid, const LCHead& head) override;
public:
RadosNotification(const DoutPrefixProvider *_dpp, RadosStore* _store, Object* _obj, req_state* _s,
- rgw::notify::EventType _type, const std::string* object_name=nullptr) :
+ rgw::notify::EventType _type, const std::string* object_name=nullptr) :
Notification(_obj, _type), store(_store), res(_dpp, _store, _s, _obj, object_name) { }
~RadosNotification() = default;
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
RGWServices_Def::RGWServices_Def() = default;
RGWServices_Def::~RGWServices_Def()
{
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
namespace STS {
void Credentials::dump(Formatter *f) const
uint64_t MAX_DURATION_IN_SECS;
CephContext* cct;
uint64_t duration;
- string err_msg;
- string iamPolicy;
- string roleArn;
- string roleSessionName;
+ std::string err_msg;
+ std::string iamPolicy;
+ std::string roleArn;
+ std::string roleSessionName;
public:
AssumeRoleRequestBase(CephContext* cct,
- const string& duration,
- const string& iamPolicy,
- const string& roleArn,
- const string& roleSessionName);
- const string& getRoleARN() const { return roleArn; }
- const string& getRoleSessionName() const { return roleSessionName; }
- const string& getPolicy() const {return iamPolicy; }
+ const std::string& duration,
+ const std::string& iamPolicy,
+ const std::string& roleArn,
+ const std::string& roleSessionName);
+ const std::string& getRoleARN() const { return roleArn; }
+ const std::string& getRoleSessionName() const { return roleSessionName; }
+ const std::string& getPolicy() const {return iamPolicy; }
static const uint64_t& getMaxPolicySize() { return MAX_POLICY_SIZE; }
void setMaxDuration(const uint64_t& maxDuration) { MAX_DURATION_IN_SECS = maxDuration; }
const uint64_t& getDuration() const { return duration; }
class AssumeRoleWithWebIdentityRequest : public AssumeRoleRequestBase {
static constexpr uint64_t MIN_PROVIDER_ID_LEN = 4;
static constexpr uint64_t MAX_PROVIDER_ID_LEN = 2048;
- string providerId;
- string iamPolicy;
- string iss;
- string sub;
- string aud;
+ std::string providerId;
+ std::string iamPolicy;
+ std::string iss;
+ std::string sub;
+ std::string aud;
public:
AssumeRoleWithWebIdentityRequest( CephContext* cct,
- const string& duration,
- const string& providerId,
- const string& iamPolicy,
- const string& roleArn,
- const string& roleSessionName,
- const string& iss,
- const string& sub,
- const string& aud)
+ const std::string& duration,
+ const std::string& providerId,
+ const std::string& iamPolicy,
+ const std::string& roleArn,
+ const std::string& roleSessionName,
+ const std::string& iss,
+ const std::string& sub,
+ const std::string& aud)
: AssumeRoleRequestBase(cct, duration, iamPolicy, roleArn, roleSessionName),
providerId(providerId), iss(iss), sub(sub), aud(aud) {}
- const string& getProviderId() const { return providerId; }
- const string& getIss() const { return iss; }
- const string& getAud() const { return aud; }
- const string& getSub() const { return sub; }
+ const std::string& getProviderId() const { return providerId; }
+ const std::string& getIss() const { return iss; }
+ const std::string& getAud() const { return aud; }
+ const std::string& getSub() const { return sub; }
int validate_input() const;
};
static constexpr uint64_t MIN_SERIAL_NUMBER_SIZE = 9;
static constexpr uint64_t MAX_SERIAL_NUMBER_SIZE = 256;
static constexpr uint64_t TOKEN_CODE_SIZE = 6;
- string externalId;
- string serialNumber;
- string tokenCode;
+ std::string externalId;
+ std::string serialNumber;
+ std::string tokenCode;
public:
AssumeRoleRequest(CephContext* cct,
- const string& duration,
- const string& externalId,
- const string& iamPolicy,
- const string& roleArn,
- const string& roleSessionName,
- const string& serialNumber,
- const string& tokenCode)
+ const std::string& duration,
+ const std::string& externalId,
+ const std::string& iamPolicy,
+ const std::string& roleArn,
+ const std::string& roleSessionName,
+ const std::string& serialNumber,
+ const std::string& tokenCode)
: AssumeRoleRequestBase(cct, duration, iamPolicy, roleArn, roleSessionName),
externalId(externalId), serialNumber(serialNumber), tokenCode(tokenCode){}
int validate_input() const;
static constexpr uint64_t MIN_DURATION_IN_SECS = 900;
static constexpr uint64_t DEFAULT_DURATION_IN_SECS = 3600;
uint64_t duration;
- string serialNumber;
- string tokenCode;
+ std::string serialNumber;
+ std::string tokenCode;
public:
- GetSessionTokenRequest(const string& duration, const string& serialNumber, const string& tokenCode);
+ GetSessionTokenRequest(const std::string& duration, const std::string& serialNumber, const std::string& tokenCode);
const uint64_t& getDuration() const { return duration; }
static const uint64_t& getMinDuration() { return MIN_DURATION_IN_SECS; }
};
class AssumedRoleUser {
- string arn;
- string assumeRoleId;
+ std::string arn;
+ std::string assumeRoleId;
public:
int generateAssumedRoleUser( CephContext* cct,
rgw::sal::Store* store,
- const string& roleId,
+ const std::string& roleId,
const rgw::ARN& roleArn,
- const string& roleSessionName);
- const string& getARN() const { return arn; }
- const string& getAssumeRoleId() const { return assumeRoleId; }
+ const std::string& roleSessionName);
+ const std::string& getARN() const { return arn; }
+ const std::string& getAssumeRoleId() const { return assumeRoleId; }
void dump(Formatter *f) const;
};
struct SessionToken {
- string access_key_id;
- string secret_access_key;
- string expiration;
- string policy;
- string roleId;
+ std::string access_key_id;
+ std::string secret_access_key;
+ std::string expiration;
+ std::string policy;
+ std::string roleId;
rgw_user user;
- string acct_name;
+ std::string acct_name;
uint32_t perm_mask;
bool is_admin;
uint32_t acct_type;
- string role_session;
- std::vector<string> token_claims;
- string issued_at;
+ std::string role_session;
+ std::vector<std::string> token_claims;
+ std::string issued_at;
SessionToken() {}
class Credentials {
static constexpr int MAX_ACCESS_KEY_LEN = 20;
static constexpr int MAX_SECRET_KEY_LEN = 40;
- string accessKeyId;
- string expiration;
- string secretAccessKey;
- string sessionToken;
+ std::string accessKeyId;
+ std::string expiration;
+ std::string secretAccessKey;
+ std::string sessionToken;
public:
int generateCredentials(CephContext* cct,
const uint64_t& duration,
- const boost::optional<string>& policy,
- const boost::optional<string>& roleId,
- const boost::optional<string>& role_session,
- const boost::optional<std::vector<string> > token_claims,
+ const boost::optional<std::string>& policy,
+ const boost::optional<std::string>& roleId,
+ const boost::optional<std::string>& role_session,
+ const boost::optional<std::vector<std::string> > token_claims,
boost::optional<rgw_user> user,
rgw::auth::Identity* identity);
- const string& getAccessKeyId() const { return accessKeyId; }
- const string& getExpiration() const { return expiration; }
- const string& getSecretAccessKey() const { return secretAccessKey; }
- const string& getSessionToken() const { return sessionToken; }
+ const std::string& getAccessKeyId() const { return accessKeyId; }
+ const std::string& getExpiration() const { return expiration; }
+ const std::string& getSecretAccessKey() const { return secretAccessKey; }
+ const std::string& getSessionToken() const { return sessionToken; }
void dump(Formatter *f) const;
};
struct AssumeRoleWithWebIdentityResponse {
AssumeRoleResponse assumeRoleResp;
- string aud;
- string providerId;
- string sub;
+ std::string aud;
+ std::string providerId;
+ std::string sub;
};
using AssumeRoleResponse = struct AssumeRoleResponse ;
rgw_user user_id;
std::unique_ptr<rgw::sal::RGWRole> role;
rgw::auth::Identity* identity;
- int storeARN(const DoutPrefixProvider *dpp, string& arn, optional_yield y);
+ int storeARN(const DoutPrefixProvider *dpp, std::string& arn, optional_yield y);
public:
STSService() = default;
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, rgw::sal::RGWRole*> getRoleInfo(const DoutPrefixProvider *dpp, const string& arn, optional_yield y);
+ std::tuple<int, rgw::sal::RGWRole*> getRoleInfo(const DoutPrefixProvider *dpp, const std::string& arn, optional_yield y);
AssumeRoleResponse assumeRole(const DoutPrefixProvider *dpp, AssumeRoleRequest& req, optional_yield y);
GetSessionTokenResponse getSessionToken(GetSessionTokenRequest& req);
AssumeRoleWithWebIdentityResponse assumeRoleWithWebIdentity(AssumeRoleWithWebIdentityRequest& req);
#define DEFAULT_SWIFT_PREFIX "/swift"
+using namespace std;
using namespace ceph::crypto;
#undef dout_prefix
#define dout_prefix (*_dout << "meta sync: ")
+using namespace std;
+
static string mdlog_sync_status_oid = "mdlog.sync-status";
static string mdlog_sync_status_shard_prefix = "mdlog.sync-status.shard";
static string mdlog_sync_full_sync_index_prefix = "meta.full-sync.index";
struct rgw_mdlog_entry {
- string id;
- string section;
- string name;
+ std::string id;
+ std::string section;
+ std::string name;
ceph::real_time timestamp;
RGWMetadataLogData log_data;
};
struct rgw_mdlog_shard_data {
- string marker;
+ std::string marker;
bool truncated;
- vector<rgw_mdlog_entry> entries;
+ std::vector<rgw_mdlog_entry> entries;
void decode_json(JSONObj *obj);
};
class RGWSyncErrorLogger {
rgw::sal::RadosStore* store;
- vector<string> oids;
+ std::vector<std::string> oids;
int num_shards;
std::atomic<int64_t> counter = { 0 };
public:
- RGWSyncErrorLogger(rgw::sal::RadosStore* _store, const string &oid_prefix, int _num_shards);
- RGWCoroutine *log_error_cr(const DoutPrefixProvider *dpp, const string& source_zone, const string& section, const string& name, uint32_t error_code, const string& message);
+ RGWSyncErrorLogger(rgw::sal::RadosStore* _store, const std::string &oid_prefix, int _num_shards);
+ RGWCoroutine *log_error_cr(const DoutPrefixProvider *dpp, const std::string& source_zone, const std::string& section, const std::string& name, uint32_t error_code, const std::string& message);
- static string get_shard_oid(const string& oid_prefix, int shard_id);
+ static std::string get_shard_oid(const std::string& oid_prefix, int shard_id);
};
struct rgw_sync_error_info {
- string source_zone;
+ std::string source_zone;
uint32_t error_code;
- string message;
+ std::string message;
rgw_sync_error_info() : error_code(0) {}
- rgw_sync_error_info(const string& _source_zone, uint32_t _error_code, const string& _message) : source_zone(_source_zone), error_code(_error_code), message(_message) {}
+ rgw_sync_error_info(const std::string& _source_zone, uint32_t _error_code, const std::string& _message) : source_zone(_source_zone), error_code(_error_code), message(_message) {}
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
RGWAsyncRadosProcessor *_async_rados, RGWHTTPManager *_http_manager,
RGWSyncErrorLogger *_error_logger, RGWSyncTraceManager *_sync_tracer);
- string shard_obj_name(int shard_id);
- string status_oid();
+ std::string shard_obj_name(int shard_id);
+ std::string status_oid();
};
class RGWRemoteMetaLog : public RGWCoroutinesManager {
void finish();
int read_log_info(const DoutPrefixProvider *dpp, rgw_mdlog_info *log_info);
- int read_master_log_shards_info(const DoutPrefixProvider *dpp, const string& master_period, map<int, RGWMetadataLogInfo> *shards_info);
- int read_master_log_shards_next(const DoutPrefixProvider *dpp, const string& period, map<int, string> shard_markers, map<int, rgw_mdlog_shard_data> *result);
+ int read_master_log_shards_info(const DoutPrefixProvider *dpp, const std::string& master_period, std::map<int, RGWMetadataLogInfo> *shards_info);
+ int read_master_log_shards_next(const DoutPrefixProvider *dpp, const std::string& period, std::map<int, std::string> shard_markers, std::map<int, rgw_mdlog_shard_data> *result);
int read_sync_status(const DoutPrefixProvider *dpp, rgw_meta_sync_status *sync_status);
int init_sync_status(const DoutPrefixProvider *dpp);
int run_sync(const DoutPrefixProvider *dpp, optional_yield y);
RGWRemoteMetaLog master_log;
- map<int, rgw_raw_obj> shard_objs;
+ std::map<int, rgw_raw_obj> shard_objs;
struct utime_shard {
real_time ts;
};
ceph::shared_mutex ts_to_shard_lock = ceph::make_shared_mutex("ts_to_shard_lock");
- map<utime_shard, int> ts_to_shard;
- vector<string> clone_markers;
+ std::map<utime_shard, int> ts_to_shard;
+ std::vector<std::string> clone_markers;
public:
RGWMetaSyncStatusManager(rgw::sal::RadosStore* _store, RGWAsyncRadosProcessor *async_rados)
int read_log_info(const DoutPrefixProvider *dpp, rgw_mdlog_info *log_info) {
return master_log.read_log_info(dpp, log_info);
}
- int read_master_log_shards_info(const DoutPrefixProvider *dpp, const string& master_period, map<int, RGWMetadataLogInfo> *shards_info) {
+ int read_master_log_shards_info(const DoutPrefixProvider *dpp, const std::string& master_period, std::map<int, RGWMetadataLogInfo> *shards_info) {
return master_log.read_master_log_shards_info(dpp, master_period, shards_info);
}
- int read_master_log_shards_next(const DoutPrefixProvider *dpp, const string& period, map<int, string> shard_markers, map<int, rgw_mdlog_shard_data> *result) {
+ int read_master_log_shards_next(const DoutPrefixProvider *dpp, const std::string& period, std::map<int, std::string> shard_markers, std::map<int, rgw_mdlog_shard_data> *result) {
return master_log.read_master_log_shards_next(dpp, period, shard_markers, result);
}
};
typename std::map<T, marker_entry> pending;
- map<T, marker_entry> finish_markers;
+ std::map<T, marker_entry> finish_markers;
int window_size;
int updates_since_flush;
class RGWMetaSyncSingleEntryCR : public RGWCoroutine {
RGWMetaSyncEnv *sync_env;
- string raw_key;
- string entry_marker;
+ std::string raw_key;
+ std::string entry_marker;
RGWMDLogStatus op_status;
ssize_t pos;
- string section;
- string key;
+ std::string section;
+ std::string key;
int sync_status;
public:
RGWMetaSyncSingleEntryCR(RGWMetaSyncEnv *_sync_env,
- const string& _raw_key, const string& _entry_marker,
+ const std::string& _raw_key, const std::string& _entry_marker,
const RGWMDLogStatus& _op_status,
RGWMetaSyncShardMarkerTrack *_marker_tracker, const RGWSyncTraceNodeRef& _tn_parent);
class RGWSyncModulesManager {
ceph::mutex lock = ceph::make_mutex("RGWSyncModulesManager");
- map<string, RGWSyncModuleRef> modules;
+ std::map<std::string, RGWSyncModuleRef> modules;
public:
RGWSyncModulesManager() = default;
- void register_module(const string& name, RGWSyncModuleRef& module, bool is_default = false) {
+ void register_module(const std::string& name, RGWSyncModuleRef& module, bool is_default = false) {
std::lock_guard l{lock};
modules[name] = module;
if (is_default) {
- modules[string()] = module;
+ modules[std::string()] = module;
}
}
- bool get_module(const string& name, RGWSyncModuleRef *module) {
+ bool get_module(const std::string& name, RGWSyncModuleRef *module) {
std::lock_guard l{lock};
auto iter = modules.find(name);
if (iter == modules.end()) {
}
- bool supports_data_export(const string& name) {
+ bool supports_data_export(const std::string& name) {
RGWSyncModuleRef module;
if (!get_module(name, &module)) {
return false;
return module->supports_data_export();
}
- int create_instance(CephContext *cct, const string& name, const JSONFormattable& config, RGWSyncModuleInstanceRef *instance) {
+ int create_instance(CephContext *cct, const std::string& name, const JSONFormattable& config, RGWSyncModuleInstanceRef *instance) {
RGWSyncModuleRef module;
if (!get_module(name, &module)) {
return -ENOENT;
return module.get()->create_instance(cct, config, instance);
}
- vector<string> get_registered_module_names() const {
- vector<string> names;
+ std::vector<std::string> get_registered_module_names() const {
+ std::vector<std::string> names;
for (auto& i: modules) {
if (!i.first.empty()) {
names.push_back(i.first);
ceph::real_time mtime;
uint64_t size = 0;
- string etag;
- map<string, bufferlist> attrs;
- map<string, string> headers;
+ std::string etag;
+ std::map<std::string, bufferlist> attrs;
+ std::map<std::string, std::string> headers;
public:
RGWStatRemoteObjCBCR(RGWDataSyncCtx *_sc,
rgw_bucket& _src_bucket, rgw_obj_key& _key);
void set_result(ceph::real_time& _mtime,
uint64_t _size,
- const string& _etag,
- map<string, bufferlist>&& _attrs,
- map<string, string>&& _headers) {
+ const std::string& _etag,
+ std::map<std::string, bufferlist>&& _attrs,
+ std::map<std::string, std::string>&& _headers) {
mtime = _mtime;
size = _size;
etag = _etag;
class RGWCallStatRemoteObjCR : public RGWCoroutine {
ceph::real_time mtime;
uint64_t size{0};
- string etag;
- map<string, bufferlist> attrs;
- map<string, string> headers;
+ std::string etag;
+ std::map<std::string, bufferlist> attrs;
+ std::map<std::string, std::string> headers;
protected:
RGWDataSyncCtx *sc;
#define DEFAULT_MULTIPART_SYNC_PART_SIZE (32 * 1024 * 1024)
+using namespace std;
+
static string default_target_path = "rgw-${zonegroup}-${sid}/${bucket}";
static string get_key_oid(const rgw_obj_key& key)
int part_num{0};
uint64_t ofs{0};
uint64_t size{0};
- string etag;
+ std::string etag;
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
struct rgw_sync_aws_src_obj_properties {
ceph::real_time mtime;
- string etag;
+ std::string etag;
uint32_t zone_short_id{0};
uint64_t pg_ver{0};
uint64_t versioned_epoch{0};
WRITE_CLASS_ENCODER(rgw_sync_aws_src_obj_properties)
struct rgw_sync_aws_multipart_upload_info {
- string upload_id;
+ std::string upload_id;
uint64_t obj_size;
rgw_sync_aws_src_obj_properties src_properties;
uint32_t part_size{0};
#define dout_subsys ceph_subsys_rgw
+using namespace std;
/*
* allowlist utility. Config string is a list of entries, where an entry is either an item,
RGWRESTMgr *get_rest_filter(int dialect, RGWRESTMgr *orig) override;
RGWRESTConn *get_rest_conn();
std::string get_index_path();
- map<string, string>& get_request_headers();
+ std::map<std::string, std::string>& get_request_headers();
bool supports_user_writes() override {
return true;
}
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
struct es_index_obj_response {
string bucket;
rgw_obj_key key;
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
class RGWLogStatRemoteObjCBCR : public RGWStatRemoteObjCBCR {
public:
RGWLogStatRemoteObjCBCR(RGWDataSyncCtx *_sc,
#define PUBSUB_EVENTS_RETENTION_DEFAULT 7
+using namespace std;
+
/*
config:
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
// command: PUT /topics/<topic-name>[&push-endpoint=<endpoint>[&<arg1>=<value1>]]
class RGWPSCreateTopic_ObjStore : public RGWPSCreateTopicOp {
public:
#define dout_subsys ceph_subsys_rgw
+using namespace std;
string rgw_sync_bucket_entity::bucket_key() const
{
struct rgw_sync_symmetric_group {
- string id;
+ std::string id;
std::set<rgw_zone_id> zones;
rgw_sync_symmetric_group() {}
- rgw_sync_symmetric_group(const string& _id,
+ rgw_sync_symmetric_group(const std::string& _id,
const std::set<rgw_zone_id> _zones) : id(_id), zones(_zones) {}
std::optional<rgw_zone_id> zone; /* define specific zones */
std::optional<rgw_bucket> bucket; /* define specific bucket */
- static bool match_str(const string& s1, const string& s2) { /* empty string is wildcard */
+ static bool match_str(const std::string& s1, const std::string& s2) { /* empty std::string is wildcard */
return (s1.empty() ||
s2.empty() ||
s1 == s2);
return bucket.value_or(rgw_bucket());
}
- string bucket_key() const;
+ std::string bucket_key() const;
bool match_zone(const rgw_zone_id& z) const {
if (all_zones) {
zone = z;
}
- static bool match_bucket_id(const string& bid1, const string& bid2) {
+ static bool match_bucket_id(const std::string& bid1, const std::string& bid2) {
return (bid1.empty() || bid2.empty() || (bid1 == bid2));
}
WRITE_CLASS_ENCODER(rgw_sync_bucket_entity)
struct rgw_sync_pipe_filter_tag {
- string key;
- string value;
+ std::string key;
+ std::string value;
rgw_sync_pipe_filter_tag() {}
- rgw_sync_pipe_filter_tag(const string& s) {
+ rgw_sync_pipe_filter_tag(const std::string& s) {
from_str(s);
}
- rgw_sync_pipe_filter_tag(const string& _key,
- const string& _value) : key(_key),
+ rgw_sync_pipe_filter_tag(const std::string& _key,
+ const std::string& _value) : key(_key),
value(_value) {}
void encode(bufferlist& bl) const {
void dump(ceph::Formatter *f) const;
void decode_json(JSONObj *obj);
- bool from_str(const string& s);
+ bool from_str(const std::string& s);
bool operator<(const rgw_sync_pipe_filter_tag& t) const {
if (key < t.key) {
return (value < t.value);
}
- bool operator==(const string& s) const;
+ bool operator==(const std::string& s) const;
};
WRITE_CLASS_ENCODER(rgw_sync_pipe_filter_tag)
struct rgw_sync_pipe_filter {
- std::optional<string> prefix;
+ std::optional<std::string> prefix;
std::set<rgw_sync_pipe_filter_tag> tags;
void set_prefix(std::optional<std::string> opt_prefix,
bool is_subset_of(const rgw_sync_pipe_filter& f) const;
bool has_tags() const;
- bool check_tag(const string& s) const;
- bool check_tag(const string& k, const string& v) const;
- bool check_tags(const std::vector<string>& tags) const;
+ bool check_tag(const std::string& s) const;
+ bool check_tag(const std::string& k, const std::string& v) const;
+ bool check_tags(const std::vector<std::string>& tags) const;
bool check_tags(const RGWObjTags::tag_map_t& tags) const;
};
WRITE_CLASS_ENCODER(rgw_sync_pipe_filter)
struct rgw_sync_pipe_dest_params {
std::optional<rgw_sync_pipe_acl_translation> acl_translation;
- std::optional<string> storage_class;
+ std::optional<std::string> storage_class;
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
DECODE_FINISH(bl);
}
- void set_storage_class(const string& sc) {
+ void set_storage_class(const std::string& sc) {
storage_class = sc;
}
WRITE_CLASS_ENCODER(rgw_sync_pipe_params)
struct rgw_sync_bucket_pipe {
- string id;
+ std::string id;
rgw_sync_bucket_entity source;
rgw_sync_bucket_entity dest;
void add_zones(const std::vector<rgw_zone_id>& new_zones);
void remove_zones(const std::vector<rgw_zone_id>& rm_zones);
- void set_bucket(std::optional<string> tenant,
- std::optional<string> bucket_name,
- std::optional<string> bucket_id);
- void remove_bucket(std::optional<string> tenant,
- std::optional<string> bucket_name,
- std::optional<string> bucket_id);
+ void set_bucket(std::optional<std::string> tenant,
+ std::optional<std::string> bucket_name,
+ std::optional<std::string> bucket_id);
+ void remove_bucket(std::optional<std::string> tenant,
+ std::optional<std::string> bucket_name,
+ std::optional<std::string> bucket_id);
bool match_zone(const rgw_zone_id& zone) const {
if (!zones) {
return bucket.value_or(rgw_bucket());
}
- static string bucket_key(std::optional<rgw_bucket> b);
+ static std::string bucket_key(std::optional<rgw_bucket> b);
void set_all_zones(bool state) {
all_zones = state;
WRITE_CLASS_ENCODER(rgw_sync_bucket_entities)
struct rgw_sync_bucket_pipes {
- string id;
+ std::string id;
rgw_sync_bucket_entities source;
rgw_sync_bucket_entities dest;
return (symmetrical.empty() && directional.empty());
}
- bool find_or_create_symmetrical(const string& flow_id, rgw_sync_symmetric_group **flow_group);
- void remove_symmetrical(const string& flow_id, std::optional<std::vector<rgw_zone_id> > zones);
+ bool find_or_create_symmetrical(const std::string& flow_id, rgw_sync_symmetric_group **flow_group);
+ void remove_symmetrical(const std::string& flow_id, std::optional<std::vector<rgw_zone_id> > zones);
bool find_or_create_directional(const rgw_zone_id& source_zone, const rgw_zone_id& dest_zone, rgw_sync_directional_rule **flow_group);
void remove_directional(const rgw_zone_id& source_zone, const rgw_zone_id& dest_zone);
struct rgw_sync_policy_group {
- string id;
+ std::string id;
rgw_sync_data_flow_group data_flow; /* override data flow, howver, will not be able to
add new flows that don't exist at higher level */
void dump(ceph::Formatter *f) const;
void decode_json(JSONObj *obj);
- bool set_status(const string& s) {
+ bool set_status(const std::string& s) {
if (s == "forbidden") {
status = rgw_sync_policy_group::Status::FORBIDDEN;
} else if (s == "allowed") {
return true;
}
- bool find_pipe(const string& pipe_id, bool create, rgw_sync_bucket_pipes **pipe);
- void remove_pipe(const string& pipe_id);
+ bool find_pipe(const std::string& pipe_id, bool create, rgw_sync_bucket_pipes **pipe);
+ void remove_pipe(const std::string& pipe_id);
void get_potential_related_buckets(const rgw_bucket& bucket,
std::set<rgw_bucket> *sources,
WRITE_CLASS_ENCODER(rgw_sync_policy_group)
struct rgw_sync_policy_info {
- std::map<string, rgw_sync_policy_group> groups;
+ std::map<std::string, rgw_sync_policy_group> groups;
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
#define dout_context g_ceph_context
+using namespace std;
+
RGWSyncTraceNode::RGWSyncTraceNode(CephContext *_cct, uint64_t _handle,
const RGWSyncTraceNodeRef& _parent,
const string& _type, const string& _id) : cct(_cct),
uint64_t handle;
- boost::circular_buffer<string> history;
+ boost::circular_buffer<std::string> history;
// private constructor, create with RGWSyncTraceManager::add_node()
RGWSyncTraceNode(CephContext *_cct, uint64_t _handle,
const std::string& _type, const std::string& _id);
public:
- void set_resource_name(const string& s) {
+ void set_resource_name(const std::string& s) {
resource_name = s;
}
- const string& get_resource_name() {
+ const std::string& get_resource_name() {
return resource_name;
}
return prefix + " " + status;
}
- const string& get_prefix() {
+ const std::string& get_prefix() {
return prefix;
}
return os;
}
- boost::circular_buffer<string>& get_history() {
+ boost::circular_buffer<std::string>& get_history() {
return history;
}
- bool match(const string& search_term, bool search_history);
+ bool match(const std::string& search_term, bool search_history);
};
class RGWSyncTraceManager : public AdminSocketHook {
std::atomic<uint64_t> count = { 0 };
- std::list<std::array<string, 3> > admin_commands;
+ std::list<std::array<std::string, 3> > admin_commands;
uint64_t alloc_handle() {
return ++count;
Formatter *f,
std::ostream& ss,
bufferlist& out) override;
- string get_active_names();
+ std::string get_active_names();
};
#include "rgw_tag.h"
#include "rgw_common.h"
+using namespace std;
+
bool RGWObjTags::add_tag(const string&key, const string& val){
return tag_map.emplace(std::make_pair(key,val)).second;
}
#include "rgw_tag_s3.h"
+using namespace std;
+
void RGWObjTagEntry_S3::decode_xml(XMLObj *obj) {
RGWXMLDecoder::decode_xml("Key", key, obj, true);
RGWXMLDecoder::decode_xml("Value", val, obj, true);
}
+using namespace std;
+
void usage()
{
cout << "usage: radosgw-token --encode --ttype=<token type> [options...]" << std::endl;
return to_base64(std::move(os.str()));
}
- friend inline ostream& operator<<(ostream& os, const RGWToken& token);
+ friend inline std::ostream& operator<<(std::ostream& os, const RGWToken& token);
virtual ~RGWToken() {};
};
WRITE_CLASS_ENCODER(RGWToken)
- inline ostream& operator<<(ostream& os, const RGWToken& token)
+ inline std::ostream& operator<<(std::ostream& os, const RGWToken& token)
{
os << "<<RGWToken"
<< " type=" << RGWToken::from_type(token.type)
#define READ_CHUNK_LEN (512 * 1024)
+using namespace std;
+
static std::map<std::string, std::string>* ext_mime_map;
int rgw_init_ioctx(const DoutPrefixProvider *dpp,
}
// used for logging and tagging
-inline int rgw_shard_id(const string& key, int max_shards)
+inline int rgw_shard_id(const std::string& key, int max_shards)
{
return rgw_shards_mod(ceph_str_hash_linux(key.c_str(), key.size()),
max_shards);
}
-void rgw_shard_name(const string& prefix, unsigned max_shards, const string& key, string& name, int *shard_id);
-void rgw_shard_name(const string& prefix, unsigned max_shards, const string& section, const string& key, string& name);
-void rgw_shard_name(const string& prefix, unsigned shard_id, string& name);
+void rgw_shard_name(const std::string& prefix, unsigned max_shards, const std::string& key, std::string& name, int *shard_id);
+void rgw_shard_name(const std::string& prefix, unsigned max_shards, const std::string& section, const std::string& key, std::string& name);
+void rgw_shard_name(const std::string& prefix, unsigned shard_id, std::string& name);
struct rgw_name_to_flag {
const char *type_name;
};
int rgw_parse_list_of_flags(struct rgw_name_to_flag *mapping,
- const string& str, uint32_t *perm);
+ const std::string& str, uint32_t *perm);
-int rgw_put_system_obj(const DoutPrefixProvider *dpp, RGWSysObjectCtx& obj_ctx, 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 = NULL);
-int rgw_get_system_obj(RGWSysObjectCtx& obj_ctx, const rgw_pool& pool, const string& key, bufferlist& bl,
- RGWObjVersionTracker *objv_tracker, real_time *pmtime, optional_yield y, const DoutPrefixProvider *dpp, map<string, bufferlist> *pattrs = NULL,
+int rgw_put_system_obj(const DoutPrefixProvider *dpp, RGWSysObjectCtx& obj_ctx, const rgw_pool& pool, const std::string& oid, bufferlist& data, bool exclusive,
+ RGWObjVersionTracker *objv_tracker, real_time set_mtime, optional_yield y, std::map<std::string, bufferlist> *pattrs = NULL);
+int rgw_get_system_obj(RGWSysObjectCtx& obj_ctx, const rgw_pool& pool, const std::string& key, bufferlist& bl,
+ RGWObjVersionTracker *objv_tracker, real_time *pmtime, optional_yield y, const DoutPrefixProvider *dpp, std::map<std::string, bufferlist> *pattrs = NULL,
rgw_cache_entry_info *cache_info = NULL,
boost::optional<obj_version> refresh_version = boost::none);
int rgw_delete_system_obj(const DoutPrefixProvider *dpp,
- RGWSI_SysObj *sysobj_svc, const rgw_pool& pool, const string& oid,
+ RGWSI_SysObj *sysobj_svc, const rgw_pool& pool, const std::string& oid,
RGWObjVersionTracker *objv_tracker, optional_yield y);
-const char *rgw_find_mime_by_ext(string& ext);
+const char *rgw_find_mime_by_ext(std::string& ext);
-void rgw_filter_attrset(map<string, bufferlist>& unfiltered_attrset, const string& check_prefix,
- map<string, bufferlist> *attrset);
+void rgw_filter_attrset(std::map<std::string, bufferlist>& unfiltered_attrset, const std::string& check_prefix,
+ std::map<std::string, bufferlist> *attrset);
/// indicates whether the current thread is in boost::asio::io_context::run(),
/// used to log warnings if synchronous librados calls are made
}
}
- void update(const string& s) {
+ void update(const std::string& s) {
if (!s.empty()) {
update(s.c_str(), s.size());
}
}
- void finish(string *etag) {
+ void finish(std::string *etag) {
char etag_buf[S];
char etag_buf_str[S * 2 + 16];
using BucketRef = std::shared_ptr<Bucket>;
using ObjectRef = std::shared_ptr<Object>;
- class Bucket : public enable_shared_from_this<Bucket> {
+ class Bucket : public std::enable_shared_from_this<Bucket> {
friend class RGWDataAccess;
friend class Object;
RGWDataAccess *sd{nullptr};
RGWBucketInfo bucket_info;
- string tenant;
- string name;
- string bucket_id;
+ std::string tenant;
+ std::string name;
+ std::string bucket_id;
ceph::real_time mtime;
- map<std::string, bufferlist> attrs;
+ std::map<std::string, bufferlist> attrs;
RGWAccessControlPolicy policy;
int finish_init();
Bucket(RGWDataAccess *_sd,
- const string& _tenant,
- const string& _name,
- const string& _bucket_id) : sd(_sd),
+ const std::string& _tenant,
+ const std::string& _name,
+ const std::string& _bucket_id) : sd(_sd),
tenant(_tenant),
name(_name),
bucket_id(_bucket_id) {}
Bucket(RGWDataAccess *_sd) : sd(_sd) {}
int init(const DoutPrefixProvider *dpp, optional_yield y);
- int init(const RGWBucketInfo& _bucket_info, const map<string, bufferlist>& _attrs);
+ int init(const RGWBucketInfo& _bucket_info, const std::map<std::string, bufferlist>& _attrs);
public:
int get_object(const rgw_obj_key& key,
ObjectRef *obj);
rgw_obj_key key;
ceph::real_time mtime;
- string etag;
+ std::string etag;
uint64_t olh_epoch{0};
ceph::real_time delete_at;
- std::optional<string> user_data;
+ std::optional<std::string> user_data;
std::optional<bufferlist> aclbl;
bucket(_bucket),
key(_key) {}
public:
- int put(bufferlist& data, map<string, bufferlist>& attrs, const DoutPrefixProvider *dpp, optional_yield y); /* might modify attrs */
+ int put(bufferlist& data, std::map<std::string, bufferlist>& attrs, const DoutPrefixProvider *dpp, optional_yield y); /* might modify attrs */
void set_mtime(const ceph::real_time& _mtime) {
mtime = _mtime;
}
- void set_etag(const string& _etag) {
+ void set_etag(const std::string& _etag) {
etag = _etag;
}
delete_at = _delete_at;
}
- void set_user_data(const string& _user_data) {
+ void set_user_data(const std::string& _user_data) {
user_data = _user_data;
}
};
int get_bucket(const DoutPrefixProvider *dpp,
- const string& tenant,
- const string name,
- const string bucket_id,
+ const std::string& tenant,
+ const std::string name,
+ const std::string bucket_id,
BucketRef *bucket,
optional_yield y) {
bucket->reset(new Bucket(this, tenant, name, bucket_id));
}
int get_bucket(const RGWBucketInfo& bucket_info,
- const map<string, bufferlist>& attrs,
+ const std::map<std::string, bufferlist>& attrs,
BucketRef *bucket) {
bucket->reset(new Bucket(this));
return (*bucket)->init(bucket_info, attrs);
#define dout_subsys ceph_subsys_rgw
-using ceph::crypto::MD5;
+using namespace std;
using namespace librados;
using namespace boost;
+using ceph::crypto::MD5;
using ceph::crypto::SHA1;
seed::seed()
{
int piece_length; // each piece length
bufferlist sha1_bl; // save sha1
- string name; // file name
+ std::string name; // file name
off_t len; // file total bytes
}info;
- string announce; // tracker
- string origin; // origin
+ std::string announce; // tracker
+ std::string origin; // origin
time_t create_date{0}; // time of the file created
- string comment; // comment
- string create_by; // app name and version
- string encoding; // if encode use gbk rather than gtf-8 use this field
+ std::string comment; // comment
+ std::string create_by; // app name and version
+ std::string encoding; // if encode use gbk rather than gtf-8 use this field
uint64_t sha_len; // sha1 length
bool is_torrent; // flag
bufferlist bl; // bufflist ready to send
bool get_flag();
void set_create_date(ceph::real_time& value);
- void set_info_name(const string& value);
+ void set_info_name(const std::string& value);
void update(bufferlist &bl);
int complete(optional_yield y);
#undef dout_prefix
#define dout_prefix (*_dout << "trim: ")
+using namespace std;
+
using rgw::BucketTrimConfig;
using BucketChangeCounter = BoundedKeyCounter<std::string, int>;
#include "rgw_formats.h"
#include "rgw_sal.h"
-
+using namespace std;
static void dump_usage_categories_info(Formatter *formatter, const rgw_usage_log_entry& entry, map<string, bool> *categories)
{
#define dout_subsys ceph_subsys_rgw
-
+using namespace std;
extern void op_type_to_str(uint32_t mask, char *buf, int len);
{
rgw_user user_id;
void encode(bufferlist& bl) const {
- string s;
+ std::string s;
user_id.to_str(s);
using ceph::encode;
encode(s, bl);
}
void decode(bufferlist::const_iterator& bl) {
- string s;
+ std::string s;
using ceph::decode;
decode(s, bl);
user_id.from_str(s);
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::Store* store, rgw::sal::User* user,
- map<string, cls_user_bucket_entry>& buckets_usage_map, optional_yield y);
+ std::map<std::string, cls_user_bucket_entry>& buckets_usage_map, optional_yield y);
/**
* Get the anonymous (ie, unauthenticated) user info.
extern void rgw_perm_to_str(uint32_t mask, char *buf, int len);
extern uint32_t rgw_str_to_perm(const char *str);
-extern int rgw_validate_tenant_name(const string& t);
+extern int rgw_validate_tenant_name(const std::string& t);
enum ObjectKeyType {
KEY_TYPE_SWIFT,
std::string caps;
RGWObjVersionTracker objv;
uint32_t op_mask{0};
- map<int, string> temp_url_keys;
+ std::map<int, std::string> temp_url_keys;
// subuser attributes
std::string subuser;
std::string key; // secret key
int32_t key_type{-1};
- std::set<string> mfa_ids;
+ std::set<std::string> mfa_ids;
// operation attributes
bool existing_user{false};
rgw_placement_rule default_placement; // user default placement
bool default_placement_specified{false};
- list<string> placement_tags; // user default placement_tags
+ std::list<std::string> placement_tags; // user default placement_tags
bool placement_tags_specified{false};
void set_access_key(const std::string& access_key) {
op_mask_specified = true;
}
- void set_temp_url_key(const string& key, int index) {
+ void set_temp_url_key(const std::string& key, int index) {
temp_url_keys[index] = key;
temp_url_key_specified = true;
}
user_quota_specified = true;
}
- void set_mfa_ids(const std::set<string>& ids) {
+ void set_mfa_ids(const std::set<std::string>& ids) {
mfa_ids = ids;
mfa_ids_specified = true;
}
default_placement_specified = true;
}
- void set_placement_tags(const list<string>& _tags) {
+ void set_placement_tags(const std::list<std::string>& _tags) {
placement_tags = _tags;
placement_tags_specified = true;
}
uint32_t get_op_mask() { return op_mask; }
RGWQuotaInfo& get_bucket_quota() { return bucket_quota; }
RGWQuotaInfo& get_user_quota() { return user_quota; }
- set<string>& get_mfa_ids() { return mfa_ids; }
+ std::set<std::string>& get_mfa_ids() { return mfa_ids; }
rgw::sal::User* get_user() { return user.get(); }
const rgw_user& get_user_id();
std::string get_display_name() { return display_name; }
rgw_user& get_new_uid() { return new_user_id; }
bool get_overwrite_new_user() const { return overwrite_new_user; }
- map<int, std::string>& get_temp_url_keys() { return temp_url_keys; }
+ std::map<int, std::string>& get_temp_url_keys() { return temp_url_keys; }
RGWUserInfo& get_user_info();
- map<std::string, RGWAccessKey>* get_swift_keys();
- map<std::string, RGWAccessKey>* get_access_keys();
- map<std::string, RGWSubUser>* get_subusers();
+ std::map<std::string, RGWAccessKey>* get_swift_keys();
+ std::map<std::string, RGWAccessKey>* get_access_keys();
+ std::map<std::string, RGWSubUser>* get_subusers();
RGWUserCaps* get_caps_obj();
rgw_user user_id;
rgw::sal::Store* store{nullptr};
- map<std::string, RGWAccessKey> *swift_keys{nullptr};
- map<std::string, RGWAccessKey> *access_keys{nullptr};
+ std::map<std::string, RGWAccessKey> *swift_keys{nullptr};
+ std::map<std::string, RGWAccessKey> *access_keys{nullptr};
// we don't want to allow keys for the anonymous user or a null user
bool keys_allowed{false};
rgw::sal::Store* store{nullptr};
bool subusers_allowed{false};
- map<string, RGWSubUser> *subuser_map{nullptr};
+ std::map<std::string, RGWSubUser> *subuser_map{nullptr};
private:
int check_op(RGWUserAdminOpState& op_state, std::string *err_msg = NULL);
struct RGWUserCompleteInfo {
RGWUserInfo info;
- map<string, bufferlist> attrs;
+ std::map<std::string, bufferlist> attrs;
bool has_attrs{false};
void dump(Formatter * const f) const {
RGWObjVersionTracker *objv_tracker{nullptr};
ceph::real_time *mtime{nullptr};
rgw_cache_entry_info *cache_info{nullptr};
- map<string, bufferlist> *attrs{nullptr};
+ std::map<std::string, bufferlist> *attrs{nullptr};
GetParams() {}
return *this;
}
- GetParams& set_attrs(map<string, bufferlist> *_attrs) {
+ GetParams& set_attrs(std::map<std::string, bufferlist> *_attrs) {
attrs = _attrs;
return *this;
}
RGWObjVersionTracker *objv_tracker{nullptr};
ceph::real_time mtime;
bool exclusive{false};
- map<string, bufferlist> *attrs{nullptr};
+ std::map<std::string, bufferlist> *attrs{nullptr};
PutParams() {}
return *this;
}
- PutParams& set_attrs(map<string, bufferlist> *_attrs) {
+ PutParams& set_attrs(std::map<std::string, bufferlist> *_attrs) {
attrs = _attrs;
return *this;
}
const rgw_user& uid, RGWUserInfo *info,
optional_yield y, const GetParams& params = {});
int get_info_by_email(const DoutPrefixProvider *dpp,
- const string& email, RGWUserInfo *info,
+ const std::string& email, RGWUserInfo *info,
optional_yield y, const GetParams& params = {});
int get_info_by_swift(const DoutPrefixProvider *dpp,
- const string& swift_name, RGWUserInfo *info,
+ const std::string& swift_name, RGWUserInfo *info,
optional_yield y, const GetParams& params = {});
int get_info_by_access_key(const DoutPrefixProvider *dpp,
- const string& access_key, RGWUserInfo *info,
+ const std::string& access_key, RGWUserInfo *info,
optional_yield y, const GetParams& params = {});
int get_attrs_by_uid(const DoutPrefixProvider *dpp,
const rgw_user& user_id,
- map<string, bufferlist> *attrs,
+ std::map<std::string, bufferlist> *attrs,
optional_yield y,
RGWObjVersionTracker *objv_tracker = nullptr);
const rgw_bucket& bucket, optional_yield y);
int list_buckets(const DoutPrefixProvider *dpp,
const rgw_user& user,
- const string& marker,
- const string& end_marker,
+ const std::string& marker,
+ const std::string& end_marker,
uint64_t max,
bool need_stats,
RGWUserBuckets *buckets,
#include "include/types.h"
#include "rgw_website.h"
-
+using namespace std;
bool RGWBWRoutingRuleCondition::check_key_condition(const string& key) {
return (key.size() >= key_prefix_equals.size() &&
std::atomic<bool> down_flag = { false };
- string thread_name;
+ std::string thread_name;
virtual uint64_t interval_msec() = 0;
virtual void stop_process() {}
public:
- RGWRadosThread(RGWRados *_store, const string& thread_name = "radosgw")
+ RGWRadosThread(RGWRados *_store, const std::string& thread_name = "radosgw")
: worker(NULL), cct(_store->ctx()), store(_store), thread_name(thread_name) {}
virtual ~RGWRadosThread() {
stop();
#include "rgw_xml.h"
+using namespace std;
+
XMLObjIter::
XMLObjIter()
{
class XMLObjIter {
public:
- typedef map<std::string, XMLObj *>::iterator map_iter_t;
- typedef map<std::string, XMLObj *>::iterator const_map_iter_t;
+ typedef std::map<std::string, XMLObj *>::iterator map_iter_t;
+ typedef std::map<std::string, XMLObj *>::iterator const_map_iter_t;
XMLObjIter();
~XMLObjIter();
// return the first sub-tags matching the name
XMLObj *find_first(const std::string& name);
- friend ostream& operator<<(ostream &out, const XMLObj &obj);
+ friend std::ostream& operator<<(std::ostream &out, const XMLObj &obj);
friend RGWXMLParser;
};
void decode_xml(const char *name, T& val, T& default_val, XMLObj* obj);
}
-static inline ostream& operator<<(ostream &out, RGWXMLDecoder::err& err)
+static inline std::ostream& operator<<(std::ostream &out, RGWXMLDecoder::err& err)
{
return out << err.what();
}
val.decode_xml(obj);
}
-static inline void decode_xml_obj(string& val, XMLObj *obj)
+static inline void decode_xml_obj(std::string& val, XMLObj *obj)
{
val = obj->get_data();
}
}
template<class T>
-void do_decode_xml_obj(list<T>& l, const string& name, XMLObj *obj)
+void do_decode_xml_obj(std::list<T>& l, const std::string& name, XMLObj *obj)
{
l.clear();
XMLObj *o = iter.get_next();
if (!o) {
if (mandatory) {
- string s = "missing mandatory field " + string(name);
+ std::string s = "missing mandatory field " + std::string(name);
throw err(s);
}
val = T();
try {
decode_xml_obj(val, o);
} catch (const err& e) {
- string s = string(name) + ": ";
+ std::string s = std::string(name) + ": ";
s.append(e.what());
throw err(s);
}
if (!o) {
if (mandatory) {
- string s = "missing mandatory field " + string(name);
+ std::string s = "missing mandatory field " + std::string(name);
throw err(s);
}
return false;
try {
decode_xml_obj(val, o);
} catch (const err& e) {
- string s = string(name) + ": ";
+ std::string s = std::string(name) + ": ";
s.append(e.what());
throw err(s);
}
XMLObj *o = iter.get_next();
if (!o) {
if (mandatory) {
- string s = "missing mandatory field " + string(name);
+ std::string s = "missing mandatory field " + std::string(name);
throw err(s);
}
return false;
try {
decode_xml_obj(container, cb, o);
} catch (const err& e) {
- string s = string(name) + ": ";
+ std::string s = std::string(name) + ": ";
s.append(e.what());
throw err(s);
}
decode_xml_obj(val, o);
} catch (const err& e) {
val = default_val;
- string s = string(name) + ": ";
+ std::string s = std::string(name) + ": ";
s.append(e.what());
throw err(s);
}
f->close_section();
}
-void encode_xml(const char *name, const string& val, ceph::Formatter *f);
+void encode_xml(const char *name, const std::string& val, ceph::Formatter *f);
void encode_xml(const char *name, const char *val, ceph::Formatter *f);
void encode_xml(const char *name, bool val, ceph::Formatter *f);
void encode_xml(const char *name, int val, ceph::Formatter *f);
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
void RGWBWRedirectInfo::dump_xml(Formatter *f) const
{
if (!redirect.protocol.empty()) {
}
+using namespace std;
using namespace rgw_zone_defaults;
RGWMetaSyncStatusManager::~RGWMetaSyncStatusManager(){}
class RGWZoneStorageClasses {
- map<string, RGWZoneStorageClass> m;
+ std::map<std::string, RGWZoneStorageClass> m;
/* in memory only */
RGWZoneStorageClass *standard_class;
return *standard_class;
}
- bool find(const string& sc, const RGWZoneStorageClass **pstorage_class) const {
+ bool find(const std::string& sc, const RGWZoneStorageClass **pstorage_class) const {
auto iter = m.find(sc);
if (iter == m.end()) {
return false;
return true;
}
- bool exists(const string& sc) const {
+ bool exists(const std::string& sc) const {
if (sc.empty()) {
return true;
}
return (iter != m.end());
}
- const map<string, RGWZoneStorageClass>& get_all() const {
+ const std::map<std::string, RGWZoneStorageClass>& get_all() const {
return m;
}
- map<string, RGWZoneStorageClass>& get_all() {
+ std::map<std::string, RGWZoneStorageClass>& get_all() {
return m;
}
- void set_storage_class(const string& sc, const rgw_pool *data_pool, const string *compression_type) {
- const string *psc = ≻
+ void set_storage_class(const std::string& sc, const rgw_pool *data_pool, const std::string *compression_type) {
+ const std::string *psc = ≻
if (sc.empty()) {
psc = &RGW_STORAGE_CLASS_STANDARD;
}
}
}
- void remove_storage_class(const string& sc) {
+ void remove_storage_class(const std::string& sc) {
if (!sc.empty()) {
m.erase(sc);
}
encode(standard_data_pool.to_str(), bl);
encode(data_extra_pool.to_str(), bl);
encode((uint32_t)index_type, bl);
- string standard_compression_type = get_compression_type(RGW_STORAGE_CLASS_STANDARD);
+ std::string standard_compression_type = get_compression_type(RGW_STORAGE_CLASS_STANDARD);
encode(standard_compression_type, bl);
encode(storage_classes, bl);
ENCODE_FINISH(bl);
void decode(bufferlist::const_iterator& bl) {
DECODE_START(7, bl);
- string index_pool_str;
- string data_pool_str;
+ std::string index_pool_str;
+ std::string data_pool_str;
decode(index_pool_str, bl);
index_pool = rgw_pool(index_pool_str);
decode(data_pool_str, bl);
rgw_pool standard_data_pool(data_pool_str);
if (struct_v >= 4) {
- string data_extra_pool_str;
+ std::string data_extra_pool_str;
decode(data_extra_pool_str, bl);
data_extra_pool = rgw_pool(data_extra_pool_str);
}
decode(it, bl);
index_type = (rgw::BucketIndexType)it;
}
- string standard_compression_type;
+ std::string standard_compression_type;
if (struct_v >= 6) {
decode(standard_compression_type, bl);
}
}
return data_extra_pool;
}
- const rgw_pool& get_data_pool(const string& sc) const {
+ const rgw_pool& get_data_pool(const std::string& sc) const {
const RGWZoneStorageClass *storage_class;
static rgw_pool no_pool;
return get_data_pool(RGW_STORAGE_CLASS_STANDARD);
}
- const string& get_compression_type(const string& sc) const {
+ const std::string& get_compression_type(const std::string& sc) const {
const RGWZoneStorageClass *storage_class;
- static string no_compression;
+ static std::string no_compression;
if (!storage_classes.find(sc, &storage_class)) {
return no_compression;
return storage_class->compression_type.get_value_or(no_compression);
}
- bool storage_class_exists(const string& sc) const {
+ bool storage_class_exists(const std::string& sc) const {
return storage_classes.exists(sc);
}
RGWAccessKey system_key;
- map<std::string, RGWZonePlacementInfo> placement_pools;
+ std::map<std::string, RGWZonePlacementInfo> placement_pools;
std::string realm_id;
int create(const DoutPrefixProvider *dpp, optional_yield y, bool exclusive = true) override;
int fix_pool_names(const DoutPrefixProvider *dpp, optional_yield y);
- const string& get_compression_type(const rgw_placement_rule& placement_rule) const;
+ const std::string& get_compression_type(const rgw_placement_rule& placement_rule) const;
void encode(bufferlist& bl) const override {
ENCODE_START(14, 1, bl);
encode(unused_metadata_heap, bl);
encode(realm_id, bl);
encode(lc_pool, bl);
- map<std::string, std::string, ltstr_nocase> old_tier_config;
+ std::map<std::string, std::string, ltstr_nocase> old_tier_config;
encode(old_tier_config, bl);
encode(roles_pool, bl);
encode(reshard_pool, bl);
} else {
lc_pool = log_pool.name + ":lc";
}
- map<std::string, std::string, ltstr_nocase> old_tier_config;
+ std::map<std::string, std::string, ltstr_nocase> old_tier_config;
if (struct_v >= 8) {
decode(old_tier_config, bl);
}
}
void dump(Formatter *f) const;
void decode_json(JSONObj *obj);
- static void generate_test_instances(list<RGWZoneParams*>& o);
+ static void generate_test_instances(std::list<RGWZoneParams*>& o);
bool get_placement(const std::string& placement_id, RGWZonePlacementInfo *placement) const {
auto iter = placement_pools.find(placement_id);
struct RGWZone {
std::string id;
std::string name;
- list<std::string> endpoints;
+ std::list<std::string> endpoints;
bool log_meta;
bool log_data;
bool read_only;
static constexpr uint32_t default_bucket_index_max_shards = 11;
bool sync_from_all;
- set<std::string> sync_from; /* list of zones to sync from */
+ std::set<std::string> sync_from; /* list of zones to sync from */
RGWZone()
: log_meta(false), log_data(false), read_only(false),
}
void dump(Formatter *f) const;
void decode_json(JSONObj *obj);
- static void generate_test_instances(list<RGWZone*>& o);
+ static void generate_test_instances(std::list<RGWZone*>& o);
bool is_read_only() const { return read_only; }
struct RGWZoneGroupPlacementTarget {
std::string name;
- set<std::string> tags;
- set<std::string> storage_classes;
+ std::set<std::string> tags;
+ std::set<std::string> storage_classes;
- bool user_permitted(const list<std::string>& user_tags) const {
+ bool user_permitted(const std::list<std::string>& user_tags) const {
if (tags.empty()) {
return true;
}
struct RGWZoneGroup : public RGWSystemMetaObj {
std::string api_name;
- list<std::string> endpoints;
+ std::list<std::string> endpoints;
bool is_master = false;
rgw_zone_id master_zone;
- map<rgw_zone_id, RGWZone> zones;
+ std::map<rgw_zone_id, RGWZone> zones;
- map<std::string, RGWZoneGroupPlacementTarget> placement_targets;
+ std::map<std::string, RGWZoneGroupPlacementTarget> placement_targets;
rgw_placement_rule default_placement;
- list<std::string> hostnames;
- list<std::string> hostnames_s3website;
- // TODO: Maybe convert hostnames to a map<std::string,list<std::string>> for
+ std::list<std::string> hostnames;
+ std::list<std::string> hostnames_s3website;
+ // TODO: Maybe convert hostnames to a map<std::string,std::list<std::string>> for
// endpoint_type->hostnames
/*
20:05 < _robbat21irssi> maybe I do someting like: if (hostname_map.empty()) { populate all map keys from hostnames; };
20:05 < _robbat21irssi> but that's a later compatability migration planning bit
20:06 < yehudasa> more like if (!hostnames.empty()) {
-20:06 < yehudasa> for (list<std::string>::iterator iter = hostnames.begin(); iter != hostnames.end(); ++iter) {
+20:06 < yehudasa> for (std::list<std::string>::iterator iter = hostnames.begin(); iter != hostnames.end(); ++iter) {
20:06 < yehudasa> hostname_map["s3"].append(iter->second);
20:07 < yehudasa> hostname_map["s3website"].append(iter->second);
20:07 < yehudasa> s/append/push_back/g
20:08 < yehudasa> yeah, probably
20:08 < _robbat21irssi> s3, s3website, swift, swith_auth, swift_website
*/
- map<std::string, list<std::string> > api_hostname_map;
- map<std::string, list<std::string> > api_endpoints_map;
+ std::map<std::string, std::list<std::string> > api_hostname_map;
+ std::map<std::string, std::list<std::string> > api_endpoints_map;
std::string realm_id;
RGWZoneGroup(const std::string &id, const std::string &name):RGWSystemMetaObj(id, name) {}
explicit RGWZoneGroup(const std::string &_name):RGWSystemMetaObj(_name) {}
RGWZoneGroup(const std::string &_name, bool _is_master, CephContext *cct, RGWSI_SysObj* sysobj_svc,
- const std::string& _realm_id, const list<std::string>& _endpoints)
+ const std::string& _realm_id, const std::list<std::string>& _endpoints)
: RGWSystemMetaObj(_name, cct , sysobj_svc), endpoints(_endpoints), is_master(_is_master),
realm_id(_realm_id) {}
int equals(const std::string& other_zonegroup) const;
int add_zone(const DoutPrefixProvider *dpp,
const RGWZoneParams& zone_params, bool *is_master, bool *read_only,
- const list<std::string>& endpoints, const std::string *ptier_type,
- bool *psync_from_all, list<std::string>& sync_from,
- list<std::string>& sync_from_rm, std::string *predirect_zone,
+ const std::list<std::string>& endpoints, const std::string *ptier_type,
+ bool *psync_from_all, std::list<std::string>& sync_from,
+ std::list<std::string>& sync_from_rm, std::string *predirect_zone,
std::optional<int> bucket_index_max_shards, RGWSyncModulesManager *sync_mgr,
optional_yield y);
int remove_zone(const DoutPrefixProvider *dpp, const std::string& zone_id, optional_yield y);
void dump(Formatter *f) const;
void decode_json(JSONObj *obj);
- static void generate_test_instances(list<RGWZoneGroup*>& o);
+ static void generate_test_instances(std::list<RGWZoneGroup*>& o);
};
WRITE_CLASS_ENCODER(RGWZoneGroup)
struct RGWPeriodMap
{
std::string id;
- map<std::string, RGWZoneGroup> zonegroups;
- map<std::string, RGWZoneGroup> zonegroups_by_api;
- map<std::string, uint32_t> short_zone_ids;
+ std::map<std::string, RGWZoneGroup> zonegroups;
+ std::map<std::string, RGWZoneGroup> zonegroups_by_api;
+ std::map<std::string, uint32_t> short_zone_ids;
std::string master_zonegroup;
bool find_zone_by_id(const rgw_zone_id& zone_id,
RGWZoneGroup *zonegroup,
RGWZone *zone) const;
- bool find_zone_by_name(const string& zone_id,
+ bool find_zone_by_name(const std::string& zone_id,
RGWZoneGroup *zonegroup,
RGWZone *zone) const;
};
/* for backward comaptability */
struct RGWRegionMap {
- map<std::string, RGWZoneGroup> regions;
+ std::map<std::string, RGWZoneGroup> regions;
std::string master_region;
struct RGWZoneGroupMap {
- map<std::string, RGWZoneGroup> zonegroups;
- map<std::string, RGWZoneGroup> zonegroups_by_api;
+ std::map<std::string, RGWZoneGroup> zonegroups;
+ std::map<std::string, RGWZoneGroup> zonegroups_by_api;
std::string master_zonegroup;
void dump(Formatter *f) const;
void decode_json(JSONObj *obj);
- static void generate_test_instances(list<RGWRealm*>& o);
+ static void generate_test_instances(std::list<RGWRealm*>& o);
const std::string& get_current_period() const {
return current_period;
void dump(Formatter *f) const;
void decode_json(JSONObj *obj);
- static void generate_test_instances(list<RGWPeriodLatestEpochInfo*>& o);
+ static void generate_test_instances(std::list<RGWPeriodLatestEpochInfo*>& o);
};
WRITE_CLASS_ENCODER(RGWPeriodLatestEpochInfo)
period_config.bucket_quota = bucket_quota;
}
- void set_id(const string& _id) {
+ void set_id(const std::string& _id) {
this->id = _id;
period_map.id = _id;
}
}
void dump(Formatter *f) const;
void decode_json(JSONObj *obj);
- static void generate_test_instances(list<RGWPeriod*>& o);
+ static void generate_test_instances(std::list<RGWPeriod*>& o);
static std::string get_staging_id(const std::string& realm_id) {
return realm_id + ":staging";
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
static string dir_oid_prefix = ".dir.";
RGWSI_BucketIndex_RADOS::RGWSI_BucketIndex_RADOS(CephContext *cct) : RGWSI_BucketIndex(cct)
int open_bucket_index_base(const DoutPrefixProvider *dpp,
const RGWBucketInfo& bucket_info,
RGWSI_RADOS::Pool *index_pool,
- string *bucket_oid_base);
+ std::string *bucket_oid_base);
- void get_bucket_index_object(const string& bucket_oid_base,
+ void get_bucket_index_object(const std::string& bucket_oid_base,
uint32_t num_shards,
int shard_id,
uint64_t gen_id,
- string *bucket_obj);
- int get_bucket_index_object(const string& bucket_oid_base, const string& obj_key,
+ std::string *bucket_obj);
+ int get_bucket_index_object(const std::string& bucket_oid_base, const std::string& obj_key,
uint32_t num_shards, rgw::BucketHashType hash_type,
- string *bucket_obj, int *shard_id);
+ std::string *bucket_obj, int *shard_id);
int cls_bucket_head(const DoutPrefixProvider *dpp,
const RGWBucketInfo& bucket_info,
int shard_id,
- vector<rgw_bucket_dir_header> *headers,
- map<int, string> *bucket_instance_ids,
+ std::vector<rgw_bucket_dir_header> *headers,
+ std::map<int, std::string> *bucket_instance_ids,
optional_yield y);
public:
return RGW_SHARDS_PRIME_1;
}
- static int shard_id(const string& key, int max_shards) {
+ static int shard_id(const std::string& key, int max_shards) {
return rgw_shard_id(key, max_shards);
}
int open_bucket_index_shard(const DoutPrefixProvider *dpp,
const RGWBucketInfo& bucket_info,
- const string& obj_key,
+ const std::string& obj_key,
RGWSI_RADOS::Obj *bucket_obj,
int *shard_id);
int open_bucket_index(const DoutPrefixProvider *dpp,
const RGWBucketInfo& bucket_info,
RGWSI_RADOS::Pool *index_pool,
- string *bucket_oid);
+ std::string *bucket_oid);
int open_bucket_index(const DoutPrefixProvider *dpp,
const RGWBucketInfo& bucket_info,
std::optional<int> shard_id,
RGWSI_RADOS::Pool *index_pool,
- map<int, string> *bucket_objs,
- map<int, string> *bucket_instance_ids);
+ std::map<int, std::string> *bucket_objs,
+ std::map<int, std::string> *bucket_instance_ids);
};
#include "cls/rgw/cls_rgw_client.h"
-
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
RGWSI_BILog_RADOS::RGWSI_BILog_RADOS(CephContext *cct) : RGWServiceInstance(cct)
{
}
int get_log_status(const DoutPrefixProvider *dpp,
const RGWBucketInfo& bucket_info,
int shard_id,
- map<int, string> *markers,
+ std::map<int, std::string> *markers,
optional_yield y);
};
#define dout_subsys ceph_subsys_rgw
-string RGWSI_Bucket::get_entrypoint_meta_key(const rgw_bucket& bucket)
+std::string RGWSI_Bucket::get_entrypoint_meta_key(const rgw_bucket& bucket)
{
if (bucket.bucket_id.empty()) {
return bucket.get_key();
return b.get_key();
}
-string RGWSI_Bucket::get_bi_meta_key(const rgw_bucket& bucket)
+std::string RGWSI_Bucket::get_bi_meta_key(const rgw_bucket& bucket)
{
return bucket.get_key();
}
RGWSI_Bucket(CephContext *cct) : RGWServiceInstance(cct) {}
virtual ~RGWSI_Bucket() {}
- static string get_entrypoint_meta_key(const rgw_bucket& bucket);
- static string get_bi_meta_key(const rgw_bucket& bucket);
+ static std::string get_entrypoint_meta_key(const rgw_bucket& bucket);
+ static std::string get_bi_meta_key(const rgw_bucket& bucket);
virtual RGWSI_Bucket_BE_Handler& get_ep_be_handler() = 0;
virtual RGWSI_BucketInstance_BE_Handler& get_bi_be_handler() = 0;
virtual int read_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
- const string& key,
+ const std::string& key,
RGWBucketEntryPoint *entry_point,
RGWObjVersionTracker *objv_tracker,
real_time *pmtime,
- map<string, bufferlist> *pattrs,
+ std::map<std::string, bufferlist> *pattrs,
optional_yield y,
const DoutPrefixProvider *dpp,
rgw_cache_entry_info *cache_info = nullptr,
boost::optional<obj_version> refresh_version = boost::none) = 0;
virtual int store_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
- const string& key,
+ const std::string& key,
RGWBucketEntryPoint& info,
bool exclusive,
real_time mtime,
- map<string, bufferlist> *pattrs,
+ std::map<std::string, bufferlist> *pattrs,
RGWObjVersionTracker *objv_tracker,
optional_yield y,
const DoutPrefixProvider *dpp) = 0;
virtual int remove_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
- const string& key,
+ const std::string& key,
RGWObjVersionTracker *objv_tracker,
optional_yield y,
const DoutPrefixProvider *dpp) = 0;
virtual int read_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
- const string& key,
+ const std::string& key,
RGWBucketInfo *info,
real_time *pmtime,
- map<string, bufferlist> *pattrs,
+ std::map<std::string, bufferlist> *pattrs,
optional_yield y,
const DoutPrefixProvider *dpp,
rgw_cache_entry_info *cache_info = nullptr,
const rgw_bucket& bucket,
RGWBucketInfo *info,
real_time *pmtime,
- map<string, bufferlist> *pattrs,
+ std::map<std::string, bufferlist> *pattrs,
boost::optional<obj_version> refresh_version,
optional_yield y,
const DoutPrefixProvider *dpp) = 0;
virtual int store_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
- const string& key,
+ const std::string& key,
RGWBucketInfo& info,
std::optional<RGWBucketInfo *> orig_info, /* nullopt: orig_info was not fetched,
nullptr: orig_info was not found (new bucket instance */
bool exclusive,
real_time mtime,
- map<string, bufferlist> *pattrs,
+ std::map<std::string, bufferlist> *pattrs,
optional_yield y,
const DoutPrefixProvider *dpp) = 0;
virtual int remove_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
- const string& key,
+ const std::string& key,
const RGWBucketInfo& bucket_info,
RGWObjVersionTracker *objv_tracker,
optional_yield y,
const DoutPrefixProvider *dpp) = 0;
virtual int read_buckets_stats(RGWSI_Bucket_X_Ctx& ctx,
- map<string, RGWBucketEnt>& m,
+ std::map<std::string, RGWBucketEnt>& m,
optional_yield y,
const DoutPrefixProvider *dpp) = 0;
};
#define RGW_BUCKET_INSTANCE_MD_PREFIX ".bucket.meta."
+using namespace std;
+
class RGWSI_Bucket_SObj_Module : public RGWSI_MBSObj_Handler_Module {
RGWSI_Bucket_SObj::Svc& svc;
struct bucket_info_cache_entry {
RGWBucketInfo info;
real_time mtime;
- map<string, bufferlist> attrs;
+ std::map<std::string, bufferlist> attrs;
};
using RGWChainedCacheImpl_bucket_info_cache_entry = RGWChainedCacheImpl<bucket_info_cache_entry>;
- unique_ptr<RGWChainedCacheImpl_bucket_info_cache_entry> binfo_cache;
+ std::unique_ptr<RGWChainedCacheImpl_bucket_info_cache_entry> binfo_cache;
RGWSI_Bucket_BE_Handler ep_be_handler;
std::unique_ptr<RGWSI_MetaBackend::Module> ep_be_module;
int do_start(optional_yield, const DoutPrefixProvider *dpp) override;
int do_read_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
- const string& key,
+ const std::string& key,
RGWBucketInfo *info,
real_time *pmtime,
- map<string, bufferlist> *pattrs,
+ std::map<std::string, bufferlist> *pattrs,
rgw_cache_entry_info *cache_info,
boost::optional<obj_version> refresh_version,
optional_yield y,
int read_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
- const string& key,
+ const std::string& key,
RGWBucketEntryPoint *entry_point,
RGWObjVersionTracker *objv_tracker,
real_time *pmtime,
- map<string, bufferlist> *pattrs,
+ std::map<std::string, bufferlist> *pattrs,
optional_yield y,
const DoutPrefixProvider *dpp,
rgw_cache_entry_info *cache_info = nullptr,
boost::optional<obj_version> refresh_version = boost::none) override;
int store_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
- const string& key,
+ const std::string& key,
RGWBucketEntryPoint& info,
bool exclusive,
real_time mtime,
- map<string, bufferlist> *pattrs,
+ std::map<std::string, bufferlist> *pattrs,
RGWObjVersionTracker *objv_tracker,
optional_yield y,
const DoutPrefixProvider *dpp) override;
int remove_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
- const string& key,
+ const std::string& key,
RGWObjVersionTracker *objv_tracker,
optional_yield y,
const DoutPrefixProvider *dpp) override;
int read_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
- const string& key,
+ const std::string& key,
RGWBucketInfo *info,
real_time *pmtime,
- map<string, bufferlist> *pattrs,
+ std::map<std::string, bufferlist> *pattrs,
optional_yield y,
const DoutPrefixProvider *dpp,
rgw_cache_entry_info *cache_info = nullptr,
const rgw_bucket& bucket,
RGWBucketInfo *info,
real_time *pmtime,
- map<string, bufferlist> *pattrs,
+ std::map<std::string, bufferlist> *pattrs,
boost::optional<obj_version> refresh_version,
optional_yield y,
const DoutPrefixProvider *dpp) override;
int store_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
- const string& key,
+ const std::string& key,
RGWBucketInfo& info,
std::optional<RGWBucketInfo *> orig_info, /* nullopt: orig_info was not fetched,
nullptr: orig_info was not found (new bucket instance */
bool exclusive,
real_time mtime,
- map<string, bufferlist> *pattrs,
+ std::map<std::string, bufferlist> *pattrs,
optional_yield y,
const DoutPrefixProvider *dpp) override;
int remove_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
- const string& key,
+ const std::string& key,
const RGWBucketInfo& bucket_info,
RGWObjVersionTracker *objv_tracker,
optional_yield y,
const DoutPrefixProvider *dpp) override;
int read_buckets_stats(RGWSI_Bucket_X_Ctx& ctx,
- map<string, RGWBucketEnt>& m,
+ std::map<std::string, RGWBucketEnt>& m,
optional_yield y,
const DoutPrefixProvider *dpp) override;
};
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
static string bucket_sync_sources_oid_prefix = "bucket.sync-source-hints";
static string bucket_sync_targets_oid_prefix = "bucket.sync-target-hints";
std::shared_ptr<RGWBucketSyncPolicyHandler> handler;
};
- unique_ptr<RGWChainedCacheImpl<bucket_sync_policy_cache_entry> > sync_policy_cache;
+ std::unique_ptr<RGWChainedCacheImpl<bucket_sync_policy_cache_entry> > sync_policy_cache;
std::unique_ptr<RGWSI_Bucket_Sync_SObj_HintIndexManager> hint_index_mgr;
int do_start(optional_yield, const DoutPrefixProvider *dpp) override;
struct optional_zone_bucket {
- optional<rgw_zone_id> zone;
- optional<rgw_bucket> bucket;
+ std::optional<rgw_zone_id> zone;
+ std::optional<rgw_bucket> bucket;
- optional_zone_bucket(const optional<rgw_zone_id>& _zone,
- const optional<rgw_bucket>& _bucket) : zone(_zone), bucket(_bucket) {}
+ optional_zone_bucket(const std::optional<rgw_zone_id>& _zone,
+ const std::optional<rgw_bucket>& _bucket) : zone(_zone), bucket(_bucket) {}
bool operator<(const optional_zone_bucket& ozb) const {
if (zone < ozb.zone) {
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
static string log_lock_name = "rgw_log_lock";
int RGWSI_Cls::do_start(optional_yield y, const DoutPrefixProvider *dpp)
public:
MFA(CephContext *cct): ClsSubService(cct) {}
- string get_mfa_oid(const rgw_user& user) {
- return string("user:") + user.to_str();
+ std::string get_mfa_oid(const rgw_user& user) {
+ return std::string("user:") + user.to_str();
}
- int check_mfa(const DoutPrefixProvider *dpp, const rgw_user& user, const string& otp_id, const string& pin, optional_yield y);
+ int check_mfa(const DoutPrefixProvider *dpp, const rgw_user& user, const std::string& otp_id, const std::string& pin, optional_yield y);
int create_mfa(const DoutPrefixProvider *dpp, const rgw_user& user, const rados::cls::otp::otp_info_t& config,
RGWObjVersionTracker *objv_tracker, const ceph::real_time& mtime, optional_yield y);
int remove_mfa(const DoutPrefixProvider *dpp,
- const rgw_user& user, const string& id,
+ const rgw_user& user, const std::string& id,
RGWObjVersionTracker *objv_tracker,
const ceph::real_time& mtime,
optional_yield y);
- int get_mfa(const DoutPrefixProvider *dpp, const rgw_user& user, const string& id, rados::cls::otp::otp_info_t *result, optional_yield y);
- int list_mfa(const DoutPrefixProvider *dpp, const rgw_user& user, list<rados::cls::otp::otp_info_t> *result, optional_yield y);
+ int get_mfa(const DoutPrefixProvider *dpp, const rgw_user& user, const std::string& id, rados::cls::otp::otp_info_t *result, optional_yield y);
+ int list_mfa(const DoutPrefixProvider *dpp, const rgw_user& user, std::list<rados::cls::otp::otp_info_t> *result, optional_yield y);
int otp_get_current_time(const DoutPrefixProvider *dpp, const rgw_user& user, ceph::real_time *result, optional_yield y);
- int set_mfa(const DoutPrefixProvider *dpp, const string& oid, const list<rados::cls::otp::otp_info_t>& entries,
+ int set_mfa(const DoutPrefixProvider *dpp, const std::string& oid, const std::list<rados::cls::otp::otp_info_t>& entries,
bool reset_obj, RGWObjVersionTracker *objv_tracker,
const real_time& mtime, optional_yield y);
- int list_mfa(const DoutPrefixProvider *dpp, const string& oid, list<rados::cls::otp::otp_info_t> *result,
+ int list_mfa(const DoutPrefixProvider *dpp, const std::string& oid, std::list<rados::cls::otp::otp_info_t> *result,
RGWObjVersionTracker *objv_tracker, ceph::real_time *pmtime, optional_yield y);
} mfa;
class TimeLog : public ClsSubService {
- int init_obj(const DoutPrefixProvider *dpp, const string& oid, RGWSI_RADOS::Obj& obj);
+ int init_obj(const DoutPrefixProvider *dpp, const std::string& oid, RGWSI_RADOS::Obj& obj);
public:
TimeLog(CephContext *cct): ClsSubService(cct) {}
void prepare_entry(cls_log_entry& entry,
const real_time& ut,
- const string& section,
- const string& key,
+ const std::string& section,
+ const std::string& key,
bufferlist& bl);
int add(const DoutPrefixProvider *dpp,
- const string& oid,
+ const std::string& oid,
const real_time& ut,
- const string& section,
- const string& key,
+ const std::string& section,
+ const std::string& key,
bufferlist& bl,
optional_yield y);
int add(const DoutPrefixProvider *dpp,
- const string& oid,
+ const std::string& oid,
std::list<cls_log_entry>& entries,
librados::AioCompletion *completion,
bool monotonic_inc,
optional_yield y);
int list(const DoutPrefixProvider *dpp,
- const string& oid,
+ const std::string& oid,
const real_time& start_time,
const real_time& end_time,
- int max_entries, list<cls_log_entry>& entries,
- const string& marker,
- string *out_marker,
+ int max_entries, std::list<cls_log_entry>& entries,
+ const std::string& marker,
+ std::string *out_marker,
bool *truncated,
optional_yield y);
int info(const DoutPrefixProvider *dpp,
- const string& oid,
+ const std::string& oid,
cls_log_header *header,
optional_yield y);
int info_async(const DoutPrefixProvider *dpp,
RGWSI_RADOS::Obj& obj,
- const string& oid,
+ const std::string& oid,
cls_log_header *header,
librados::AioCompletion *completion);
int trim(const DoutPrefixProvider *dpp,
- const string& oid,
+ const std::string& oid,
const real_time& start_time,
const real_time& end_time,
- const string& from_marker,
- const string& to_marker,
+ const std::string& from_marker,
+ const std::string& to_marker,
librados::AioCompletion *completion,
optional_yield y);
} timelog;
class Lock : public ClsSubService {
- int init_obj(const string& oid, RGWSI_RADOS::Obj& obj);
+ int init_obj(const std::string& oid, RGWSI_RADOS::Obj& obj);
public:
Lock(CephContext *cct): ClsSubService(cct) {}
int lock_exclusive(const DoutPrefixProvider *dpp,
const rgw_pool& pool,
- const string& oid,
+ const std::string& oid,
timespan& duration,
- string& zone_id,
- string& owner_id,
- std::optional<string> lock_name = std::nullopt);
+ std::string& zone_id,
+ std::string& owner_id,
+ std::optional<std::string> lock_name = std::nullopt);
int unlock(const DoutPrefixProvider *dpp,
const rgw_pool& pool,
- const string& oid,
- string& zone_id,
- string& owner_id,
- std::optional<string> lock_name = std::nullopt);
+ const std::string& oid,
+ std::string& zone_id,
+ std::string& owner_id,
+ std::optional<std::string> lock_name = std::nullopt);
} lock;
RGWSI_Cls(CephContext *cct): RGWServiceInstance(cct), mfa(cct), timelog(cct), lock(cct) {}
RGWSI_ConfigKey(CephContext *cct) : RGWServiceInstance(cct) {}
virtual ~RGWSI_ConfigKey() {}
- virtual int get(const string& key, bool secure, bufferlist *result) = 0;
+ virtual int get(const std::string& key, bool secure, bufferlist *result) = 0;
};
#include "svc_rados.h"
#include "svc_config_key_rados.h"
+using namespace std;
+
RGWSI_ConfigKey_RADOS::~RGWSI_ConfigKey_RADOS(){}
int RGWSI_ConfigKey_RADOS::do_start(optional_yield, const DoutPrefixProvider *dpp)
virtual ~RGWSI_ConfigKey_RADOS() override;
- int get(const string& key, bool secure, bufferlist *result) override;
+ int get(const std::string& key, bool secure, bufferlist *result) override;
};
#include "svc_finisher.h"
+using namespace std;
+
int RGWSI_Finisher::do_start(optional_yield, const DoutPrefixProvider *dpp)
{
finisher = new Finisher(cct);
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
using Svc = RGWSI_MDLog::Svc;
using Cursor = RGWPeriodHistory::Cursor;
RGWObjVersionTracker *objv_tracker,
optional_yield y, bool exclusive = false);
- int add_entry(const DoutPrefixProvider *dpp, const string& hash_key, const string& section, const string& key, bufferlist& bl);
+ int add_entry(const DoutPrefixProvider *dpp, const std::string& hash_key, const std::string& section, const std::string& key, bufferlist& bl);
- int get_shard_id(const string& hash_key, int *shard_id);
+ int get_shard_id(const std::string& hash_key, int *shard_id);
RGWPeriodHistory *get_period_history() {
return period_history.get();
#define dout_subsys ceph_subsys_rgw
+using namespace std;
RGWSI_Meta::RGWSI_Meta(CephContext *cct) : RGWServiceInstance(cct) {
}
RGWSI_SysObj *sysobj_svc{nullptr};
RGWSI_MDLog *mdlog_svc{nullptr};
- map<RGWSI_MetaBackend::Type, RGWSI_MetaBackend *> be_svc;
+ std::map<RGWSI_MetaBackend::Type, RGWSI_MetaBackend *> be_svc;
- vector<unique_ptr<RGWSI_MetaBackend_Handler> > be_handlers;
+ std::vector<std::unique_ptr<RGWSI_MetaBackend_Handler> > be_handlers;
public:
RGWSI_Meta(CephContext *cct);
void init(RGWSI_SysObj *_sysobj_svc,
RGWSI_MDLog *_mdlog_svc,
- vector<RGWSI_MetaBackend *>& _be_svc);
+ std::vector<RGWSI_MetaBackend *>& _be_svc);
int create_be_handler(RGWSI_MetaBackend::Type be_type,
RGWSI_MetaBackend_Handler **phandler);
#define dout_subsys ceph_subsys_rgw
+using namespace std;
RGWSI_MetaBackend::Context::~Context() {} // needed, even though destructor is pure virtual
RGWSI_MetaBackend::Module::~Module() {} // ditto
RGWObjVersionTracker *objv_tracker,
optional_yield y) = 0;
- virtual int list_init(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, const string& marker) = 0;
+ virtual int list_init(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, const std::string& marker) = 0;
virtual int list_next(const DoutPrefixProvider *dpp,
RGWSI_MetaBackend::Context *ctx,
- int max, list<string> *keys,
+ int max, std::list<std::string> *keys,
bool *truncated) = 0;
virtual int list_get_marker(RGWSI_MetaBackend::Context *ctx,
- string *marker) = 0;
+ std::string *marker) = 0;
int call(std::function<int(RGWSI_MetaBackend::Context *)> f) {
- return call(nullopt, f);
+ return call(std::nullopt, f);
}
virtual int call(std::optional<RGWSI_MetaBackend_CtxParams> opt,
return be->mutate(be_ctx, key, params, objv_tracker, y, f, dpp);
}
- int list_init(const DoutPrefixProvider *dpp, const string& marker) {
+ int list_init(const DoutPrefixProvider *dpp, const std::string& marker) {
return be->list_init(dpp, be_ctx, marker);
}
- int list_next(const DoutPrefixProvider *dpp, int max, list<string> *keys,
+ int list_next(const DoutPrefixProvider *dpp, int max, std::list<std::string> *keys,
bool *truncated) {
return be->list_next(dpp, be_ctx, max, keys, truncated);
}
- int list_get_marker(string *marker) {
+ int list_get_marker(std::string *marker) {
return be->list_get_marker(be_ctx, marker);
}
virtual ~RGWSI_MetaBackend_Handler() {}
int call(std::function<int(Op *)> f) {
- return call(nullopt, f);
+ return call(std::nullopt, f);
}
virtual int call(std::optional<RGWSI_MetaBackend_CtxParams> bectx_params,
#define dout_subsys ceph_subsys_rgw
+using namespace std;
RGWSI_MetaBackend_OTP::RGWSI_MetaBackend_OTP(CephContext *cct) : RGWSI_MetaBackend_SObj(cct) {
}
using RGWSI_MBOTP_Handler_Module = RGWSI_MBSObj_Handler_Module;
using RGWSI_MetaBackend_Handler_OTP = RGWSI_MetaBackend_Handler_SObj;
-using otp_devices_list_t = list<rados::cls::otp::otp_info_t>;
+using otp_devices_list_t = std::list<rados::cls::otp::otp_info_t>;
struct RGWSI_MBOTP_GetParams : public RGWSI_MetaBackend::GetParams {
otp_devices_list_t *pdevices{nullptr};
return MDBE_OTP;
}
- static string get_meta_key(const rgw_user& user);
+ static std::string get_meta_key(const rgw_user& user);
void init(RGWSI_SysObj *_sysobj_svc,
RGWSI_MDLog *_mdlog_svc,
int call_with_get_params(ceph::real_time *pmtime, std::function<int(RGWSI_MetaBackend::GetParams&)> cb) override;
int get_entry(RGWSI_MetaBackend::Context *ctx,
- const string& key,
+ const std::string& key,
RGWSI_MetaBackend::GetParams& _params,
RGWObjVersionTracker *objv_tracker,
optional_yield y,
const DoutPrefixProvider *dpp);
int put_entry(const DoutPrefixProvider *dpp,
RGWSI_MetaBackend::Context *ctx,
- const string& key,
+ const std::string& key,
RGWSI_MetaBackend::PutParams& _params,
RGWObjVersionTracker *objv_tracker,
optional_yield y);
#define dout_subsys ceph_subsys_rgw
+using namespace std;
RGWSI_MetaBackend_SObj::RGWSI_MetaBackend_SObj(CephContext *cct) : RGWSI_MetaBackend(cct) {
}
class RGWSI_MBSObj_Handler_Module : public RGWSI_MetaBackend::Module {
protected:
- string section;
+ std::string section;
public:
- RGWSI_MBSObj_Handler_Module(const string& _section) : section(_section) {}
+ RGWSI_MBSObj_Handler_Module(const std::string& _section) : section(_section) {}
virtual void get_pool_and_oid(const std::string& key, rgw_pool *pool, std::string *oid) = 0;
virtual const std::string& get_oid_prefix() = 0;
virtual std::string key_to_oid(const std::string& key) = 0;
struct RGWSI_MBSObj_GetParams : public RGWSI_MetaBackend::GetParams {
bufferlist *pbl{nullptr};
- map<string, bufferlist> *pattrs{nullptr};
+ std::map<std::string, bufferlist> *pattrs{nullptr};
rgw_cache_entry_info *cache_info{nullptr};
boost::optional<obj_version> refresh_version;
RGWSI_MBSObj_GetParams() {}
RGWSI_MBSObj_GetParams(bufferlist *_pbl,
- std::map<string, bufferlist> *_pattrs,
+ std::map<std::string, bufferlist> *_pattrs,
ceph::real_time *_pmtime) : RGWSI_MetaBackend::GetParams(_pmtime),
pbl(_pbl),
pattrs(_pattrs) {}
struct RGWSI_MBSObj_PutParams : public RGWSI_MetaBackend::PutParams {
bufferlist bl;
- map<string, bufferlist> *pattrs{nullptr};
+ std::map<std::string, bufferlist> *pattrs{nullptr};
bool exclusive{false};
RGWSI_MBSObj_PutParams() {}
- RGWSI_MBSObj_PutParams(std::map<string, bufferlist> *_pattrs,
+ RGWSI_MBSObj_PutParams(std::map<std::string, bufferlist> *_pattrs,
const ceph::real_time& _mtime) : RGWSI_MetaBackend::PutParams(_mtime),
pattrs(_pattrs) {}
RGWSI_MBSObj_PutParams(bufferlist& _bl,
- std::map<string, bufferlist> *_pattrs,
+ std::map<std::string, bufferlist> *_pattrs,
const ceph::real_time& _mtime,
bool _exclusive) : RGWSI_MetaBackend::PutParams(_mtime),
bl(_bl),
int pre_modify(const DoutPrefixProvider *dpp,
RGWSI_MetaBackend::Context *ctx,
- const string& key,
+ const std::string& key,
RGWMetadataLogData& log_data,
RGWObjVersionTracker *objv_tracker,
RGWMDLogStatus op_type,
optional_yield y);
int post_modify(const DoutPrefixProvider *dpp,
RGWSI_MetaBackend::Context *ctx,
- const string& key,
+ const std::string& key,
RGWMetadataLogData& log_data,
RGWObjVersionTracker *objv_tracker, int ret,
optional_yield y);
int get_entry(RGWSI_MetaBackend::Context *ctx,
- const string& key,
+ const std::string& key,
RGWSI_MetaBackend::GetParams& params,
RGWObjVersionTracker *objv_tracker,
optional_yield y,
const DoutPrefixProvider *dpp) override;
int put_entry(const DoutPrefixProvider *dpp,
RGWSI_MetaBackend::Context *ctx,
- const string& key,
+ const std::string& key,
RGWSI_MetaBackend::PutParams& params,
RGWObjVersionTracker *objv_tracker,
optional_yield y) override;
int remove_entry(const DoutPrefixProvider *dpp,
RGWSI_MetaBackend::Context *ctx,
- const string& key,
+ const std::string& key,
RGWSI_MetaBackend::RemoveParams& params,
RGWObjVersionTracker *objv_tracker,
optional_yield y) override;
- int list_init(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *_ctx, const string& marker) override;
+ int list_init(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *_ctx, const std::string& marker) override;
int list_next(const DoutPrefixProvider *dpp,
RGWSI_MetaBackend::Context *_ctx,
- int max, list<string> *keys,
+ int max, std::list<std::string> *keys,
bool *truncated) override;
int list_get_marker(RGWSI_MetaBackend::Context *ctx,
- string *marker) override;
+ std::string *marker) override;
int get_shard_id(RGWSI_MetaBackend::Context *ctx,
const std::string& key,
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
static string notify_oid_prefix = "notify";
RGWSI_Notify::~RGWSI_Notify()
int num_watchers{0};
RGWWatcher **watchers{nullptr};
std::set<int> watchers_set;
- vector<RGWSI_RADOS::Obj> notify_objs;
+ std::vector<RGWSI_RADOS::Obj> notify_objs;
bool enabled{false};
double inject_notify_timeout_probability{0};
static constexpr unsigned max_notify_retries = 10;
- string get_control_oid(int i);
- RGWSI_RADOS::Obj pick_control_obj(const string& key);
+ std::string get_control_oid(int i);
+ RGWSI_RADOS::Obj pick_control_obj(const std::string& key);
CB *cb{nullptr};
virtual void set_enabled(bool status) = 0;
};
- int distribute(const DoutPrefixProvider *dpp, const string& key, const RGWCacheNotifyInfo& bl,
+ int distribute(const DoutPrefixProvider *dpp, const std::string& key, const RGWCacheNotifyInfo& bl,
optional_yield y);
void register_watch_cb(CB *cb);
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
class RGW_MB_Handler_Module_OTP : public RGWSI_MBSObj_Handler_Module {
RGWSI_Zone *zone_svc;
string prefix;
RGWSI_MetaBackend *_meta_be_svc);
int read_all(RGWSI_OTP_BE_Ctx& ctx,
- const string& key,
+ const std::string& key,
otp_devices_list_t *devices,
real_time *pmtime,
RGWObjVersionTracker *objv_tracker,
const DoutPrefixProvider *dpp);
int store_all(const DoutPrefixProvider *dpp,
RGWSI_OTP_BE_Ctx& ctx,
- const string& key,
+ const std::string& key,
const otp_devices_list_t& devices,
real_time mtime,
RGWObjVersionTracker *objv_tracker,
optional_yield y);
int remove_all(const DoutPrefixProvider *dpp,
RGWSI_OTP_BE_Ctx& ctx,
- const string& key,
+ const std::string& key,
RGWObjVersionTracker *objv_tracker,
optional_yield y);
int remove_all(const DoutPrefixProvider *dpp,
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
RGWSI_RADOS::RGWSI_RADOS(CephContext *cct) : RGWServiceInstance(cct)
{
}
class RGWAccessListFilter {
public:
virtual ~RGWAccessListFilter() {}
- virtual bool filter(const string& name, string& key) = 0;
+ virtual bool filter(const std::string& name, std::string& key) = 0;
};
struct RGWAccessListFilterPrefix : public RGWAccessListFilter {
- string prefix;
+ std::string prefix;
- explicit RGWAccessListFilterPrefix(const string& _prefix) : prefix(_prefix) {}
- bool filter(const string& name, string& key) override {
+ explicit RGWAccessListFilterPrefix(const std::string& _prefix) : prefix(_prefix) {}
+ bool filter(const std::string& name, std::string& key) override {
return (prefix.compare(key.substr(0, prefix.size())) == 0);
}
};
int pool_iterate(const DoutPrefixProvider *dpp,
librados::IoCtx& ioctx,
librados::NObjectIterator& iter,
- uint32_t num, vector<rgw_bucket_dir_entry>& objs,
+ uint32_t num, std::vector<rgw_bucket_dir_entry>& objs,
RGWAccessListFilter *filter,
bool *is_truncated);
return async_processor.get();
}
- int clog_warn(const string& msg);
+ int clog_warn(const std::string& msg);
class Handle;
List() {}
List(Pool *_pool) : pool(_pool) {}
- int init(const DoutPrefixProvider *dpp, const string& marker, RGWAccessListFilter *filter = nullptr);
+ int init(const DoutPrefixProvider *dpp, const std::string& marker, RGWAccessListFilter *filter = nullptr);
int get_next(const DoutPrefixProvider *dpp, int max,
- std::vector<string> *oids,
+ std::vector<std::string> *oids,
bool *is_truncated);
- int get_marker(string *marker);
+ int get_marker(std::string *marker);
};
List op() {
init(_obj);
}
- Obj(Pool& pool, const string& oid);
+ Obj(Pool& pool, const std::string& oid);
public:
Obj() {}
return Obj(this, o);
}
- Obj obj(Pool& pool, const string& oid) {
+ Obj obj(Pool& pool, const std::string& oid) {
return Obj(pool, oid);
}
using rgw_rados_ref = RGWSI_RADOS::rados_ref;
-inline ostream& operator<<(ostream& out, const RGWSI_RADOS::Obj& obj) {
+inline std::ostream& operator<<(std::ostream& out, const RGWSI_RADOS::Obj& obj) {
return out << obj.get_raw_obj();
}
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
RGWSysObjectCtx RGWSI_SysObj::init_obj_ctx()
{
return RGWSysObjectCtx(this);
ceph::static_ptr<RGWSI_SysObj_Obj_GetObjState, sizeof(RGWSI_SysObj_Core_GetObjState)> state;
RGWObjVersionTracker *objv_tracker{nullptr};
- map<string, bufferlist> *attrs{nullptr};
+ std::map<std::string, bufferlist> *attrs{nullptr};
bool raw_attrs{false};
boost::optional<obj_version> refresh_version{boost::none};
ceph::real_time *lastmod{nullptr};
return *this;
}
- ROp& set_attrs(map<string, bufferlist> *_attrs) {
+ ROp& set_attrs(std::map<std::string, bufferlist> *_attrs) {
attrs = _attrs;
return *this;
}
Obj& source;
RGWObjVersionTracker *objv_tracker{nullptr};
- map<string, bufferlist> attrs;
+ std::map<std::string, bufferlist> attrs;
ceph::real_time mtime;
ceph::real_time *pmtime{nullptr};
bool exclusive{false};
return *this;
}
- WOp& set_attrs(map<string, bufferlist>& _attrs) {
+ WOp& set_attrs(std::map<std::string, bufferlist>& _attrs) {
attrs = _attrs;
return *this;
}
- WOp& set_attrs(map<string, bufferlist>&& _attrs) {
+ WOp& set_attrs(std::map<std::string, bufferlist>&& _attrs) {
attrs = _attrs;
return *this;
}
OmapOp(Obj& _source) : source(_source) {}
- int get_all(const DoutPrefixProvider *dpp, std::map<string, bufferlist> *m, optional_yield y);
- int get_vals(const DoutPrefixProvider *dpp, const string& marker, uint64_t count,
- std::map<string, bufferlist> *m,
+ int get_all(const DoutPrefixProvider *dpp, std::map<std::string, bufferlist> *m, optional_yield y);
+ int get_vals(const DoutPrefixProvider *dpp, const std::string& marker, uint64_t count,
+ std::map<std::string, bufferlist> *m,
bool *pmore, optional_yield y);
int set(const DoutPrefixProvider *dpp, const std::string& key, bufferlist& bl, optional_yield y);
- int set(const DoutPrefixProvider *dpp, const map<std::string, bufferlist>& m, optional_yield y);
+ int set(const DoutPrefixProvider *dpp, const std::map<std::string, bufferlist>& m, optional_yield y);
int del(const DoutPrefixProvider *dpp, const std::string& key, optional_yield y);
};
Op(Pool& _source) : source(_source) {}
int init(const DoutPrefixProvider *dpp, const std::string& marker, const std::string& prefix);
- int get_next(const DoutPrefixProvider *dpp, int max, std::vector<string> *oids, bool *is_truncated);
- int get_marker(string *marker);
+ int get_next(const DoutPrefixProvider *dpp, int max, std::vector<std::string> *oids, bool *is_truncated);
+ int get_marker(std::string *marker);
};
- int list_prefixed_objs(const DoutPrefixProvider *dpp, const std::string& prefix, std::function<void(const string&)> cb);
+ int list_prefixed_objs(const DoutPrefixProvider *dpp, const std::string& prefix, std::function<void(const std::string&)> cb);
template <typename Container>
- int list_prefixed_objs(const DoutPrefixProvider *dpp, const string& prefix,
+ int list_prefixed_objs(const DoutPrefixProvider *dpp, const std::string& prefix,
Container *result) {
- return list_prefixed_objs(dpp, prefix, [&](const string& val) {
+ return list_prefixed_objs(dpp, prefix, [&](const std::string& val) {
result->push_back(val);
});
}
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
class RGWSI_SysObj_Cache_CB : public RGWSI_Notify::CB
{
RGWSI_SysObj_Cache *svc;
std::shared_ptr<RGWSI_SysObj_Cache_CB> cb;
- void normalize_pool_and_obj(const rgw_pool& src_pool, const string& src_obj, rgw_pool& dst_pool, string& dst_obj);
+ void normalize_pool_and_obj(const rgw_pool& src_pool, const std::string& src_obj, rgw_pool& dst_pool, std::string& dst_obj);
protected:
void init(RGWSI_RADOS *_rados_svc,
RGWSI_Zone *_zone_svc,
void shutdown() override;
int raw_stat(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, uint64_t *psize, real_time *pmtime, uint64_t *epoch,
- map<string, bufferlist> *attrs, bufferlist *first_chunk,
+ std::map<std::string, bufferlist> *attrs, bufferlist *first_chunk,
RGWObjVersionTracker *objv_tracker,
optional_yield y) override;
RGWObjVersionTracker *objv_tracker,
const rgw_raw_obj& obj,
bufferlist *bl, off_t ofs, off_t end,
- map<string, bufferlist> *attrs,
+ std::map<std::string, bufferlist> *attrs,
bool raw_attrs,
rgw_cache_entry_info *cache_info,
boost::optional<obj_version>,
int set_attrs(const DoutPrefixProvider *dpp,
const rgw_raw_obj& obj,
- map<string, bufferlist>& attrs,
- map<string, bufferlist> *rmattrs,
+ std::map<std::string, bufferlist>& attrs,
+ std::map<std::string, bufferlist> *rmattrs,
RGWObjVersionTracker *objv_tracker,
optional_yield y);
int write(const DoutPrefixProvider *dpp,
const rgw_raw_obj& obj,
real_time *pmtime,
- map<std::string, bufferlist>& attrs,
+ std::map<std::string, bufferlist>& attrs,
bool exclusive,
const bufferlist& data,
RGWObjVersionTracker *objv_tracker,
RGWObjVersionTracker *objv_tracker,
optional_yield y);
- int distribute_cache(const DoutPrefixProvider *dpp, const string& normal_name, const rgw_raw_obj& obj,
+ int distribute_cache(const DoutPrefixProvider *dpp, const std::string& normal_name, const rgw_raw_obj& obj,
ObjectCacheInfo& obj_info, int op,
optional_yield y);
// `call_list` must iterate over all cache entries and call
// `cache_list_dump_helper` with the supplied Formatter on any that
- // include `filter` as a substring.
+ // include `filter` as a substd::string.
//
void call_list(const std::optional<std::string>& filter, Formatter* f);
"rgw_cache_expiry_interval"));
}
- boost::optional<T> find(const string& key) {
+ boost::optional<T> find(const std::string& key) {
std::shared_lock rl{lock};
auto iter = entries.find(key);
if (iter == entries.end()) {
return iter->second.first;
}
- bool put(const DoutPrefixProvider *dpp, RGWSI_SysObj_Cache *svc, const string& key, T *entry,
+ bool put(const DoutPrefixProvider *dpp, RGWSI_SysObj_Cache *svc, const std::string& key, T *entry,
std::initializer_list<rgw_cache_entry_info *> cache_info_entries) {
if (!svc) {
return false;
return svc->chain_cache_entry(dpp, cache_info_entries, &chain_entry);
}
- void chain_cb(const string& key, void *data) override {
+ void chain_cb(const std::string& key, void *data) override {
T *entry = static_cast<T *>(data);
std::unique_lock wl{lock};
entries[key].first = *entry;
}
}
- void invalidate(const string& key) override {
+ void invalidate(const std::string& key) override {
std::unique_lock wl{lock};
entries.erase(key);
}
#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
int RGWSI_SysObj_Core_GetObjState::get_rados_obj(const DoutPrefixProvider *dpp,
RGWSI_RADOS *rados_svc,
RGWSI_Zone *zone_svc,
virtual int raw_stat(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, uint64_t *psize,
real_time *pmtime, uint64_t *epoch,
- map<string, bufferlist> *attrs, bufferlist *first_chunk,
+ std::map<std::string, bufferlist> *attrs, bufferlist *first_chunk,
RGWObjVersionTracker *objv_tracker,
optional_yield y);
RGWObjVersionTracker *objv_tracker,
const rgw_raw_obj& obj,
bufferlist *bl, off_t ofs, off_t end,
- map<string, bufferlist> *attrs,
+ std::map<std::string, bufferlist> *attrs,
bool raw_attrs,
rgw_cache_entry_info *cache_info,
boost::optional<obj_version>,
virtual int write(const DoutPrefixProvider *dpp,
const rgw_raw_obj& obj,
real_time *pmtime,
- map<std::string, bufferlist>& attrs,
+ std::map<std::string, bufferlist>& attrs,
bool exclusive,
const bufferlist& data,
RGWObjVersionTracker *objv_tracker,
optional_yield y);
virtual int set_attrs(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj,
- map<string, bufferlist>& attrs,
- map<string, bufferlist> *rmattrs,
+ std::map<std::string, bufferlist>& attrs,
+ std::map<std::string, bufferlist> *rmattrs,
RGWObjVersionTracker *objv_tracker,
optional_yield y);
- virtual int omap_get_all(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, std::map<string, bufferlist> *m,
+ virtual int omap_get_all(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, std::map<std::string, bufferlist> *m,
optional_yield y);
virtual int omap_get_vals(const DoutPrefixProvider *dpp,
const rgw_raw_obj& obj,
- const string& marker,
+ const std::string& marker,
uint64_t count,
- std::map<string, bufferlist> *m,
+ std::map<std::string, bufferlist> *m,
bool *pmore,
optional_yield y);
virtual int omap_set(const DoutPrefixProvider *dpp,
bufferlist& bl, bool must_exist,
optional_yield y);
virtual int omap_set(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj,
- const map<std::string, bufferlist>& m, bool must_exist,
+ const std::map<std::string, bufferlist>& m, bool must_exist,
optional_yield y);
virtual int omap_del(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, const std::string& key,
optional_yield y);
virtual int pool_list_prefixed_objs(const DoutPrefixProvider *dpp,
const rgw_pool& pool,
- const string& prefix,
- std::function<void(const string&)> cb);
+ const std::string& prefix,
+ std::function<void(const std::string&)> cb);
virtual int pool_list_objects_init(const DoutPrefixProvider *dpp,
const rgw_pool& pool,
virtual int pool_list_objects_next(const DoutPrefixProvider *dpp,
RGWSI_SysObj::Pool::ListCtx& ctx,
int max,
- vector<string> *oids,
+ std::vector<std::string> *oids,
bool *is_truncated);
virtual int pool_list_objects_get_marker(RGWSI_SysObj::Pool::ListCtx& _ctx,
- string *marker);
+ std::string *marker);
/* wrappers */
int get_system_obj_state_impl(RGWSysObjectCtxBase *rctx,
int stat(RGWSysObjectCtxBase& obj_ctx,
RGWSI_SysObj_Obj_GetObjState& state,
const rgw_raw_obj& obj,
- map<string, bufferlist> *attrs,
+ std::map<std::string, bufferlist> *attrs,
bool raw_attrs,
real_time *lastmod,
uint64_t *obj_size,
RGWSI_RADOS::Pool::List op;
RGWAccessListFilterPrefix filter;
- RGWSI_SysObj_Core_PoolListImplInfo(const string& prefix) : op(pool.op()), filter(prefix) {}
+ RGWSI_SysObj_Core_PoolListImplInfo(const std::string& prefix) : op(pool.op()), filter(prefix) {}
};
struct RGWSysObjState {
RGWObjVersionTracker objv_tracker;
- map<string, bufferlist> attrset;
+ std::map<std::string, bufferlist> attrset;
RGWSysObjState() {}
RGWSysObjState(const RGWSysObjState& rhs) : obj (rhs.obj) {
has_attrs = rhs.has_attrs;
#include "svc_tier_rados.h"
+using namespace std;
+
const std::string MP_META_SUFFIX = ".meta";
MultipartMetaFilter::~MultipartMetaFilter() {}
extern const std::string MP_META_SUFFIX;
class RGWMPObj {
- string oid;
- string prefix;
- string meta;
- string upload_id;
+ std::string oid;
+ std::string prefix;
+ std::string meta;
+ std::string upload_id;
public:
RGWMPObj() {}
- RGWMPObj(const string& _oid, const string& _upload_id) {
+ RGWMPObj(const std::string& _oid, const std::string& _upload_id) {
init(_oid, _upload_id, _upload_id);
}
- RGWMPObj(const string& _oid, std::optional<string> _upload_id) {
+ RGWMPObj(const std::string& _oid, std::optional<std::string> _upload_id) {
if (_upload_id) {
init(_oid, *_upload_id, *_upload_id);
} else {
from_meta(_oid);
}
}
- void init(const string& _oid, const string& _upload_id) {
+ void init(const std::string& _oid, const std::string& _upload_id) {
init(_oid, _upload_id, _upload_id);
}
- void init(const string& _oid, const string& _upload_id, const string& part_unique_str) {
+ void init(const std::string& _oid, const std::string& _upload_id, const std::string& part_unique_str) {
if (_oid.empty()) {
clear();
return;
meta = prefix + upload_id + MP_META_SUFFIX;
prefix.append(part_unique_str);
}
- const string& get_meta() const { return meta; }
- string get_part(int num) const {
+ const std::string& get_meta() const { return meta; }
+ std::string get_part(int num) const {
char buf[16];
snprintf(buf, 16, ".%d", num);
- string s = prefix;
+ std::string s = prefix;
s.append(buf);
return s;
}
- string get_part(const string& part) const {
- string s = prefix;
+ std::string get_part(const std::string& part) const {
+ std::string s = prefix;
s.append(".");
s.append(part);
return s;
}
- const string& get_upload_id() const {
+ const std::string& get_upload_id() const {
return upload_id;
}
- const string& get_key() const {
+ const std::string& get_key() const {
return oid;
}
- bool from_meta(const string& meta) {
+ bool from_meta(const std::string& meta) {
int end_pos = meta.rfind('.'); // search for ".meta"
if (end_pos < 0)
return false;
* @return true if the name provided is in the form of a multipart meta
* object, false otherwise
*/
- bool filter(const string& name, string& key) override;
+ bool filter(const std::string& name, std::string& key) override;
};
class RGWSI_Tier_RADOS : public RGWServiceInstance
RGWSI_User(CephContext *cct);
virtual ~RGWSI_User();
- static string get_meta_key(const rgw_user& user) {
+ static std::string get_meta_key(const rgw_user& user) {
return user.to_str();
}
- static rgw_user user_from_meta_key(const string& key) {
+ static rgw_user user_from_meta_key(const std::string& key) {
return rgw_user(key);
}
RGWObjVersionTracker * const objv_tracker,
real_time * const pmtime,
rgw_cache_entry_info * const cache_info,
- map<string, bufferlist> * const pattrs,
+ std::map<std::string, bufferlist> * const pattrs,
optional_yield y,
const DoutPrefixProvider *dpp) = 0;
RGWObjVersionTracker *objv_tracker,
const real_time& mtime,
bool exclusive,
- map<string, bufferlist> *attrs,
+ std::map<std::string, bufferlist> *attrs,
optional_yield y,
const DoutPrefixProvider *dpp) = 0;
const DoutPrefixProvider *dpp) = 0;
virtual int get_user_info_by_email(RGWSI_MetaBackend::Context *ctx,
- const string& email, RGWUserInfo *info,
+ const std::string& email, RGWUserInfo *info,
RGWObjVersionTracker *objv_tracker,
real_time *pmtime,
optional_yield y,
const DoutPrefixProvider *dpp) = 0;
virtual int get_user_info_by_swift(RGWSI_MetaBackend::Context *ctx,
- const string& swift_name,
+ const std::string& swift_name,
RGWUserInfo *info, /* out */
RGWObjVersionTracker * const objv_tracker,
real_time * const pmtime,
virtual int list_buckets(const DoutPrefixProvider *dpp,
RGWSI_MetaBackend::Context *ctx,
const rgw_user& user,
- const string& marker,
- const string& end_marker,
+ const std::string& marker,
+ const std::string& end_marker,
uint64_t max,
RGWUserBuckets *buckets,
bool *is_truncated,
#define RGW_BUCKETS_OBJ_SUFFIX ".buckets"
+using namespace std;
+
class RGWSI_User_Module : public RGWSI_MBSObj_Handler_Module {
RGWSI_User_RADOS::Svc& svc;
};
using RGWChainedCacheImpl_user_info_cache_entry = RGWChainedCacheImpl<user_info_cache_entry>;
- unique_ptr<RGWChainedCacheImpl_user_info_cache_entry> uinfo_cache;
+ std::unique_ptr<RGWChainedCacheImpl_user_info_cache_entry> uinfo_cache;
rgw_raw_obj get_buckets_obj(const rgw_user& user_id) const;
int get_user_info_from_index(RGWSI_MetaBackend::Context *ctx,
- const string& key,
+ const std::string& key,
const rgw_pool& pool,
RGWUserInfo *info,
RGWObjVersionTracker * const objv_tracker,
optional_yield y, const DoutPrefixProvider *dpp);
int remove_key_index(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, const RGWAccessKey& access_key, optional_yield y);
- int remove_email_index(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, const string& email, optional_yield y);
- int remove_swift_name_index(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, const string& swift_name, optional_yield y);
+ int remove_email_index(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, const std::string& email, optional_yield y);
+ int remove_swift_name_index(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, const std::string& swift_name, optional_yield y);
/* admin management */
- int cls_user_update_buckets(const DoutPrefixProvider *dpp, rgw_raw_obj& obj, list<cls_user_bucket_entry>& entries, bool add, optional_yield y);
+ int cls_user_update_buckets(const DoutPrefixProvider *dpp, rgw_raw_obj& obj, std::list<cls_user_bucket_entry>& entries, bool add, optional_yield y);
int cls_user_add_bucket(const DoutPrefixProvider *dpp, rgw_raw_obj& obj, const cls_user_bucket_entry& entry, optional_yield y);
int cls_user_remove_bucket(const DoutPrefixProvider *dpp, rgw_raw_obj& obj, const cls_user_bucket& bucket, optional_yield y);
const RGWBucketEnt& ent, optional_yield y);
int cls_user_list_buckets(const DoutPrefixProvider *dpp,
rgw_raw_obj& obj,
- const string& in_marker,
- const string& end_marker,
+ const std::string& in_marker,
+ const std::string& end_marker,
const int max_entries,
- list<cls_user_bucket_entry>& entries,
- string * const out_marker,
+ std::list<cls_user_bucket_entry>& entries,
+ std::string * const out_marker,
bool * const truncated,
optional_yield y);
int cls_user_reset_stats(const DoutPrefixProvider *dpp, const rgw_user& user, optional_yield y);
int cls_user_get_header(const DoutPrefixProvider *dpp, const rgw_user& user, cls_user_header *header, optional_yield y);
- int cls_user_get_header_async(const DoutPrefixProvider *dpp, const string& user, RGWGetUserHeader_CB *cb);
+ int cls_user_get_header_async(const DoutPrefixProvider *dpp, const std::string& user, RGWGetUserHeader_CB *cb);
int do_start(optional_yield, const DoutPrefixProvider *dpp) override;
public:
RGWObjVersionTracker * const objv_tracker,
real_time * const pmtime,
rgw_cache_entry_info * const cache_info,
- map<string, bufferlist> * const pattrs,
+ std::map<std::string, bufferlist> * const pattrs,
optional_yield y,
const DoutPrefixProvider *dpp) override;
RGWObjVersionTracker *objv_tracker,
const real_time& mtime,
bool exclusive,
- map<string, bufferlist> *attrs,
+ std::map<std::string, bufferlist> *attrs,
optional_yield y,
const DoutPrefixProvider *dpp) override;
const DoutPrefixProvider *dpp) override;
int get_user_info_by_email(RGWSI_MetaBackend::Context *ctx,
- const string& email, RGWUserInfo *info,
+ const std::string& email, RGWUserInfo *info,
RGWObjVersionTracker *objv_tracker,
real_time *pmtime,
optional_yield y,
const DoutPrefixProvider *dpp) override;
int get_user_info_by_swift(RGWSI_MetaBackend::Context *ctx,
- const string& swift_name,
+ const std::string& swift_name,
RGWUserInfo *info, /* out */
RGWObjVersionTracker * const objv_tracker,
real_time * const pmtime,
int list_buckets(const DoutPrefixProvider *dpp,
RGWSI_MetaBackend::Context *ctx,
const rgw_user& user,
- const string& marker,
- const string& end_marker,
+ const std::string& marker,
+ const std::string& end_marker,
uint64_t max,
RGWUserBuckets *buckets,
bool *is_truncated,
#define dout_subsys ceph_subsys_rgw
+using namespace std;
using namespace rgw_zone_defaults;
RGWSI_Zone::RGWSI_Zone(CephContext *cct) : RGWServiceInstance(cct)
std::map<rgw_zone_id, std::shared_ptr<RGWBucketSyncPolicyHandler> > sync_policy_handlers;
RGWRESTConn *rest_master_conn{nullptr};
- map<rgw_zone_id, RGWRESTConn *> zone_conn_map;
+ std::map<rgw_zone_id, RGWRESTConn *> zone_conn_map;
std::vector<const RGWZone*> data_sync_source_zones;
- map<rgw_zone_id, RGWRESTConn *> zone_data_notify_to_map;
- map<string, RGWRESTConn *> zonegroup_conn_map;
+ std::map<rgw_zone_id, RGWRESTConn *> zone_data_notify_to_map;
+ std::map<std::string, RGWRESTConn *> zonegroup_conn_map;
- map<string, rgw_zone_id> zone_id_by_name;
- map<rgw_zone_id, RGWZone> zone_by_id;
+ std::map<std::string, rgw_zone_id> zone_id_by_name;
+ std::map<rgw_zone_id, RGWZone> zone_by_id;
std::unique_ptr<rgw_sync_policy_info> sync_policy;
const RGWPeriod& get_current_period() const;
const RGWRealm& get_realm() const;
const RGWZoneGroup& get_zonegroup() const;
- int get_zonegroup(const string& id, RGWZoneGroup& zonegroup) const;
+ int get_zonegroup(const std::string& id, RGWZoneGroup& zonegroup) const;
const RGWZone& get_zone() const;
- std::shared_ptr<RGWBucketSyncPolicyHandler> get_sync_policy_handler(std::optional<rgw_zone_id> zone = nullopt) const;
+ std::shared_ptr<RGWBucketSyncPolicyHandler> get_sync_policy_handler(std::optional<rgw_zone_id> zone = std::nullopt) const;
- const string& zone_name() const;
+ const std::string& zone_name() const;
const rgw_zone_id& zone_id() const {
return cur_zone_id;
}
uint32_t get_zone_short_id() const;
- const string& get_current_period_id() const;
+ const std::string& get_current_period_id() const;
bool has_zonegroup_api(const std::string& api) const;
bool zone_is_writeable();
bool zone_syncs_from(const RGWZone& target_zone, const RGWZone& source_zone) const;
- bool get_redirect_zone_endpoint(string *endpoint);
+ bool get_redirect_zone_endpoint(std::string *endpoint);
bool sync_module_supports_writes() const { return writeable_zone; }
bool sync_module_exports_data() const { return exports_data; }
return rest_master_conn;
}
- map<string, RGWRESTConn *>& get_zonegroup_conn_map() {
+ std::map<std::string, RGWRESTConn *>& get_zonegroup_conn_map() {
return zonegroup_conn_map;
}
- map<rgw_zone_id, RGWRESTConn *>& get_zone_conn_map() {
+ std::map<rgw_zone_id, RGWRESTConn *>& get_zone_conn_map() {
return zone_conn_map;
}
return data_sync_source_zones;
}
- map<rgw_zone_id, RGWRESTConn *>& get_zone_data_notify_to_map() {
+ std::map<rgw_zone_id, RGWRESTConn *>& get_zone_data_notify_to_map() {
return zone_data_notify_to_map;
}
bool find_zone(const rgw_zone_id& id, RGWZone **zone);
RGWRESTConn *get_zone_conn(const rgw_zone_id& zone_id);
- RGWRESTConn *get_zone_conn_by_name(const string& name);
- bool find_zone_id_by_name(const string& name, rgw_zone_id *id);
+ RGWRESTConn *get_zone_conn_by_name(const std::string& name);
+ bool find_zone_id_by_name(const std::string& name, rgw_zone_id *id);
- int select_bucket_placement(const DoutPrefixProvider *dpp, const RGWUserInfo& user_info, const string& zonegroup_id,
+ int select_bucket_placement(const DoutPrefixProvider *dpp, const RGWUserInfo& user_info, const std::string& zonegroup_id,
const rgw_placement_rule& rule,
rgw_placement_rule *pselected_rule, RGWZonePlacementInfo *rule_info, optional_yield y);
int select_legacy_bucket_placement(const DoutPrefixProvider *dpp, RGWZonePlacementInfo *rule_info, optional_yield y);
- int select_new_bucket_location(const DoutPrefixProvider *dpp, const RGWUserInfo& user_info, const string& zonegroup_id,
+ int select_new_bucket_location(const DoutPrefixProvider *dpp, const RGWUserInfo& user_info, const std::string& zonegroup_id,
const rgw_placement_rule& rule,
rgw_placement_rule *pselected_rule_name, RGWZonePlacementInfo *rule_info,
optional_yield y);
int add_bucket_placement(const DoutPrefixProvider *dpp, const rgw_pool& new_pool, optional_yield y);
int remove_bucket_placement(const DoutPrefixProvider *dpp, const rgw_pool& old_pool, optional_yield y);
- int list_placement_set(const DoutPrefixProvider *dpp, set<rgw_pool>& names, optional_yield y);
+ int list_placement_set(const DoutPrefixProvider *dpp, std::set<rgw_pool>& names, optional_yield y);
bool is_meta_master() const;
bool can_reshard() const;
bool is_syncing_bucket_meta(const rgw_bucket& bucket);
- int list_zonegroups(const DoutPrefixProvider *dpp, list<string>& zonegroups);
- int list_regions(const DoutPrefixProvider *dpp, list<string>& regions);
- int list_zones(const DoutPrefixProvider *dpp, list<string>& zones);
- int list_realms(const DoutPrefixProvider *dpp, list<string>& realms);
- int list_periods(const DoutPrefixProvider *dpp, list<string>& periods);
- int list_periods(const DoutPrefixProvider *dpp, const string& current_period, list<string>& periods, optional_yield y);
+ int list_zonegroups(const DoutPrefixProvider *dpp, std::list<std::string>& zonegroups);
+ int list_regions(const DoutPrefixProvider *dpp, std::list<std::string>& regions);
+ int list_zones(const DoutPrefixProvider *dpp, std::list<std::string>& zones);
+ int list_realms(const DoutPrefixProvider *dpp, std::list<std::string>& realms);
+ int list_periods(const DoutPrefixProvider *dpp, std::list<std::string>& periods);
+ int list_periods(const DoutPrefixProvider *dpp, const std::string& current_period, std::list<std::string>& periods, optional_yield y);
};
#include "rgw/rgw_zone.h"
+using namespace std;
+
int RGWSI_ZoneUtils::do_start(optional_yield, const DoutPrefixProvider *dpp)
{
init_unique_trans_id_deps();
RGWSI_RADOS *rados_svc{nullptr};
RGWSI_Zone *zone_svc{nullptr};
- string trans_id_suffix;
+ std::string trans_id_suffix;
void init(RGWSI_RADOS *_rados_svc,
RGWSI_Zone *_zone_svc) {
public:
RGWSI_ZoneUtils(CephContext *cct): RGWServiceInstance(cct) {}
- string gen_host_id();
- string unique_id(uint64_t unique_num);
+ std::string gen_host_id();
+ std::string unique_id(uint64_t unique_num);
- string unique_trans_id(const uint64_t unique_num);
+ std::string unique_trans_id(const uint64_t unique_num);
};