XRootD
Loading...
Searching...
No Matches
XrdOssArcFSMon.hh
Go to the documentation of this file.
1
#ifndef _XRDOSSACFSMON_H
2
#define _XRDOSSACFSMON_H
3
/******************************************************************************/
4
/* */
5
/* X r d O s s A r c F S M o n . h h */
6
/* */
7
/* (c) 2024 by the Board of Trustees of the Leland Stanford, Jr., University */
8
/* All Rights Reserved */
9
/* Produced by Andrew Hanushevsky for Stanford University under contract */
10
/* DE-AC02-76-SFO0515 with the Department of Energy */
11
/* */
12
/* This file is part of the XRootD software suite. */
13
/* */
14
/* XRootD is free software: you can redistribute it and/or modify it under */
15
/* the terms of the GNU Lesser General Public License as published by the */
16
/* Free Software Foundation, either version 3 of the License, or (at your */
17
/* option) any later version. */
18
/* */
19
/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22
/* License for more details. */
23
/* */
24
/* You should have received a copy of the GNU Lesser General Public License */
25
/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26
/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27
/* */
28
/* The copyright holder's institutional names and contributor's names may not */
29
/* be used to endorse or promote products derived from this software without */
30
/* specific prior written permission of the institution or contributor. */
31
/******************************************************************************/
32
33
#include <deque>
34
35
#include "
Xrd/XrdJob.hh
"
36
37
#include "
XrdSys/XrdSysPthread.hh
"
38
39
class
XrdOssArcBackupTask
;
40
41
class
XrdOssArcFSMon
:
public
XrdJob
42
{
43
public
:
44
45
void
DoIt
()
override
;
46
47
bool
Init
(
const
char
* path,
long
long
fVal,
int
fsupdt);
48
49
bool
Permit
(
XrdOssArcBackupTask
* btP);
50
51
void
Release
(
size_t
bytes);
52
53
XrdOssArcFSMon
() : fs_inBkp(0) {}
54
~XrdOssArcFSMon
() {}
55
56
private
:
57
58
size_t
getFSpace(
size_t
&Size,
const
char
*path);
59
60
XrdSysMutex
rmMutex;
61
std::deque<XrdOssArcBackupTask*> btWaitQ;
62
63
const
char
* fs_Path;
64
65
size_t
fs_inBkp;
// Bytes currently committed for backup
66
size_t
fs_inUse;
// Bytes currently in use (Size - Free) since last update
67
68
size_t
fs_MaxUsed;
// Maximum used space allowed in bytes
69
size_t
fs_MinFree;
// Minimum free space allowed in bytes
70
71
size_t
fs_Free;
// Filesystem free in bytes
72
size_t
fs_Size;
// Filesystem size in bytes
73
74
int
fs_Updt;
// Interval between async free space updates
75
};
76
#endif
XrdJob.hh
XrdSysPthread.hh
XrdJob::XrdJob
XrdJob(const char *desc="")
Definition
XrdJob.hh:51
XrdOssArcBackupTask
Definition
XrdOssArcBackup.hh:48
XrdOssArcFSMon::~XrdOssArcFSMon
~XrdOssArcFSMon()
Definition
XrdOssArcFSMon.hh:54
XrdOssArcFSMon::Release
void Release(size_t bytes)
Definition
XrdOssArcFSMon.cc:227
XrdOssArcFSMon::Permit
bool Permit(XrdOssArcBackupTask *btP)
Definition
XrdOssArcFSMon.cc:203
XrdOssArcFSMon::DoIt
void DoIt() override
Definition
XrdOssArcFSMon.cc:93
XrdOssArcFSMon::Init
bool Init(const char *path, long long fVal, int fsupdt)
Definition
XrdOssArcFSMon.cc:141
XrdOssArcFSMon::XrdOssArcFSMon
XrdOssArcFSMon()
Definition
XrdOssArcFSMon.hh:53
XrdSysMutex
Definition
XrdSysPthread.hh:165
XrdOssArc
XrdOssArcFSMon.hh
Generated by
1.16.1