XRootD
XrdPfcPurgePin.hh
Go to the documentation of this file.
1 #ifndef __XRDPFC_PURGEPLG_HH__
2 #define __XRDPFC_PURGEPLG_HH__
3 
4 #include <string>
5 #include <vector>
6 
7 namespace XrdPfc
8 {
9 class DataFsPurgeshot;
10 class DirUsage;
11 
12 //----------------------------------------------------------------------------
14 //----------------------------------------------------------------------------
15 class PurgePin
16 {
17 public:
18  struct DirInfo
19  {
20  std::string path;
21  long long nBytesQuota{0};
22  long long nBytesToRecover{0};
23 
24  // internal use by the Cache purge thread. to be revisited, maybe an access token is more appropriate.
25  const DirUsage* dirUsage{nullptr};
26  };
27 
28  typedef std::vector<DirInfo> list_t;
29  typedef list_t::iterator list_i;
30 
31 protected:
33 
34 public:
35  virtual ~PurgePin() {}
36 
37 
38  //---------------------------------------------------------------------
42  //---------------------------------------------------------------------
43  virtual bool CallPeriodically() { return true; };
44 
45 
46  //---------------------------------------------------------------------
50  // To be revisited -- can have a multi-step approach where
51  // cache periodically sends udates.
54  //---------------------------------------------------------------------
55  virtual long long GetBytesToRecover(const DataFsPurgeshot&) = 0;
56 
57  //------------------------------------------------------------------------------
63  //------------------------------------------------------------------------------
64  virtual bool ConfigPurgePin(const char* params) // ?? AMT should this be abstract
65  {
66  (void) params;
67  return true;
68  }
69 
70  //-----------------------------------------------
74  //------------------------------------------------------------------------------
75  list_t &refDirInfos() { return m_list; }
76 };
77 }
78 
79 #endif
Base class for reguesting directory space to obtain.
virtual long long GetBytesToRecover(const DataFsPurgeshot &)=0
std::vector< DirInfo > list_t
virtual bool ConfigPurgePin(const char *params)
const DirUsage * dirUsage
list_t::iterator list_i
virtual bool CallPeriodically()
list_t & refDirInfos()
Definition: XrdPfc.hh:41