]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mgr: use a struct for DaemonKey
authorKefu Chai <kchai@redhat.com>
Sun, 29 Sep 2019 09:28:28 +0000 (17:28 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 30 Sep 2019 03:05:54 +0000 (11:05 +0800)
commit5aac7eba36be99861eb8726872e339ff55360f47
tree0991102e77e0fe87efb72aa3199a42a78d639682
parentdd96fdcc5f43ed456a6c23df083de7a53847c415
mgr: use a struct for DaemonKey

instead of using `std::pair<>` for presenting it. there are three
advantages:

1. better names for readability: `type` and `name` are better names
   than `first` and `second`
2. so we can specliaze its behavior by its type: define
   `operator<<` once, and use it everywhere. no need to worry
   about ADL to pickup the generic operator of `operator<< (..., pair<>)`
   anymore. so we can safely use `<< key`, and no need to
   use `<< key.first << '.' << key.second`. kill the printed form of
   `osd,1` once and for all, all of them are now "osd.1".
3. consolidate the print/parse in a single place

Fixes: https://tracker.ceph.com/issues/42079
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mgr/ActivePyModules.cc
src/mgr/CMakeLists.txt
src/mgr/DaemonHealthMetricCollector.cc
src/mgr/DaemonHealthMetricCollector.h
src/mgr/DaemonKey.cc [new file with mode: 0644]
src/mgr/DaemonKey.h [new file with mode: 0644]
src/mgr/DaemonServer.cc
src/mgr/DaemonState.cc
src/mgr/DaemonState.h
src/mgr/Mgr.cc