]> git.proxmox.com Git - ceph.git/blame - ceph/src/messages/MMonHealth.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / messages / MMonHealth.h
CommitLineData
7c673cae
FG
1// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2// vim: ts=8 sw=2 smarttab
3/*
4 * Ceph - scalable distributed file system
5 *
6 * Copyright (C) 2012 Inktank, Inc.
7 *
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
12 *
13 */
14#ifndef CEPH_MMON_HEALTH_H
15#define CEPH_MMON_HEALTH_H
16
17#include "msg/Message.h"
18#include "messages/MMonQuorumService.h"
19#include "mon/mon_types.h"
20
f67539c2 21class MMonHealth final : public MMonQuorumService {
11fdf7f2 22public:
11fdf7f2 23 static constexpr int HEAD_VERSION = 1;
7c673cae 24
d2e6a577
FG
25 int service_type = 0;
26 int service_op = 0;
7c673cae
FG
27
28 // service specific data
29 DataStats data_stats;
30
9f95a23c 31 MMonHealth() : MMonQuorumService{MSG_MON_HEALTH, HEAD_VERSION} { }
7c673cae
FG
32
33private:
f67539c2 34 ~MMonHealth() final { }
7c673cae
FG
35
36public:
11fdf7f2 37 std::string_view get_type_name() const override { return "mon_health"; }
f67539c2 38 void print(std::ostream &o) const override {
11fdf7f2
TL
39 o << "mon_health("
40 << " e " << get_epoch()
41 << " r " << get_round()
7c673cae
FG
42 << " )";
43 }
44
7c673cae 45 void decode_payload() override {
f67539c2 46 using ceph::decode;
11fdf7f2 47 auto p = payload.cbegin();
7c673cae 48 service_decode(p);
11fdf7f2
TL
49 decode(service_type, p);
50 decode(service_op, p);
51 decode(data_stats, p);
7c673cae
FG
52 }
53
54 void encode_payload(uint64_t features) override {
11fdf7f2 55 using ceph::encode;
7c673cae 56 service_encode();
11fdf7f2
TL
57 encode(service_type, payload);
58 encode(service_op, payload);
59 encode(data_stats, payload);
7c673cae 60 }
7c673cae
FG
61};
62
63#endif /* CEPH_MMON_HEALTH_H */