#include "include/assert.h"
#include "mon/Monitor.h"
-// #include "mon/QuorumService.h"
-// #include "mon/HealthService.h"
+#include "mon/HealthService.h"
#include "mon/HealthMonitor.h"
#include "mon/DataHealthService.h"
return services[service_type]->service_dispatch(op);
}
+void HealthMonitor::start_epoch() {
+ for (map<int,HealthService*>::iterator it = services.begin();
+ it != services.end(); ++it) {
+ it->second->start(get_epoch());
+ }
+}
+
+void HealthMonitor::finish_epoch() {
+ generic_dout(20) << "HealthMonitor::finish_epoch()" << dendl;
+ for (map<int,HealthService*>::iterator it = services.begin();
+ it != services.end(); ++it) {
+ assert(it->second != NULL);
+ it->second->finish();
+ }
+}
+
void HealthMonitor::service_shutdown()
{
dout(0) << "HealthMonitor::service_shutdown "
#define CEPH_HEALTH_MONITOR_H
#include "mon/QuorumService.h"
-#include "mon/HealthService.h"
//forward declaration
namespace ceph { class Formatter; }
+class HealthService;
class HealthMonitor : public QuorumService
{
list<pair<health_status_t,string> > *detail) override;
bool service_dispatch(MonOpRequestRef op) override;
- void start_epoch() override {
- for (map<int,HealthService*>::iterator it = services.begin();
- it != services.end(); ++it) {
- it->second->start(get_epoch());
- }
- }
+ void start_epoch() override;
- void finish_epoch() override {
- generic_dout(20) << "HealthMonitor::finish_epoch()" << dendl;
- for (map<int,HealthService*>::iterator it = services.begin();
- it != services.end(); ++it) {
- assert(it->second != NULL);
- it->second->finish();
- }
- }
+ void finish_epoch() override;
void cleanup() override { }
void service_tick() override { }