}
PGBackend::interruptible_future<std::tuple<std::vector<hobject_t>, hobject_t>>
-PGBackend::list_objects(const hobject_t& start, uint64_t limit) const
+PGBackend::list_objects(
+ const hobject_t& start, const hobject_t &end, uint64_t limit) const
{
auto gstart = start.is_min() ? ghobject_t{} : ghobject_t{start, 0, shard};
+ auto gend = end.is_max() ? ghobject_t::get_max() : ghobject_t{end, 0, shard};
return interruptor::make_interruptible(store->list_objects(coll,
gstart,
- ghobject_t::get_max(),
+ gend,
limit))
.then_interruptible([](auto ret) {
auto& [gobjects, next] = ret;
epoch_t min_epoch,
epoch_t map_epoch,
std::vector<pg_log_entry_t>&& log_entries);
+
+ /**
+ * list_objects
+ *
+ * List a prefix of length up to limit of the ordered set of logical
+ * librados objects in [start, end) stored by the PG.
+ *
+ * Output excludes objects maintained locally on each pg instance such as:
+ * - pg_meta object (see hobject_t::is_pgmeta, ghobject_t::make_pgmeta)
+ * - snap mapper
+ * as well as
+ * - temp objects (see hobject_t::is_temp(), hobject_t::make_temp_hobject())
+ * - ec rollback objects (see ghobject_t::is_no_gen)
+ *
+ * @param [in] start inclusive beginning of range
+ * @param [in] end exclusive end of range
+ * @param [in] limit upper bound on number of objects to return
+ * @return pair<object_list, next> where object_list is the output list
+ * above and next is > the elements in object_list and <= the
+ * least eligible object in the pg > the elements in object_list
+ */
interruptible_future<std::tuple<std::vector<hobject_t>, hobject_t>> list_objects(
const hobject_t& start,
+ const hobject_t& end,
uint64_t limit) const;
+ interruptible_future<std::tuple<std::vector<hobject_t>, hobject_t>> list_objects(
+ const hobject_t& start,
+ uint64_t limit) const {
+ return list_objects(start, hobject_t::get_max(), limit);
+ }
+ interruptible_future<std::tuple<std::vector<hobject_t>, hobject_t>> list_objects(
+ const hobject_t& start,
+ const hobject_t& end) {
+ return list_objects(start, end, std::numeric_limits<uint64_t>::max());
+ }
+
using setxattr_errorator = crimson::errorator<
crimson::ct_error::file_too_large,
crimson::ct_error::enametoolong>;