}
bool RGWObjectExpirer::process_single_shard(const string& shard,
- const utime_t& last_run,
- const utime_t& round_start)
+ const utime_t& last_run,
+ const utime_t& round_start)
{
string marker;
string out_marker;
dout(5) << __func__ << "(): failed to acquire lock on " << shard << dendl;
return false;
}
+
do {
real_time rt_last = last_run.to_real_time();
real_time rt_start = round_start.to_real_time();
list<cls_timeindex_entry> entries;
ret = store->objexp_hint_list(shard, rt_last, rt_start,
- num_entries, marker, entries,
- &out_marker, &truncated);
+ num_entries, marker, entries,
+ &out_marker, &truncated);
if (ret < 0) {
- ldout(cct, 10) << "cannot get removal hints from shard: " << shard << dendl;
+ ldout(cct, 10) << "cannot get removal hints from shard: " << shard
+ << dendl;
continue;
}
}
/* Returns true if all shards have been processed successfully. */
-bool RGWObjectExpirer::inspect_all_shards(const utime_t& last_run, const utime_t& round_start)
+bool RGWObjectExpirer::inspect_all_shards(const utime_t& last_run,
+ const utime_t& round_start)
{
- utime_t shard_marker;
-
- CephContext *cct = store->ctx();
+ CephContext * const cct = store->ctx();
int num_shards = cct->_conf->rgw_objexp_hints_num_shards;
bool all_done = true;
protected:
RGWRados *store;
- int init_bucket_info(const string& tenant_name,
- const string& bucket_name,
- const string& bucket_id,
+ int init_bucket_info(const std::string& tenant_name,
+ const std::string& bucket_name,
+ const std::string& bucket_id,
RGWBucketInfo& bucket_info);
class OEWorker : public Thread {
Cond cond;
public:
- OEWorker(CephContext *_cct, RGWObjectExpirer *_oe) : cct(_cct), oe(_oe), lock("OEWorker") {}
+ OEWorker(CephContext * const cct,
+ RGWObjectExpirer * const oe)
+ : cct(cct),
+ oe(oe),
+ lock("OEWorker") {
+ }
+
void *entry();
void stop();
};
public:
explicit RGWObjectExpirer(RGWRados *_store)
- : store(_store)
- {}
+ : store(_store) {
+ }
int garbage_single_object(objexp_hint_entry& hint);
- void garbage_chunk(list<cls_timeindex_entry>& entries, /* in */
+ void garbage_chunk(std::list<cls_timeindex_entry>& entries, /* in */
bool& need_trim); /* out */
- void trim_chunk(const string& shard,
+ void trim_chunk(const std::string& shard,
const utime_t& from,
const utime_t& to,
const string& from_marker,