]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/messages/MPGStats.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / messages / MPGStats.h
index e0a299eb5c877caef56917d80c251404fee74a6e..944e536f99542909eb1a5bc2feecef4c39ea915a 100644 (file)
 #include "osd/osd_types.h"
 #include "messages/PaxosServiceMessage.h"
 
-class MPGStats : public MessageInstance<MPGStats, PaxosServiceMessage> {
+class MPGStats : public PaxosServiceMessage {
   static constexpr int HEAD_VERSION = 2;
   static constexpr int COMPAT_VERSION = 1;
-public:
-  friend factory;
 
+public:
   uuid_d fsid;
-  map<pg_t, pg_stat_t> pg_stat;
+  std::map<pg_t, pg_stat_t> pg_stat;
   osd_stat_t osd_stat;
-  map<int64_t, store_statfs_t> pool_stat;
+  std::map<int64_t, store_statfs_t> pool_stat;
   epoch_t epoch = 0;
-  utime_t had_map_for;
-  
-  MPGStats() : MessageInstance(MSG_PGSTATS, 0, HEAD_VERSION, COMPAT_VERSION) {}
-  MPGStats(const uuid_d& f, epoch_t e, utime_t had)
-    : MessageInstance(MSG_PGSTATS, 0, HEAD_VERSION, COMPAT_VERSION),
+
+  MPGStats() : PaxosServiceMessage{MSG_PGSTATS, 0, HEAD_VERSION, COMPAT_VERSION} {}
+  MPGStats(const uuid_d& f, epoch_t e)
+    : PaxosServiceMessage{MSG_PGSTATS, 0, HEAD_VERSION, COMPAT_VERSION},
       fsid(f),
-      epoch(e),
-      had_map_for(had)
+      epoch(e)
   {}
 
 private:
@@ -44,7 +41,7 @@ private:
 
 public:
   std::string_view get_type_name() const override { return "pg_stats"; }
-  void print(ostream& out) const override {
+  void print(std::ostream& out) const override {
     out << "pg_stats(" << pg_stat.size() << " pgs tid " << get_tid() << " v " << version << ")";
   }
 
@@ -55,10 +52,11 @@ public:
     encode(osd_stat, payload, features);
     encode(pg_stat, payload);
     encode(epoch, payload);
-    encode(had_map_for, payload);
+    encode(utime_t{}, payload);
     encode(pool_stat, payload, features);
   }
   void decode_payload() override {
+    using ceph::decode;
     auto p = payload.cbegin();
     paxos_decode(p);
     decode(fsid, p);
@@ -69,7 +67,8 @@ public:
     }
     decode(pg_stat, p);
     decode(epoch, p);
-    decode(had_map_for, p);
+    utime_t dummy;
+    decode(dummy, p);
     if (header.version >= 2)
       decode(pool_stat, p);
   }