]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_admin: better bucket reshard logging
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 27 Sep 2016 21:35:31 +0000 (14:35 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Wed, 19 Oct 2016 15:41:49 +0000 (08:41 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_admin.cc

index 6eead05f25bdbe429da364db69247bc505c7cb22..58600a791b26c9f1ca4c591347e3dad5a334ecaf 100644 (file)
@@ -4918,6 +4918,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();
@@ -4931,6 +4933,12 @@ next:
 
         list<rgw_cls_bi_entry>::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;
@@ -4954,9 +4962,9 @@ next:
           if (ret < 0) {
             return ret;
           }
+          formatter->close_section();
+          formatter->flush(cout);
         }
-
-        formatter->flush(cout);
       }
     }
     formatter->close_section();