]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/mon/PaxosService.h
update sources to v12.1.1
[ceph.git] / ceph / src / mon / PaxosService.h
index ca75915841e591702b41a3d80444f52c78a99fa7..da3038ff1e9f9a77c6e45d453058a7bbf3ad4194 100644 (file)
@@ -77,15 +77,23 @@ protected:
    */
   bool have_pending; 
 
-protected:
+  /**
+   * health checks for this service
+   *
+   * Child must populate this during encode_pending() by calling encode_health().
+   */
+  health_check_map_t health_checks;
+public:
+  const health_check_map_t& get_health_checks() {
+    return health_checks;
+  }
 
+protected:
   /**
    * format of our state in leveldb, 0 for default
    */
   version_t format_version;
 
-
-
   /**
    * @defgroup PaxosService_h_callbacks Callback classes
    * @{
@@ -428,6 +436,15 @@ public:
                          list<pair<health_status_t,string> > *detail,
                          CephContext *cct) const { }
 
+  void encode_health(const health_check_map_t& next,
+                    MonitorDBStore::TransactionRef t) {
+    bufferlist bl;
+    ::encode(next, bl);
+    t->put("health", service_name, bl);
+    mon->log_health(next, health_checks, t);
+  }
+  void load_health();
+
  private:
   /**
    * @defgroup PaxosService_h_store_keys Set of keys that are usually used on