X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fmds%2FMDSTableClient.h;fp=src%2Fceph%2Fsrc%2Fmds%2FMDSTableClient.h;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=ce15c54d87490c1af15fc5832f9c06034c295158;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/mds/MDSTableClient.h b/src/ceph/src/mds/MDSTableClient.h deleted file mode 100644 index ce15c54..0000000 --- a/src/ceph/src/mds/MDSTableClient.h +++ /dev/null @@ -1,93 +0,0 @@ -// -*- 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) 2004-2006 Sage Weil - * - * 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 CEPH_MDSTABLECLIENT_H -#define CEPH_MDSTABLECLIENT_H - -#include "include/types.h" -#include "MDSContext.h" -#include "mds_table_types.h" - -class MDSRank; -class LogSegment; -class MMDSTableRequest; - -class MDSTableClient { -protected: - MDSRank *mds; - int table; - - uint64_t last_reqid; - - bool server_ready; - - // prepares - struct _pending_prepare { - MDSInternalContextBase *onfinish; - version_t *ptid; - bufferlist *pbl; - bufferlist mutation; - - _pending_prepare() : onfinish(0), ptid(0), pbl(0) {} - _pending_prepare(MDSInternalContextBase *c, version_t *pt, bufferlist *pb, bufferlist& m) : - onfinish(c), ptid(pt), pbl(pb), mutation(m) {} - }; - - map pending_prepare; - map prepared_update; - list<_pending_prepare> waiting_for_reqid; - - // pending commits - map pending_commit; - map > ack_waiters; - - void handle_reply(class MMDSTableQuery *m); - void _logged_ack(version_t tid); - friend class C_LoggedAck; - -public: - MDSTableClient(MDSRank *m, int tab) : - mds(m), table(tab), last_reqid(~0ULL), server_ready(false) {} - virtual ~MDSTableClient() {} - - void handle_request(MMDSTableRequest *m); - - void _prepare(bufferlist& mutation, version_t *ptid, bufferlist *pbl, MDSInternalContextBase *onfinish); - void commit(version_t tid, LogSegment *ls); - - void resend_commits(); - void resend_prepares(); - - // for recovery (by me) - void got_journaled_agree(version_t tid, LogSegment *ls); - void got_journaled_ack(version_t tid); - - bool has_committed(version_t tid) const { - return pending_commit.count(tid) == 0; - } - void wait_for_ack(version_t tid, MDSInternalContextBase *c) { - ack_waiters[tid].push_back(c); - } - - void handle_mds_failure(mds_rank_t mds); - - // child must implement - virtual void resend_queries() = 0; - virtual void handle_query_result(MMDSTableRequest *m) = 0; - - // and friendly front-end for _prepare. - -}; - -#endif