Loading...
Searching...
No Matches
XrdPfcPurgePin.hh
Go to the documentation of this file.
#ifndef __XRDPFC_PURGEPLG_HH__
#define __XRDPFC_PURGEPLG_HH__
#include <string>
#include <vector>
namespace XrdPfc
{
struct DataFsPurgeshot;
struct DirUsage;
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
class PurgePin
{
public:
struct DirInfo
{
std::string path;
long long nBytesQuota{0};
long long nBytesToRecover{0};
// internal use by the Cache purge thread. to be revisited, maybe an access token is more appropriate.
const DirUsage* dirUsage{nullptr};
};
typedef std::vector<DirInfo> list_t;
typedef list_t::iterator list_i;
protected:
list_t m_list;
public:
virtual ~PurgePin() {}
//---------------------------------------------------------------------
//---------------------------------------------------------------------
virtual bool CallPeriodically() { return true; };
//---------------------------------------------------------------------
// To be revisited -- can have a multi-step approach where
// cache periodically sends udates.
//---------------------------------------------------------------------
virtual long long GetBytesToRecover(const DataFsPurgeshot&) = 0;
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
virtual bool ConfigPurgePin(const char* params) // ?? AMT should this be abstract
{
(void) params;
return true;
}
//-----------------------------------------------
//------------------------------------------------------------------------------
list_t &refDirInfos() { return m_list; }
};
}
#endif
XrdPfc::PurgePin
Base class for reguesting directory space to obtain.
Definition XrdPfcPurgePin.hh:16
XrdPfc::PurgePin::GetBytesToRecover
virtual long long GetBytesToRecover(const DataFsPurgeshot &)=0
XrdPfc::PurgePin::m_list
list_t m_list
Definition XrdPfcPurgePin.hh:32
XrdPfc::PurgePin::list_t
std::vector< DirInfo > list_t
Definition XrdPfcPurgePin.hh:28
XrdPfc::PurgePin::ConfigPurgePin
virtual bool ConfigPurgePin(const char *params)
Definition XrdPfcPurgePin.hh:64
XrdPfc::PurgePin::refDirInfos
list_t & refDirInfos()
Definition XrdPfcPurgePin.hh:75
XrdPfc::PurgePin::DirInfo::dirUsage
const DirUsage * dirUsage
Definition XrdPfcPurgePin.hh:25
XrdPfc::PurgePin::list_i
list_t::iterator list_i
Definition XrdPfcPurgePin.hh:29
XrdPfc::PurgePin::~PurgePin
virtual ~PurgePin()
Definition XrdPfcPurgePin.hh:35
XrdPfc::PurgePin::CallPeriodically
virtual bool CallPeriodically()
Definition XrdPfcPurgePin.hh:43
XrdPfc::PurgePin::DirInfo::nBytesQuota
long long nBytesQuota
Definition XrdPfcPurgePin.hh:21
XrdPfc::PurgePin::DirInfo::path
std::string path
Definition XrdPfcPurgePin.hh:20
XrdPfc::PurgePin::DirInfo::nBytesToRecover
long long nBytesToRecover
Definition XrdPfcPurgePin.hh:22
XrdPfc::PurgePin::DirInfo
Definition XrdPfcPurgePin.hh:19
XrdPfc
Definition XrdPfc.hh:41
XrdPfc::DataFsPurgeshot
Definition XrdPfcDirStatePurgeshot.hh:25
XrdPfc::DirUsage
Definition XrdPfcDirStateBase.hh:16