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
38
40
41class XrdOssArcFSMon : public XrdJob
42{
43public:
44
45void DoIt() override;
46
47bool Init(const char* path, long long fVal, int fsupdt);
48
50
51void Release(size_t bytes);
52
53 XrdOssArcFSMon() : fs_inBkp(0) {}
55
56private:
57
58size_t getFSpace(size_t &Size, const char *path);
59
60XrdSysMutex rmMutex;
61std::deque<XrdOssArcBackupTask*> btWaitQ;
62
63const char* fs_Path;
64
65size_t fs_inBkp; // Bytes currently committed for backup
66size_t fs_inUse; // Bytes currently in use (Size - Free) since last update
67
68size_t fs_MaxUsed; // Maximum used space allowed in bytes
69size_t fs_MinFree; // Minimum free space allowed in bytes
70
71size_t fs_Free; // Filesystem free in bytes
72size_t fs_Size; // Filesystem size in bytes
73
74int fs_Updt; // Interval between async free space updates
75};
76#endif
XrdJob(const char *desc="")
Definition XrdJob.hh:51
void Release(size_t bytes)
bool Permit(XrdOssArcBackupTask *btP)
void DoIt() override
bool Init(const char *path, long long fVal, int fsupdt)