]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | /* | |
4 | * Ceph - scalable distributed file system | |
5 | * | |
6 | * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net> | |
7 | * | |
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. | |
12 | * | |
13 | */ | |
14 | ||
15 | #ifndef CEPH_MMDSRESOLVEACK_H | |
16 | #define CEPH_MMDSRESOLVEACK_H | |
17 | ||
18 | #include "msg/Message.h" | |
19 | ||
20 | #include "include/types.h" | |
21 | ||
22 | ||
9f95a23c TL |
23 | class MMDSResolveAck : public SafeMessage { |
24 | static const int HEAD_VERSION = 1; | |
25 | static const int COMPAT_VERSION = 1; | |
11fdf7f2 | 26 | public: |
7c673cae FG |
27 | map<metareqid_t, bufferlist> commit; |
28 | vector<metareqid_t> abort; | |
29 | ||
11fdf7f2 | 30 | protected: |
9f95a23c | 31 | MMDSResolveAck() : SafeMessage{MSG_MDS_RESOLVEACK, HEAD_VERSION, COMPAT_VERSION} {} |
7c673cae FG |
32 | ~MMDSResolveAck() override {} |
33 | ||
34 | public: | |
11fdf7f2 | 35 | std::string_view get_type_name() const override { return "resolve_ack"; } |
7c673cae FG |
36 | /*void print(ostream& out) const { |
37 | out << "resolve_ack.size() | |
38 | << "+" << ambiguous_imap.size() | |
39 | << " imports +" << slave_requests.size() << " slave requests)"; | |
40 | } | |
41 | */ | |
42 | ||
43 | void add_commit(metareqid_t r) { | |
44 | commit[r].clear(); | |
45 | } | |
46 | void add_abort(metareqid_t r) { | |
47 | abort.push_back(r); | |
48 | } | |
49 | ||
50 | void encode_payload(uint64_t features) override { | |
11fdf7f2 TL |
51 | using ceph::encode; |
52 | encode(commit, payload); | |
53 | encode(abort, payload); | |
7c673cae FG |
54 | } |
55 | void decode_payload() override { | |
11fdf7f2 TL |
56 | using ceph::decode; |
57 | auto p = payload.cbegin(); | |
58 | decode(commit, p); | |
59 | decode(abort, p); | |
7c673cae | 60 | } |
9f95a23c TL |
61 | private: |
62 | template<class T, typename... Args> | |
63 | friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args); | |
7c673cae FG |
64 | }; |
65 | ||
66 | #endif |