]> 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>
Fri, 30 Sep 2016 17:16:38 +0000 (10:16 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Conflicts:
src/rgw/rgw_admin.cc

src/rgw/rgw_admin.cc

index 1fa9dbe4f807acdf3d15967efe90c2a703fb7e0f..1eef84c2ab77787b2dd5559cca18456a53e130f9 100644 (file)
@@ -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<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;
@@ -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();