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"
|
|
|
|
|
|
|
|
#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;
|
|
|
|
|
|
|
|
class MgrStandby : public Dispatcher {
|
|
|
|
protected:
|
|
|
|
MonClient *monc;
|
2016-07-16 21:04:39 +00:00
|
|
|
Objecter *objecter;
|
2016-07-14 23:39:22 +00:00
|
|
|
Messenger *client_messenger;
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
2016-07-14 23:39:22 +00:00
|
|
|
public:
|
|
|
|
MgrStandby();
|
|
|
|
~MgrStandby();
|
|
|
|
|
|
|
|
bool ms_dispatch(Message *m);
|
|
|
|
bool ms_handle_reset(Connection *con) { return false; }
|
|
|
|
void ms_handle_remote_reset(Connection *con) {}
|
|
|
|
bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer,
|
|
|
|
bool force_new);
|
2016-09-20 15:34:37 +00:00
|
|
|
bool ms_handle_refused(Connection *con);
|
|
|
|
|
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
|
|
|
|
|