return rc;
}
+void dump_buckets(void) {
+ /* get the bucket list */
+ string marker; // XXX need to match offset
+ string end_marker;
+ uint64_t bucket_count, bucket_objcount;
+
+ RGWUserBuckets buckets;
+ uint64_t max_buckets = g_ceph_context->_conf->rgw_list_buckets_max_chunk;
+
+ RGWRados* store = librgw.get_store();
+
+ /* XXX check offsets */
+ uint64_t ix = 3;
+ rgw_user uid("testuser");
+ int rc = rgw_read_user_buckets(store, uid, buckets, marker, end_marker,
+ max_buckets, true);
+ if (rc == 0) {
+ bucket_count = 0;
+ bucket_objcount = 0;
+ map<string, RGWBucketEnt>& m = buckets.get_buckets();
+ for (auto& ib : m) {
+ RGWBucketEnt& bent = ib.second;
+ bucket_objcount += bent.count;
+ marker = ib.first;
+ std::cout << bent.bucket.name.c_str() << " ix: " << ix++ << std::endl;
+ }
+ bucket_count += m.size();
+ }
+} /* dump_buckets */
+
/*
lookup object by name (POSIX style)
*/
ASSERT_NE(fs, nullptr);
}
+extern "C" {
+extern void dump_buckets(void);
+}
+
+TEST(LibRGW, DUMP_BUCKETS) {
+ dump_buckets();
+}
+
extern "C" {
static bool r1_cb(const char* name, void *arg, uint64_t offset) {
// don't need arg--it would point to fids1
rgw_fh = get<2>(fid);
if (rgw_fh)
ret = rgw_fh_rele(fs, rgw_fh, 0 /* flags */);
+ ASSERT_EQ(ret, 0);
}
}
}