Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / mds / RecoveryQueue.h
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) 2004-2006 Sage Weil <sage@newdream.net>
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
15 //class C_MDC_Recover;
16 //
17 #ifndef RECOVERY_QUEUE_H
18 #define RECOVERY_QUEUE_H
19
20 #include <set>
21
22 #include "osdc/Filer.h"
23
24 class CInode;
25 class MDSRank;
26 class PerfCounters;
27
28 class RecoveryQueue {
29 public:
30   void enqueue(CInode *in);
31   void advance();
32   void prioritize(CInode *in);   ///< do this inode now/soon
33   explicit RecoveryQueue(MDSRank *mds_);
34
35   void set_logger(PerfCounters *p) {logger=p;}
36
37 private:
38   void _start(CInode *in);  ///< start recovering this file
39
40   std::set<CInode*> file_recover_queue;   ///< the queue
41   std::set<CInode*> file_recover_queue_front;  ///< elevated priority items
42   std::set<CInode*> file_recovering;
43   void _recovered(CInode *in, int r, uint64_t size, utime_t mtime);
44   MDSRank *mds;
45   PerfCounters *logger;
46   Filer filer;
47
48   friend class C_MDC_Recover;
49 };
50
51 #endif // RECOVERY_QUEUE_H