]> git.proxmox.com Git - ceph.git/blame - ceph/src/mon/HealthMonitor.h
update sources to ceph Nautilus 14.2.1
[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
224ce89b 17#include "mon/PaxosService.h"
7c673cae 18
224ce89b 19class HealthMonitor : public PaxosService
7c673cae 20{
224ce89b
WB
21 version_t version = 0;
22 map<int,health_check_map_t> quorum_checks; // for each quorum member
23 health_check_map_t leader_checks; // leader only
7c673cae
FG
24
25public:
224ce89b 26 HealthMonitor(Monitor *m, Paxos *p, const string& service_name);
7c673cae 27
7c673cae
FG
28 /**
29 * @defgroup HealthMonitor_Inherited_h Inherited abstract methods
30 * @{
31 */
32 void init() override;
7c673cae 33
224ce89b
WB
34 bool preprocess_query(MonOpRequestRef op) override;
35 bool prepare_update(MonOpRequestRef op) override;
7c673cae 36
224ce89b 37 bool prepare_health_checks(MonOpRequestRef op);
7c673cae 38
224ce89b
WB
39 bool check_leader_health();
40 bool check_member_health();
7c673cae 41
224ce89b
WB
42 void create_initial() override;
43 void update_from_paxos(bool *need_bootstrap) override;
44 void create_pending() override;
45 void encode_pending(MonitorDBStore::TransactionRef t) override;
11fdf7f2 46 version_t get_trim_to() const override;
224ce89b
WB
47
48 void encode_full(MonitorDBStore::TransactionRef t) override { }
49
50 void tick() override;
7c673cae
FG
51
52 /**
53 * @} // HealthMonitor_Inherited_h
54 */
55};
56
57#endif // CEPH_HEALTH_MONITOR_H