-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMgr.h
91 lines (70 loc) · 1.91 KB
/
Mgr.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2014 John Spray <[email protected]>
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software
* Foundation. See file COPYING.
*/
#ifndef CEPH_MGR_H_
#define CEPH_MGR_H_
// Python.h comes first because otherwise it clobbers ceph's assert
#include "Python.h"
// Python's pyconfig-64.h conflicts with ceph's acconfig.h
#undef HAVE_SYS_WAIT_H
#undef HAVE_UNISTD_H
#undef HAVE_UTIME_H
#undef _POSIX_C_SOURCE
#undef _XOPEN_SOURCE
#include "mds/FSMap.h"
#include "messages/MFSMap.h"
#include "msg/Messenger.h"
#include "auth/Auth.h"
#include "common/Finisher.h"
#include "common/Timer.h"
#include "DaemonServer.h"
#include "PyModules.h"
#include "DaemonState.h"
#include "ClusterState.h"
class MCommand;
class MMgrDigest;
class MLog;
class Objecter;
class MgrPyModule;
class Mgr {
protected:
MonClient *monc;
Objecter *objecter;
Messenger *client_messenger;
Mutex lock;
SafeTimer timer;
Finisher finisher;
Context *waiting_for_fs_map;
PyModules py_modules;
DaemonStateIndex daemon_state;
ClusterState cluster_state;
DaemonServer server;
void load_config();
void load_all_metadata();
void init();
bool initialized;
bool initializing;
public:
Mgr(MonClient *monc_, Messenger *clientm_, Objecter *objecter_,
LogChannelRef clog_, LogChannelRef audit_clog_);
~Mgr();
bool is_initialized() const {return initialized;}
entity_addr_t get_server_addr() const { return server.get_myaddr(); }
void handle_mgr_digest(MMgrDigest* m);
void handle_fs_map(MFSMap* m);
void handle_osd_map();
void handle_log(MLog *m);
bool ms_dispatch(Message *m);
void background_init();
void shutdown();
};
#endif