]> git.proxmox.com Git - ceph.git/blame - ceph/src/mgr/Mgr.h
bump version to 12.0.3-pve3
[ceph.git] / ceph / src / mgr / Mgr.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) 2014 John Spray <john.spray@inktank.com>
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_MGR_H_
15#define CEPH_MGR_H_
16
17// Python.h comes first because otherwise it clobbers ceph's assert
18#include "Python.h"
19// Python's pyconfig-64.h conflicts with ceph's acconfig.h
20#undef HAVE_SYS_WAIT_H
21#undef HAVE_UNISTD_H
22#undef HAVE_UTIME_H
23#undef _POSIX_C_SOURCE
24#undef _XOPEN_SOURCE
25
26#include "mds/FSMap.h"
27#include "messages/MFSMap.h"
28#include "msg/Messenger.h"
29#include "auth/Auth.h"
30#include "common/Finisher.h"
31#include "common/Timer.h"
32
33#include "DaemonServer.h"
34#include "PyModules.h"
35
36#include "DaemonState.h"
37#include "ClusterState.h"
38
39class MCommand;
40class MMgrDigest;
41class MLog;
42class Objecter;
43class Client;
44
45
46class MgrPyModule;
47
48class Mgr {
49protected:
50 MonClient *monc;
51 Objecter *objecter;
52 Client *client;
53 Messenger *client_messenger;
54
55 Mutex lock;
56 SafeTimer timer;
57 Finisher finisher;
58
59 Cond fs_map_cond;
60
61 PyModules py_modules;
62 DaemonStateIndex daemon_state;
63 ClusterState cluster_state;
64
65 DaemonServer server;
66
67 void load_config();
68 void load_all_metadata();
69 void init();
70
71 bool initialized;
72 bool initializing;
73
74public:
75 Mgr(MonClient *monc_, Messenger *clientm_, Objecter *objecter_,
76 Client *client_, LogChannelRef clog_, LogChannelRef audit_clog_);
77 ~Mgr();
78
79 bool is_initialized() const {return initialized;}
80 entity_addr_t get_server_addr() const { return server.get_myaddr(); }
81
82 void handle_mgr_digest(MMgrDigest* m);
83 void handle_fs_map(MFSMap* m);
84 void handle_osd_map();
85 void handle_log(MLog *m);
86
87 bool ms_dispatch(Message *m);
88
89 void background_init();
90 void shutdown();
91};
92
93#endif