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.
15 #ifndef MOSDPGPUSHREPLY_H
16 #define MOSDPGPUSHREPLY_H
18 #include "MOSDFastDispatchOp.h"
20 class MOSDPGPushReply : public MOSDFastDispatchOp {
21 static const int HEAD_VERSION = 3;
22 static const int COMPAT_VERSION = 2;
27 epoch_t map_epoch, min_epoch;
28 vector<PushReplyOp> replies;
31 epoch_t get_map_epoch() const override {
34 epoch_t get_min_epoch() const override {
37 spg_t get_spg() const override {
42 : MOSDFastDispatchOp(MSG_OSD_PG_PUSH_REPLY, HEAD_VERSION, COMPAT_VERSION),
46 void compute_cost(CephContext *cct) {
48 for (vector<PushReplyOp>::iterator i = replies.begin();
55 int get_cost() const override {
59 void decode_payload() override {
60 bufferlist::iterator p = payload.begin();
61 ::decode(pgid.pgid, p);
62 ::decode(map_epoch, p);
65 ::decode(pgid.shard, p);
67 if (header.version >= 3) {
68 ::decode(min_epoch, p);
70 min_epoch = map_epoch;
74 void encode_payload(uint64_t features) override {
75 ::encode(pgid.pgid, payload);
76 ::encode(map_epoch, payload);
77 ::encode(replies, payload);
78 ::encode(cost, payload);
79 ::encode(pgid.shard, payload);
80 ::encode(from, payload);
81 ::encode(min_epoch, payload);
84 void print(ostream& out) const override {
85 out << "MOSDPGPushReply(" << pgid
86 << " " << map_epoch << "/" << min_epoch
91 const char *get_type_name() const override { return "MOSDPGPushReply"; }