#pragma once
+#include "common/RWLock.h"
#include "rgw/rgw_service.h"
#include "rgw/rgw_cache.h"
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);
}