]> git.proxmox.com Git - ceph.git/blame - ceph/src/tools/cephfs/MDSUtility.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / tools / cephfs / MDSUtility.h
CommitLineData
7c673cae
FG
1// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2// vim: ts=8 sw=2 smarttab
3/*
4 * Ceph - scalable distributed file system
5 *
6 * Copyright (C) 2014 John Spray <john.spray@inktank.com>
7 *
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.
12 */
13
14#ifndef MDS_UTILITY_H_
15#define MDS_UTILITY_H_
16
17#include "osdc/Objecter.h"
18#include "mds/FSMap.h"
19#include "messages/MFSMap.h"
20#include "msg/Dispatcher.h"
21#include "msg/Messenger.h"
22#include "auth/Auth.h"
23#include "common/Finisher.h"
24#include "common/Timer.h"
25
26/// MDS Utility
27/**
28 * This class is the parent for MDS utilities, i.e. classes that
29 * need access the objects belonging to the MDS without actually
30 * acting as an MDS daemon themselves.
31 */
32class MDSUtility : public Dispatcher {
33protected:
34 Objecter *objecter;
35 FSMap *fsmap;
36 Messenger *messenger;
37 MonClient *monc;
38
9f95a23c 39 ceph::mutex lock = ceph::make_mutex("MDSUtility::lock");
7c673cae
FG
40 Finisher finisher;
41
42 Context *waiting_for_mds_map;
43
94b18763 44 bool inited;
7c673cae
FG
45public:
46 MDSUtility();
47 ~MDSUtility() override;
48
49 void handle_fs_map(MFSMap* m);
50 bool ms_dispatch(Message *m) override;
51 bool ms_handle_reset(Connection *con) override { return false; }
52 void ms_handle_remote_reset(Connection *con) override {}
53 bool ms_handle_refused(Connection *con) override { return false; }
7c673cae
FG
54 int init();
55 void shutdown();
56};
57
58#endif /* MDS_UTILITY_H_ */