]>
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 | ||
16 | #ifndef CEPH_MGETPOOLSTATS_H | |
17 | #define CEPH_MGETPOOLSTATS_H | |
18 | ||
19 | #include "messages/PaxosServiceMessage.h" | |
20 | ||
11fdf7f2 | 21 | class MGetPoolStats : public MessageInstance<MGetPoolStats, PaxosServiceMessage> { |
7c673cae | 22 | public: |
11fdf7f2 TL |
23 | friend factory; |
24 | ||
7c673cae FG |
25 | uuid_d fsid; |
26 | list<string> pools; | |
27 | ||
11fdf7f2 | 28 | MGetPoolStats() : MessageInstance(MSG_GETPOOLSTATS, 0) {} |
7c673cae | 29 | MGetPoolStats(const uuid_d& f, ceph_tid_t t, list<string>& ls, version_t l) : |
11fdf7f2 | 30 | MessageInstance(MSG_GETPOOLSTATS, l), |
7c673cae FG |
31 | fsid(f), pools(ls) { |
32 | set_tid(t); | |
33 | } | |
34 | ||
35 | private: | |
36 | ~MGetPoolStats() override {} | |
37 | ||
38 | public: | |
11fdf7f2 | 39 | std::string_view get_type_name() const override { return "getpoolstats"; } |
7c673cae FG |
40 | void print(ostream& out) const override { |
41 | out << "getpoolstats(" << get_tid() << " " << pools << " v" << version << ")"; | |
42 | } | |
43 | ||
44 | void encode_payload(uint64_t features) override { | |
11fdf7f2 | 45 | using ceph::encode; |
7c673cae | 46 | paxos_encode(); |
11fdf7f2 TL |
47 | encode(fsid, payload); |
48 | encode(pools, payload); | |
7c673cae FG |
49 | } |
50 | void decode_payload() override { | |
11fdf7f2 TL |
51 | using ceph::decode; |
52 | auto p = payload.cbegin(); | |
7c673cae | 53 | paxos_decode(p); |
11fdf7f2 TL |
54 | decode(fsid, p); |
55 | decode(pools, p); | |
7c673cae FG |
56 | } |
57 | }; | |
58 | ||
59 | #endif |