cerr << "ERROR: driver->list_objects(): " << cpp_strerror(-ret) << std::endl;
return -ret;
}
+ ldpp_dout(dpp(), 20) << "INFO: " << __func__ <<
+ ": list() returned without error; results.objs.sizie()=" <<
+ results.objs.size() << "results.is_truncated=" << results.is_truncated << ", marker=" <<
+ params.marker << dendl;
count += results.objs.size();
}
formatter->flush(cout);
} while (results.is_truncated && count < max_entries);
+ ldpp_dout(dpp(), 20) << "INFO: " << __func__ << ": done" << dendl;
formatter->close_section();
formatter->flush(cout);
}
rgw_cls_bi_entry entry;
-
ret = static_cast<rgw::sal::RadosStore*>(driver)->getRados()->bi_get(dpp(), bucket->get_info(), obj, bi_index_type, &entry);
if (ret < 0) {
cerr << "ERROR: bi_get(): " << cpp_strerror(-ret) << std::endl;
cerr << "ERROR: bucket name not specified" << std::endl;
return EINVAL;
}
+
int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket);
if (ret < 0) {
cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
- list<rgw_cls_bi_entry> entries;
+ std::list<rgw_cls_bi_entry> entries;
bool is_truncated;
+ const auto& index = bucket->get_info().layout.current_index;
+ const int max_shards = rgw::num_shards(index);
if (max_entries < 0) {
max_entries = 1000;
}
- const auto& index = bucket->get_info().layout.current_index;
- const int max_shards = rgw::num_shards(index);
+ ldpp_dout(dpp(), 20) << "INFO: " << __func__ << ": max_entries=" << max_entries <<
+ ", index=" << index << ", max_shards=" << max_shards << dendl;
formatter->open_array_section("entries");
int i = (specified_shard_id ? shard_id : 0);
for (; i < max_shards; i++) {
+ ldpp_dout(dpp(), 20) << "INFO: " << __func__ << ": starting shard=" << i << dendl;
+
RGWRados::BucketShard bs(static_cast<rgw::sal::RadosStore*>(driver)->getRados());
int ret = bs.init(dpp(), bucket->get_info(), index, i);
marker.clear();
cerr << "ERROR: bi_list(): " << cpp_strerror(-ret) << std::endl;
return -ret;
}
+ ldpp_dout(dpp(), 20) << "INFO: " << __func__ <<
+ ": bi_list() returned without error; entries.size()=" <<
+ entries.size() << ", is_truncated=" << is_truncated <<
+ ", marker=" << marker << dendl;
- list<rgw_cls_bi_entry>::iterator iter;
- for (iter = entries.begin(); iter != entries.end(); ++iter) {
- rgw_cls_bi_entry& entry = *iter;
+ for (const auto& entry : entries) {
encode_json("entry", entry, formatter.get());
marker = entry.idx;
}
formatter->flush(cout);
} while (is_truncated);
+
formatter->flush(cout);
- if (specified_shard_id)
+ if (specified_shard_id) {
break;
+ }
}
+ ldpp_dout(dpp(), 20) << "INFO: " << __func__ << ": done" << dendl;
+
formatter->close_section();
formatter->flush(cout);
}
uint32_t num_shards = 1;
BucketHashType hash_type = BucketHashType::Mod;
-};
+ friend std::ostream& operator<<(std::ostream& out, const bucket_index_normal_layout& l) {
+ out << "num_shards=" << l.num_shards << ", hash_type=" << to_string(l.hash_type);
+ return out;
+ }
+};
inline bool operator==(const bucket_index_normal_layout& l,
const bucket_index_normal_layout& r) {
// TODO: variant of layout types?
bucket_index_normal_layout normal;
+
+ friend std::ostream& operator<<(std::ostream& out, const bucket_index_layout& l) {
+ out << "type=" << to_string(l.type) << ", normal=" << l.normal;
+ return out;
+ }
};
inline bool operator==(const bucket_index_layout& l,
struct bucket_index_layout_generation {
uint64_t gen = 0;
bucket_index_layout layout;
+
+ friend std::ostream& operator<<(std::ostream& out, const bucket_index_layout_generation& g) {
+ out << "gen=" << g.gen;
+ return out;
+ }
};
inline bool operator==(const bucket_index_layout_generation& l,
BucketLogType type = BucketLogType::InIndex;
bucket_index_log_layout in_index;
+
+ friend std::ostream& operator<<(std::ostream& out, const bucket_log_layout& l) {
+ out << "type=" << to_string(l.type);
+ return out;
+ }
};
void encode(const bucket_log_layout& l, bufferlist& bl, uint64_t f=0);
struct bucket_log_layout_generation {
uint64_t gen = 0;
bucket_log_layout layout;
+
+ friend std::ostream& operator<<(std::ostream& out, const bucket_log_layout_generation& g) {
+ out << "gen=" << g.gen << ", layout=[ " << g.layout << " ]";
+ return out;
+ }
};
void encode(const bucket_log_layout_generation& l, bufferlist& bl, uint64_t f=0);
// history of untrimmed bucket log layout generations, with the current
// generation at the back()
std::vector<bucket_log_layout_generation> logs;
+
+ friend std::ostream& operator<<(std::ostream& out, const BucketLayout& l) {
+ std::stringstream ss;
+ if (l.target_index) {
+ ss << *l.target_index;
+ } else {
+ ss << "none";
+ }
+ out << "resharding=" << to_string(l.resharding) <<
+ ", current_index=[" << l.current_index << "], target_index=[" <<
+ ss.str() << "], logs.size()=" << l.logs.size();
+
+ return out;
+ }
};
void encode(const BucketLayout& l, bufferlist& bl, uint64_t f=0);