![]() |
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) | |
void | apply_stats_to_usages () |
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) |
DirState * | get_parent () |
void | init () |
void | reset_stats () |
void | upward_propagate_initial_scan_usages () |
void | upward_propagate_stats_and_times () |
![]() | |
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 |
DsMap_t | m_subdirs |
![]() | |
std::string | m_dir_name |
Definition at line 121 of file XrdPfcDirState.hh.
typedef DsMap_t::iterator XrdPfc::DirState::DsMap_i |
Definition at line 124 of file XrdPfcDirState.hh.
typedef std::map<std::string, DirState> XrdPfc::DirState::DsMap_t |
Definition at line 123 of file XrdPfcDirState.hh.
DirState::DirState | ( | ) |
Constructor.
Definition at line 11 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 28 of file XrdPfcDirState.cc.
void DirState::apply_stats_to_usages | ( | ) |
Definition at line 154 of file XrdPfcDirState.cc.
References m_here_stats, m_here_usage, m_recursive_subdir_stats, m_recursive_subdir_usage, m_subdirs, and XrdPfc::DirUsage::update_from_stats().
Referenced by XrdPfc::DataFsState::apply_stats_to_usages().
int DirState::count_dirs_to_level | ( | int | max_depth | ) | const |
Definition at line 178 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 38 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 195 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 97 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 81 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 48 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().
|
inline |
Definition at line 157 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_stats | ( | ) |
Reset current transaction statistics. Called from ... to be seen if needed at all XXXX
Definition at line 168 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::upward_propagate_initial_scan_usages | ( | ) |
Propagate usages to parents after initial directory scan. Called from ResourceMonitor::perform_initial_scan()
Definition at line 115 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().
void DirState::upward_propagate_stats_and_times | ( | ) |
Propagate stat to parents Called from ResourceMonitor::heart_beat()
Definition at line 139 of file XrdPfcDirState.cc.
References XrdPfc::DirStats::AddUp(), m_recursive_subdir_stats, m_recursive_subdir_usage, m_subdirs, and XrdPfc::DirUsage::update_last_times().
Referenced by XrdPfc::DataFsState::upward_propagate_stats_and_times().
int XrdPfc::DirState::m_depth |
Definition at line 139 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 126 of file XrdPfcDirState.hh.
Referenced by apply_stats_to_usages(), dump_recursively(), XrdPfc::ResourceMonitor::process_queues(), and reset_stats().
DirUsage XrdPfc::DirState::m_here_usage |
Definition at line 129 of file XrdPfcDirState.hh.
Referenced by apply_stats_to_usages(), 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(), and upward_propagate_initial_scan_usages().
DirState* XrdPfc::DirState::m_parent = nullptr |
Definition at line 137 of file XrdPfcDirState.hh.
Referenced by get_parent().
DirStats XrdPfc::DirState::m_recursive_subdir_stats |
Definition at line 127 of file XrdPfcDirState.hh.
Referenced by apply_stats_to_usages(), reset_stats(), and upward_propagate_stats_and_times().
DirUsage XrdPfc::DirState::m_recursive_subdir_usage |
Definition at line 130 of file XrdPfcDirState.hh.
Referenced by apply_stats_to_usages(), dump_recursively(), XrdPfc::ResourceMonitor::heart_beat(), XrdPfc::ResourceMonitor::perform_initial_scan(), XrdPfc::ResourceMonitor::perform_purge_check(), upward_propagate_initial_scan_usages(), and upward_propagate_stats_and_times().
bool XrdPfc::DirState::m_scanned = false |
Definition at line 140 of file XrdPfcDirState.hh.
Referenced by XrdPfc::ResourceMonitor::scan_dir_and_recurse().
DsMap_t XrdPfc::DirState::m_subdirs |
Definition at line 138 of file XrdPfcDirState.hh.
Referenced by apply_stats_to_usages(), 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_stats(), upward_propagate_initial_scan_usages(), and upward_propagate_stats_and_times().