#define dout_subsys ceph_subsys_rgw
-struct bucket_info_entry {
- RGWBucketInfo info;
- real_time mtime;
- map<string, bufferlist> attrs;
-};
-
-static RGWChainedCacheImpl<bucket_info_entry> binfo_cache;
-
void RGWDefaultZoneGroupInfo::dump(Formatter *f) const {
encode_json("default_zonegroup", default_zonegroup, f);
}
if (cr_registry) {
cr_registry->put();
}
+ delete binfo_cache;
}
/**
}
ldout(cct, 20) << __func__ << " bucket index max shards: " << bucket_index_max_shards << dendl;
- binfo_cache.init(this);
+ binfo_cache = new RGWChainedCacheImpl<bucket_info_entry>;
+ binfo_cache->init(this);
return ret;
}
string bucket_entry;
rgw_make_bucket_entry_name(tenant, bucket_name, bucket_entry);
- if (binfo_cache.find(bucket_entry, &e)) {
+ if (binfo_cache->find(bucket_entry, &e)) {
info = e.info;
if (pattrs)
*pattrs = e.attrs;
/* chain to both bucket entry point and bucket instance */
- if (!binfo_cache.put(this, bucket_entry, &e, cache_info_entries)) {
+ if (!binfo_cache->put(this, bucket_entry, &e, cache_info_entries)) {
ldout(cct, 20) << "couldn't put binfo cache entry, might have raced with data changes" << dendl;
}
class Finisher;
class RGWAsyncRadosProcessor;
+template <class T>
+class RGWChainedCacheImpl;
+
+struct bucket_info_entry {
+ RGWBucketInfo info;
+ real_time mtime;
+ map<string, bufferlist> attrs;
+};
+
class RGWRados
{
friend class RGWGC;
RWLock handle_lock;
std::map<pthread_t, int> rados_map;
+ using RGWChainedCacheImpl_bucket_info_entry = RGWChainedCacheImpl<bucket_info_entry>;
+ RGWChainedCacheImpl_bucket_info_entry *binfo_cache;
+
librados::IoCtx gc_pool_ctx; // .rgw.gc
librados::IoCtx objexp_pool_ctx;
max_bucket_id(0), cct(NULL),
rados(NULL), next_rados_handle(0),
num_rados_handles(0), handle_lock("rados_handle_lock"),
+ binfo_cache(NULL),
pools_initialized(false),
quota_handler(NULL),
finisher(NULL),