const string& end_marker,
uint64_t max,
bool need_stats,
- uint64_t default_amount)
+ bool *is_truncated,
+ uint64_t default_amount)
{
int ret;
buckets.clear();
f->close_section();
}
-void check_bad_user_bucket_mapping(RGWRados *store, const rgw_user& user_id, bool fix)
+void check_bad_user_bucket_mapping(RGWRados *store, const rgw_user& user_id,
+ bool fix)
{
RGWUserBuckets user_buckets;
bool done;
+ bool is_truncated;
string marker;
CephContext *cct = store->ctx();
size_t max_entries = cct->_conf->rgw_list_buckets_max_chunk;
do {
- int ret = rgw_read_user_buckets(store, user_id, user_buckets,
- marker, string(), max_entries, false);
+ int ret = rgw_read_user_buckets(store, user_id, user_buckets, marker,
+ string(), max_entries, false,
+ &is_truncated);
if (ret < 0) {
- ldout(store->ctx(), 0) << "failed to read user buckets: " << cpp_strerror(-ret) << dendl;
+ ldout(store->ctx(), 0) << "failed to read user buckets: "
+ << cpp_strerror(-ret) << dendl;
return;
}
RGWUserBuckets buckets;
string marker;
bool done;
+ bool is_truncated;
do {
- ret = rgw_read_user_buckets(store, user_id, buckets,
- marker, string(), max_entries, false);
+ ret = rgw_read_user_buckets(store, op_state.get_user_id(), buckets,
+ marker, string(), max_entries, false,
+ &is_truncated);
if (ret < 0)
return ret;
const string& end_marker,
uint64_t max,
bool need_stats,
+ bool* is_truncated,
uint64_t default_amount = 1000);
extern int rgw_link_bucket(RGWRados *store, const rgw_user& user_id, rgw_bucket& bucket, time_t creation_time, bool update_entrypoint = true);
RGWUserBuckets buckets;
uint64_t max_buckets = g_ceph_context->_conf->rgw_list_buckets_max_chunk;
+ bool is_truncated;
RGWRados* store = rgwlib.get_store();
uint64_t ix = 3;
rgw_user uid("testuser");
int rc = rgw_read_user_buckets(store, uid, buckets, marker, end_marker,
- max_buckets, true);
+ max_buckets, true, &is_truncated);
if (rc == 0) {
bucket_count = 0;
bucket_objcount = 0;
return 0;
}
- bool eof() { return ix == 0; }
+ bool eof() {
+ std::cout << "READDIR offset: " << *offset
+ << " is_truncated: " << is_truncated
+ << std::endl;
+ return !is_truncated;
+ }
}; /* RGWListBucketsRequest */
send_response();
}
- bool eof() { return ix == 0; }
+ bool eof() {
+ std::cout << "READDIR offset: " << *offset
+ << " next marker: " << next_marker
+ << " is_truncated: " << is_truncated
+ << std::endl;
+ return !is_truncated;
+ }
}; /* RGWReaddirRequest */
op_ret = rgw_read_user_buckets(store, s->user->user_id, buckets,
marker, end_marker, read_count,
- should_get_stats(), 0);
+ should_get_stats(), &is_truncated);
if (op_ret < 0) {
/* hmm.. something wrong here.. the user was authenticated, so it
should exist */
{
string marker;
bool done;
+ bool is_truncated;
uint64_t max_buckets = s->cct->_conf->rgw_list_buckets_max_chunk;
do {
RGWUserBuckets buckets;
- op_ret = rgw_read_user_buckets(store, s->user->user_id, buckets,
- marker, string(), max_buckets, false);
+ op_ret = rgw_read_user_buckets(store, s->user->user_id, buckets, marker,
+ string(), max_buckets, true, &is_truncated);
if (op_ret < 0) {
/* hmm.. something wrong here.. the user was authenticated, so it
should exist */
if (s->user->max_buckets) {
RGWUserBuckets buckets;
string marker;
+ bool is_truncated;
op_ret = rgw_read_user_buckets(store, s->user->user_id, buckets,
marker, string(), s->user->max_buckets,
- false);
+ false, &is_truncated);
if (op_ret < 0)
return op_ret;
uint64_t buckets_size;
uint64_t buckets_size_rounded;
map<string, bufferlist> attrs;
+ bool is_truncated;
public:
RGWListBuckets() : sent_data(false) {
CephContext *cct = store->ctx();
size_t max_entries = cct->_conf->rgw_list_buckets_max_chunk;
bool done;
+ bool is_truncated;
string marker;
int ret;
do {
RGWUserBuckets user_buckets;
- ret = rgw_read_user_buckets(store, user_id, user_buckets,
- marker, string(), max_entries, false);
+ ret = rgw_read_user_buckets(store, user_id, user_buckets, marker,
+ string(), max_entries, false, &is_truncated);
if (ret < 0) {
ldout(cct, 0) << "failed to read user buckets: ret=" << ret << dendl;
return ret;
vector<rgw_bucket> buckets_vec;
bool done;
+ bool is_truncated;
int ret;
CephContext *cct = store->ctx();
size_t max_buckets = cct->_conf->rgw_list_buckets_max_chunk;
do {
RGWUserBuckets user_buckets;
- ret = rgw_read_user_buckets(store, info.user_id, user_buckets,
- marker, string(), max_buckets, false);
+ ret = rgw_read_user_buckets(store, info.user_id, user_buckets, marker,
+ string(), max_buckets, false, &is_truncated);
if (ret < 0)
return ret;
}
bool done;
+ bool is_truncated;
string marker;
CephContext *cct = store->ctx();
size_t max_buckets = cct->_conf->rgw_list_buckets_max_chunk;
do {
RGWUserBuckets buckets;
- ret = rgw_read_user_buckets(store, uid, buckets,
- marker, string(), max_buckets, false);
+ ret = rgw_read_user_buckets(store, uid, buckets, marker, string(),
+ max_buckets, false, &is_truncated);
if (ret < 0) {
set_err_msg(err_msg, "unable to read user bucket info");
return ret;
}
bool done;
+ bool is_truncated;
string marker;
CephContext *cct = store->ctx();
size_t max_buckets = cct->_conf->rgw_list_buckets_max_chunk;
do {
- ret = rgw_read_user_buckets(store, user_id, buckets,
- marker, string(), max_buckets, false);
+ ret = rgw_read_user_buckets(store, user_id, buckets, marker, string(),
+ max_buckets, false, &is_truncated);
if (ret < 0) {
set_err_msg(err_msg, "could not get buckets for uid: " + user_id.to_str());
return ret;