}
#ifndef CLS_CLIENT_HIDE_IOCTX
-int cls_2pc_queue_get_capacity(IoCtx& io_ctx, const string& queue_name, uint64_t& size) {
+int cls_2pc_queue_get_capacity(IoCtx& io_ctx, const std::string& queue_name, uint64_t& size) {
bufferlist in, out;
const auto r = io_ctx.exec(queue_name, TPC_QUEUE_CLASS, TPC_QUEUE_GET_CAPACITY, in, out);
if (r < 0 ) {
return 0;
}
-int cls_2pc_queue_reserve(IoCtx& io_ctx, const string& queue_name,
+int cls_2pc_queue_reserve(IoCtx& io_ctx, const std::string& queue_name,
uint64_t res_size, uint32_t entries, cls_2pc_reservation::id_t& res_id) {
bufferlist in, out;
cls_2pc_queue_reserve_op reserve_op;
}
#ifndef CLS_CLIENT_HIDE_IOCTX
-int cls_2pc_queue_list_entries(IoCtx& io_ctx, const string& queue_name, const string& marker, uint32_t max,
- std::vector<cls_queue_entry>& entries,
- bool *truncated, std::string& next_marker) {
+int cls_2pc_queue_list_entries(IoCtx& io_ctx,
+ const std::string& queue_name,
+ const std::string& marker, uint32_t max,
+ std::vector<cls_queue_entry>& entries,
+ bool *truncated, std::string& next_marker) {
bufferlist in, out;
cls_queue_list_op op;
op.start_marker = marker;
// rgw_rados_operate() should be called after the overloads w/o calls to io_ctx.operate()/exec()
#ifndef CLS_CLIENT_HIDE_IOCTX
// return capacity (bytes)
-int cls_2pc_queue_get_capacity(librados::IoCtx& io_ctx, const string& queue_name, uint64_t& size);
+int cls_2pc_queue_get_capacity(librados::IoCtx& io_ctx, const std::string& queue_name, uint64_t& size);
// make a reservation on the queue (in bytes) and number of expected entries (to calculate overhead)
// return a reservation id if reservations is possible, 0 otherwise
break;
default:
throw ceph::buffer::malformed_input(
- "unrecognized chunk ref encoding type "s + stringify((int)t));
+ std::string("unrecognized chunk ref encoding type ") +
+ stringify((int)t));
}
DECODE_FINISH(p);
}
chunk_refs_by_hash_t(const chunk_refs_by_object_t *o) {
total = o->count();
for (auto& i : o->by_object) {
- by_hash[make_pair(i.pool, i.get_hash())]++;
+ by_hash[std::make_pair(i.pool, i.get_hash())]++;
}
}
std::string describe_encoding() const {
- return "by_hash("s + stringify(hash_bits) + " bits)"s;
+ using namespace std::literals;
+ return "by_hash("s + stringify(hash_bits) + " bits)";
}
uint32_t mask() {
old.swap(by_hash);
auto m = mask();
for (auto& i : old) {
- by_hash[make_pair(i.first.first, i.first.second & m)] = i.second;
+ by_hash[std::make_pair(i.first.first, i.first.second & m)] = i.second;
}
return true;
}
return total;
}
void get(const hobject_t& o) override {
- by_hash[make_pair(o.pool, o.get_hash() & mask())]++;
+ by_hash[std::make_pair(o.pool, o.get_hash() & mask())]++;
++total;
}
bool put(const hobject_t& o) override {
- auto p = by_hash.find(make_pair(o.pool, o.get_hash() & mask()));
+ auto p = by_hash.find(std::make_pair(o.pool, o.get_hash() & mask()));
if (p == by_hash.end()) {
return false;
}
denc_signed_varint(poolid, p);
memcpy(&hash, p.get_pos_add(hash_bytes), hash_bytes);
denc_varint(count, p);
- by_hash[make_pair(poolid, (uint32_t)hash)] = count;
+ by_hash[std::make_pair(poolid, (uint32_t)hash)] = count;
}
DENC_FINISH(p);
}
struct chunk_refs_by_pool_t : public chunk_refs_t::refs_t {
uint64_t total = 0;
- map<int64_t,uint64_t> by_pool;
+ std::map<int64_t,uint64_t> by_pool;
chunk_refs_by_pool_t() {}
chunk_refs_by_pool_t(const chunk_refs_by_hash_t *o) {
struct list_part
{
- std::optional<string> tag;
+ std::optional<std::string> tag;
std::uint64_t ofs{0};
int max_entries{100};
}
};
WRITE_CLASS_ENCODER(objv)
-inline ostream& operator <<(std::ostream& os, const objv& objv)
+inline std::ostream& operator <<(std::ostream& os, const objv& objv)
{
return os << objv.to_str();
}
std::int64_t max_push_part_num{-1};
std::string head_tag;
- std::map<int64_t, string> tags;
+ std::map<int64_t, std::string> tags;
std::multimap<int64_t, journal_entry> journal;
#include "cls/lock/cls_lock_ops.h"
using namespace rados::cls::lock;
+using std::list;
+using std::map;
+using std::string;
static void generate_lock_id(locker_id_t& i, int n, const string& cookie)
{
#include "cls_lua.h"
#include "cls_lua_ops.h"
+using namespace std;
+
CLS_VER(1,0)
CLS_NAME(lua)
#include "cls/queue/cls_queue_const.h"
#include "cls/queue/cls_queue_client.h"
+using namespace std;
using namespace librados;
void cls_queue_init(ObjectWriteOperation& op, const string& queue_name, uint64_t size)
#include "cls_queue_ops.h"
#include "common/ceph_time.h"
-void cls_queue_init(librados::ObjectWriteOperation& op, const string& queue_name, uint64_t size);
-int cls_queue_get_capacity(librados::IoCtx& io_ctx, const string& oid, uint64_t& size);
-void cls_queue_enqueue(librados::ObjectWriteOperation& op, uint32_t expiration_secs, vector<bufferlist> bl_data_vec);
-int cls_queue_list_entries(librados::IoCtx& io_ctx, const string& oid, const string& marker, uint32_t max,
- vector<cls_queue_entry>& entries, bool *truncated, string& next_marker);
-void cls_queue_remove_entries(librados::ObjectWriteOperation& op, const string& end_marker);
+void cls_queue_init(librados::ObjectWriteOperation& op, const std::string& queue_name, uint64_t size);
+int cls_queue_get_capacity(librados::IoCtx& io_ctx, const std::string& oid, uint64_t& size);
+void cls_queue_enqueue(librados::ObjectWriteOperation& op, uint32_t expiration_secs, std::vector<bufferlist> bl_data_vec);
+int cls_queue_list_entries(librados::IoCtx& io_ctx, const std::string& oid, const std::string& marker, uint32_t max,
+ std::vector<cls_queue_entry>& entries, bool *truncated, std::string& next_marker);
+void cls_queue_remove_entries(librados::ObjectWriteOperation& op, const std::string& end_marker);
-#endif
\ No newline at end of file
+#endif
#include "cls/queue/cls_queue_const.h"
#include "cls/queue/cls_queue_src.h"
+using std::string;
using ceph::bufferlist;
using ceph::decode;
using ceph::encode;
#ifndef CLS_CLIENT_HIDE_IOCTX
int cls_rgw_lc_get_head(librados::IoCtx& io_ctx, const std::string& oid, cls_rgw_lc_obj_head& head);
int cls_rgw_lc_put_head(librados::IoCtx& io_ctx, const std::string& oid, cls_rgw_lc_obj_head& head);
-int cls_rgw_lc_get_next_entry(librados::IoCtx& io_ctx, const std::string& oid, string& marker, cls_rgw_lc_entry& entry);
+int cls_rgw_lc_get_next_entry(librados::IoCtx& io_ctx, const std::string& oid, std::string& marker, cls_rgw_lc_entry& entry);
int cls_rgw_lc_rm_entry(librados::IoCtx& io_ctx, const std::string& oid, const cls_rgw_lc_entry& entry);
int cls_rgw_lc_set_entry(librados::IoCtx& io_ctx, const std::string& oid, const cls_rgw_lc_entry& entry);
int cls_rgw_lc_get_entry(librados::IoCtx& io_ctx, const std::string& oid, const std::string& marker, cls_rgw_lc_entry& entry);
int cls_rgw_lc_list(librados::IoCtx& io_ctx, const std::string& oid,
const std::string& marker, uint32_t max_entries,
- vector<cls_rgw_lc_entry>& entries);
+ std::vector<cls_rgw_lc_entry>& entries);
#endif
/* resharding */
WRITE_CLASS_ENCODER(cls_rgw_lc_list_entries_op)
struct cls_rgw_lc_list_entries_ret {
- vector<cls_rgw_lc_entry> entries;
+ std::vector<cls_rgw_lc_entry> entries;
bool is_truncated{false};
uint8_t compat_v;
void encode(ceph::buffer::list& bl) const {
ENCODE_START(compat_v, 1, bl);
if (compat_v <= 2) {
- map<string, int> oes;
+ std::map<std::string, int> oes;
std::for_each(entries.begin(), entries.end(),
[&oes](const cls_rgw_lc_entry& elt)
{oes.insert({elt.bucket, elt.status});});
DECODE_START(3, bl);
compat_v = struct_v;
if (struct_v <= 2) {
- map<string, int> oes;
+ std::map<std::string, int> oes;
decode(oes, bl);
std::for_each(oes.begin(), oes.end(),
- [this](const std::pair<string, int>& oe)
+ [this](const std::pair<std::string, int>& oe)
{entries.push_back({oe.first, 0 /* start */,
uint32_t(oe.second)});});
} else {
f->dump_string("value", value.to_str());
}
-void cls_timeindex_entry::generate_test_instances(list<cls_timeindex_entry*>& o)
+void cls_timeindex_entry::generate_test_instances(std::list<cls_timeindex_entry*>& o)
{
cls_timeindex_entry *i = new cls_timeindex_entry;
i->key_ts = utime_t(0,0);