XRootD
XrdOssArcConfig.hh
Go to the documentation of this file.
1 #ifndef __XRDOSSARCCONFIG_HH__
2 #define __XRDOSSARCCONFIG_HH__
3 /******************************************************************************/
4 /* */
5 /* X r d O s s A r c C o n f i g . h h */
6 /* */
7 /* (c) 2023 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* Produced by Andrew Hanushevsky for Stanford University under contract */
9 /* DE-AC02-76-SFO0515 with the Deprtment of Energy */
10 /* */
11 /* This file is part of the XRootD software suite. */
12 /* */
13 /* XRootD is free software: you can redistribute it and/or modify it under */
14 /* the terms of the GNU Lesser General Public License as published by the */
15 /* Free Software Foundation, either version 3 of the License, or (at your */
16 /* option) any later version. */
17 /* */
18 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
19 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
20 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
21 /* License for more details. */
22 /* */
23 /* You should have received a copy of the GNU Lesser General Public License */
24 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
25 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
26 /* */
27 /* The copyright holder's institutional names and contributor's names may not */
28 /* be used to endorse or promote products derived from this software without */
29 /* specific prior written permission of the institution or contributor. */
30 /******************************************************************************/
31 
32 class XrdOucEnv;
33 class XrdOucProg;
34 class XrdOucGatherConf;
35 class XrdOssArcStopMon;
36 
38 {
39 public:
40 
41 bool BuildPath(const char* what, const char* baseP,
42  const char* addP, char*& destP, int mode=0);
43 
44 bool Configure(const char* cfn, const char* parms, XrdOucEnv* envP);
45 
46 int GenTapePath(const char* dsn, char* buff, int bSZ, bool addafn=false);
47 
49  ~XrdOssArcConfig() {} // Never gets deleted
50 
51 // Program section (i.e. the various scripts to launch
52 //
53 XrdOucProg* BkpUtilProg; // Various Rucio involved functions
54 char* BkpUtilPath; // The actual path to the program
55 const char* BkpUtilName; // Last component for debugging
56 const char* BkpUtilEOL; // Character sequence to indicate EOL
57 
58 XrdOucProg* PrepArcProg; // Create an archive
59 char* PrepArcPath; // The actual path to the executable
60 const char* PrepArcName; // Last component for debugging
61 
62 XrdOucProg* PostArcProg; // Create an archive
63 char* PostArcPath; // The actual path to the executable
64 const char* PostArcName; // Last component for debugging
65 
66 XrdOucProg* ArchiverProg; // Create an archive
67 char* ArchiverPath; // The actual path to the executable
68 const char* ArchiverName; // Last component for debugging
69 char* ArchiverSave; // The command to use to save archives for backup
70 
71 XrdOucProg* MssComProg; // Communicate with the MSS
72 char* MssComPath; // Path to prog script
73 const char* MssComName; // Last component for debugging
74 char* MssComCmd; // Actual command to be invoked
75 char* MssComRoot; // Root of the MSS Tape File System
76 
77 // Path section
78 //
79 char* arcvPathLFN; // LFN of archive path, default "/archive/"
80 int arcvPathLEN; // Length of the above
81 int bkupPathLEN; // Length of the below
82 char* bkupPathLFN; // LFN of backup path, default "/backup/"
83 char* dsetPathLFN; // LFN of dataset path, default "/dataset/"
84 char* dsetRepoPFN; // Path to directory where dataset backups are staged
85 char* admnPath; // The admin path
86 char* srcData; // Root path to where srcrse data is mounted
87 char* stagePath; // Path to directory where zip members are extracted
88 char* stopPath; // Path where the stop file should be written
89 char* tapePath; // The full path of the tape disk buffer
90 int tapePathLEN; // Length of the above
91 char* utilsPath; // Default path to utils
92 
93 // Miscellaneous
94 //
95 XrdOssArcStopMon* stopMon; // Pointer to the parent stop monitor
96 
97 const char* metaBKP; // Metadata variable name of backup status
98 const char* metaIDX; // Metadata variable name of ordinal index
99 char* doneBKP; // Metadata value indicating a backup completed
100 char* needBKP; // Metadata value indicating a backup is needed
101 char* dstRSE; // The name of the dest rse (our name)
102 char* srcRSE; // The name of the source rse
103 char* manCKS; // Checksum algorithm to add to manifest
104 long long bkpMinF; // Percentage or bytes that must be always available
105 int bkpMax; // Maximum number of parallel backups
106 int bkpPoll; // Polling interval to find new items to backup
107 int bkpFSt; // Backup fs scan interval in seconds
108 int maxStage; // Maximum number of parallel stages
109 int wtpStage; // Staging Wait/Poll interval
110 int r_maxItems; // rucio maximum response lines (query limit)
111 char* arFName; // Full archive filename (e.g. archive.zip)
112 char* arfSfx; // Archive file suffix
113 int arfSfxLen; // Length of the above
114 int stopChk; // Stat interval for STOP file
115 long long arcSZ_Want; // Preferred size of archive
116 long long arcSZ_MinV; // Minimum size archive can have
117 long long arcSZ_MaxV; // Maximum size archive can have
118 bool arcSZ_Skip; // When true skip archiving if size can't be met
119 bool bkpLocal; // T->Use fuse mount for backup, else do remote copy.
120 
121 private:
122 void ConfigPath(char** pDest, const char* pRoot);
123 bool ConfigProc(const char* drctv);
124 bool ConfigXeq(const char* cfName, const char* parms, XrdOucEnv* envP);
125 int GenLocalPath(const char* dsn, char* buff, int bSZ);
126 bool MissArg(const char* what);
127 bool Usable(const char* path, const char* what, bool useOss=true);
128 bool xqGrab(const char* what, char*& theDest, const char* theLine);
129 bool xqArcsz();
130 bool xqBkup();
131 bool xqBkupPS(char* tval);
132 bool xqBkupScope();
133 bool xqManf();
134 bool xqPaths();
135 bool xqRse();
136 bool xqRucio();
137 bool xqStage();
138 bool xqTrace();
139 bool xqUtils();
140 
141 XrdOucGatherConf* Conf;
142 };
143 #endif
const char * PostArcName
XrdOucProg * MssComProg
const char * metaBKP
const char * metaIDX
const char * BkpUtilEOL
bool BuildPath(const char *what, const char *baseP, const char *addP, char *&destP, int mode=0)
XrdOssArcStopMon * stopMon
XrdOucProg * ArchiverProg
int GenTapePath(const char *dsn, char *buff, int bSZ, bool addafn=false)
const char * ArchiverName
const char * MssComName
const char * PrepArcName
bool Configure(const char *cfn, const char *parms, XrdOucEnv *envP)
const char * BkpUtilName
XrdOucProg * PrepArcProg
XrdOucProg * PostArcProg
XrdOucProg * BkpUtilProg
XrdOucEnv * envP
Definition: XrdPss.cc:110