]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon/MonClient: extract MonSub out 23688/head
authorKefu Chai <kchai@redhat.com>
Wed, 22 Aug 2018 11:14:30 +0000 (19:14 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 22 Aug 2018 13:12:52 +0000 (21:12 +0800)
commitea9c881ec6d70c4c0a9255b71d3e506163f18429
tree28d854cec3dadbd800b7e4c41020b0e78441c725
parenta5735b8718407a9fe21185188b7022b184801d56
mon/MonClient: extract MonSub out

MonSub is extracted so crimson/mon/MonClient can reuse it.

also, it's more readable this way:

- use ceph::coarse_mono_time instead of utime_t for renew_sent, and
  renew_after timestamps
- modernize the code using C++17
  * use range-based loop
  * use structured-bind
- fix the anti-pattern of map.count(foo) and then map[foo], use
  auto i = map.find(foo); instead.
- some logging messages are dropped in this refactory, but they are
  printed only when talking with pre-infernalis monitor.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/CMakeLists.txt
src/mon/MonClient.cc
src/mon/MonClient.h
src/mon/MonSub.cc [new file with mode: 0644]
src/mon/MonSub.h [new file with mode: 0644]