Partially fixes #8858.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
do {
list<rgw_bi_log_entry> entries;
ret = store->list_objects(bucket, max_entries - count, prefix, delim,
- marker, result, common_prefixes, true,
+ marker, NULL, result, common_prefixes, true,
ns, false, &truncated, NULL);
if (ret < 0) {
cerr << "ERROR: store->list_objects(): " << cpp_strerror(-ret) << std::endl;
if (delete_children) {
int max = 1000;
- ret = store->list_objects(bucket, max, prefix, delim, marker,
+ ret = store->list_objects(bucket, max, prefix, delim, marker, NULL,
objs, common_prefixes,
false, ns, true, NULL, NULL);
}
objs.clear();
- ret = store->list_objects(bucket, max, prefix, delim, marker, objs, common_prefixes,
+ ret = store->list_objects(bucket, max, prefix, delim, marker, NULL, objs, common_prefixes,
false, ns, true, NULL, NULL);
if (ret < 0)
return ret;
do {
vector<RGWObjEnt> result;
- int r = store->list_objects(bucket, max, prefix, delim, marker,
+ int r = store->list_objects(bucket, max, prefix, delim, marker, NULL,
result, common_prefixes, false,
ns, true,
&is_truncated, NULL);
do {
#define MAX_LIST_OBJS 100
- int r = store->list_objects(bucket, MAX_LIST_OBJS, obj_prefix, delim, marker,
+ int r = store->list_objects(bucket, MAX_LIST_OBJS, obj_prefix, delim, marker, NULL,
objs, common_prefixes,
true, no_ns, true, &is_truncated, NULL);
if (r < 0)
if (ret < 0)
return;
- ret = store->list_objects(s->bucket, max, prefix, delimiter, marker, objs, common_prefixes,
+ string *pnext_marker = (delimiter.empty() ? NULL : &next_marker);
+
+ ret = store->list_objects(s->bucket, max, prefix, delimiter, marker, pnext_marker, objs, common_prefixes,
!!(s->prot_flags & RGW_REST_SWIFT), no_ns, true, &is_truncated, NULL);
}
}
}
marker_meta = marker.get_meta();
- ret = store->list_objects(s->bucket, max_uploads, prefix, delimiter, marker_meta, objs, common_prefixes,
+ ret = store->list_objects(s->bucket, max_uploads, prefix, delimiter, marker_meta, NULL, objs, common_prefixes,
!!(s->prot_flags & RGW_REST_SWIFT), mp_ns, true, &is_truncated, &mp_filter);
if (!objs.empty()) {
vector<RGWObjEnt>::iterator iter;
protected:
string prefix;
string marker;
+ string next_marker;
string max_keys;
string delimiter;
int max;
* here.
*/
int RGWRados::list_objects(rgw_bucket& bucket, int max, string& prefix, string& delim,
- string& marker, vector<RGWObjEnt>& result, map<string, bool>& common_prefixes,
+ string& marker, string *next_marker, vector<RGWObjEnt>& result,
+ map<string, bool>& common_prefixes,
bool get_content_type, string& ns, bool enforce_ns,
bool *is_truncated, RGWAccessListFilter *filter)
{
continue;
}
+ if (next_marker) {
+ *next_marker = obj;
+ }
+
if (filter && !filter->filter(obj, key))
continue;
* here.
*/
virtual int list_objects(rgw_bucket& bucket, int max, std::string& prefix, std::string& delim,
- std::string& marker, std::vector<RGWObjEnt>& result, map<string, bool>& common_prefixes,
- bool get_content_type, string& ns, bool enforce_ns, bool *is_truncated, RGWAccessListFilter *filter);
+ std::string& marker, std::string *next_marker, std::vector<RGWObjEnt>& result,
+ map<string, bool>& common_prefixes, bool get_content_type, string& ns, bool enforce_ns,
+ bool *is_truncated, RGWAccessListFilter *filter);
virtual int create_pool(rgw_bucket& bucket);
if (!prefix.empty())
s->formatter->dump_string("Prefix", prefix);
s->formatter->dump_string("Marker", marker);
+ if (is_truncated && !next_marker.empty())
+ s->formatter->dump_string("NextMarker", next_marker);
s->formatter->dump_int("MaxKeys", max);
if (!delimiter.empty())
s->formatter->dump_string("Delimiter", delimiter);