*
*/
-
-
#ifndef CEPH_MDS_H
#define CEPH_MDS_H
-#include "mdstypes.h"
+#include <boost/utility/string_view.hpp>
-#include "msg/Dispatcher.h"
-#include "include/CompatSet.h"
-#include "include/types.h"
-#include "include/Context.h"
-#include "common/DecayCounter.h"
-#include "common/perf_counters.h"
+#include "common/LogClient.h"
#include "common/Mutex.h"
-#include "common/Cond.h"
#include "common/Timer.h"
-#include "common/LogClient.h"
-#include "common/TrackedOp.h"
-#include "common/Finisher.h"
-#include "common/cmdparse.h"
+#include "include/Context.h"
+#include "include/types.h"
#include "mgr/MgrClient.h"
-
-#include "MDSRank.h"
-#include "MDSMap.h"
+#include "msg/Dispatcher.h"
#include "Beacon.h"
+#include "MDSMap.h"
+#include "MDSRank.h"
-
-#define CEPH_MDS_PROTOCOL 29 /* cluster internal */
-
-class MonClient;
-
-class Server;
-class Locker;
-class MDCache;
-class MDBalancer;
-class MDSInternalContextBase;
-
-class Messenger;
-class Message;
-
-class SnapServer;
-class SnapClient;
-
-class MDSTableServer;
-class MDSTableClient;
+#define CEPH_MDS_PROTOCOL 30 /* cluster internal */
class AuthAuthorizeHandlerRegistry;
+class Message;
+class Messenger;
+class MonClient;
class MDSDaemon : public Dispatcher, public md_config_obs_t {
public:
SafeTimer timer;
+
+ mono_time get_starttime() const {
+ return starttime;
+ }
+ chrono::duration<double> get_uptime() const {
+ mono_time now = mono_clock::now();
+ return chrono::duration<double>(now-starttime);
+ }
+
protected:
Beacon beacon;
MDSRankDispatcher *mds_rank;
public:
- MDSDaemon(const std::string &n, Messenger *m, MonClient *mc);
+ MDSDaemon(boost::string_view n, Messenger *m, MonClient *mc);
~MDSDaemon() override;
int orig_argc;
const char **orig_argv;
const std::set <std::string> &changed) override;
protected:
// tick and other timer fun
- class C_MDS_Tick;
- C_MDS_Tick *tick_event;
+ Context *tick_event = nullptr;
void reset_tick();
void wait_for_omap_osds();
bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new) override;
bool ms_verify_authorizer(Connection *con, int peer_type,
int protocol, bufferlist& authorizer_data, bufferlist& authorizer_reply,
- bool& isvalid, CryptoKey& session_key) override;
+ bool& isvalid, CryptoKey& session_key,
+ std::unique_ptr<AuthAuthorizerChallenge> *challenge) override;
void ms_handle_accept(Connection *con) override;
void ms_handle_connect(Connection *con) override;
bool ms_handle_reset(Connection *con) override;
// special message types
friend class C_MDS_Send_Command_Reply;
static void send_command_reply(MCommand *m, MDSRank* mds_rank, int r,
- bufferlist outbl, const std::string& outs);
+ bufferlist outbl, boost::string_view outs);
int _handle_command(
const cmdmap_t &cmdmap,
MCommand *m,
void handle_command(class MCommand *m);
void handle_mds_map(class MMDSMap *m);
void _handle_mds_map(MDSMap *oldmap);
+
+private:
+ mono_time starttime = mono_clock::zero();
};