]>
git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MOSDPGPull.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) 2013 Inktank Storage, Inc.
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.
18 #include "MOSDFastDispatchOp.h"
20 class MOSDPGPull
: public MOSDFastDispatchOp
{
22 static constexpr int HEAD_VERSION
= 3;
23 static constexpr int COMPAT_VERSION
= 2;
30 epoch_t map_epoch
= 0, min_epoch
= 0;
33 epoch_t
get_map_epoch() const override
{
36 epoch_t
get_min_epoch() const override
{
39 spg_t
get_spg() const override
{
43 void take_pulls(vector
<PullOp
> *outpulls
) {
44 outpulls
->swap(pulls
);
46 void set_pulls(vector
<PullOp
> *inpulls
) {
51 : MOSDFastDispatchOp
{MSG_OSD_PG_PULL
, HEAD_VERSION
, COMPAT_VERSION
}
54 void compute_cost(CephContext
*cct
) {
56 for (vector
<PullOp
>::iterator i
= pulls
.begin();
63 int get_cost() const override
{
67 void decode_payload() override
{
68 auto p
= payload
.cbegin();
73 decode(pgid
.shard
, p
);
75 if (header
.version
>= 3) {
78 min_epoch
= map_epoch
;
82 void encode_payload(uint64_t features
) override
{
84 encode(pgid
.pgid
, payload
);
85 encode(map_epoch
, payload
);
86 encode(pulls
, payload
, features
);
87 encode(cost
, payload
);
88 encode(pgid
.shard
, payload
);
89 encode(from
, payload
);
90 encode(min_epoch
, payload
);
93 std::string_view
get_type_name() const override
{ return "MOSDPGPull"; }
95 void print(ostream
& out
) const override
{
96 out
<< "MOSDPGPull(" << pgid
97 << " e" << map_epoch
<< "/" << min_epoch
103 template<class T
, typename
... Args
>
104 friend boost::intrusive_ptr
<T
> ceph::make_message(Args
&&... args
);