XRootD
Loading...
Searching...
No Matches
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
7namespace XrdPfc
8{
9class DataFsPurgeshot;
10class DirUsage;
11
12//----------------------------------------------------------------------------
14//----------------------------------------------------------------------------
16{
17public:
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
31protected:
33
34public:
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)
list_t & refDirInfos()
list_t::iterator list_i
virtual bool CallPeriodically()