1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2014 John Spray <john.spray@inktank.com>
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.
17 // Python.h comes first because otherwise it clobbers ceph's assert
19 // Python's pyconfig-64.h conflicts with ceph's acconfig.h
20 #undef HAVE_SYS_WAIT_H
23 #undef _POSIX_C_SOURCE
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 #include "mon/MgrMap.h"
34 #include "DaemonServer.h"
35 #include "PyModuleRegistry.h"
37 #include "DaemonState.h"
38 #include "ClusterState.h"
52 Messenger *client_messenger;
58 // Track receipt of initial data during startup
63 PyModuleRegistry *py_module_registry;
64 DaemonStateIndex daemon_state;
65 ClusterState cluster_state;
70 LogChannelRef audit_clog;
72 PyModuleConfig load_config();
73 void load_all_metadata();
80 Mgr(MonClient *monc_, const MgrMap& mgrmap,
81 PyModuleRegistry *py_module_registry_,
82 Messenger *clientm_, Objecter *objecter_,
83 Client *client_, LogChannelRef clog_, LogChannelRef audit_clog_);
86 bool is_initialized() const {return initialized;}
87 entity_addr_t get_server_addr() const { return server.get_myaddr(); }
89 void handle_mgr_digest(MMgrDigest* m);
90 void handle_fs_map(MFSMap* m);
91 void handle_osd_map();
92 void handle_log(MLog *m);
93 void handle_service_map(MServiceMap *m);
95 bool got_mgr_map(const MgrMap& m);
97 bool ms_dispatch(Message *m);
101 void background_init(Context *completion);
104 std::vector<MonCommand> get_command_set() const;
105 std::map<std::string, std::string> get_services() const;