return 0;
}
-int RGWOrphanSearch::init(const string& job_name, RGWOrphanSearchInfo *info) {
+int RGWOrphanSearch::init(const string& job_name, RGWOrphanSearchInfo *info, bool detailed_mode)
+{
int r = orphan_store.init();
if (r < 0) {
return r;
max_list_bucket_entries = std::max(store->ctx()->_conf->rgw_list_bucket_min_readahead,
MAX_LIST_OBJS_ENTRIES);
+ detailed_mode = detailed_mode;
RGWOrphanSearchState state;
r = orphan_store.read_job(job_name, state);
if (r < 0 && r != -ENOENT) {
} else {
RGWObjManifest& manifest = result.manifest;
+ if (!detailed_mode &&
+ manifest.get_obj_size() <= manifest.get_head_size()) {
+ ldout(store->ctx(), 5) << "skipping object as it fits in a head" << dendl;
+ return 0;
+ }
+
RGWObjManifest::obj_iterator miter;
for (miter = manifest.obj_begin(); miter != manifest.obj_end(); ++miter) {
const rgw_raw_obj& loc = miter.get_location().get_raw_obj(store);
}
ldout(store->ctx(), 20) << __func__ << ": entry.key.name=" << entry.key.name << " entry.key.instance=" << entry.key.instance << dendl;
+
+ if (!detailed_mode &&
+ entry.meta.accounted_size <= (uint64_t)store->ctx()->_conf->rgw_max_chunk_size) {
+ ldout(store->ctx(),5) << __func__ << "skipping stat as the object " << entry.key.name
+ << "fits in a head" << dendl;
+ continue;
+ }
+
rgw_obj obj(bucket_info.bucket, entry.key);
RGWRados::Object op_target(store, bucket_info, obj_ctx, obj);
uint16_t max_concurrent_ios;
uint64_t stale_secs;
- uint64_t max_list_obj_entries;
+ int64_t max_list_bucket_entries;
+
+ bool detailed_mode;
struct log_iter_info {
string oid;
return orphan_store.write_job(search_info.job_name, state);
}
- int init(const string& job_name, RGWOrphanSearchInfo *info);
+ int init(const string& job_name, RGWOrphanSearchInfo *info, bool detailed_mode=false);
int create(const string& job_name, int num_shards);