]> git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MOSDFull.h
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / messages / MOSDFull.h
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_MOSDFULL_H
5 #define CEPH_MOSDFULL_H
6
7 #include "messages/PaxosServiceMessage.h"
8 #include "osd/OSDMap.h"
9
10 // tell the mon to update the full/nearfull bits. note that in the
11 // future this message could be generalized to other state bits, but
12 // for now name it for its sole application.
13
14 class MOSDFull : public MessageInstance<MOSDFull, PaxosServiceMessage> {
15 public:
16 friend factory;
17
18 epoch_t map_epoch = 0;
19 uint32_t state = 0;
20
21 private:
22 ~MOSDFull() {}
23
24 public:
25 MOSDFull(epoch_t e, unsigned s)
26 : MessageInstance(MSG_OSD_FULL, e), map_epoch(e), state(s) { }
27 MOSDFull()
28 : MessageInstance(MSG_OSD_FULL, 0) {}
29
30 public:
31 void encode_payload(uint64_t features) {
32 using ceph::encode;
33 paxos_encode();
34 encode(map_epoch, payload);
35 encode(state, payload);
36 }
37 void decode_payload() {
38 auto p = payload.cbegin();
39 paxos_decode(p);
40 decode(map_epoch, p);
41 decode(state, p);
42 }
43
44 std::string_view get_type_name() const { return "osd_full"; }
45 void print(ostream &out) const {
46 set<string> states;
47 OSDMap::calc_state_set(state, states);
48 out << "osd_full(e" << map_epoch << " " << states << " v" << version << ")";
49 }
50
51 };
52
53 #endif