XRootD
Loading...
Searching...
No Matches
XrdPfcDirStateBase.hh
Go to the documentation of this file.
1#ifndef __XRDPFC_DIRSTATEBASE_HH__
2#define __XRDPFC_DIRSTATEBASE_HH__
3
5#include <ctime>
6#include <string>
7
8namespace XrdPfc
9{
10
11//==============================================================================
12// Data-holding struct DirUsage -- complementary to Stats.
13//==============================================================================
14
16{
17 time_t m_LastOpenTime = 0;
18 time_t m_LastCloseTime = 0;
19 long long m_StBlocks = 0;
20 int m_NFilesOpen = 0;
21 int m_NFiles = 0;
23
24 DirUsage() = default;
25
26 DirUsage(const DirUsage& s) = default;
27
28 DirUsage& operator=(const DirUsage&) = default;
29
30 DirUsage(const DirUsage &a, const DirUsage &b) :
37 {}
38
40 {
45 }
46
48 {
51 }
52};
53
54
55//==============================================================================
56// Base classes, shared between in-memory tree form and snap-shot vector forms.
57//==============================================================================
58
60{
61 std::string m_dir_name;
62
64 DirStateBase(const std::string &dname) : m_dir_name(dname) {}
65};
66
68{
70
71 long long m_disk_total = 0; // In bytes, from Oss::StatVS() on space data
72 long long m_disk_used = 0; // ""
73 long long m_file_usage = 0; // Calculate usage by data files in the cache
74 long long m_meta_total = 0; // In bytes, from Oss::StatVS() on space meta
75 long long m_meta_used = 0; // ""
76};
77
78}
79
80#endif
long long m_StBlocksRemoved
long long m_StBlocksAdded
number of 512-byte blocks the file has grown by
DirStateBase(const std::string &dname)
DirUsage(const DirUsage &s)=default
void update_from_stats(const DirStats &s)
DirUsage(const DirUsage &a, const DirUsage &b)
DirUsage & operator=(const DirUsage &)=default
void update_last_times(const DirUsage &u)
DirUsage()=default