]> git.proxmox.com Git - ceph.git/blame - ceph/src/mon/HealthMonitor.h
buildsys: fix parallel builds
[ceph.git] / ceph / src / mon / HealthMonitor.h
CommitLineData
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) 2013 Inktank, Inc
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#ifndef CEPH_HEALTH_MONITOR_H
15#define CEPH_HEALTH_MONITOR_H
16
17#include "mon/QuorumService.h"
18
19//forward declaration
20namespace ceph { class Formatter; }
21class HealthService;
22
23class HealthMonitor : public QuorumService
24{
25 map<int,HealthService*> services;
26
27protected:
28 void service_shutdown() override;
29
30public:
31 HealthMonitor(Monitor *m) : QuorumService(m) { }
32 ~HealthMonitor() override {
33 assert(services.empty());
34 }
35
36
37 /**
38 * @defgroup HealthMonitor_Inherited_h Inherited abstract methods
39 * @{
40 */
41 void init() override;
42 void get_health(Formatter *f,
43 list<pair<health_status_t,string> >& summary,
44 list<pair<health_status_t,string> > *detail) override;
45 bool service_dispatch(MonOpRequestRef op) override;
46
47 void start_epoch() override;
48
49 void finish_epoch() override;
50
51 void cleanup() override { }
52 void service_tick() override { }
53
54 int get_type() override {
55 return QuorumService::SERVICE_HEALTH;
56 }
57
58 string get_name() const override {
59 return "health";
60 }
61
62 /**
63 * @} // HealthMonitor_Inherited_h
64 */
65};
66
67#endif // CEPH_HEALTH_MONITOR_H