![]() |
XRootD
|
#include <XrdPfcDirState.hh>
Public Types | |
typedef DsMap_t::iterator | DsMap_i |
typedef std::map< std::string, DirState > | DsMap_t |
Public Member Functions | |
DirState () | |
Constructor. More... | |
DirState (DirState *parent) | |
DirState (DirState *parent, const std::string &dname) | |
int | count_dirs_to_level (int max_depth) const |
DirState * | create_child (const std::string &dir) |
void | dump_recursively (const char *name, int max_depth) const |
DirState * | find_dir (const std::string &dir, bool create_subdirs) |
DirState * | find_path (const std::string &path, int max_depth, bool parse_as_lfn, bool create_subdirs, DirState **last_existing_dir=nullptr) |
DirState * | find_path_tok (PathTokenizer &pt, int pos, bool create_subdirs, DirState **last_existing_dir=nullptr) |
int | generate_dir_path (std::string &result) |
DirState * | get_parent () |
void | init () |
void | reset_sshot_stats () |
void | reset_stats () |
void | update_stats_and_usages (bool purge_empty_dirs, unlink_func unlink_foo) |
void | upward_propagate_initial_scan_usages () |
![]() | |
DirStateBase () | |
DirStateBase (const std::string &dname) | |
Public Attributes | |
int | m_depth |
DirStats | m_here_stats |
DirUsage | m_here_usage |
DirState * | m_parent = nullptr |
DirStats | m_recursive_subdir_stats |
DirUsage | m_recursive_subdir_usage |
bool | m_scanned = false |
DirStats | m_sshot_stats |
DsMap_t | m_subdirs |
![]() | |
std::string | m_dir_name |
Definition at line 55 of file XrdPfcDirState.hh.
typedef DsMap_t::iterator XrdPfc::DirState::DsMap_i |
Definition at line 58 of file XrdPfcDirState.hh.
typedef std::map<std::string, DirState> XrdPfc::DirState::DsMap_t |
Definition at line 57 of file XrdPfcDirState.hh.
DirState::DirState | ( | ) |
Constructor.
Definition at line 12 of file XrdPfcDirState.cc.
Referenced by create_child().
DirState::DirState | ( | DirState * | parent | ) |
DirState::DirState | ( | DirState * | parent, |
const std::string & | dname | ||
) |
Constructor
parent | parent DirState object |
dname | name of this directory only, no slashes, no extras. |
Definition at line 29 of file XrdPfcDirState.cc.
int DirState::count_dirs_to_level | ( | int | max_depth | ) | const |
Definition at line 233 of file XrdPfcDirState.cc.
References m_depth, and m_subdirs.
Referenced by XrdPfc::ResourceMonitor::heart_beat(), and XrdPfc::ResourceMonitor::perform_purge_check().
DirState * DirState::create_child | ( | const std::string & | dir | ) |
Internal function called from find_dir or find_path_tok
dir | subdir name |
Definition at line 39 of file XrdPfcDirState.cc.
References DirState(), and m_subdirs.
Referenced by find_dir(), and find_path_tok().
void DirState::dump_recursively | ( | const char * | name, |
int | max_depth | ||
) | const |
Recursive print of statistics. Called if defined in pfc configuration.
Definition at line 250 of file XrdPfcDirState.cc.
References XrdPfc::Stats::m_BytesBypassed, XrdPfc::Stats::m_BytesHit, XrdPfc::Stats::m_BytesMissed, XrdPfc::Stats::m_BytesWritten, m_depth, XrdPfc::Stats::m_Duration, m_here_stats, m_here_usage, XrdPfc::Stats::m_NumIos, m_recursive_subdir_usage, XrdPfc::DirUsage::m_StBlocks, and m_subdirs.
Referenced by XrdPfc::DataFsState::dump_recursively().
DirState * DirState::find_dir | ( | const std::string & | dir, |
bool | create_subdirs | ||
) |
Non recursive function to find an entry in this directory only.
dir | subdir name |
bool | create the subdir in this DirsStat |
create_subdirs | if true and the dir is not found, a new DirState child is created |
Definition at line 98 of file XrdPfcDirState.cc.
References create_child(), and m_subdirs.
Referenced by XrdPfc::FsTraversal::cd_down().
DirState * DirState::find_path | ( | const std::string & | path, |
int | max_depth, | ||
bool | parse_as_lfn, | ||
bool | create_subdirs, | ||
DirState ** | last_existing_dir = nullptr |
||
) |
Recursive function to find DirState with given absolute dir path
path | full path to parse |
max_depth | directory depth to which to descend (value < 0 means full descent) |
parse_as_lfn | |
create_subdirs |
Definition at line 82 of file XrdPfcDirState.cc.
References find_path_tok().
Referenced by XrdPfc::DataFsState::find_dirstate_for_lfn(), and XrdPfc::ResourceMonitor::process_queues().
DirState * DirState::find_path_tok | ( | PathTokenizer & | pt, |
int | pos, | ||
bool | create_subdirs, | ||
DirState ** | last_existing_dir = nullptr |
||
) |
Internal function called from find_path
dir | subdir name |
Definition at line 49 of file XrdPfcDirState.cc.
References create_child(), find_path_tok(), XrdPfc::PathTokenizer::get_n_dirs(), XrdPfc::PathTokenizer::m_dirs, and m_subdirs.
Referenced by find_path(), and find_path_tok().
int DirState::generate_dir_path | ( | std::string & | result | ) |
Parent-recursively height-first append '/' and directory names to the result string. Returns total number of added characters.
Definition at line 116 of file XrdPfcDirState.cc.
References generate_dir_path(), XrdPfc::DirStateBase::m_dir_name, and m_parent.
Referenced by generate_dir_path(), and update_stats_and_usages().
|
inline |
Definition at line 91 of file XrdPfcDirState.hh.
References m_parent.
Referenced by XrdPfc::FsTraversal::cd_up(), and XrdPfc::ResourceMonitor::process_queues().
void XrdPfc::DirState::init | ( | ) |
void DirState::reset_sshot_stats | ( | ) |
Definition at line 224 of file XrdPfcDirState.cc.
References m_sshot_stats, m_subdirs, and XrdPfc::DirStats::Reset().
Referenced by XrdPfc::DataFsState::reset_sshot_stats().
void DirState::reset_stats | ( | ) |
Reset current transaction deltas / stats. Called from ResourceMonitor::heart_beat()
Definition at line 214 of file XrdPfcDirState.cc.
References m_here_stats, m_recursive_subdir_stats, m_subdirs, and XrdPfc::DirStats::Reset().
Referenced by XrdPfc::DataFsState::reset_stats().
void DirState::update_stats_and_usages | ( | bool | purge_empty_dirs, |
unlink_func | unlink_foo | ||
) |
Upward propagate stats to parents, join last open/close timestamps, and apply deltas / stats to usages.
Additionally, manage removal of empty leaf directories and destruction of corresponding leaf DirState objects.
Definition at line 158 of file XrdPfcDirState.cc.
References XrdPfc::DirStats::AddUp(), generate_dir_path(), m_here_stats, m_here_usage, XrdPfc::DirUsage::m_NDirectories, XrdPfc::DirStats::m_NDirectoriesRemoved, XrdPfc::DirUsage::m_NFiles, m_recursive_subdir_stats, m_recursive_subdir_usage, m_sshot_stats, m_subdirs, XrdPfc::DirUsage::update_from_stats(), XrdPfc::DirUsage::update_last_times(), and update_stats_and_usages().
Referenced by update_stats_and_usages(), and XrdPfc::DataFsState::update_stats_and_usages().
void DirState::upward_propagate_initial_scan_usages | ( | ) |
Propagate usages to parents after initial directory scan. Called from ResourceMonitor::perform_initial_scan()
Definition at line 131 of file XrdPfcDirState.cc.
References m_here_usage, XrdPfc::DirUsage::m_NDirectories, XrdPfc::DirUsage::m_NFiles, m_recursive_subdir_usage, XrdPfc::DirUsage::m_StBlocks, and m_subdirs.
Referenced by XrdPfc::ResourceMonitor::perform_initial_scan().
int XrdPfc::DirState::m_depth |
Definition at line 73 of file XrdPfcDirState.hh.
Referenced by count_dirs_to_level(), dump_recursively(), XrdPfc::ResourceMonitor::fill_pshot_vec_children(), and XrdPfc::ResourceMonitor::fill_sshot_vec_children().
DirStats XrdPfc::DirState::m_here_stats |
Definition at line 60 of file XrdPfcDirState.hh.
Referenced by dump_recursively(), XrdPfc::ResourceMonitor::process_queues(), reset_stats(), and update_stats_and_usages().
DirUsage XrdPfc::DirState::m_here_usage |
Definition at line 63 of file XrdPfcDirState.hh.
Referenced by dump_recursively(), XrdPfc::ResourceMonitor::heart_beat(), XrdPfc::ResourceMonitor::perform_initial_scan(), XrdPfc::ResourceMonitor::perform_purge_check(), XrdPfc::ResourceMonitor::process_queues(), XrdPfc::ResourceMonitor::scan_dir_and_recurse(), update_stats_and_usages(), and upward_propagate_initial_scan_usages().
DirState* XrdPfc::DirState::m_parent = nullptr |
Definition at line 71 of file XrdPfcDirState.hh.
Referenced by generate_dir_path(), and get_parent().
DirStats XrdPfc::DirState::m_recursive_subdir_stats |
Definition at line 61 of file XrdPfcDirState.hh.
Referenced by reset_stats(), and update_stats_and_usages().
DirUsage XrdPfc::DirState::m_recursive_subdir_usage |
Definition at line 64 of file XrdPfcDirState.hh.
Referenced by dump_recursively(), XrdPfc::ResourceMonitor::heart_beat(), XrdPfc::ResourceMonitor::perform_initial_scan(), XrdPfc::ResourceMonitor::perform_purge_check(), update_stats_and_usages(), and upward_propagate_initial_scan_usages().
bool XrdPfc::DirState::m_scanned = false |
Definition at line 74 of file XrdPfcDirState.hh.
Referenced by XrdPfc::ResourceMonitor::scan_dir_and_recurse().
DirStats XrdPfc::DirState::m_sshot_stats |
Definition at line 68 of file XrdPfcDirState.hh.
Referenced by reset_sshot_stats(), and update_stats_and_usages().
DsMap_t XrdPfc::DirState::m_subdirs |
Definition at line 72 of file XrdPfcDirState.hh.
Referenced by count_dirs_to_level(), create_child(), dump_recursively(), XrdPfc::ResourceMonitor::fill_pshot_vec_children(), XrdPfc::ResourceMonitor::fill_sshot_vec_children(), find_dir(), find_path_tok(), reset_sshot_stats(), reset_stats(), update_stats_and_usages(), and upward_propagate_initial_scan_usages().