diff options
author | Samuel Just <sjust@redhat.com> | 2019-04-04 01:58:15 +0200 |
---|---|---|
committer | sjust@redhat.com <sjust@redhat.com> | 2019-05-01 20:22:25 +0200 |
commit | 2e06118f4936c8cd6495e77da0576f03cfc251d5 (patch) | |
tree | 854c9e45fba925e0fa4fa37b691558eeae664832 /src/osd/PrimaryLogPG.cc | |
parent | osd/: clean up PeeringState::write_if_dirty (diff) | |
download | ceph-2e06118f4936c8cd6495e77da0576f03cfc251d5.tar.xz ceph-2e06118f4936c8cd6495e77da0576f03cfc251d5.zip |
osd/: move ostream<< and dump logic into PeeringState
Signed-off-by: Samuel Just <sjust@redhat.com>
Diffstat (limited to 'src/osd/PrimaryLogPG.cc')
-rw-r--r-- | src/osd/PrimaryLogPG.cc | 49 |
1 files changed, 1 insertions, 48 deletions
diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index a1a020b381f..794a8bd58ae 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -996,56 +996,9 @@ int PrimaryLogPG::do_command( cmd_getval(cct, cmdmap, "cmd", command); if (command == "query") { f->open_object_section("pg"); - f->dump_string("state", pg_state_string(get_state())); f->dump_stream("snap_trimq") << snap_trimq; f->dump_unsigned("snap_trimq_len", snap_trimq.size()); - f->dump_unsigned("epoch", get_osdmap_epoch()); - f->open_array_section("up"); - for (vector<int>::iterator p = up.begin(); p != up.end(); ++p) - f->dump_unsigned("osd", *p); - f->close_section(); - f->open_array_section("acting"); - for (vector<int>::iterator p = acting.begin(); p != acting.end(); ++p) - f->dump_unsigned("osd", *p); - f->close_section(); - if (!backfill_targets.empty()) { - f->open_array_section("backfill_targets"); - for (set<pg_shard_t>::iterator p = backfill_targets.begin(); - p != backfill_targets.end(); - ++p) - f->dump_stream("shard") << *p; - f->close_section(); - } - if (!async_recovery_targets.empty()) { - f->open_array_section("async_recovery_targets"); - for (set<pg_shard_t>::iterator p = async_recovery_targets.begin(); - p != async_recovery_targets.end(); - ++p) - f->dump_stream("shard") << *p; - f->close_section(); - } - if (!acting_recovery_backfill.empty()) { - f->open_array_section("acting_recovery_backfill"); - for (set<pg_shard_t>::iterator p = acting_recovery_backfill.begin(); - p != acting_recovery_backfill.end(); - ++p) - f->dump_stream("shard") << *p; - f->close_section(); - } - f->open_object_section("info"); - _update_calc_stats(); - info.dump(f.get()); - f->close_section(); - - f->open_array_section("peer_info"); - for (map<pg_shard_t, pg_info_t>::iterator p = peer_info.begin(); - p != peer_info.end(); - ++p) { - f->open_object_section("info"); - f->dump_stream("peer") << p->first; - p->second.dump(f.get()); - f->close_section(); - } + recovery_state.dump_peering_state(f.get()); f->close_section(); f->open_array_section("recovery_state"); |