]>
git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MOSDPGInfo.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) 2004-2006 Sage Weil <sage@newdream.net>
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.
16 #ifndef CEPH_MOSDPGINFO_H
17 #define CEPH_MOSDPGINFO_H
19 #include "msg/Message.h"
20 #include "osd/osd_types.h"
22 class MOSDPGInfo
: public MessageInstance
<MOSDPGInfo
> {
26 static constexpr int HEAD_VERSION
= 5;
27 static constexpr int COMPAT_VERSION
= 5;
32 vector
<pair
<pg_notify_t
,PastIntervals
> > pg_list
;
34 epoch_t
get_epoch() const { return epoch
; }
37 : MessageInstance(MSG_OSD_PG_INFO
, HEAD_VERSION
, COMPAT_VERSION
) {
38 set_priority(CEPH_MSG_PRIO_HIGH
);
40 MOSDPGInfo(version_t mv
)
41 : MessageInstance(MSG_OSD_PG_INFO
, HEAD_VERSION
, COMPAT_VERSION
),
43 set_priority(CEPH_MSG_PRIO_HIGH
);
46 ~MOSDPGInfo() override
{}
49 std::string_view
get_type_name() const override
{ return "pg_info"; }
50 void print(ostream
& out
) const override
{
52 for (auto i
= pg_list
.begin();
55 if (i
!= pg_list
.begin())
57 out
<< i
->first
<< "=" << i
->second
;
59 out
<< " epoch " << epoch
63 void encode_payload(uint64_t features
) override
{
65 encode(epoch
, payload
);
66 encode(pg_list
, payload
);
68 void decode_payload() override
{
69 auto p
= payload
.cbegin();