2222#include " mdstypes.h" // for mds_table_pending_t
2323#include " mds_table_types.h" // for get_mdstable_name()
2424
25- #include " messages/MMDSTableRequest.h"
26-
2725#include " common/ref.h" // for cref_t
2826
2927class MDSContext ;
28+ class MMDSTableRequest ;
3029
3130class MDSTableServer : public MDSTable {
3231public:
3332 friend class C_ServerRecovery ;
3433
35- MDSTableServer (MDSRank *m, int tab) :
36- MDSTable (m, get_mdstable_name(tab), false ), table(tab) {}
37- ~MDSTableServer () override {}
34+ MDSTableServer (MDSRank *m, int tab);
35+ ~MDSTableServer ();
36+
37+ // required by DencoderImplFeatureful::copy()
38+ MDSTableServer (const MDSTableServer &);
39+ MDSTableServer &operator =(const MDSTableServer &);
3840
3941 virtual void handle_query (const cref_t <MMDSTableRequest> &m) = 0;
4042 virtual void _prepare (const bufferlist &bl, uint64_t reqid, mds_rank_t bymds, bufferlist& out) = 0;
@@ -44,51 +46,21 @@ class MDSTableServer : public MDSTable {
4446 virtual void _server_update (bufferlist& bl) { ceph_abort (); }
4547 virtual bool _notify_prep (version_t tid) { return false ; };
4648
47- void _note_prepare (mds_rank_t mds, uint64_t reqid, bool replay=false ) {
48- version++;
49- if (replay)
50- projected_version = version;
51- pending_for_mds[version].mds = mds;
52- pending_for_mds[version].reqid = reqid;
53- pending_for_mds[version].tid = version;
54- }
55- void _note_commit (uint64_t tid, bool replay=false ) {
56- version++;
57- if (replay)
58- projected_version = version;
59- pending_for_mds.erase (tid);
60- }
61- void _note_rollback (uint64_t tid, bool replay=false ) {
62- version++;
63- if (replay)
64- projected_version = version;
65- pending_for_mds.erase (tid);
66- }
67- void _note_server_update (bufferlist& bl, bool replay=false ) {
68- version++;
69- if (replay)
70- projected_version = version;
71- }
72-
73- void reset_state () override {
74- pending_for_mds.clear ();
75- ++version;
76- }
49+ void _note_prepare (mds_rank_t mds, uint64_t reqid, bool replay=false );
50+ void _note_commit (uint64_t tid, bool replay=false );
51+ void _note_rollback (uint64_t tid, bool replay=false );
52+ void _note_server_update (bufferlist& bl, bool replay=false );
53+
54+ void reset_state () override ;
7755
7856 void handle_request (const cref_t <MMDSTableRequest> &m);
7957 void do_server_update (bufferlist& bl);
8058
8159 virtual void encode_server_state (bufferlist& bl) const = 0;
8260 virtual void decode_server_state (bufferlist::const_iterator& bl) = 0;
8361
84- void encode_state (bufferlist& bl) const override {
85- encode_server_state (bl);
86- encode (pending_for_mds, bl);
87- }
88- void decode_state (bufferlist::const_iterator& bl) override {
89- decode_server_state (bl);
90- decode (pending_for_mds, bl);
91- }
62+ void encode_state (bufferlist& bl) const override ;
63+ void decode_state (bufferlist::const_iterator& bl) override ;
9264
9365 // recovery
9466 void finish_recovery (std::set<mds_rank_t >& active);
@@ -101,13 +73,7 @@ class MDSTableServer : public MDSTable {
10173 bool recovered = false ;
10274 std::set<mds_rank_t > active_clients;
10375private:
104- struct notify_info_t {
105- notify_info_t () {}
106- std::set<mds_rank_t > notify_ack_gather;
107- mds_rank_t mds;
108- ref_t <MMDSTableRequest> reply = NULL ;
109- MDSContext *onfinish = nullptr ;
110- };
76+ struct notify_info_t ;
11177
11278 friend class C_Prepare ;
11379 friend class C_Commit ;
0 commit comments