]>
git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MMonGetOSDMap.h
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) 2014 Red Hat
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_MMONGETOSDMAP_H
16 #define CEPH_MMONGETOSDMAP_H
20 #include <string_view>
22 #include "msg/Message.h"
24 #include "include/types.h"
26 class MMonGetOSDMap final
: public PaxosServiceMessage
{
28 epoch_t full_first
, full_last
;
29 epoch_t inc_first
, inc_last
;
33 : PaxosServiceMessage
{CEPH_MSG_MON_GET_OSDMAP
, 0},
39 ~MMonGetOSDMap() final
{}
42 void request_full(epoch_t first
, epoch_t last
) {
43 ceph_assert(last
>= first
);
47 void request_inc(epoch_t first
, epoch_t last
) {
48 ceph_assert(last
>= first
);
52 epoch_t
get_full_first() const {
55 epoch_t
get_full_last() const {
58 epoch_t
get_inc_first() const {
61 epoch_t
get_inc_last() const {
65 std::string_view
get_type_name() const override
{ return "mon_get_osdmap"; }
66 void print(std::ostream
& out
) const override
{
67 out
<< "mon_get_osdmap(";
68 if (full_first
&& full_last
)
69 out
<< "full " << full_first
<< "-" << full_last
;
70 if (inc_first
&& inc_last
)
71 out
<< " inc" << inc_first
<< "-" << inc_last
;
75 void encode_payload(uint64_t features
) override
{
78 encode(full_first
, payload
);
79 encode(full_last
, payload
);
80 encode(inc_first
, payload
);
81 encode(inc_last
, payload
);
83 void decode_payload() override
{
85 auto p
= payload
.cbegin();
87 decode(full_first
, p
);
93 template<class T
, typename
... Args
>
94 friend boost::intrusive_ptr
<T
> ceph::make_message(Args
&&... args
);