xrootd
XrdOucPsx.hh
Go to the documentation of this file.
1 #ifndef _XRDOUCPSX_H
2 #define _XRDOUCPSX_H
3 /******************************************************************************/
4 /* */
5 /* X r d O u c P s x . h h */
6 /* */
7 /* (c) 2017 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 <stdlib.h>
34 #include <string.h>
35 #include <sys/types.h>
36 
37 #include "XrdOuc/XrdOucCacheCM.hh"
38 
39 class XrdOucCacheIF;
40 class XrdOucEnv;
41 class XrdOucName2Name;
42 class XrdSysError;
43 class XrdOucStream;
44 class XrdOucTList;
45 
46 struct XrdVersionInfo;
47 
48 class XrdOucPsx
49 {
50 public:
51 
52 const
53 char *CCMInfo(const char *&path) {path = mPath; return mParm;}
54 
55 bool ClientConfig(const char *pfx, bool hush=false);
56 
57 bool ConfigSetup(XrdSysError &eDest, bool hush=false);
58 
60 
62 
64 
66 
68 
70 
72 
74 
75 void SetRoot(const char *lroot, const char *oroot=0);
76 
77 char *configFN; // -> Pointer to the config file name
80 XrdOucName2Name *theN2N; // -> File mapper object
81 XrdOucCache *theCache; // -> V1 cache
82 XrdOucCache2 *theCache2; // -> V2 cache
83 XrdOucCacheCMInit_t initCCM; // -> Cache context manager initializer
84 char *mCache; // -> memory cache parameters
87 int maxRHCB;
90 int cioWait;
92 bool useV4;
93 bool xLfn2Pfn;
94 bool xPfn2Lfn;
95 bool xNameLib;
96 
97  XrdOucPsx(XrdVersionInfo *vInfo, const char *cfn, XrdSysLogger *lp=0)
98  : configFN(strdup(cfn)), theLogger(lp), theEnv(0),
99  theN2N(0), theCache(0), theCache2(0), initCCM(0),
100  mCache(0), setFirst(0), setLast(0), maxRHCB(0),
101  traceLvl(0), debugLvl(0), cioWait(0), cioTries(0),
102  useV4(false), xLfn2Pfn(false), xPfn2Lfn(false),
103  xNameLib(false),
104  LocalRoot(0), RemotRoot(0), N2NLib(0), N2NParms(0),
105  cPath(0), cParm(0), mPath(0), mParm(0),
106  myVersion(vInfo) {}
108 
109 private:
110 
111 char *LocalRoot;// -> Local n2n root, if any
112 char *RemotRoot;// -> Remote n2n root, if any
113 char *N2NLib; // -> Name2Name Library Path
114 char *N2NParms; // -> Name2Name Object Parameters
115 char *cPath; // -> Cache path
116 char *cParm; // -> Cache parameters
117 char *mPath; // -> CCM path
118 char *mParm; // -> CCM parameters
119 XrdVersionInfo *myVersion;// -> Compilation version
120 
122 bool ConfigN2N(XrdSysError &eDest);
123 bool LoadCCM(XrdSysError &eDest);
125 char *ParseCache(XrdSysError *Eroute, XrdOucStream &Config, char *pBuff);
126 void ParseSet(const char *kword, int kval);
127 void WarnConfig(XrdSysError &eDest, XrdOucTList *tList, bool fatal);
128 void WarnPlugin(XrdSysError &eDest, XrdOucTList *tList,
129  const char *txt1, const char *txt2);
130 };
131 #endif
XrdOucPsx::setFirst
XrdOucTList * setFirst
Definition: XrdOucPsx.hh:85
XrdOucPsx::Parse
bool Parse(char *, XrdOucStream &, XrdSysError &)
XrdOucPsx::theEnv
XrdOucEnv * theEnv
Definition: XrdOucPsx.hh:79
XrdOucPsx::theLogger
XrdSysLogger * theLogger
Definition: XrdOucPsx.hh:78
XrdOucCache
Definition: XrdOucCache.hh:283
XrdOucPsx::XrdOucPsx
XrdOucPsx(XrdVersionInfo *vInfo, const char *cfn, XrdSysLogger *lp=0)
Definition: XrdOucPsx.hh:97
XrdOucPsx::SetRoot
void SetRoot(const char *lroot, const char *oroot=0)
XrdOucPsx::setLast
XrdOucTList * setLast
Definition: XrdOucPsx.hh:86
XrdOucPsx::mCache
char * mCache
Definition: XrdOucPsx.hh:84
XrdOucPsx::ParseCache
bool ParseCache(XrdSysError *Eroute, XrdOucStream &Config)
XrdOucPsx::configFN
char * configFN
Definition: XrdOucPsx.hh:77
XrdOucCache2
Definition: XrdOucCache2.hh:197
XrdOucPsx::ParseCache
char * ParseCache(XrdSysError *Eroute, XrdOucStream &Config, char *pBuff)
XrdOucPsx::theCache
XrdOucCache * theCache
Definition: XrdOucPsx.hh:81
XrdOucStream
Definition: XrdOucStream.hh:46
XrdOucPsx::ParseCio
bool ParseCio(XrdSysError *Eroute, XrdOucStream &Config)
XrdOucPsx::ParseINet
bool ParseINet(XrdSysError *Eroute, XrdOucStream &Config)
XrdOucPsx::LoadCCM
bool LoadCCM(XrdSysError &eDest)
XrdOucPsx::cPath
char * cPath
Definition: XrdOucPsx.hh:115
XrdOucCacheCMInit_t
bool(* XrdOucCacheCMInit_t)(XrdPosixCache &Cache, XrdSysLogger *Logger, const char *Config, const char *Parms, XrdOucEnv *envP)
Definition: XrdOucCacheCM.hh:67
XrdOucPsx::theN2N
XrdOucName2Name * theN2N
Definition: XrdOucPsx.hh:80
XrdOucPsx::myVersion
XrdVersionInfo * myVersion
Definition: XrdOucPsx.hh:119
XrdOucPsx::ClientConfig
bool ClientConfig(const char *pfx, bool hush=false)
XrdOucPsx::ConfigSetup
bool ConfigSetup(XrdSysError &eDest, bool hush=false)
XrdOucPsx::ParseMLib
bool ParseMLib(XrdSysError *Eroute, XrdOucStream &Config)
XrdOucPsx::ParseCLib
bool ParseCLib(XrdSysError *Eroute, XrdOucStream &Config)
XrdOucPsx::ConfigN2N
bool ConfigN2N(XrdSysError &eDest)
XrdOucPsx::theCache2
XrdOucCache2 * theCache2
Definition: XrdOucPsx.hh:82
XrdOucPsx::xNameLib
bool xNameLib
Definition: XrdOucPsx.hh:95
XrdOucPsx::debugLvl
int debugLvl
Definition: XrdOucPsx.hh:89
XrdOucEnv
Definition: XrdOucEnv.hh:42
XrdOucPsx::N2NParms
char * N2NParms
Definition: XrdOucPsx.hh:114
XrdOucCacheCM.hh
XrdSysLogger
Definition: XrdSysLogger.hh:53
XrdOucPsx::ParseTrace
bool ParseTrace(XrdSysError *Eroute, XrdOucStream &Config)
XrdCms::Config
XrdCmsConfig Config
XrdOucPsx::maxRHCB
int maxRHCB
Definition: XrdOucPsx.hh:87
XrdOucPsx::mPath
char * mPath
Definition: XrdOucPsx.hh:117
XrdOucPsx::WarnConfig
void WarnConfig(XrdSysError &eDest, XrdOucTList *tList, bool fatal)
XrdOucPsx::ParseSet
void ParseSet(const char *kword, int kval)
XrdOucPsx::cioWait
int cioWait
Definition: XrdOucPsx.hh:90
XrdOucPsx::initCCM
XrdOucCacheCMInit_t initCCM
Definition: XrdOucPsx.hh:83
XrdOucPsx::N2NLib
char * N2NLib
Definition: XrdOucPsx.hh:113
XrdOucPsx::ParseSet
bool ParseSet(XrdSysError *Eroute, XrdOucStream &Config)
XrdOucPsx::CCMInfo
const char * CCMInfo(const char *&path)
Definition: XrdOucPsx.hh:53
XrdOucName2Name
Definition: XrdOucName2Name.hh:49
XrdOucPsx::LocalRoot
char * LocalRoot
Definition: XrdOucPsx.hh:111
XrdOucPsx::useV4
bool useV4
Definition: XrdOucPsx.hh:92
XrdOucPsx::xPfn2Lfn
bool xPfn2Lfn
Definition: XrdOucPsx.hh:94
XrdOucPsx::xLfn2Pfn
bool xLfn2Pfn
Definition: XrdOucPsx.hh:93
XrdOucPsx::cParm
char * cParm
Definition: XrdOucPsx.hh:116
XrdOucPsx::RemotRoot
char * RemotRoot
Definition: XrdOucPsx.hh:112
XrdOucPsx::traceLvl
int traceLvl
Definition: XrdOucPsx.hh:88
XrdOucPsx::~XrdOucPsx
~XrdOucPsx()
XrdSysError
Definition: XrdSysError.hh:90
XrdOucPsx::WarnPlugin
void WarnPlugin(XrdSysError &eDest, XrdOucTList *tList, const char *txt1, const char *txt2)
XrdOucPsx::mParm
char * mParm
Definition: XrdOucPsx.hh:118
XrdOucTList
Definition: XrdOucTList.hh:42
XrdOucPsx::cioTries
int cioTries
Definition: XrdOucPsx.hh:91
XrdOucPsx::ConfigCache
bool ConfigCache(XrdSysError &eDest)
XrdOucPsx::ParseNLib
bool ParseNLib(XrdSysError *Eroute, XrdOucStream &Config)
XrdOucPsx
Definition: XrdOucPsx.hh:49