From: Yehuda Sadeh Date: Tue, 27 Sep 2016 21:35:31 +0000 (-0700) Subject: rgw_admin: better bucket reshard logging X-Git-Tag: v0.94.10~8^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=55e3e7742b22fd0f015f7439e7aeabdce1845caa;p=ceph.git rgw_admin: better bucket reshard logging Signed-off-by: Yehuda Sadeh Conflicts: src/rgw/rgw_admin.cc --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 1fa9dbe4f807..1eef84c2ab77 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -2730,6 +2730,8 @@ next: formatter->open_array_section("entries"); + uint64_t total_entries = 0; + for (int i = 0; i < num_source_shards; ++i) { bool is_truncated = true; marker.clear(); @@ -2743,6 +2745,12 @@ next: list::iterator iter; for (iter = entries.begin(); iter != entries.end(); ++iter) { + formatter->open_object_section("entry"); + + encode_json("shard_id", i, formatter); + encode_json("num_entry", total_entries, formatter); + total_entries++; + rgw_cls_bi_entry& entry = *iter; encode_json("entry", entry, formatter); marker = entry.idx; @@ -2767,9 +2775,9 @@ next: cerr << "ERROR: target_shards.add_entry(" << key << ") returned error: " << cpp_strerror(-ret) << std::endl; return ret; } + formatter->close_section(); + formatter->flush(cout); } - - formatter->flush(cout); } } formatter->close_section();