OPTION(rgw_data_log_obj_prefix, OPT_STR, "data_log") //
OPTION(rgw_replica_log_obj_prefix, OPT_STR, "replica_log") //
+OPTION(rgw_bucket_quota_ttl, OPT_INT, 600) // time for cached bucket stats to be cached within rgw instance
+
OPTION(mutex_perf_counter, OPT_BOOL, false) // enable/disable mutex perf counter
// This will be set to true when it is safe to start threads.
if (ret < 0 && ret != -ENOENT)
return ret;
- qs.expiration = ceph_clock_now(store->ctx()) + store->ctx()->_conf->rgw_bucket_quota_ttl;
+ qs.expiration = ceph_clock_now(store->ctx());
+ qs.expiration += store->ctx()->_conf->rgw_bucket_quota_ttl;
stats_map.add(bucket, qs);
utime_t expiration;
};
+struct RGWQuotaInfo {
+ uint64_t max_kb;
+ uint64_t max_objs;
+ bool is_set;
+
+ RGWQuotaInfo() : max_kb(0), max_objs(0), is_set(false) {}
+
+ void encode(bufferlist& bl) const {
+ ENCODE_START(1, 1, bl);
+ ::encode(max_kb, bl);
+ ::encode(max_objs, bl);
+ ::encode(is_set, bl);
+ ENCODE_FINISH(bl);
+ }
+ void decode(bufferlist::iterator& bl) {
+ DECODE_START(1, bl);
+ ::decode(max_kb, bl);
+ ::decode(max_objs, bl);
+ ::decode(is_set, bl);
+ DECODE_FINISH(bl);
+ }
+};
+WRITE_CLASS_ENCODER(RGWQuotaInfo)
class RGWBucketStatsCache {
RGWRados *store;
RGWBucketStatsCache(RGWRados *_store) : store(_store), stats_map(10000) {}
int get_bucket_stats(rgw_bucket& bucket, RGWBucketStats& stats);
+ void adjust_bucket_stats(rgw_bucket& bucket, int objs_delta, uint64_t added_bytes, uint64_t removed_bytes);
};
-
#endif