XRootD
XrdPfc::DataFsPurgeshot Struct Reference

#include <XrdPfcDirStateSnapshot.hh>

+ Inheritance diagram for XrdPfc::DataFsPurgeshot:
+ Collaboration diagram for XrdPfc::DataFsPurgeshot:

Public Member Functions

 DataFsPurgeshot ()
 
 DataFsPurgeshot (const DataFsState &b)
 
int find_dir_entry_for_dir_path (const std::string &dir_path) const
 
int find_dir_entry_from_tok (int entry, PathTokenizer &pt, int pos, int *last_existing_entry) const
 
const DirUsagefind_dir_usage_for_dir_path (const std::string &dir_path) const
 

Public Attributes

bool m_age_based_purge = false
 
long long m_bytes_to_remove = 0
 
std::vector< DirPurgeElementm_dir_vec
 
long long m_estimated_writes_from_writeq = 0
 
bool m_space_based_purge = false
 
- Public Attributes inherited from XrdPfc::DataFsStateBase
long long m_disk_total = 0
 
long long m_disk_used = 0
 
long long m_file_usage = 0
 
long long m_meta_total = 0
 
long long m_meta_used = 0
 
time_t m_stats_reset_time = 0
 
time_t m_usage_update_time = 0
 

Detailed Description

Definition at line 67 of file XrdPfcDirStateSnapshot.hh.

Constructor & Destructor Documentation

◆ DataFsPurgeshot() [1/2]

XrdPfc::DataFsPurgeshot::DataFsPurgeshot ( )
inline

Definition at line 80 of file XrdPfcDirStateSnapshot.hh.

80 {}

◆ DataFsPurgeshot() [2/2]

XrdPfc::DataFsPurgeshot::DataFsPurgeshot ( const DataFsState b)
inline

Definition at line 81 of file XrdPfcDirStateSnapshot.hh.

81  :
82  DataFsStateBase(b)
83  {}

Member Function Documentation

◆ find_dir_entry_for_dir_path()

int DataFsPurgeshot::find_dir_entry_for_dir_path ( const std::string &  dir_path) const

Definition at line 111 of file XrdPfcDirStateSnapshot.cc.

112 {
113  PathTokenizer pt(dir_path, -1, false);
114  return find_dir_entry_from_tok(0, pt, 0, nullptr);
115 }
int find_dir_entry_from_tok(int entry, PathTokenizer &pt, int pos, int *last_existing_entry) const

References find_dir_entry_from_tok().

Referenced by find_dir_usage_for_dir_path().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ find_dir_entry_from_tok()

int DataFsPurgeshot::find_dir_entry_from_tok ( int  entry,
PathTokenizer pt,
int  pos,
int *  last_existing_entry 
) const

Definition at line 94 of file XrdPfcDirStateSnapshot.cc.

95 {
96  if (pos == pt.get_n_dirs())
97  return entry;
98 
99  const DirPurgeElement &dpe = m_dir_vec[entry];
100  for (int i = dpe.m_daughters_begin; i != dpe.m_daughters_end; ++i)
101  {
102  if (m_dir_vec[i].m_dir_name == pt.get_dir(pos)) {
103  return find_dir_entry_from_tok(i, pt, pos + 1, last_existing_entry);
104  }
105  }
106  if (last_existing_entry)
107  *last_existing_entry = entry;
108  return -1;
109 }
std::vector< DirPurgeElement > m_dir_vec
const char * get_dir(int pos)

References XrdPfc::PathTokenizer::get_dir(), XrdPfc::PathTokenizer::get_n_dirs(), XrdPfc::DirPurgeElement::m_daughters_begin, XrdPfc::DirPurgeElement::m_daughters_end, and m_dir_vec.

Referenced by find_dir_entry_for_dir_path().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ find_dir_usage_for_dir_path()

const DirUsage * DataFsPurgeshot::find_dir_usage_for_dir_path ( const std::string &  dir_path) const

Definition at line 117 of file XrdPfcDirStateSnapshot.cc.

118 {
119  int entry = find_dir_entry_for_dir_path(dir_path);
120  return entry >= 0 ? &m_dir_vec[entry].m_usage : nullptr;
121 }
int find_dir_entry_for_dir_path(const std::string &dir_path) const

References find_dir_entry_for_dir_path(), and m_dir_vec.

Referenced by XrdPfcPurgeQuota::InitDirStatesForLocalPaths().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_age_based_purge

bool XrdPfc::DataFsPurgeshot::m_age_based_purge = false

◆ m_bytes_to_remove

long long XrdPfc::DataFsPurgeshot::m_bytes_to_remove = 0

◆ m_dir_vec

std::vector<DirPurgeElement> XrdPfc::DataFsPurgeshot::m_dir_vec

◆ m_estimated_writes_from_writeq

long long XrdPfc::DataFsPurgeshot::m_estimated_writes_from_writeq = 0

◆ m_space_based_purge

bool XrdPfc::DataFsPurgeshot::m_space_based_purge = false

The documentation for this struct was generated from the following files: