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