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
18 #include "msg/Message.h"
20 #include "include/types.h"
22 class MMonGetOSDMap : public PaxosServiceMessage {
23 epoch_t full_first, full_last;
24 epoch_t inc_first, inc_last;
28 : PaxosServiceMessage(CEPH_MSG_MON_GET_OSDMAP, 0),
34 ~MMonGetOSDMap() override {}
37 void request_full(epoch_t first, epoch_t last) {
38 assert(last >= first);
42 void request_inc(epoch_t first, epoch_t last) {
43 assert(last >= first);
47 epoch_t get_full_first() const {
50 epoch_t get_full_last() const {
53 epoch_t get_inc_first() const {
56 epoch_t get_inc_last() const {
60 const char *get_type_name() const override { return "mon_get_osdmap"; }
61 void print(ostream& out) const override {
62 out << "mon_get_osdmap(";
63 if (full_first && full_last)
64 out << "full " << full_first << "-" << full_last;
65 if (inc_first && inc_last)
66 out << " inc" << inc_first << "-" << inc_last;
70 void encode_payload(uint64_t features) override {
72 ::encode(full_first, payload);
73 ::encode(full_last, payload);
74 ::encode(inc_first, payload);
75 ::encode(inc_last, payload);
77 void decode_payload() override {
78 bufferlist::iterator p = payload.begin();
80 ::decode(full_first, p);
81 ::decode(full_last, p);
82 ::decode(inc_first, p);
83 ::decode(inc_last, p);