2016-07-14 23:39:22 +00:00
|
|
|
// -*- 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) 2016 John Spray <john.spray@redhat.com>
|
|
|
|
*
|
|
|
|
* 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 MGR_STANDBY_H_
|
|
|
|
#define MGR_STANDBY_H_
|
|
|
|
|
|
|
|
#include "auth/Auth.h"
|
|
|
|
#include "common/Finisher.h"
|
|
|
|
#include "common/Timer.h"
|
2017-03-22 01:24:24 +00:00
|
|
|
#include "common/LogClient.h"
|
2016-07-14 23:39:22 +00:00
|
|
|
|
2017-05-04 07:39:55 +00:00
|
|
|
#include "client/Client.h"
|
|
|
|
#include "mon/MonClient.h"
|
|
|
|
#include "osdc/Objecter.h"
|
|
|
|
|
2016-07-14 23:39:22 +00:00
|
|
|
#include "DaemonServer.h"
|
|
|
|
#include "PyModules.h"
|
|
|
|
|
|
|
|
#include "DaemonState.h"
|
|
|
|
#include "ClusterState.h"
|
|
|
|
|
2016-07-16 21:04:39 +00:00
|
|
|
class MMgrMap;
|
2016-07-14 23:39:22 +00:00
|
|
|
class Mgr;
|
|
|
|
|
2017-03-22 01:24:24 +00:00
|
|
|
class MgrStandby : public Dispatcher,
|
|
|
|
public md_config_obs_t {
|
|
|
|
public:
|
|
|
|
// config observer bits
|
|
|
|
const char** get_tracked_conf_keys() const override;
|
|
|
|
void handle_conf_change(const struct md_config_t *conf,
|
|
|
|
const std::set <std::string> &changed) override;
|
|
|
|
|
2016-07-14 23:39:22 +00:00
|
|
|
protected:
|
2017-05-04 07:39:55 +00:00
|
|
|
MonClient monc;
|
|
|
|
std::unique_ptr<Messenger> client_messenger;
|
|
|
|
Objecter objecter;
|
|
|
|
Client client;
|
2017-03-22 01:24:24 +00:00
|
|
|
|
|
|
|
LogClient log_client;
|
|
|
|
LogChannelRef clog, audit_clog;
|
2016-07-14 23:39:22 +00:00
|
|
|
|
|
|
|
Mutex lock;
|
|
|
|
SafeTimer timer;
|
|
|
|
|
2017-02-04 21:14:13 +00:00
|
|
|
std::unique_ptr<Mgr> active_mgr;
|
2016-07-14 23:39:22 +00:00
|
|
|
|
|
|
|
std::string state_str();
|
|
|
|
|
2016-07-16 21:04:39 +00:00
|
|
|
void handle_mgr_map(MMgrMap *m);
|
2017-03-22 01:24:24 +00:00
|
|
|
void _update_log_config();
|
2016-07-16 21:04:39 +00:00
|
|
|
|
2016-07-14 23:39:22 +00:00
|
|
|
public:
|
|
|
|
MgrStandby();
|
2017-02-22 11:52:46 +00:00
|
|
|
~MgrStandby() override;
|
2016-07-14 23:39:22 +00:00
|
|
|
|
2017-02-22 11:52:46 +00:00
|
|
|
bool ms_dispatch(Message *m) override;
|
|
|
|
bool ms_handle_reset(Connection *con) override { return false; }
|
|
|
|
void ms_handle_remote_reset(Connection *con) override {}
|
2016-07-14 23:39:22 +00:00
|
|
|
bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer,
|
2017-02-22 11:52:46 +00:00
|
|
|
bool force_new) override;
|
|
|
|
bool ms_handle_refused(Connection *con) override;
|
2016-09-20 15:34:37 +00:00
|
|
|
|
2016-07-14 23:39:22 +00:00
|
|
|
int init();
|
|
|
|
void shutdown();
|
|
|
|
void usage() {}
|
|
|
|
int main(vector<const char *> args);
|
|
|
|
void handle_signal(int signum);
|
|
|
|
void send_beacon();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|