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_MOSDPGUPDATELOGMISSING_H
17 #define CEPH_MOSDPGUPDATELOGMISSING_H
19 #include "MOSDFastDispatchOp.h"
21 class MOSDPGUpdateLogMissing : public MOSDFastDispatchOp {
23 static const int HEAD_VERSION = 2;
24 static const int COMPAT_VERSION = 1;
28 epoch_t map_epoch, min_epoch;
32 mempool::osd_pglog::list<pg_log_entry_t> entries;
34 epoch_t get_epoch() const { return map_epoch; }
35 spg_t get_pgid() const { return pgid; }
36 epoch_t get_query_epoch() const { return map_epoch; }
37 ceph_tid_t get_tid() const { return rep_tid; }
39 epoch_t get_map_epoch() const override {
42 epoch_t get_min_epoch() const override {
45 spg_t get_spg() const override {
49 MOSDPGUpdateLogMissing()
50 : MOSDFastDispatchOp(MSG_OSD_PG_UPDATE_LOG_MISSING, HEAD_VERSION,
52 MOSDPGUpdateLogMissing(
53 const mempool::osd_pglog::list<pg_log_entry_t> &entries,
59 : MOSDFastDispatchOp(MSG_OSD_PG_UPDATE_LOG_MISSING, HEAD_VERSION,
69 ~MOSDPGUpdateLogMissing() override {}
72 const char *get_type_name() const override { return "PGUpdateLogMissing"; }
73 void print(ostream& out) const override {
74 out << "pg_update_log_missing(" << pgid << " epoch " << map_epoch
76 << " rep_tid " << rep_tid
77 << " entries " << entries << ")";
80 void encode_payload(uint64_t features) override {
81 ::encode(map_epoch, payload);
82 ::encode(pgid, payload);
83 ::encode(from, payload);
84 ::encode(rep_tid, payload);
85 ::encode(entries, payload);
86 ::encode(min_epoch, payload);
88 void decode_payload() override {
89 bufferlist::iterator p = payload.begin();
90 ::decode(map_epoch, p);
95 if (header.version >= 2) {
96 ::decode(min_epoch, p);
98 min_epoch = map_epoch;