]>
Commit | Line | Data |
---|---|---|
224ce89b WB |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | ||
4 | #ifndef CEPH_MMON_HEALTH_CHECKS_H | |
5 | #define CEPH_MMON_HEALTH_CHECKS_H | |
6 | ||
7 | #include "messages/PaxosServiceMessage.h" | |
8 | #include "mon/health_check.h" | |
9 | ||
f67539c2 | 10 | class MMonHealthChecks final : public PaxosServiceMessage { |
11fdf7f2 | 11 | public: |
11fdf7f2 TL |
12 | static constexpr int HEAD_VERSION = 1; |
13 | static constexpr int COMPAT_VERSION = 1; | |
224ce89b WB |
14 | |
15 | health_check_map_t health_checks; | |
16 | ||
17 | MMonHealthChecks() | |
9f95a23c | 18 | : PaxosServiceMessage{MSG_MON_HEALTH_CHECKS, HEAD_VERSION, COMPAT_VERSION} { |
224ce89b WB |
19 | } |
20 | MMonHealthChecks(health_check_map_t& m) | |
9f95a23c TL |
21 | : PaxosServiceMessage{MSG_MON_HEALTH_CHECKS, HEAD_VERSION, COMPAT_VERSION}, |
22 | health_checks(m) | |
23 | {} | |
224ce89b WB |
24 | |
25 | private: | |
f67539c2 | 26 | ~MMonHealthChecks() final { } |
224ce89b WB |
27 | |
28 | public: | |
11fdf7f2 | 29 | std::string_view get_type_name() const override { return "mon_health_checks"; } |
f67539c2 | 30 | void print(std::ostream &o) const override { |
224ce89b WB |
31 | o << "mon_health_checks(" << health_checks.checks.size() << " checks)"; |
32 | } | |
33 | ||
34 | void decode_payload() override { | |
f67539c2 | 35 | using ceph::decode; |
11fdf7f2 | 36 | auto p = payload.cbegin(); |
224ce89b | 37 | paxos_decode(p); |
11fdf7f2 | 38 | decode(health_checks, p); |
224ce89b WB |
39 | } |
40 | ||
41 | void encode_payload(uint64_t features) override { | |
11fdf7f2 | 42 | using ceph::encode; |
224ce89b | 43 | paxos_encode(); |
11fdf7f2 | 44 | encode(health_checks, payload); |
224ce89b | 45 | } |
9f95a23c TL |
46 | private: |
47 | template<class T, typename... Args> | |
48 | friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args); | |
224ce89b WB |
49 | }; |
50 | ||
51 | #endif |