1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2017 Greg Farnum/Red Hat <gfarnum@redhat.com>
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.
15 #ifndef CEPH_MMONMGRREPORT_H
16 #define CEPH_MMONMGRREPORT_H
18 #include "messages/PaxosServiceMessage.h"
19 #include "include/types.h"
20 #include "include/health.h"
21 #include "mon/health_check.h"
23 class MMonMgrReport
: public PaxosServiceMessage
{
25 static const int HEAD_VERSION
= 1;
26 static const int COMPAT_VERSION
= 1;
29 // PGMapDigest is in data payload
30 health_check_map_t health_checks
;
31 bufferlist service_map_bl
; // encoded ServiceMap
34 : PaxosServiceMessage(MSG_MON_MGR_REPORT
, 0, HEAD_VERSION
, COMPAT_VERSION
)
37 ~MMonMgrReport() override
{}
40 const char *get_type_name() const override
{ return "monmgrreport"; }
42 void print(ostream
& out
) const override
{
43 out
<< get_type_name() << "(" << health_checks
.checks
.size() << " checks)";
46 void encode_payload(uint64_t features
) override
{
48 ::encode(health_checks
, payload
);
49 ::encode(service_map_bl
, payload
);
51 void decode_payload() override
{
52 bufferlist::iterator p
= payload
.begin();
54 ::decode(health_checks
, p
);
55 ::decode(service_map_bl
, p
);